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 4fa697d30ce8bd4c41cdf74b5b09efd0038c09d1..3ebb0eaf3ba08ecd38c3cbf3d96889c5c3b133ea 100644 --- a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js +++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js @@ -4,14 +4,14 @@ /** * Activity reply object for the activity index screen * - * @since BuddyPress (1.6) + * @since 1.6.0 */ var activityReply = { /** * Attach event handler functions to the relevant elements. * - * @since BuddyPress (1.6) + * @since 1.6.0 */ init : function() { $(document).on( 'click', '.row-actions a.reply', activityReply.open ); @@ -29,7 +29,7 @@ var activityReply = { /** * Reveals the entire row when "reply" is pressed. * - * @since BuddyPress (1.6) + * @since 1.6.0 */ open : function() { // Hide the container row, and move it to the new location @@ -46,7 +46,7 @@ var activityReply = { /** * Hide and reset the entire row when "cancel", or escape, are pressed. * - * @since BuddyPress (1.6) + * @since 1.6.0 */ close : function() { // Hide the container row @@ -66,7 +66,7 @@ var activityReply = { /** * Submits "form" via AJAX back to WordPress. * - * @since BuddyPress (1.6) + * @since 1.6.0 */ send : function() { // Hide any existing error message, and show the loading spinner @@ -100,7 +100,7 @@ var activityReply = { /** * send() error message handler * - * @since BuddyPress (1.6) + * @since 1.6.0 */ error : function( r ) { var er = r.statusText; @@ -118,7 +118,7 @@ var activityReply = { /** * send() success handler * - * @since BuddyPress (1.6) + * @since 1.6.0 */ show : function ( xml ) { var bg, id, response; 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 524e101b644679e7d389ede88692ccd4ef3d52d3..8fb7630bb6417ed02bcc0c55aa7976b83365f029 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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 2b8b244e4a0203971d6c120e5d6affcad95784f2..472c2db11f14e66863c9ea9366eeb6a98bb05815 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php @@ -1,5 +1,4 @@ <?php - /** * 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 @@ -7,15 +6,16 @@ * * @package BuddyPress * @subpackage ActivityActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Allow core components and dependent plugins to register activity actions. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses do_action() To call 'bp_register_activity_actions' hook. */ @@ -24,7 +24,7 @@ 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) + * @since 1.2.0 */ do_action( 'bp_register_activity_actions' ); } @@ -33,7 +33,7 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 ); /** * Catch and route requests for single activity item permalinks. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_activity_component() * @uses bp_is_current_action() @@ -51,15 +51,15 @@ add_action( 'bp_init', 'bp_register_activity_actions', 8 ); */ function bp_activity_action_permalink_router() { - // Not viewing activity + // Not viewing activity. if ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) ) return false; - // No activity to display + // No activity to display. if ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) ) return false; - // Get the activity details + // Get the activity details. $activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) ); // 404 if activity does not exist @@ -70,31 +70,31 @@ function bp_activity_action_permalink_router() { $activity = $activity['activities'][0]; } - // Do not redirect at default + // Do not redirect at default. $redirect = false; - // Redirect based on the type of activity + // Redirect based on the type of activity. if ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) { - // Activity is a user update + // Activity is a user update. if ( ! 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 . '/'; - // Activity is something else + // Activity is something else. } else { - // Set redirect to group activity stream + // Set redirect to group activity stream. if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) { $redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/'; } } - // Set redirect to users' activity stream + // Set redirect to users' activity stream. } 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 . '/'; } - // If set, add the original query string back onto the redirect URL + // If set, add the original query string back onto the redirect URL. if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { $query_frags = array(); wp_parse_str( $_SERVER['QUERY_STRING'], $query_frags ); @@ -104,15 +104,15 @@ function bp_activity_action_permalink_router() { /** * Filter the intended redirect url before the redirect occurs for the single activity item. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * - * @param array Array with url to redirect to and activity related to the redirect. + * @param array $value 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() ); } - // Redirect to the actual activity permalink page + // Redirect to the actual activity permalink page. bp_core_redirect( $redirect ); } add_action( 'bp_actions', 'bp_activity_action_permalink_router' ); @@ -120,9 +120,7 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' ); /** * Delete specific activity item and redirect to previous page. * - * @since BuddyPress (1.1.0) - * - * @param int $activity_id Activity id to be deleted. Defaults to 0. + * @since 1.1.0 * * @uses bp_is_activity_component() * @uses bp_is_current_action() @@ -135,42 +133,43 @@ add_action( 'bp_actions', 'bp_activity_action_permalink_router' ); * @uses do_action() Calls 'bp_activity_action_delete_activity' hook to allow actions to be taken after the activity is deleted. * @uses bp_core_redirect() * + * @param int $activity_id Activity id to be deleted. Defaults to 0. * @return bool False on failure. */ function bp_activity_action_delete_activity( $activity_id = 0 ) { - // Not viewing activity or action is not delete + // Not viewing activity or action is not delete. if ( !bp_is_activity_component() || !bp_is_current_action( 'delete' ) ) return false; if ( empty( $activity_id ) && bp_action_variable( 0 ) ) $activity_id = (int) bp_action_variable( 0 ); - // Not viewing a specific activity item + // Not viewing a specific activity item. if ( empty( $activity_id ) ) return false; - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_activity_delete_link' ); - // Load up the activity item + // Load up the activity item. $activity = new BP_Activity_Activity( $activity_id ); - // Check access + // Check access. if ( ! bp_activity_user_can_delete( $activity ) ) return false; /** * Fires before the deletion so plugins can still fetch information about it. * - * @since BuddyPress (1.5.0) + * @since 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 + // Delete the activity item and provide user feedback. if ( bp_activity_delete( array( 'id' => $activity_id, 'user_id' => $activity->user_id ) ) ) bp_core_add_message( __( 'Activity deleted successfully', 'buddypress' ) ); else @@ -179,15 +178,15 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) { /** * Fires after the deletion so plugins can act afterwards based on the activity. * - * @since BuddyPress (1.1.0) + * @since 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 - if ( !empty( $_GET['redirect_to'] ) ) + // Check for the redirect query arg, otherwise let WP handle things. + if ( !empty( $_GET['redirect_to'] ) ) bp_core_redirect( esc_url( $_GET['redirect_to'] ) ); else bp_core_redirect( wp_get_referer() ); @@ -197,23 +196,22 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' ); /** * Mark specific activity item as spam and redirect to previous page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @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 ) { $bp = buddypress(); - // Not viewing activity, or action is not spam, or Akismet isn't present + // 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 ) ) return false; if ( empty( $activity_id ) && bp_action_variable( 0 ) ) $activity_id = (int) bp_action_variable( 0 ); - // Not viewing a specific activity item + // Not viewing a specific activity item. if ( empty( $activity_id ) ) return false; @@ -221,43 +219,43 @@ function bp_activity_action_spam_activity( $activity_id = 0 ) { if ( !bp_activity_user_can_mark_spam() ) return false; - // Load up the activity item + // Load up the activity item. $activity = new BP_Activity_Activity( $activity_id ); if ( empty( $activity->id ) ) return false; - // Check nonce + // Check nonce. check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); /** * Fires before the marking activity as spam so plugins can modify things if they want to. * - * @since BuddyPress (1.6.0) + * @since 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 + // Mark as spam. bp_activity_mark_as_spam( $activity ); $activity->save(); - // Tell the user the spamming has been successful + // 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) + * @since 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 - if ( !empty( $_GET['redirect_to'] ) ) + // Check for the redirect query arg, otherwise let WP handle things. + if ( !empty( $_GET['redirect_to'] ) ) bp_core_redirect( esc_url( $_GET['redirect_to'] ) ); else bp_core_redirect( wp_get_referer() ); @@ -267,7 +265,7 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' ); /** * Post user/group activity update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_is_activity_component() @@ -287,17 +285,17 @@ add_action( 'bp_actions', 'bp_activity_action_spam_activity' ); */ function bp_activity_action_post_update() { - // Do not proceed if user is not logged in, not viewing activity, or not posting + // Do not proceed if user is not logged in, not viewing activity, or not posting. if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) ) return false; - // Check the nonce + // Check the nonce. check_admin_referer( 'post_update', '_wpnonce_post_update' ); /** * Filters the content provided in the activity input field. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Activity message being posted. */ @@ -308,7 +306,7 @@ function bp_activity_action_post_update() { /** * Filters the item type that the activity update should be associated with. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Item type to associate with. */ @@ -320,24 +318,24 @@ function bp_activity_action_post_update() { /** * Filters what component the activity is being to. * - * @since BuddyPress (1.2.0) + * @since 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'] ); } - // No activity content so provide feedback and redirect + // No activity content so provide feedback and redirect. if ( empty( $content ) ) { bp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' ); bp_core_redirect( wp_get_referer() ); } - // No existing item_id + // No existing item_id. if ( empty( $item_id ) ) { $activity_id = bp_activity_post_update( array( 'content' => $content ) ); - // Post to groups object + // Post to groups object. } elseif ( 'groups' == $object && bp_is_active( 'groups' ) ) { if ( (int) $item_id ) { $activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) ); @@ -348,7 +346,7 @@ function bp_activity_action_post_update() { /** * Filters activity object for BuddyPress core and plugin authors before posting activity update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $object Activity item being associated to. * @param string $item_id Component ID being posted to. @@ -357,13 +355,13 @@ function bp_activity_action_post_update() { $activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content ); } - // Provide user feedback + // Provide user feedback. 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' ); - // Redirect + // Redirect. bp_core_redirect( wp_get_referer() ); } add_action( 'bp_actions', 'bp_activity_action_post_update' ); @@ -371,7 +369,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_update' ); /** * Post new activity comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_is_activity_component() @@ -391,13 +389,13 @@ function bp_activity_action_post_comment() { if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'reply' ) ) return false; - // Check the nonce + // 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) + * @since 1.2.0 * * @param string $value ID of the activity being replied to. */ @@ -406,7 +404,7 @@ function bp_activity_action_post_comment() { /** * Filters the comment content for a comment reply. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Comment content being posted. */ @@ -435,7 +433,7 @@ add_action( 'bp_actions', 'bp_activity_action_post_comment' ); /** * Mark activity as favorite. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_is_activity_component() @@ -454,7 +452,7 @@ function bp_activity_action_mark_favorite() { if ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'favorite' ) ) return false; - // Check the nonce + // Check the nonce. check_admin_referer( 'mark_favorite' ); if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) ) @@ -469,7 +467,7 @@ add_action( 'bp_actions', 'bp_activity_action_mark_favorite' ); /** * Remove activity from favorites. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_is_activity_component() @@ -488,7 +486,7 @@ function bp_activity_action_remove_favorite() { if ( ! is_user_logged_in() || ! bp_is_activity_component() || ! bp_is_current_action( 'unfavorite' ) ) return false; - // Check the nonce + // Check the nonce. check_admin_referer( 'unmark_favorite' ); if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) ) @@ -503,7 +501,7 @@ add_action( 'bp_actions', 'bp_activity_action_remove_favorite' ); /** * Load the sitewide activity feed. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_is_activity_component() * @uses bp_is_current_action() @@ -518,7 +516,7 @@ function bp_activity_action_sitewide_feed() { if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) return false; - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'sitewide', @@ -535,7 +533,7 @@ add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); /** * Load a user's personal activity feed. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_is_user_activity() * @uses bp_is_current_action() @@ -548,7 +546,7 @@ function bp_activity_action_personal_feed() { return false; } - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'personal', @@ -565,7 +563,7 @@ add_action( 'bp_actions', 'bp_activity_action_personal_feed' ); /** * Load a user's friends' activity feed. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_is_active() * @uses bp_is_user_activity() @@ -581,7 +579,7 @@ function bp_activity_action_friends_feed() { return false; } - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'friends', @@ -598,7 +596,7 @@ add_action( 'bp_actions', 'bp_activity_action_friends_feed' ); /** * Load the activity feed for a user's groups. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_active() * @uses bp_is_user_activity() @@ -614,11 +612,11 @@ function bp_activity_action_my_groups_feed() { return false; } - // get displayed user's group IDs + // Get displayed user's group IDs. $groups = groups_get_user_groups(); $group_ids = implode( ',', $groups['groups'] ); - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'mygroups', @@ -639,7 +637,7 @@ add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); /** * Load a user's @mentions feed. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_user_activity() * @uses bp_is_current_action() @@ -657,7 +655,7 @@ function bp_activity_action_mentions_feed() { return false; } - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'mentions', @@ -676,7 +674,7 @@ add_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); /** * Load a user's favorites feed. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_user_activity() * @uses bp_is_current_action() @@ -690,11 +688,11 @@ function bp_activity_action_favorites_feed() { return false; } - // get displayed user's favorite activity IDs + // Get displayed user's favorite activity IDs. $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); $fav_ids = implode( ',', (array) $favs ); - // setup the feed + // Setup the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'favorites', @@ -711,23 +709,23 @@ add_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); /** * Loads Akismet filtering for activity. * - * @since BuddyPress (1.6.0) - * @since BuddyPress (2.3.0) We only support Akismet 3+. + * @since 1.6.0 + * @since 2.3.0 We only support Akismet 3+. */ function bp_activity_setup_akismet() { $bp = buddypress(); - // Bail if Akismet is not active + // Bail if Akismet is not active. if ( ! defined( 'AKISMET_VERSION' ) ) { return; } - // Bail if older version of Akismet + // Bail if older version of Akismet. if ( ! class_exists( 'Akismet' ) ) { return; } - // Bail if no Akismet key is set + // Bail if no Akismet key is set. if ( ! bp_get_option( 'wordpress_api_key' ) && ! defined( 'WPCOM_API_KEY' ) ) { return; } @@ -735,7 +733,7 @@ function bp_activity_setup_akismet() { /** * Filters if BuddyPress Activity Akismet support has been disabled by another plugin. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Return value of bp_is_akismet_active boolean function. */ @@ -743,14 +741,14 @@ function bp_activity_setup_akismet() { return; } - // Instantiate Akismet for BuddyPress + // Instantiate Akismet for BuddyPress. $bp->activity->akismet = new BP_Akismet(); } /** * AJAX endpoint for Suggestions API lookups. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_ajax_get_suggestions() { if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) { @@ -782,7 +780,7 @@ 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) + * @since 2.2.0 * * @todo Support untrashing better. * @@ -799,7 +797,28 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status 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 ); + $edit = bp_activity_post_type_update( $post ); + + // Post was never recorded into activity stream, so record it now! + if ( null === $edit ) { + bp_activity_post_type_publish( $post->ID, $post ); + } + + // Allow plugins to eventually deal with other post statuses. + } else { + /** + * Fires when editing the post and the new status is not 'publish'. + * + * This is a variable filter that is dependent on the post type + * being untrashed. + * + * @since 2.5.0 + * + * @param WP_Post $post Post data. + * @param string $new_status New status for the post. + * @param string $old_status Old status for the post. + */ + do_action( 'bp_activity_post_type_edit_' . $post->post_type, $post, $new_status, $old_status ); } return; @@ -816,7 +835,7 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status * This is a variable filter that is dependent on the post type * being untrashed. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param WP_Post $post Post data. */ @@ -828,8 +847,145 @@ function bp_activity_catch_transition_post_type_status( $new_status, $old_status // Unpublishing a previously published post. } elseif ( 'publish' === $old_status ) { - // Some form of pending status - only remove the activity entry + // Some form of pending status - only remove the activity entry. bp_activity_post_type_unpublish( $post->ID, $post ); + + // For any other cases, allow plugins to eventually deal with it. + } else { + /** + * Fires when the old and the new post status are not 'publish'. + * + * This is a variable filter that is dependent on the post type + * being untrashed. + * + * @since 2.5.0 + * + * @param WP_Post $post Post data. + * @param string $new_status New status for the post. + * @param string $old_status Old status for the post. + */ + do_action( 'bp_activity_post_type_transition_status_' . $post->post_type, $post, $new_status, $old_status ); } } add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 ); + +/** + * When a post type comment status transition occurs, update the relevant activity's status. + * + * @since 2.5.0 + * + * @param string $new_status New comment status. + * @param string $old_status Previous comment status. + * @param WP_Comment $comment Comment data. + */ +function bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment ) { + $post_type = get_post_type( $comment->comment_post_ID ); + if ( ! $post_type ) { + return; + } + + // Get the post type tracking args. + $activity_post_object = bp_activity_get_post_type_tracking_args( $post_type ); + + // Bail if the activity type does not exist + if ( empty( $activity_post_object->comments_tracking->action_id ) ) { + return false; + + // Set the $activity_comment_object + } else { + $activity_comment_object = $activity_post_object->comments_tracking; + } + + // Init an empty activity ID + $activity_id = 0; + + /** + * Activity currently doesn't have any concept of a trash, or an unapproved/approved state. + * + * If a blog comment transitions to a "delete" or "hold" status, delete the activity item. + * If a blog comment transitions to trashed, or spammed, mark the activity as spam. + * If a blog comment transitions to approved (and the activity exists), mark the activity as ham. + * If a blog comment transitions to unapproved (and the activity exists), mark the activity as spam. + * Otherwise, record the comment into the activity stream. + */ + + // This clause handles delete/hold. + if ( in_array( $new_status, array( 'delete', 'hold' ) ) ) { + return bp_activity_post_type_remove_comment( $comment->comment_ID, $activity_post_object ); + + // These clauses handle trash, spam, and un-spams. + } elseif ( in_array( $new_status, array( 'trash', 'spam', 'unapproved' ) ) ) { + $action = 'spam_activity'; + } elseif ( 'approved' == $new_status ) { + $action = 'ham_activity'; + } + + // Get the activity + if ( bp_disable_blogforum_comments() ) { + $activity_id = bp_activity_get_activity_id( array( + 'component' => $activity_comment_object->component_id, + 'item_id' => get_current_blog_id(), + 'secondary_item_id' => $comment->comment_ID, + 'type' => $activity_comment_object->action_id, + ) ); + } else { + $activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true ); + } + + /** + * Leave a chance to plugins to manage activity comments differently. + * + * @since 2.5.0 + * + * @param bool $value True to override BuddyPress management. + * @param string $post_type The post type name. + * @param int $activity_id The post type activity (0 if not found). + * @param string $new_status The new status of the post type comment. + * @param string $old_status The old status of the post type comment. + * @param WP_Comment $comment Comment data. + */ + if ( true === apply_filters( 'bp_activity_pre_transition_post_type_comment_status', false, $post_type, $activity_id, $new_status, $old_status, $comment ) ) { + return false; + } + + // Check activity item exists + if ( empty( $activity_id ) ) { + // If no activity exists, but the comment has been approved, record it into the activity table. + if ( 'approved' == $new_status ) { + return bp_activity_post_type_comment( $comment->comment_ID, true, $activity_post_object ); + } + + return; + } + + // Create an activity object + $activity = new BP_Activity_Activity( $activity_id ); + if ( empty( $activity->component ) ) { + return; + } + + // Spam/ham the activity if it's not already in that state + if ( 'spam_activity' === $action && ! $activity->is_spam ) { + bp_activity_mark_as_spam( $activity ); + } elseif ( 'ham_activity' == $action) { + bp_activity_mark_as_ham( $activity ); + } + + // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated + $post_type_comment_action = $activity_comment_object->action_id; + $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' ); + add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); + + // Make sure the activity change won't edit the comment if sync is on + remove_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 ); + + // Save the updated activity + $activity->save(); + + // Restore the action + add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 ); + + // Remove the "new_blog_comment" activity type whitelist so we don't break anything + remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); +} +add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_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 1a560c7b6dc68c2d4679cbba536fd4406b6dee51..d91777979c35f93274a41e05c7ccac10804ef8e1 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php @@ -6,28 +6,30 @@ * help text, on which this implementation is heavily based. * * @package BuddyPress - * @since BuddyPress (1.6.0) - * @subpackage Activity + * @subpackage ActivityAdmin + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -// Include WP's list table class +// Include WP's list table class. if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); -// per_page screen option. Has to be hooked in extremely early. +require dirname( __FILE__ ) . '/classes/class-bp-activity-list-table.php'; + +// Per_page screen option. Has to be hooked in extremely early. if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['page'] ) add_filter( 'set-screen-option', 'bp_activity_admin_screen_options', 10, 3 ); /** * Register the Activity component admin screen. * - * @since BuddyPress (1.6) + * @since 1.6.0 */ function bp_activity_add_admin_menu() { - // Add our screen + // Add our screen. $hook = add_menu_page( _x( 'Activity', 'Admin Dashbord SWA page title', 'buddypress' ), _x( 'Activity', 'Admin Dashbord SWA menu', 'buddypress' ), @@ -49,10 +51,9 @@ add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' ); * which all appear together in the middle of the Dashboard menu. This function * adds the Activity page to the array of these menu items. * - * @since BuddyPress (1.7.0) + * @since 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. */ function bp_activity_admin_menu_order( $custom_menus = array() ) { @@ -67,10 +68,10 @@ add_filter( 'bp_admin_menu_order', 'bp_activity_admin_menu_order' ); * Processes requests to add new activity comments, and echoes HTML for a new * table row. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_activity_admin_reply() { - // Check nonce + // Check nonce. check_ajax_referer( 'bp-activity-admin-reply', '_ajax_nonce-bp-activity-admin-reply' ); $parent_id = ! empty( $_REQUEST['parent_id'] ) ? (int) $_REQUEST['parent_id'] : 0; @@ -80,15 +81,15 @@ function bp_activity_admin_reply() { if ( empty( $parent_id ) ) die( '-1' ); - // If $root_id not set (e.g. for root items), use $parent_id + // If $root_id not set (e.g. for root items), use $parent_id. if ( empty( $root_id ) ) $root_id = $parent_id; - // Check that a reply has been entered + // Check that a reply has been entered. if ( empty( $_REQUEST['content'] ) ) die( __( 'ERROR: Please type a reply.', 'buddypress' ) ); - // Check parent activity exists + // Check parent activity exists. $parent_activity = new BP_Activity_Activity( $parent_id ); if ( empty( $parent_activity->component ) ) die( __( 'ERROR: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) ); @@ -98,25 +99,25 @@ function bp_activity_admin_reply() { if ( ! current_user_can( 'bp_moderate' ) ) die( '-1' ); - // Add new activity comment + // Add new activity comment. $new_activity_id = bp_activity_new_comment( array( - 'activity_id' => $root_id, // ID of the root activity item + 'activity_id' => $root_id, // ID of the root activity item. 'content' => $_REQUEST['content'], - 'parent_id' => $parent_id, // ID of a parent comment + 'parent_id' => $parent_id, // ID of a parent comment. ) ); - // Fetch the new activity item, as we need it to create table markup to return + // Fetch the new activity item, as we need it to create table markup to return. $new_activity = new BP_Activity_Activity( $new_activity_id ); - // This needs to be set for the BP_Activity_List_Table constructor to work + // This needs to be set for the BP_Activity_List_Table constructor to work. set_current_screen( 'toplevel_page_bp-activity' ); - // Set up an output buffer + // Set up an output buffer. ob_start(); $list_table = new BP_Activity_List_Table(); $list_table->single_row( (array) $new_activity ); - // Get table markup + // Get table markup. $response = array( 'data' => ob_get_contents(), 'id' => $new_activity_id, @@ -125,7 +126,7 @@ function bp_activity_admin_reply() { ); ob_end_clean(); - // Send response + // Send response. $r = new WP_Ajax_Response(); $r->add( $response ); $r->send(); @@ -137,19 +138,18 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' ); /** * Handle save/update of screen options for the Activity component admin screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @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 ) { if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option ) return $value; - // Per page + // Per page. $new_value = (int) $new_value; if ( $new_value < 1 || $new_value > 999 ) return $value; @@ -160,24 +160,23 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) { /** * Hide the advanced edit meta boxes by default, so we don't clutter the screen. * - * @since BuddyPress (1.6.0) + * @since 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 ) { if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id ) return $hidden; - // Hide the primary link meta box by default + // 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) + * @since 1.6.0 * * @param array $hidden Default metaboxes to hide. * @param WP_Screen $screen Screen identifier. @@ -194,7 +193,7 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe * - Enqueues scripts and styles. * - Catches POST and GET requests related to Activity. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global object $bp BuddyPress global settings. * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table. @@ -202,25 +201,22 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe function bp_activity_admin_load() { global $bp_activity_list_table; - $bp = buddypress(); - - // Decide whether to load the dev version of the CSS and JavaScript - $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.'; - + $bp = buddypress(); $doaction = bp_admin_list_table_current_bulk_action(); + $min = bp_core_get_minified_asset_suffix(); /** * Fires at top of Activity admin page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $doaction Current $_GET action being performed in admin screen. */ do_action( 'bp_activity_admin_load', $doaction ); - // Edit screen + // Edit screen. if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) { - // columns screen option + // Columns screen option. add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); get_current_screen()->add_help_tab( array( @@ -242,7 +238,7 @@ function bp_activity_admin_load() { '<p>' . __( 'For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side.', 'buddypress' ) . '</p>' ) ); - // Help panel - sidebar links + // Help panel - sidebar links. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.buddypress.org/administrator-guide/activity-stream-management-panels/">Managing Activity</a>', 'buddypress' ) . '</p>' . @@ -256,20 +252,27 @@ 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 JavaScript files + /** + * Fires after the registration of all of the default activity meta boxes. + * + * @since 2.4.0 + */ + do_action( 'bp_activity_admin_meta_boxes' ); + + // Enqueue JavaScript files. wp_enqueue_script( 'postbox' ); wp_enqueue_script( 'dashboard' ); wp_enqueue_script( 'comment' ); - // Index screen + // Index screen. } else { - // Create the Activity screen list table + // Create the Activity screen list table. $bp_activity_list_table = new BP_Activity_List_Table(); - // per_page screen option + // The per_page screen option. add_screen_option( 'per_page', array( 'label' => _x( 'Activity', 'Activity items per page (screen options)', 'buddypress' )) ); - // Help panel - overview text + // Help panel - overview text. get_current_screen()->add_help_tab( array( 'id' => 'bp-activity-overview', 'title' => __( 'Overview', 'buddypress' ), @@ -278,7 +281,7 @@ function bp_activity_admin_load() { '<p>' . __( 'There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them.', 'buddypress' ) . '</p>' ) ); - // Help panel - moderation text + // Help panel - moderation text. get_current_screen()->add_help_tab( array( 'id' => 'bp-activity-moderating', 'title' => __( 'Moderating Activity', 'buddypress' ), @@ -287,40 +290,53 @@ function bp_activity_admin_load() { '<p>' . __( "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, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items.", 'buddypress' ) . '</p>' ) ); - // Help panel - sidebar links + // Help panel - sidebar links. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' ); + + // Add accessible hidden heading and text for Activity screen pagination. + if ( bp_get_major_wp_version() >= 4.4 ) { + get_current_screen()->set_screen_reader_content( array( + 'heading_pagination' => __( 'Activity list navigation', 'buddypress' ), + ) ); + } } - // Enqueue CSS and JavaScript - wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true ); + // Enqueue CSS and JavaScript. + wp_enqueue_script( 'bp_activity_admin_js', $bp->plugin_url . "bp-activity/admin/js/admin{$min}.js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true ); wp_localize_script( 'bp_activity_admin_js', 'bp_activity_admin_vars', array( - 'page' => get_current_screen()->id - ) ); - wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() ); + 'page' => get_current_screen()->id + ) ); + wp_enqueue_style( 'bp_activity_admin_css', $bp->plugin_url . "bp-activity/admin/css/admin{$min}.css", array(), bp_get_version() ); wp_style_add_data( 'bp_activity_admin_css', 'rtl', true ); if ( $min ) { wp_style_add_data( 'bp_activity_admin_css', 'suffix', $min ); } + /** + * Fires after the activity js and style has been enqueued. + * + * @since 2.4.0 + */ + do_action( 'bp_activity_admin_enqueue_scripts' ); - // Handle spam/un-spam/delete of activities + // Handle spam/un-spam/delete of activities. if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) { - // Build redirection URL + // Build redirection URL. $redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() ); $redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to ); - // Get activity IDs + // Get activity IDs. $activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] ); /** * Filters list of IDs being spammed/un-spammed/deleted. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $activity_ids Activity IDs to spam/un-spam/delete. */ @@ -328,32 +344,31 @@ function bp_activity_admin_load() { // Is this a bulk request? if ( 'bulk_' == substr( $doaction, 0, 5 ) && ! empty( $_REQUEST['aid'] ) ) { - // Check this is a valid form submission + // Check this is a valid form submission. check_admin_referer( 'bulk-activities' ); - // Trim 'bulk_' off the action name to avoid duplicating a ton of code + // Trim 'bulk_' off the action name to avoid duplicating a ton of code. $doaction = substr( $doaction, 5 ); // This is a request to delete, spam, or un-spam, a single item. } elseif ( !empty( $_REQUEST['aid'] ) ) { - // Check this is a valid form submission + // Check this is a valid form submission. check_admin_referer( 'spam-activity_' . $activity_ids[0] ); } - // Initialise counters for how many of each type of item we perform an action on + // Initialise counters for how many of each type of item we perform an action on. $deleted = $spammed = $unspammed = 0; - // Store any errors that occurs when updating the database items + // Store any errors that occurs when updating the database items. $errors = array(); // "We'd like to shoot the monster, could you move, please?" foreach ( $activity_ids as $activity_id ) { // @todo: Check the permissions on each - //if ( ! current_user_can( 'bp_edit_activity', $activity_id ) ) - // continue; - - // Get the activity from the database + // if ( ! current_user_can( 'bp_edit_activity', $activity_id ) ) + // continue; + // Get the activity from the database. $activity = new BP_Activity_Activity( $activity_id ); if ( empty( $activity->component ) ) { $errors[] = $activity_id; @@ -381,7 +396,7 @@ function bp_activity_admin_load() { bp_activity_mark_as_ham( $activity ); $result = $activity->save(); - // Check for any error during activity save + // Check for any error during activity save. if ( ! $result ) $errors[] = $activity->id; else @@ -392,7 +407,7 @@ function bp_activity_admin_load() { bp_activity_mark_as_spam( $activity ); $result = $activity->save(); - // Check for any error during activity save + // Check for any error during activity save. if ( ! $result ) $errors[] = $activity->id; else @@ -403,7 +418,7 @@ function bp_activity_admin_load() { break; } - // Release memory + // Release memory. unset( $activity ); } @@ -412,7 +427,7 @@ function bp_activity_admin_load() { * * Passes an activity array counts how many were spam, not spam, deleted, and IDs that were errors. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $value Array holding spam, not spam, deleted counts, error IDs. * @param string $redirect_to URL to redirect to. @@ -430,14 +445,14 @@ function bp_activity_admin_load() { if ( $deleted ) $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to ); - // If an error occurred, pass back the activity ID that failed + // If an error occurred, pass back the activity ID that failed. if ( ! empty( $errors ) ) $redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to ); /** * Filters redirect URL after activity spamming/un-spamming/deletion occurs. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $redirect_to URL to redirect to. */ @@ -445,73 +460,72 @@ function bp_activity_admin_load() { exit; - // Save the edit + // Save the edit. } elseif ( $doaction && 'save' == $doaction ) { - // Build redirection URL + // Build redirection URL. $redirect_to = remove_query_arg( array( 'action', 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] ); - // Get activity ID + // Get activity ID. $activity_id = (int) $_REQUEST['aid']; - // Check this is a valid form submission + // Check this is a valid form submission. check_admin_referer( 'edit-activity_' . $activity_id ); - // Get the activity from the database + // Get the activity from the database. $activity = new BP_Activity_Activity( $activity_id ); - // If the activity doesn't exist, just redirect back to the index + // If the activity doesn't exist, just redirect back to the index. if ( empty( $activity->component ) ) { wp_redirect( $redirect_to ); exit; } - // Check the form for the updated properties - - // Store any error that occurs when updating the database item + // Check the form for the updated properties. + // Store any error that occurs when updating the database item. $error = 0; - // Activity spam status + // Activity spam status. $prev_spam_status = $new_spam_status = false; if ( ! empty( $_POST['activity_status'] ) ) { $prev_spam_status = $activity->is_spam; $new_spam_status = ( 'spam' == $_POST['activity_status'] ) ? true : false; } - // Activity action + // Activity action. if ( isset( $_POST['bp-activities-action'] ) ) $activity->action = $_POST['bp-activities-action']; - // Activity content + // Activity content. if ( isset( $_POST['bp-activities-content'] ) ) $activity->content = $_POST['bp-activities-content']; - // Activity primary link + // Activity primary link. if ( ! empty( $_POST['bp-activities-link'] ) ) $activity->primary_link = $_POST['bp-activities-link']; - // Activity user ID + // Activity user ID. if ( ! empty( $_POST['bp-activities-userid'] ) ) $activity->user_id = (int) $_POST['bp-activities-userid']; - // Activity item primary ID + // Activity item primary ID. if ( isset( $_POST['bp-activities-primaryid'] ) ) $activity->item_id = (int) $_POST['bp-activities-primaryid']; - // Activity item secondary ID + // Activity item secondary ID. if ( isset( $_POST['bp-activities-secondaryid'] ) ) $activity->secondary_item_id = (int) $_POST['bp-activities-secondaryid']; - // Activity type + // Activity type. if ( ! empty( $_POST['bp-activities-type'] ) ) { $actions = bp_activity_admin_get_activity_actions(); - // Check that the new type is a registered activity type + // Check that the new type is a registered activity type. if ( in_array( $_POST['bp-activities-type'], $actions ) ) { $activity->type = $_POST['bp-activities-type']; } } - // Activity timestamp + // Activity timestamp. if ( ! empty( $_POST['aa'] ) && ! empty( $_POST['mm'] ) && ! empty( $_POST['jj'] ) && ! empty( $_POST['hh'] ) && ! empty( $_POST['mn'] ) && ! empty( $_POST['ss'] ) ) { $aa = $_POST['aa']; $mm = $_POST['mm']; @@ -527,7 +541,7 @@ function bp_activity_admin_load() { $mn = ( $mn > 59 ) ? $mn -60 : $mn; $ss = ( $ss > 59 ) ? $ss -60 : $ss; - // Reconstruct the date into a timestamp + // Reconstruct the date into a timestamp. $gmt_date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $aa, $mm, $jj, $hh, $mn, $ss ); $activity->date_recorded = $gmt_date; @@ -541,26 +555,26 @@ function bp_activity_admin_load() { bp_activity_mark_as_ham( $activity ); } - // Save + // Save. $result = $activity->save(); - // Clear the activity stream first page cache, in case this activity's timestamp was changed + // Clear the activity stream first page cache, in case this activity's timestamp was changed. wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); - // Check for any error during activity save + // Check for any error during activity save. if ( false === $result ) $error = $activity->id; /** * Fires before redirect so plugins can do something first on save action. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param array Array holding activity object and ID that holds error. + * @param array $value 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 + // If an error occurred, pass back the activity ID that failed. if ( $error ) $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to ); else @@ -569,7 +583,7 @@ function bp_activity_admin_load() { /** * Filters URL to redirect to after saving. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $redirect_to URL to redirect to. */ @@ -587,17 +601,17 @@ function bp_activity_admin_load() { /** * Output the Activity component admin screens. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_activity_admin() { - // Decide whether to load the index or edit screen + // Decide whether to load the index or edit screen. $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; - // Display the single activity edit screen + // Display the single activity edit screen. if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) ) bp_activity_admin_edit(); - // Otherwise, display the Activity index screen + // Otherwise, display the Activity index screen. else bp_activity_admin_index(); } @@ -605,7 +619,7 @@ function bp_activity_admin() { /** * Display the single activity edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_activity_admin_edit() { @@ -614,7 +628,7 @@ function bp_activity_admin_edit() { if ( ! is_super_admin() ) die( '-1' ); - // Get the activity from the database + // Get the activity from the database. $activity = bp_activity_get( array( 'in' => ! empty( $_REQUEST['aid'] ) ? (int) $_REQUEST['aid'] : 0, 'max' => 1, @@ -626,29 +640,28 @@ function bp_activity_admin_edit() { if ( ! empty( $activity['activities'][0] ) ) { $activity = $activity['activities'][0]; - // Workaround to use WP's touch_time() without duplicating that function + // Workaround to use WP's touch_time() without duplicating that function. $GLOBALS['comment'] = new stdClass; $GLOBALS['comment']->comment_date = $activity->date_recorded; } else { $activity = ''; } - // Construct URL for form + // Construct URL for form. $form_url = remove_query_arg( array( 'action', 'deleted', 'error', 'spammed', 'unspammed', ), $_SERVER['REQUEST_URI'] ); $form_url = add_query_arg( 'action', 'save', $form_url ); /** * Fires before activity edit form is displays so plugins can modify the activity. * - * @since BuddyPress (1.6.0) + * @since 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"> - <?php screen_icon( 'buddypress-activity' ); ?> - <h2><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h2> + <h1><?php printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?></h1> <?php if ( ! empty( $activity ) ) : ?> @@ -659,14 +672,14 @@ function bp_activity_admin_edit() { <div id="post-body-content"> <div id="postdiv"> <div id="bp_activity_action" class="postbox"> - <h3><?php _e( 'Action', 'buddypress' ); ?></h3> + <h2><?php _e( 'Action', 'buddypress' ); ?></h2> <div class="inside"> <?php wp_editor( stripslashes( $activity->action ), 'bp-activities-action', array( 'media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> </div> </div> <div id="bp_activity_content" class="postbox"> - <h3><?php _e( 'Content', 'buddypress' ); ?></h3> + <h2><?php _e( 'Content', 'buddypress' ); ?></h2> <div class="inside"> <?php wp_editor( stripslashes( $activity->content ), 'bp-activities-content', array( 'media_buttons' => false, 'teeny' => true, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> </div> @@ -691,7 +704,10 @@ function bp_activity_admin_edit() { </form> <?php else : ?> - <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ) ); ?></p> + <p> + <?php _e( 'No activity found with this ID.', 'buddypress' ); ?> + <a href="<?php echo esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ); ?>"><?php _e( 'Go back and try again.', 'buddypress' ); ?></a> + </p> <?php endif; ?> </div><!-- .wrap --> @@ -702,7 +718,7 @@ function bp_activity_admin_edit() { /** * Status metabox for the Activity admin edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param object $item Activity item. */ @@ -722,17 +738,17 @@ function bp_activity_admin_edit_metabox_status( $item ) { <div id="misc-publishing-actions"> <div class="misc-pub-section" id="comment-status-radio"> - <label class="approved"><input type="radio" name="activity_status" value="ham" <?php checked( $item->is_spam, 0 ); ?>><?php _e( 'Approved', 'buddypress' ); ?></label><br /> - <label class="spam"><input type="radio" name="activity_status" value="spam" <?php checked( $item->is_spam, 1 ); ?>><?php _e( 'Spam', 'buddypress' ); ?></label> + <label class="approved" for="activity-status-approved"><input type="radio" name="activity_status" id="activity-status-approved" value="ham" <?php checked( $item->is_spam, 0 ); ?>><?php _e( 'Approved', 'buddypress' ); ?></label><br /> + <label class="spam" for="activity-status-spam"><input type="radio" name="activity_status" id="activity-status-spam" value="spam" <?php checked( $item->is_spam, 1 ); ?>><?php _e( 'Spam', 'buddypress' ); ?></label> </div> <div class="misc-pub-section curtime misc-pub-section-last"> <?php - // translators: Publish box date format, see http://php.net/date + // Translators: Publish box date format, see http://php.net/date. $datef = __( 'M j, Y @ G:i', 'buddypress' ); $date = date_i18n( $datef, strtotime( $item->date_recorded ) ); ?> - <span id="timestamp"><?php printf( __( 'Submitted on: <strong>%1$s</strong>', 'buddypress' ), $date ); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a> + <span id="timestamp"><?php printf( __( 'Submitted on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e( 'Edit', 'buddypress' ); ?></a> <div id='timestampdiv' class='hide-if-js'> <?php touch_time( 1, 0, 5 ); ?> @@ -745,7 +761,7 @@ function bp_activity_admin_edit_metabox_status( $item ) { <div id="major-publishing-actions"> <div id="publishing-action"> - <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?> + <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false ); ?> </div> <div class="clear"></div> </div><!-- #major-publishing-actions --> @@ -758,7 +774,7 @@ function bp_activity_admin_edit_metabox_status( $item ) { /** * Primary link metabox for the Activity admin edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param object $item Activity item. */ @@ -766,8 +782,8 @@ function bp_activity_admin_edit_metabox_link( $item ) { ?> <label class="screen-reader-text" for="bp-activities-link"><?php _e( 'Link', 'buddypress' ); ?></label> - <input type="url" name="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" /> - <p><?php _e( '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.', 'buddypress' ); ?></p> + <input type="url" name="bp-activities-link" id="bp-activities-link" value="<?php echo esc_url( $item->primary_link ); ?>" aria-describedby="bp-activities-link-description" /> + <p id="bp-activities-link-description"><?php _e( '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.', 'buddypress' ); ?></p> <?php } @@ -775,7 +791,7 @@ function bp_activity_admin_edit_metabox_link( $item ) { /** * User ID metabox for the Activity admin edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param object $item Activity item. */ @@ -783,7 +799,7 @@ function bp_activity_admin_edit_metabox_userid( $item ) { ?> <label class="screen-reader-text" for="bp-activities-userid"><?php _e( 'Author ID', 'buddypress' ); ?></label> - <input type="number" name="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" /> + <input type="number" name="bp-activities-userid" id="bp-activities-userid" value="<?php echo esc_attr( $item->user_id ); ?>" min="1" /> <?php } @@ -793,9 +809,9 @@ function bp_activity_admin_edit_metabox_userid( $item ) { * * Format is [activity_type] => Pretty name for activity type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @return array + * @return array $actions */ function bp_activity_admin_get_activity_actions() { $actions = array(); @@ -809,10 +825,10 @@ function bp_activity_admin_get_activity_actions() { } } - // This was a mis-named activity type from before BP 1.6 + // This was a mis-named activity type from before BP 1.6. unset( $actions['friends_register_activity_action'] ); - // Sort array by the human-readable value + // Sort array by the human-readable value. natsort( $actions ); return $actions; @@ -821,7 +837,7 @@ function bp_activity_admin_get_activity_actions() { /** * Activity type metabox for the Activity admin edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param object $item Activity item. */ @@ -839,15 +855,17 @@ function bp_activity_admin_edit_metabox_type( $item ) { $actions[ $action[$i]['key'] ] = $action[$i]['value']; } - // This was a mis-named activity type from before BP 1.6 + // This was a mis-named activity type from before BP 1.6. unset( $actions['friends_register_activity_action'] ); - // Sort array by the human-readable value + // Sort array by the human-readable value. natsort( $actions ); - // If the activity type is not registered properly (eg, a plugin has - // not called bp_activity_set_action()), add the raw type to the end - // of the list + /* + * If the activity type is not registered properly (eg, a plugin has + * not called bp_activity_set_action()), add the raw type to the end + * of the list. + */ if ( ! isset( $actions[ $selected ] ) ) { _doing_it_wrong( __FUNCTION__, sprintf( __( 'This activity item has a type (%s) that is not registered using bp_activity_set_action(), so no label is available.', 'buddypress' ), $selected ), '2.0.0' ); $actions[ $selected ] = $selected; @@ -855,7 +873,8 @@ function bp_activity_admin_edit_metabox_type( $item ) { ?> - <select name="bp-activities-type"> + <label for="bp-activities-type" class="screen-reader-text"><?php esc_html_e( 'Select activity type', 'buddypress' ); ?></label> + <select name="bp-activities-type" id="bp-activities-type"> <?php foreach ( $actions as $k => $v ) : ?> <option value="<?php echo esc_attr( $k ); ?>" <?php selected( $k, $selected ); ?>><?php echo esc_html( $v ); ?></option> <?php endforeach; ?> @@ -867,7 +886,7 @@ function bp_activity_admin_edit_metabox_type( $item ) { /** * Primary item ID/Secondary item ID metabox for the Activity admin edit screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param object $item Activity item. */ @@ -889,7 +908,7 @@ function bp_activity_admin_edit_metabox_itemids( $item ) { /** * Display the Activity admin index screen, which contains a list of all the activities. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table. * @global string $plugin_page The current plugin page. @@ -899,7 +918,7 @@ function bp_activity_admin_index() { $messages = array(); - // If the user has just made a change to an activity item, build status messages + // If the user has just made a change to an activity item, build status messages. if ( ! empty( $_REQUEST['deleted'] ) || ! empty( $_REQUEST['spammed'] ) || ! empty( $_REQUEST['unspammed'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) ) { $deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; $errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : ''; @@ -909,14 +928,14 @@ function bp_activity_admin_index() { $errors = array_map( 'absint', explode( ',', $errors ) ); - // Make sure we don't get any empty values in $errors + // Make sure we don't get any empty values in $errors. for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) { if ( 0 === $errors[$i] ) { unset( $errors[$i] ); } } - // Reindex array + // Reindex array. $errors = array_values( $errors ); if ( $deleted > 0 ) @@ -930,9 +949,9 @@ function bp_activity_admin_index() { $error_msg = __( 'Errors occurred when trying to update these activity items:', 'buddypress' ); $error_msg .= '<ul class="activity-errors">'; - // Display each error as a list item + // Display each error as a list item. foreach ( $errors as $error ) { - // Translators: This is a bulleted list of item IDs + // Translators: This is a bulleted list of item IDs. $error_msg .= '<li>' . sprintf( __( '#%s', 'buddypress' ), number_format_i18n( $error ) ) . '</li>'; } @@ -951,21 +970,20 @@ function bp_activity_admin_index() { $messages[] = __( 'The activity item has been updated successfully.', 'buddypress' ); } - // Prepare the activity items for display + // Prepare the activity items for display. $bp_activity_list_table->prepare_items(); /** * Fires before edit form is displayed so plugins can modify the activity messages. * - * @since BuddyPress (1.6.0) + * @since 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"> - <?php screen_icon( 'buddypress-activity' ); ?> - <h2> + <h1> <?php if ( !empty( $_REQUEST['aid'] ) ) : ?> <?php printf( __( 'Activity related to ID #%s', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) ); ?> <?php else : ?> @@ -975,14 +993,14 @@ function bp_activity_admin_index() { <?php if ( !empty( $_REQUEST['s'] ) ) : ?> <span class="subtitle"><?php printf( __( 'Search results for “%s”', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span> <?php endif; ?> - </h2> + </h1> - <?php // If the user has just made a change to an activity item, display the status messages ?> + <?php // If the user has just made a change to an activity item, display the status messages. ?> <?php if ( !empty( $messages ) ) : ?> <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> <?php endif; ?> - <?php // Display each activity on its own row ?> + <?php // Display each activity on its own row. ?> <?php $bp_activity_list_table->views(); ?> <form id="bp-activities-form" action="" method="get"> @@ -991,13 +1009,13 @@ function bp_activity_admin_index() { <?php $bp_activity_list_table->display(); ?> </form> - <?php // This markup is used for the reply form ?> + <?php // This markup is used for the reply form. ?> <table style="display: none;"> <tr id="bp-activities-container" style="display: none;"> <td colspan="4"> <form method="get" action=""> - <h5 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h5> + <h3 id="bp-replyhead"><?php _e( 'Reply to Activity', 'buddypress' ); ?></h3> <?php wp_editor( '', 'bp-activities', array( 'dfw' => false, 'media_buttons' => false, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ), 'tinymce' => false, ) ); ?> <p id="bp-replysubmit" class="submit"> @@ -1019,773 +1037,3 @@ function bp_activity_admin_index() { <?php } - -/** - * List table class for the Activity component admin page. - * - * @since BuddyPress (1.6.0) - */ -class BP_Activity_List_Table extends WP_List_Table { - - /** - * What type of view is being displayed? - * - * e.g. "all", "pending", "approved", "spam"... - * - * @since BuddyPress (1.6.0) - * @var string - */ - public $view = 'all'; - - /** - * How many activity items have been marked as spam. - * - * @since BuddyPress (1.6.0) - * @var int - */ - public $spam_count = 0; - - /** - * Store activity-to-user-ID mappings for use in the In Response To column. - * - * @since BuddyPress (1.6.0) - * @var array - */ - 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. - * - * @since BuddyPress (1.6.0) - */ - public function __construct() { - - // See if activity commenting is enabled for blog / forum activity items - $this->disable_blogforum_comments = bp_disable_blogforum_comments(); - - // Define singular and plural labels, as well as whether we support AJAX. - parent::__construct( array( - 'ajax' => false, - 'plural' => 'activities', - 'singular' => 'activity', - 'screen' => get_current_screen(), - ) ); - } - - /** - * Handle filtering of data, sorting, pagination, and any other data manipulation prior to rendering. - * - * @since BuddyPress (1.6.0) - */ - function prepare_items() { - - // Option defaults - $filter = array(); - $include_id = false; - $search_terms = false; - $sort = 'DESC'; - $spam = 'ham_only'; - - // Set current page - $page = $this->get_pagenum(); - - // Set per page from the screen options - $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) ); - - // Check if we're on the "Spam" view - if ( !empty( $_REQUEST['activity_status'] ) && 'spam' == $_REQUEST['activity_status'] ) { - $spam = 'spam_only'; - $this->view = 'spam'; - } - - // Sort order - if ( !empty( $_REQUEST['order'] ) && 'desc' != $_REQUEST['order'] ) - $sort = 'ASC'; - - // Order by - /*if ( !empty( $_REQUEST['orderby'] ) ) { - }*/ - - // Filter - if ( !empty( $_REQUEST['activity_type'] ) ) - $filter = array( 'action' => $_REQUEST['activity_type'] ); - - // Are we doing a search? - if ( !empty( $_REQUEST['s'] ) ) - $search_terms = $_REQUEST['s']; - - // Check if user has clicked on a specific activity (if so, fetch only that, and any related, activity). - if ( !empty( $_REQUEST['aid'] ) ) - $include_id = (int) $_REQUEST['aid']; - - // Get the spam total (ignoring any search query or filter) - $spams = bp_activity_get( array( - 'display_comments' => 'stream', - 'show_hidden' => true, - 'spam' => 'spam_only', - 'count_total' => 'count_query', - ) ); - $this->spam_count = $spams['total']; - unset( $spams ); - - // Get the activities from the database - $activities = bp_activity_get( array( - 'display_comments' => 'stream', - 'filter' => $filter, - 'in' => $include_id, - 'page' => $page, - 'per_page' => $per_page, - 'search_terms' => $search_terms, - 'show_hidden' => true, - //'sort' => $sort, - 'spam' => $spam, - 'count_total' => 'count_query', - ) ); - - // 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'] ); - - // Sort the array by the activity object's date_recorded value - usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ) ); - } - - // bp_activity_get returns an array of objects; cast these to arrays for WP_List_Table. - $new_activities = array(); - foreach ( $activities['activities'] as $activity_item ) { - $new_activities[] = (array) $activity_item; - - // 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; - } - - // Set raw data to display - $this->items = $new_activities; - - // Store information needed for handling table pagination - $this->set_pagination_args( array( - 'per_page' => $per_page, - 'total_items' => $activities['total'], - 'total_pages' => ceil( $activities['total'] / $per_page ) - ) ); - - // Don't truncate activity items; bp_activity_truncate_entry() needs to be used inside a BP_Activity_Template loop. - remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); - } - - /** - * Get an array of all the columns on the page. - * - * @since BuddyPress (1.6.0) - * - * @return array Column headers. - */ - function get_column_info() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns(), - $this->get_default_primary_column_name(), - ); - - return $this->_column_headers; - } - - /** - * Display a message on screen when no items are found (e.g. no search matches). - * - * @since BuddyPress (1.6.0) - */ - function no_items() { - _e( 'No activities found.', 'buddypress' ); - } - - /** - * Output the Activity data table. - * - * @since BuddyPress (1.6.0) - */ - function display() { - $this->display_tablenav( 'top' ); ?> - - <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> - <thead> - <tr> - <?php $this->print_column_headers(); ?> - </tr> - </thead> - - <tfoot> - <tr> - <?php $this->print_column_headers( false ); ?> - </tr> - </tfoot> - - <tbody id="the-comment-list"> - <?php $this->display_rows_or_placeholder(); ?> - </tbody> - </table> - <?php - - $this->display_tablenav( 'bottom' ); - } - - /** - * Generate content for a single row of the table. - * - * @since BuddyPress (1.6.0) - * - * @param object $item The current item. - */ - function single_row( $item ) { - static $even = false; - - if ( $even ) { - $row_class = ' class="even"'; - } else { - $row_class = ' class="alternate odd"'; - } - - if ( 'activity_comment' === $item['type'] ) { - $root_id = $item['item_id']; - } else { - $root_id = $item['id']; - } - - echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $root_id ) . '">'; - echo $this->single_row_columns( $item ); - echo '</tr>'; - - $even = ! $even; - } - - /** - * Get the list of views available on this table (e.g. "all", "spam"). - * - * @since BuddyPress (1.6.0) - */ - function get_views() { - $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_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 - - /** - * 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 - } - - /** - * Get bulk actions. - * - * @since BuddyPress (1.6.0) - * - * @return array Key/value pairs for the bulk actions dropdown. - */ - function get_bulk_actions() { - $actions = array(); - $actions['bulk_spam'] = __( 'Mark as Spam', 'buddypress' ); - $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 ); - } - - /** - * Get the table column titles. - * - * @since BuddyPress (1.6.0) - * - * @see WP_List_Table::single_row_columns() - * - * @return array The columns to appear in the Activity list table. - */ - function get_columns() { - return array( - 'cb' => '<input name type="checkbox" />', - 'author' => _x('Author', 'Admin SWA column header', 'buddypress' ), - 'comment' => _x( 'Activity', 'Admin SWA column header', 'buddypress' ), - 'action' => _x( 'Action', 'Admin SWA column header', 'buddypress' ), - 'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ), - ); - } - - /** - * Get the column names for sortable columns. - * - * Currently, returns an empty array (no columns are sortable). - * - * @since BuddyPress (1.6.0) - * @todo For this to work, BP_Activity_Activity::get() needs updating - * to support ordering by specific fields. - * - * @return array The columns that can be sorted on the Activity screen. - */ - function get_sortable_columns() { - return array(); - - /*return array( - 'author' => array( 'activity_author', false ), // Intentionally not using "=>" - );*/ - } - - /** - * Markup for the "filter" part of the form (i.e. which activity type to display). - * - * @since BuddyPress (1.6.0) - * - * @param string $which 'top' or 'bottom'. - */ - function extra_tablenav( $which ) { - - // Bail on bottom table nav - if ( 'bottom' === $which ) { - return; - } - - // Is any filter currently selected? - $selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : ''; - - // Get the actions - $activity_actions = bp_activity_get_actions(); ?> - - <div class="alignleft actions"> - <select name="activity_type"> - <option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option> - - <?php foreach ( $activity_actions as $component => $actions ) : ?> - - <optgroup label="<?php echo ucfirst( $component ); ?>"> - - <?php foreach ( $actions as $action_key => $action_values ) : ?> - - <?php - - // Skip the incorrectly named pre-1.6 action - if ( 'friends_register_activity_action' !== $action_key ) : ?> - - <option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key, $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option> - - <?php endif; ?> - - <?php endforeach; ?> - - </optgroup> - - <?php endforeach; ?> - - </select> - - <?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?> - </div> - - <?php - } - - /** - * Override WP_List_Table::row_actions(). - * - * Basically a duplicate of the row_actions() method, but removes the - * unnecessary <button> addition. - * - * @since 2.3.3 - * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. - * - * @param array $actions The list of actions - * @param bool $always_visible Whether the actions should be always visible - * @return string - */ - public function row_actions( $actions, $always_visible = false ) { - $action_count = count( $actions ); - $i = 0; - - if ( !$action_count ) - return ''; - - $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; - foreach ( $actions as $action => $link ) { - ++$i; - ( $i == $action_count ) ? $sep = '' : $sep = ' | '; - $out .= "<span class='$action'>$link$sep</span>"; - } - $out .= '</div>'; - - return $out; - } - - /** - * Checkbox column markup. - * - * @since BuddyPress (1.6.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - function column_cb( $item ) { - printf( '<label class="screen-reader-text" for="aid-%1$d">' . __( 'Select activity item %1$d', 'buddypress' ) . '</label><input type="checkbox" name="aid[]" value="%1$d" id="aid-%1$d" />', $item['id'] ); - } - - /** - * Author column markup. - * - * @since BuddyPress (1.6.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - function column_author( $item ) { - echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>'; - } - - /** - * Action column markup. - * - * @since BuddyPress (2.0.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - function column_action( $item ) { - $actions = bp_activity_admin_get_activity_actions(); - - if ( isset( $actions[ $item['type'] ] ) ) { - echo $actions[ $item['type'] ]; - } else { - printf( __( 'Unregistered action - %s', 'buddypress' ), $item['type'] ); - } - } - - /** - * Content column, and "quick admin" rollover actions. - * - * Called "comment" in the CSS so we can re-use some WP core CSS. - * - * @since BuddyPress (1.6.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - function column_comment( $item ) { - // Determine what type of item (row) we're dealing with - if ( $item['is_spam'] ) - $item_status = 'spam'; - else - $item_status = 'all'; - - // Preorder items: Reply | Edit | Spam | Delete Permanently - $actions = array( - 'reply' => '', - 'edit' => '', - 'spam' => '', 'unspam' => '', - 'delete' => '', - ); - - // Build actions URLs - $base_url = bp_get_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); - $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) ); - - $delete_url = $base_url . "&action=delete&$spam_nonce"; - $edit_url = $base_url . '&action=edit'; - $ham_url = $base_url . "&action=ham&$spam_nonce"; - $spam_url = $base_url . "&action=spam&$spam_nonce"; - - // Rollover actions - - // 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' ) ); - } else { - $actions['reply'] = sprintf( '<span class="form-input-tip" title="%s">%s</span>', __( 'Replies are disabled for this activity item', 'buddypress' ), __( 'Replies disabled', 'buddypress' ) ); - } - - // Edit - $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) ); - } - - // Spam/unspam - if ( 'spam' == $item_status ) - $actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) ); - else - $actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) ); - - // Delete - $actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) ); - - // Start timestamp - echo '<div class="submitted-on">'; - - /** - * 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 */ - printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'] ), get_date_from_gmt( $item['date_recorded'], get_option( 'date_format' ) ), get_date_from_gmt( $item['date_recorded'], get_option( 'time_format' ) ) ); - - // End timestamp - echo '</div>'; - - // 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'] ) ); - } - - echo $content . ' ' . $this->row_actions( $actions ); - } - - /** - * "In response to" column markup. - * - * @since BuddyPress (1.6.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - function column_response( $item ) { - // Is $item is a root activity? - ?> - - <div class="response-links"> - - <?php - // Activity permalink - $activity_permalink = ''; - if ( ! $item['is_spam'] ) { - $activity_permalink = sprintf( __( '<a href="%1$s" class="comments-view-item-link">View Activity</a>', 'buddypress' ), bp_activity_get_permalink( $item['id'], (object) $item ) ); - } - - /** - * 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 ) ) ) { - echo $activity_permalink; - - $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&aid=' . $item['id'] ); - - // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble - if ( $comment_count ) { - $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) ); - printf( '<a href="%1$s" title="%2$s" class="post-com-count post-com-count-approved"><span class="comment-count comment-count-approved">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) ); - } - - // For non-root activities, display a link to the replied-to activity's author's profile - } else { - echo '<strong>' . get_avatar( $this->get_activity_user_id( $item['item_id'] ), '32' ) . ' ' . bp_core_get_userlink( $this->get_activity_user_id( $item['item_id'] ) ) . '</strong><br />'; - echo $activity_permalink; - } - ?> - - </div> - - <?php - } - - /** - * Get the user id associated with a given activity item. - * - * Wraps bp_activity_get_specific(), with some additional logic for - * avoiding duplicate queries. - * - * @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 ) { - // If there is an existing activity/user ID mapping, just return the user ID. - if ( ! empty( $this->activity_user_id[$activity_id] ) ) { - return $this->activity_user_id[$activity_id]; - - /** - * We don't have a mapping. This means the $activity_id is not on the current - * page of results, so fetch its details from the database. - */ - } else { - $activity = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) ); - - /** - * If, somehow, the referenced activity has been deleted, leaving its associated - * activities as orphans, use the logged in user's ID to avoid errors. - */ - if ( empty( $activity['activities'] ) ) - return bp_loggedin_user_id(); - - // Store the new activity/user ID mapping for any later re-use - $this->activity_user_id[ $activity['activities'][0]->id ] = $activity['activities'][0]->user_id; - - // Return the user ID - return $activity['activities'][0]->user_id; - } - } - - /** - * 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 - * 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 ) { - $can_comment = true; - - if ( $this->disable_blogforum_comments ) { - switch ( $item['type'] ) { - case 'new_blog_post' : - case 'new_blog_comment' : - case 'new_forum_topic' : - case 'new_forum_post' : - $can_comment = false; - break; - } - - // activity comments supported - } else { - // activity comment - if ( 'activity_comment' == $item['type'] ) { - // blogs - if ( bp_is_active( 'blogs' ) ) { - // grab the parent activity entry - $parent_activity = new BP_Activity_Activity( $item['item_id'] ); - - // fetch blog post comment depth and if the blog post's comments are open - bp_blogs_setup_activity_loop_globals( $parent_activity ); - - // check if the activity item can be replied to - if ( false === bp_blogs_can_comment_reply( true, $item ) ) { - $can_comment = false; - } - } - - // blog post - } elseif ( 'new_blog_post' == $item['type'] ) { - if ( bp_is_active( 'blogs' ) ) { - bp_blogs_setup_activity_loop_globals( (object) $item ); - - if ( empty( buddypress()->blogs->allow_comments[$item['id']] ) ) { - $can_comment = false; - } - } - } - } - - /** - * 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 ); - } - - /** - * Flatten the activity array. - * - * In some cases, BuddyPress gives us a structured tree of activity - * items plus their comments. This method converts it to a flat array. - * - * @since BuddyPress (1.6.0) - * - * @param array $tree Source array. - * - * @return array Flattened array. - */ - public static function flatten_activity_array( $tree ){ - foreach ( (array) $tree as $node ) { - if ( isset( $node->children ) ) { - - foreach ( BP_Activity_List_Table::flatten_activity_array( $node->children ) as $child ) { - $tree[] = $child; - } - - unset( $node->children ); - } - } - - return $tree; - } - - /** - * Get name of default primary column - * - * @since BuddyPress (2.3.3) - * @access protected - * - * @return string - */ - protected function get_default_primary_column_name() { - return 'author'; - } -} 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 f7385dada1cdcf1edaf57e500625705292d38ebe..91c8a91d51793430f2c34c6e9621cb7cc9bb769e 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php @@ -3,657 +3,14 @@ * Akismet support for BuddyPress' Activity Stream. * * @package BuddyPress - * @since BuddyPress (1.6.0) - * @subpackage Activity + * @subpackage ActivityAkismet + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/** - * Akismet support for the Activity component. - * - * @since BuddyPress (1.6.0) - * @since BuddyPress (2.3.0) We only support Akismet 3+. - */ -class BP_Akismet { - /** - * The activity last marked as spam. - * - * @access protected - * @var BP_Activity_Activity - * @since BuddyPress (1.6.0) - */ - protected $last_activity = null; - - /** - * Constructor. - * - * @since BuddyPress (1.6.0) - */ - public function __construct() { - $this->setup_actions(); - } - - /** - * Hook Akismet into the activity stream. - * - * @since BuddyPress (1.6.0) - */ - protected function setup_actions() { - // Add nonces to activity stream lists - add_action( 'bp_after_activity_post_form', array( $this, 'add_activity_stream_nonce' ) ); - add_action( 'bp_activity_entry_comments', array( $this, 'add_activity_stream_nonce' ) ); - - // Add a "mark as spam" button to individual activity items - add_action( 'bp_activity_entry_meta', array( $this, 'add_activity_spam_button' ) ); - add_action( 'bp_activity_comment_options', array( $this, 'add_activity_comment_spam_button' ) ); - - // Check activity for spam - add_action( 'bp_activity_before_save', array( $this, 'check_activity' ), 4, 1 ); - - // Tidy up member's latest (activity) update - add_action( 'bp_activity_posted_update', array( $this, 'check_member_activity_update' ), 1, 3 ); - - // Hooks to extend Activity core spam/ham functions for Akismet - add_action( 'bp_activity_mark_as_spam', array( $this, 'mark_as_spam' ), 10, 2 ); - add_action( 'bp_activity_mark_as_ham', array( $this, 'mark_as_ham' ), 10, 2 ); - - // Hook into the Activity wp-admin screen - add_action( 'bp_activity_admin_comment_row_actions', array( $this, 'comment_row_action' ), 10, 2 ); - add_action( 'bp_activity_admin_load', array( $this, 'add_history_metabox' ) ); - } - - /** - * Add a history item to the hover links in an activity's row. - * - * This function lifted with love from the Akismet WordPress plugin's - * akismet_comment_row_action() function. Thanks! - * - * @since BuddyPress (1.6.0) - * - * @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 ) { - $akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' ); - $user_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_user_result' ); - $desc = ''; - - if ( !$user_result || $user_result == $akismet_result ) { - // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same - if ( 'true' == $akismet_result && $activity['is_spam'] ) - $desc = __( 'Flagged as spam by Akismet', 'buddypress' ); - - elseif ( 'false' == $akismet_result && !$activity['is_spam'] ) - $desc = __( 'Cleared by Akismet', 'buddypress' ); - - } else { - $who = bp_activity_get_meta( $activity['id'], '_bp_akismet_user' ); - - if ( 'true' == $user_result ) - $desc = sprintf( __( 'Flagged as spam by %s', 'buddypress' ), $who ); - else - $desc = sprintf( __( 'Un-spammed by %s', 'buddypress' ), $who ); - } - - // add a History item to the hover links, just after Edit - if ( $akismet_result ) { - $b = array(); - foreach ( $actions as $k => $item ) { - $b[ $k ] = $item; - if ( $k == 'edit' ) - $b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; - } - - $actions = $b; - } - - if ( $desc ) - echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&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 ); - } - - /** - * Generate nonces for activity forms. - * - * These nonces appear in the member profile status form, as well as in - * the reply form of each activity item. The nonces are, in turn, used - * by Akismet to help detect spam activity. - * - * @since BuddyPress (1.6.0) - * - * @see https://plugins.trac.wordpress.org/ticket/1232 - */ - public function add_activity_stream_nonce() { - $form_id = '_bp_as_nonce'; - $value = '_bp_as_nonce_' . bp_loggedin_user_id(); - - // If we're in the activity stream loop, we can use the current item's ID to make the nonce unique - if ( 'bp_activity_entry_comments' == current_filter() ) { - $form_id .= '_' . bp_get_activity_id(); - $value .= '_' . bp_get_activity_id(); - } - - wp_nonce_field( $value, $form_id, false ); - } - - /** - * Clean up the bp_latest_update usermeta in case of spamming. - * - * Run just after an update is posted, this method check to see whether - * the newly created update has been marked as spam by Akismet. If so, - * the cached update is cleared from the user's 'bp_latest_update' - * usermeta, ensuring that it won't appear in the member header and - * elsewhere in the theme. - * - * 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.0) - * - * @see bp_dtheme_post_update() - * - * @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. - if ( empty( $this->last_activity ) || !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) ) - return; - - // Was this $activity_id just marked as spam? If not, bail out. - if ( !$this->last_activity->id || $activity_id != $this->last_activity->id || 'false' == $this->last_activity->akismet_submission['bp_as_result'] ) - return; - - // It was, so delete the member's latest activity update. - bp_delete_user_meta( $user_id, 'bp_latest_update' ); - } - - /** - * Adds a "mark as spam" button to each activity item for site admins. - * - * This function is intended to be used inside the activity stream loop. - * - * @since BuddyPress (1.6.0) - */ - public function add_activity_spam_button() { - if ( !bp_activity_user_can_mark_spam() ) - return; - - // By default, only handle activity updates and activity comments. - if ( !in_array( bp_get_activity_type(), BP_Akismet::get_activity_types() ) ) - return; - - bp_button( - array( - 'block_self' => false, - 'component' => 'activity', - 'id' => 'activity_make_spam_' . bp_get_activity_id(), - 'link_class' => 'bp-secondary-action spam-activity confirm button item-button', - 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_id() . '/', 'bp_activity_akismet_spam_' . bp_get_activity_id() ), - 'link_text' => __( 'Spam', 'buddypress' ), - 'wrapper' => false, - ) - ); - } - - /** - * Adds a "mark as spam" button to each activity COMMENT item for site admins. - * - * This function is intended to be used inside the activity stream loop. - * - * @since BuddyPress (1.6.0) - */ - public function add_activity_comment_spam_button() { - if ( !bp_activity_user_can_mark_spam() ) - return; - - // By default, only handle activity updates and activity comments. - $current_comment = bp_activity_current_comment(); - if ( empty( $current_comment ) || !in_array( $current_comment->type, BP_Akismet::get_activity_types() ) ) - return; - - bp_button( - array( - 'block_self' => false, - 'component' => 'activity', - 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), - 'link_class' => 'bp-secondary-action spam-activity-comment confirm', - 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id() ), - 'link_text' => __( 'Spam', 'buddypress' ), - 'wrapper' => false, - ) - ); - } - - /** - * Get a filterable list of activity types that Akismet should automatically check for spam. - * - * @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.0) - * - * @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.0) - * - * @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.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 ); - - $activity_data = array(); - $activity_data['akismet_comment_nonce'] = 'inactive'; - $activity_data['comment_author'] = $userdata->display_name; - $activity_data['comment_author_email'] = $userdata->user_email; - $activity_data['comment_author_url'] = bp_core_get_userlink( $userdata->ID, false, true); - $activity_data['comment_content'] = $activity->content; - $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 ); - - /** - * Get the nonce if the new activity was submitted through the "what's up, Paul?" form. - * This helps Akismet ensure that the update was a valid form submission. - */ - if ( !empty( $_POST['_bp_as_nonce'] ) ) - $activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST['_bp_as_nonce'], "_bp_as_nonce_{$userdata->ID}" ) ? 'passed' : 'failed'; - - /** - * If the new activity was a reply to an existing item, check the nonce with the activity parent ID. - * This helps Akismet ensure that the update was a valid form submission. - */ - 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.0) - * - * @see http://akismet.com/development/api/ - * @todo Spam counter? - * @todo Auto-delete old spam? - * - * @param BP_Activity_Activity $activity The activity item to check. - */ - public function check_activity( $activity ) { - // By default, only handle activity updates and activity comments. - if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) - return; - - // Make sure last_activity is clear to avoid any confusion - $this->last_activity = null; - - // Build data package for Akismet - $activity_data = BP_Akismet::build_akismet_data_package( $activity ); - - // Check with Akismet to see if this is spam - $activity_data = $this->send_akismet_request( $activity_data, 'check', 'spam' ); - - // Record this item - $this->last_activity = $activity; - - // Store a copy of the data that was submitted to Akismet - $this->last_activity->akismet_submission = $activity_data; - - // Spam - if ( 'true' == $activity_data['bp_as_result'] ) { - /** - * 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 - bp_activity_mark_as_spam( $activity, 'by_akismet' ); - } - - // Update activity meta after a spam check - add_action( 'bp_activity_after_save', array( $this, 'update_activity_akismet_meta' ), 1, 1 ); - } - - /** - * Update activity meta after a manual spam change (user-initiated). - * - * @since BuddyPress (1.6.0) - * - * @param BP_Activity_Activity $activity The activity to check. - */ - public function update_activity_spam_meta( $activity ) { - // By default, only handle activity updates and activity comments. - if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) - return; - - $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-spam' ); - bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'true' ); - bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() ); - } - - /** - * Update activity meta after a manual ham change (user-initiated). - * - * @since BuddyPress (1.6.0) - * - * @param BP_Activity_Activity $activity The activity to check. - */ - public function update_activity_ham_meta( $activity ) { - // By default, only handle activity updates and activity comments. - if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) - return; - - $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as not spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-ham' ); - bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'false' ); - bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() ); - } - - /** - * Update activity meta after an automatic spam check (not user-initiated). - * - * @since BuddyPress (1.6.0) - * - * @param BP_Activity_Activity $activity The activity to check. - */ - public function update_activity_akismet_meta( $activity ) { - // Check we're dealing with what was last updated by Akismet - if ( empty( $this->last_activity ) || !empty( $this->last_activity ) && $activity->id != $this->last_activity->id ) - return; - - // By default, only handle activity updates and activity comments. - if ( !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) ) - return; - - // Spam - if ( 'true' == $this->last_activity->akismet_submission['bp_as_result'] ) { - bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'true' ); - $this->update_activity_history( $activity->id, __( 'Akismet caught this item as spam', 'buddypress' ), 'check-spam' ); - - // Not spam - } elseif ( 'false' == $this->last_activity->akismet_submission['bp_as_result'] ) { - bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'false' ); - $this->update_activity_history( $activity->id, __( 'Akismet cleared this item', 'buddypress' ), 'check-ham' ); - - // Uh oh, something's gone horribly wrong. Unexpected result. - } else { - bp_activity_update_meta( $activity->id, '_bp_akismet_error', bp_core_current_time() ); - $this->update_activity_history( $activity->id, sprintf( __( 'Akismet was unable to check this item (response: %s), will automatically retry again later.', 'buddypress' ), $this->last_activity->akismet_submission['bp_as_result'] ), 'check-error' ); - } - - // Record the original data which was submitted to Akismet for checking - bp_activity_update_meta( $activity->id, '_bp_akismet_submission', $this->last_activity->akismet_submission ); - } - - /** - * Contact Akismet to check if this is spam or ham. - * - * Props to WordPress core Akismet plugin for a lot of this. - * - * @since BuddyPress (1.6.0) - * - * @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' ) { - $query_string = $path = ''; - - $activity_data['blog'] = bp_get_option( 'home' ); - $activity_data['blog_charset'] = bp_get_option( 'blog_charset' ); - $activity_data['blog_lang'] = get_locale(); - $activity_data['referrer'] = $_SERVER['HTTP_REFERER']; - $activity_data['user_agent'] = bp_core_current_user_ua(); - $activity_data['user_ip'] = bp_core_current_user_ip(); - - if ( Akismet::is_test_mode() ) - $activity_data['is_test'] = 'true'; - - // Loop through _POST args and rekey strings - foreach ( $_POST as $key => $value ) - if ( is_string( $value ) && 'cookie' != $key ) - $activity_data['POST_' . $key] = $value; - - // Keys to ignore - $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ); - - // Loop through _SERVER args and remove whitelisted keys - foreach ( $_SERVER as $key => $value ) { - - // Key should not be ignored - if ( !in_array( $key, $ignore ) && is_string( $value ) ) { - $activity_data[$key] = $value; - - // Key should be ignored - } else { - $activity_data[$key] = ''; - } - } - - foreach ( $activity_data as $key => $data ) - $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&'; - - if ( 'check' == $check ) - $path = 'comment-check'; - elseif ( 'submit' == $check ) - $path = 'submit-' . $spam; - - // Send to Akismet - add_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) ); - $response = Akismet::http_post( $query_string, $path ); - remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) ); - - // Get the response - if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) ) - $activity_data['bp_as_result'] = $response[1]; - else - $activity_data['bp_as_result'] = false; - - // Perform a daily tidy up - if ( ! wp_next_scheduled( 'bp_activity_akismet_delete_old_metadata' ) ) - wp_schedule_event( time(), 'daily', 'bp_activity_akismet_delete_old_metadata' ); - - return $activity_data; - } - - /** - * Filters user agent when sending to Akismet to add BuddyPress info. - * - * @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 ) { - $user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' ); - return $user_agent; - } - - /** - * Adds a "History" meta box to the activity edit screen. - * - * @since BuddyPress (1.6.0) - * - * @param string $screen_action The type of screen that has been requested. - */ - function add_history_metabox( $screen_action ) { - // Only proceed if we're on the edit screen - if ( 'edit' != $screen_action ) - return; - - // Display meta box with a low priority (low position on screen by default) - add_meta_box( 'bp_activity_history', __( 'Activity History', 'buddypress' ), array( $this, 'history_metabox' ), get_current_screen()->id, 'normal', 'low' ); - } - - /** - * History meta box for the Activity admin edit screen. - * - * @since BuddyPress (1.6.0) - * - * @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. - */ - function history_metabox( $item ) { - $history = BP_Akismet::get_activity_history( $item->id ); - - if ( empty( $history ) ) - return; - - echo '<div class="akismet-history"><div>'; - printf( _x( '<span>%1$s</span> — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), bp_core_time_since( $history[2] ), esc_html( $history[1] ) ); - echo '</div></div>'; - } - - /** - * Update an activity item's Akismet history. - * - * @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. - */ - public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) { - $event = array( - 'event' => $event, - 'message' => $message, - 'time' => Akismet::_get_microtime(), - 'user' => bp_loggedin_user_id(), - ); - - // Save the history data - bp_activity_update_meta( $activity_id, '_bp_akismet_history', $event ); - } - - /** - * Get an activity item's Akismet history. - * - * @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 ) { - $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' ); - if ( $history === false ) - $history = array(); - - // Sort it by the time recorded - usort( $history, 'akismet_cmp_time' ); - - return $history; - } -} +require dirname( __FILE__ ) . '/classes/class-bp-akismet.php'; /** * Delete old spam activity meta data. @@ -661,7 +18,7 @@ class BP_Akismet { * This is done as a clean-up mechanism, as _bp_akismet_submission meta can * grow to be quite large. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global wpdb $wpdb WordPress database object. */ @@ -673,13 +30,13 @@ function bp_activity_akismet_delete_old_metadata() { /** * Filters the threshold for how many days old Akismet metadata needs to be before being automatically deleted. * - * @since BuddyPress (1.6.0) + * @since 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 + // Enforce a minimum of 1 day. $interval = max( 1, absint( $interval ) ); // _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status 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 92ffd619c796dec142278dc30b30188de0ebe34e..a3a7241dd68408221c50ee738b4d36737718c180 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php @@ -1,12 +1,13 @@ <?php - /** * Functions related to the BuddyPress Activity component and the WP Cache. * - * @since BuddyPress (1.6.0) + * @package BuddyPress + * @subpackage ActivityCache + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -16,8 +17,10 @@ defined( 'ABSPATH' ) || exit; * in $activity_ids and adds it to the WP cache. This improves efficiency when * using querying activitymeta inline. * + * @since 1.6.0 + * * @param int|string|array|bool $activity_ids Accepts a single activity ID, or a comma- - * separated list or array of activity ids + * separated list or array of activity ids. */ function bp_activity_update_meta_cache( $activity_ids = false ) { $bp = buddypress(); @@ -37,9 +40,9 @@ function bp_activity_update_meta_cache( $activity_ids = false ) { /** * Clear a cached activity item when that item is updated. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_Activity_Activity $activity + * @param BP_Activity_Activity $activity Activity object. */ function bp_activity_clear_cache_for_activity( $activity ) { wp_cache_delete( $activity->id, 'bp_activity' ); @@ -50,7 +53,7 @@ add_action( 'bp_activity_after_save', 'bp_activity_clear_cache_for_activity' ); /** * Clear cached data for deleted activity items. * - * @since BuddyPress (2.0.0) + * @since 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 8f00824cc1221b1d1e32cd23ef3c3bf42c6f2e80..2d2fc961c910f2d161981434bab21bfab44e179d 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Activity Classes + * BuddyPress Activity Classes. * * @package BuddyPress - * @subpackage Activity + * @subpackage ActivityClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; require dirname( __FILE__ ) . '/classes/class-bp-activity-activity.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 0e02106cb90de7ad1fc9f41eaa4a85527789378f..ec14cd416b489bd62a6454e2723617c47eda34bf 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cssjs.php @@ -1,26 +1,26 @@ <?php - /** * Activity component CSS/JS * * @package BuddyPress * @subpackage ActivityScripts + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Enqueue @mentions JS. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_activity_mentions_script() { if ( ! bp_activity_maybe_load_mentions_scripts() ) { return; } - // Special handling for New/Edit screens in wp-admin + // Special handling for New/Edit screens in wp-admin. if ( is_admin() ) { if ( ! get_current_screen() || @@ -31,7 +31,7 @@ function bp_activity_mentions_script() { } - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); wp_enqueue_script( 'bp-mentions', buddypress()->plugin_url . "bp-activity/js/mentions{$min}.js", array( 'jquery', 'jquery-atwho' ), bp_get_version(), true ); wp_enqueue_style( 'bp-mentions-css', buddypress()->plugin_url . "bp-activity/css/mentions{$min}.css", array(), bp_get_version() ); @@ -50,7 +50,7 @@ function bp_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) + * @since 2.1.0 */ do_action( 'bp_activity_mentions_prime_results' ); } @@ -60,11 +60,10 @@ add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' ); /** * Bind the mentions listener to a wp_editor instance when TinyMCE initializes. * - * @since BuddyPress (2.3.3) + * @since 2.3.3 * * @param array $settings An array with TinyMCE config. * @param string $editor_id Unique editor identifier, e.g. 'content'. - * * @return array $mceInit An array with TinyMCE config. */ function bp_add_mentions_on_tinymce_init( $settings, $editor_id ) { 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 7250c66219cfc9e670eaf85517f3d6e7f0eae451..a73e3236b8d21fc3a42e00a677782e4838c8971d 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php @@ -1,18 +1,18 @@ <?php - /** * Filters related to the Activity component. * * @package BuddyPress * @subpackage ActivityFilters + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/** Filters *******************************************************************/ +/* Filters *******************************************************************/ -// Apply WordPress defined filters +// Apply WordPress defined filters. add_filter( 'bp_get_activity_action', 'bp_activity_filter_kses', 1 ); add_filter( 'bp_get_activity_content_body', 'bp_activity_filter_kses', 1 ); add_filter( 'bp_get_activity_content', 'bp_activity_filter_kses', 1 ); @@ -33,6 +33,10 @@ add_filter( 'bp_get_activity_feed_item_description', 'force_balance_tags' ); add_filter( 'bp_activity_content_before_save', 'force_balance_tags' ); add_filter( 'bp_activity_action_before_save', 'force_balance_tags' ); +if ( function_exists( 'wp_encode_emoji' ) ) { + add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' ); +} + add_filter( 'bp_get_activity_action', 'wptexturize' ); add_filter( 'bp_get_activity_content_body', 'wptexturize' ); add_filter( 'bp_get_activity_content', 'wptexturize' ); @@ -78,7 +82,7 @@ add_filter( 'bp_get_activity_feed_item_description', 'stripslashes_deep', 5 ); add_filter( 'bp_activity_primary_link_before_save', 'esc_url_raw' ); -// Apply BuddyPress-defined filters +// Apply BuddyPress-defined filters. add_filter( 'bp_get_activity_content', 'bp_activity_make_nofollow_filter' ); add_filter( 'bp_get_activity_content_body', 'bp_activity_make_nofollow_filter' ); add_filter( 'bp_get_activity_parent_content', 'bp_activity_make_nofollow_filter' ); @@ -99,12 +103,12 @@ add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 ); add_filter( 'bp_get_total_favorite_count_for_user', 'bp_core_number_format' ); add_filter( 'bp_get_total_mention_count_for_user', 'bp_core_number_format' ); -/** Actions *******************************************************************/ +/* Actions *******************************************************************/ -// At-name filter +// At-name filter. add_action( 'bp_activity_before_save', 'bp_activity_at_name_filter_updates' ); -// Activity stream moderation +// Activity stream moderation. add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 ); add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2, 1 ); @@ -113,7 +117,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.0) + * @since 1.6.0 * * @return array $types List of the activity types to moderate. */ @@ -126,7 +130,7 @@ function bp_activity_get_moderated_activity_types() { /** * Filters the default activity types that BuddyPress should moderate. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $types Default activity types to moderate. */ @@ -136,18 +140,18 @@ function bp_activity_get_moderated_activity_types() { /** * Moderate the posted activity item, if it contains moderate keywords. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param BP_Activity_Activity $activity The activity object to check. */ function bp_activity_check_moderation_keys( $activity ) { - // Only check specific types of activity updates + // Only check specific types of activity updates. if ( !in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) return; // Unset the activity component so activity stream update fails - // @todo This is temporary until some kind of moderation is built + // @todo This is temporary until some kind of moderation is built. if ( !bp_core_check_for_moderation( $activity->user_id, '', $activity->content ) ) $activity->component = false; } @@ -155,17 +159,17 @@ function bp_activity_check_moderation_keys( $activity ) { /** * Mark the posted activity as spam, if it contains blacklist keywords. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param BP_Activity_Activity $activity The activity object to check. */ function bp_activity_check_blacklist_keys( $activity ) { - // Only check specific types of activity updates + // Only check specific types of activity updates. if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) return; - // Mark as spam + // Mark as spam. if ( ! bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) ) bp_activity_mark_as_spam( $activity, 'by_blacklist' ); } @@ -173,13 +177,12 @@ function bp_activity_check_blacklist_keys( $activity ) { /** * Custom kses filtering for activity content. * - * @since BuddyPress (1.1.0) + * @since 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 ) { @@ -208,7 +211,7 @@ function bp_activity_filter_kses( $content ) { /** * Filters the allowed HTML tags for BuddyPress Activity content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $value Array of allowed HTML tags and attributes. */ @@ -219,11 +222,10 @@ function bp_activity_filter_kses( $content ) { /** * Find and link @-mentioned users in the contents of a given item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @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 ) { @@ -233,7 +235,7 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) { return $content; } - // Try to find mentions + // Try to find mentions. $usernames = bp_activity_find_mentions( $content ); // No mentions? Stop now! @@ -241,11 +243,11 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) { return $content; // We don't want to link @mentions that are inside of links, so we - // temporarily remove them + // temporarily remove them. $replace_count = 0; $replacements = array(); foreach ( $usernames as $username ) { - // prevent @ name linking inside <a> tags + // Prevent @ name linking inside <a> tags. preg_match_all( '/(<a.*?(?!<\/a>)@' . $username . '.*?<\/a>)/', $content, $content_matches ); if ( ! empty( $content_matches[1] ) ) { foreach ( $content_matches[1] as $replacement ) { @@ -256,19 +258,19 @@ function bp_activity_at_name_filter( $content, $activity_id = 0 ) { } } - // Linkify the mentions with the username + // Linkify the mentions with the username. foreach ( (array) $usernames as $user_id => $username ) { $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content ); } - // put everything back + // Put everything back. if ( ! empty( $replacements ) ) { foreach ( $replacements as $placeholder => $original ) { $content = str_replace( $placeholder, $original, $content ); } } - // Return the content + // Return the content. return $content; } @@ -278,11 +280,11 @@ 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.0) + * @since 1.5.0 * * @uses bp_activity_find_mentions() * - * @param BP_Activity_Activity $activity + * @param BP_Activity_Activity $activity Activity Object. */ function bp_activity_at_name_filter_updates( $activity ) { // Are mentions disabled? @@ -294,20 +296,20 @@ function bp_activity_at_name_filter_updates( $activity ) { if ( ! empty( $activity->is_spam ) ) return; - // Try to find mentions + // Try to find mentions. $usernames = bp_activity_find_mentions( $activity->content ); // We have mentions! if ( ! empty( $usernames ) ) { - // Replace @mention text with userlinks + // Replace @mention text with userlinks. foreach( (array) $usernames as $user_id => $username ) { $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content ); } - // Add our hook to send @mention emails after the activity item is saved + // Add our hook to send @mention emails after the activity item is saved. add_action( 'bp_activity_after_save', 'bp_activity_at_name_send_emails' ); - // temporary variable to avoid having to run bp_activity_find_mentions() again + // Temporary variable to avoid having to run bp_activity_find_mentions() again. buddypress()->activity->mentioned_users = $usernames; } } @@ -315,7 +317,7 @@ function bp_activity_at_name_filter_updates( $activity ) { /** * Sends emails and BP notifications for users @-mentioned in an activity item. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_activity_at_message_notification() * @uses bp_activity_update_mention_count_for_user() @@ -332,28 +334,31 @@ function bp_activity_at_name_send_emails( $activity ) { if ( empty( buddypress()->activity->mentioned_users ) ) return; - // Grab our temporary variable from bp_activity_at_name_filter_updates() + // Grab our temporary variable from bp_activity_at_name_filter_updates(). $usernames = buddypress()->activity->mentioned_users; - // Get rid of temporary variable + // Get rid of temporary variable. unset( buddypress()->activity->mentioned_users ); - // Send @mentions and setup BP notifications + // Send @mentions and setup BP notifications. foreach( (array) $usernames as $user_id => $username ) { /** * Filters BuddyPress' ability to send email notifications for @mentions. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * @since 2.5.0 Introduced `$user_id` and `$activity` parameters. * - * @param bool $value Whether or not BuddyPress should send a notification to the mentioned users. - * @param array $usernames Array of users potentially notified. + * @param bool $value Whether or not BuddyPress should send a notification to the mentioned users. + * @param array $usernames Array of users potentially notified. + * @param int $user_id ID of the current user being notified. + * @param BP_Activity_Activity $activity Activity object. */ - if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames ) ) { + if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames, $user_id, $activity ) ) { bp_activity_at_message_notification( $activity->id, $user_id ); } - // Updates mention count for the user + // Updates mention count for the user. bp_activity_update_mention_count_for_user( $user_id, $activity->id ); } } @@ -361,10 +366,9 @@ function bp_activity_at_name_send_emails( $activity ) { /** * Catch links in activity text so rel=nofollow can be added. * - * @since BuddyPress (1.2.0) + * @since 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 ) { @@ -374,10 +378,9 @@ function bp_activity_make_nofollow_filter( $text ) { /** * Add rel=nofollow to a link. * - * @since BuddyPress (1.2.0) + * @since 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. */ function bp_activity_make_nofollow_filter_callback( $matches ) { @@ -391,7 +394,7 @@ function bp_activity_make_nofollow_filter( $text ) { * * This method can only be used inside the Activity loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_is_single_activity() * @uses apply_filters() To call the 'bp_activity_excerpt_append_text' hook. @@ -402,7 +405,6 @@ 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 ) { @@ -411,7 +413,7 @@ function bp_activity_truncate_entry( $text ) { /** * Provides a filter that lets you choose whether to skip this filter on a per-activity basis. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param bool $value If true, text should be checked to see if it needs truncating. */ @@ -420,7 +422,7 @@ function bp_activity_truncate_entry( $text ) { 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 + // The full text of the activity update should always show on the single activity screen. if ( ! $maybe_truncate_text || bp_is_single_activity() ) { return $text; } @@ -428,7 +430,7 @@ function bp_activity_truncate_entry( $text ) { /** * Filters the appended text for the activity excerpt. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Internationalized "Read more" text. */ @@ -437,19 +439,20 @@ function bp_activity_truncate_entry( $text ) { /** * Filters the excerpt length for the activity excerpt. * - * @since BuddyPress (1.5.0) + * @since 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 - // returned. + // Run the text through the excerpt function. If it's too short, the original text will be returned. $excerpt = bp_create_excerpt( $text, $excerpt_length, array( 'ending' => __( '…', 'buddypress' ) ) ); - // If the text returned by bp_create_excerpt() is different from the original text (ie it's - // been truncated), add the "Read More" link. Note that bp_create_excerpt() is stripping - // shortcodes, so we have strip them from the $text before the comparison + /* + * If the text returned by bp_create_excerpt() is different from the original text (ie it's + * been truncated), add the "Read More" link. Note that bp_create_excerpt() is stripping + * shortcodes, so we have strip them from the $text before the comparison. + */ if ( $excerpt != strip_shortcodes( $text ) ) { $id = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id(); @@ -459,7 +462,7 @@ function bp_activity_truncate_entry( $text ) { /** * Filters the composite activity excerpt entry. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $excerpt Excerpt text and markup to be displayed. * @param string $text The original activity entry text. @@ -471,12 +474,11 @@ function bp_activity_truncate_entry( $text ) { /** * Include extra JavaScript dependencies for activity component. * - * @since BuddyPress (2.0.0) + * @since 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() ) { @@ -494,10 +496,9 @@ add_filter( 'bp_core_get_js_dependencies', 'bp_activity_get_js_dependencies', 10 * We use these classes to avoid pagination issues when items are loaded * dynamically into the activity stream. * - * @since BuddyPress (2.0.0) - * - * @param string $classes + * @since 2.0.0 * + * @param string $classes Array of classes for most recent activity item. * @return string $classes */ function bp_activity_newest_class( $classes = '' ) { @@ -514,10 +515,9 @@ function bp_activity_newest_class( $classes = '' ) { /** * Check if Activity Heartbeat feature i on to add a timestamp class. * - * @since BuddyPress (2.0.0) - * - * @param string $classes + * @since 2.0.0 * + * @param string $classes Array of classes for timestamp. * @return string $classes */ function bp_activity_timestamp_class( $classes = '' ) { @@ -541,13 +541,12 @@ add_filter( 'bp_get_activity_css_class', 'bp_activity_timestamp_class', 9, 1 ); /** * Use WordPress Heartbeat API to check for latest activity update. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @uses bp_activity_get_last_updated() to get the recorded date of the last activity. * - * @param array $response - * @param array $data - * + * @param array $response Array containing Heartbeat API response. + * @param array $data Array containing data for Heartbeat API response. * @return array $response */ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array() ) { @@ -556,7 +555,7 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array } // Use the querystring argument stored in the cookie (to preserve - // filters), but force the offset to get only new items + // filters), but force the offset to get only new items. $activity_latest_args = bp_parse_args( bp_ajax_querystring( 'activity' ), array( 'since' => date( 'Y-m-d H:i:s', $data['bp_activity_last_recorded'] ) ), @@ -570,7 +569,7 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array $newest_activities = array(); $last_activity_recorded = 0; - // Temporarily 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(); @@ -591,7 +590,7 @@ function bp_activity_heartbeat_last_recorded( $response = array(), $data = array $newest_activities['last_recorded'] = $last_activity_recorded; ob_end_clean(); - // Remove the temporary filter + // Remove the temporary filter. remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1 ); if ( ! empty( $newest_activities['last_recorded'] ) ) { @@ -606,10 +605,9 @@ add_filter( 'heartbeat_nopriv_received', 'bp_activity_heartbeat_last_recorded', /** * Set the strings for WP HeartBeat API where needed. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $strings Localized strings. - * * @return array $strings */ function bp_activity_heartbeat_strings( $strings = array() ) { @@ -623,7 +621,7 @@ function bp_activity_heartbeat_strings( $strings = array() ) { /** * Filter that checks whether the global heartbeat settings already exist. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $value Heartbeat settings array. */ @@ -636,7 +634,7 @@ function bp_activity_heartbeat_strings( $strings = array() ) { /** * Filters the pulse frequency to be used for the BuddyPress Activity heartbeat. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $value The frequency in seconds between pulses. */ @@ -668,16 +666,15 @@ add_filter( 'bp_core_get_js_strings', 'bp_activity_heartbeat_strings', 10, 1 ); /** * Set up activity arguments for use with the 'just-me' scope. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $retval Empty array by default. * @param array $filter Current activity arguments. - * - * @return array + * @return array $retval */ function bp_activity_filter_just_me_scope( $retval = array(), $filter = array() ) { - // Determine the user_id + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -703,7 +700,7 @@ function bp_activity_filter_just_me_scope( $retval = array(), $filter = array() ), $show_hidden, - // overrides + // Overrides. 'override' => array( 'display_comments' => 'stream', 'filter' => array( 'user_id' => 0 ), @@ -718,16 +715,15 @@ add_filter( 'bp_activity_set_just-me_scope_args', 'bp_activity_filter_just_me_sc /** * Set up activity arguments for use with the 'favorites' scope. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $retval Empty array by default. * @param array $filter Current activity arguments. - * - * @return array + * @return array $retval */ function bp_activity_filter_favorites_scope( $retval = array(), $filter = array() ) { - // Determine the user_id + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -736,7 +732,7 @@ function bp_activity_filter_favorites_scope( $retval = array(), $filter = array( : bp_loggedin_user_id(); } - // Determine the favorites + // Determine the favorites. $favs = bp_activity_get_user_favorites( $user_id ); if ( empty( $favs ) ) { $favs = array( 0 ); @@ -760,7 +756,7 @@ function bp_activity_filter_favorites_scope( $retval = array(), $filter = array( ), $show_hidden, - // overrides + // Overrides. 'override' => array( 'display_comments' => true, 'filter' => array( 'user_id' => 0 ), @@ -776,12 +772,11 @@ add_filter( 'bp_activity_set_favorites_scope_args', 'bp_activity_filter_favorite /** * Set up activity arguments for use with the 'favorites' scope. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $retval Empty array by default. * @param array $filter Current activity arguments. - * - * @return array + * @return array $retval */ function bp_activity_filter_mentions_scope( $retval = array(), $filter = array() ) { @@ -790,7 +785,7 @@ function bp_activity_filter_mentions_scope( $retval = array(), $filter = array() return $retval; } - // Determine the user_id + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -819,12 +814,8 @@ function bp_activity_filter_mentions_scope( $retval = array(), $filter = array() ), $show_hidden, - // overrides + // 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 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 57e42e7bc45563d32aab828604b2c6178b874ff1..8f03c6f218ff5e64dc2ea1b9f0f20cc951da6f79 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Activity Functions. * @@ -7,15 +6,16 @@ * * @package BuddyPress * @subpackage ActivityFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Check whether the $bp global lists an activity directory page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if activity directory page is found, otherwise false. */ @@ -38,7 +38,7 @@ function bp_activity_has_directory() { * * add_filter( 'bp_activity_do_mentions', '__return_false' ); * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @uses apply_filters() To call 'bp_activity_do_mentions' hook. * @@ -49,7 +49,7 @@ function bp_activity_do_mentions() { /** * Filters whether or not mentions are enabled. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param bool $enabled True to enable mentions, false to disable. */ @@ -60,7 +60,7 @@ function bp_activity_do_mentions() { * Should BuddyPress load the mentions scripts and related assets, including results to prime the * mentions suggestions? * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return bool True if mentions scripts should be loaded. */ @@ -71,7 +71,7 @@ function bp_activity_maybe_load_mentions_scripts() { /** * Filters whether or not BuddyPress should load mentions scripts and assets. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $load_mentions True to load mentions assets, false otherwise. * @param bool $mentions_enabled True if mentions are enabled. @@ -82,11 +82,10 @@ function bp_activity_maybe_load_mentions_scripts() { /** * Locate usernames in an activity content string, as designated by an @ sign. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $content The content of the activity, usually found in * $activity->content. - * * @return array|bool Associative array with user ID as key and username as * value. Boolean false if no mentions found. */ @@ -95,21 +94,21 @@ function bp_activity_find_mentions( $content ) { $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/'; preg_match_all( $pattern, $content, $usernames ); - // Make sure there's only one instance of each username + // Make sure there's only one instance of each username. $usernames = array_unique( $usernames[1] ); - // Bail if no usernames + // Bail if no usernames. if ( empty( $usernames ) ) { return false; } $mentioned_users = array(); - // We've found some mentions! Check to see if users exist + // We've found some mentions! Check to see if users exist. foreach( (array) array_values( $usernames ) as $username ) { $user_id = bp_activity_get_userid_from_mentionname( $username ); - // user ID exists, so let's add it to our array + // The user ID exists, so let's add it to our array. if ( ! empty( $user_id ) ) { $mentioned_users[ $user_id ] = $username; } @@ -119,13 +118,20 @@ function bp_activity_find_mentions( $content ) { return false; } - return $mentioned_users; + /** + * Filters the mentioned users. + * + * @since 2.5.0 + * + * @param array $mentioned_users Associative array with user IDs as keys and usernames as values. + */ + return apply_filters( 'bp_activity_mentioned_users', $mentioned_users ); } /** * Reset a user's unread mentions list and count. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_delete_user_meta() * @@ -134,6 +140,15 @@ function bp_activity_find_mentions( $content ) { function bp_activity_clear_new_mentions( $user_id ) { bp_delete_user_meta( $user_id, 'bp_new_mention_count' ); bp_delete_user_meta( $user_id, 'bp_new_mentions' ); + + /** + * Fires once mentions has been reset for a given user. + * + * @since 2.5.0 + * + * @param int $user_id The id of the user whose unread mentions are being reset. + */ + do_action( 'bp_activity_clear_new_mentions', $user_id ); } /** @@ -144,35 +159,34 @@ function bp_activity_clear_new_mentions( $user_id ) { * * Currently, only used in {@link bp_activity_delete()}. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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'. - * * @return bool */ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) { - // Bail if no activity ID passed + // Bail if no activity ID passed. if ( empty( $activity_id ) ) { return false; } - // Get activity object + // Get activity object. $activity = new BP_Activity_Activity( (int) $activity_id ); - // Try to find mentions + // Try to find mentions. $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ); - // Still empty? Stop now + // Still empty? Stop now. if ( empty( $usernames ) ) { return false; } - // Increment mention count foreach mentioned user + // Increment mention count foreach mentioned user. foreach( (array) array_keys( $usernames ) as $user_id ) { bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action ); } @@ -184,7 +198,7 @@ function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) { * This function should be used when you've already parsed your activity item * for @mentions. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_get_user_meta() * @uses bp_update_user_meta() @@ -192,7 +206,6 @@ function bp_activity_adjust_mention_count( $activity_id = 0, $action = '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' ) { @@ -201,11 +214,11 @@ function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $act return false; } - // Adjust the mention list and count for the member + // Adjust the mention list and count for the member. $new_mention_count = (int) bp_get_user_meta( $user_id, 'bp_new_mention_count', true ); $new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ); - // Make sure new mentions is an array + // Make sure new mentions is an array. if ( empty( $new_mentions ) ) { $new_mentions = array(); } @@ -229,10 +242,10 @@ function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $act break; } - // Get an updated mention count + // Get an updated mention count. $new_mention_count = count( $new_mentions ); - // Resave the user_meta + // Resave the user_meta. bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count ); bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions ); @@ -242,11 +255,10 @@ function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $act /** * Determine a user's "mentionname", the name used for that user in @-mentions. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int|string $user_id ID of the user to get @-mention name for. - * - * @return string User name appropriate for @-mentions. + * @return string $mentionname User name appropriate for @-mentions. */ function bp_activity_get_user_mentionname( $user_id ) { $mentionname = ''; @@ -267,23 +279,24 @@ function bp_activity_get_user_mentionname( $user_id ) { /** * Get a user ID from a "mentionname", the name used for a user in @-mentions. * - * @since BuddyPress (1.9.0) + * @since 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 ) { $user_id = false; - // In username compatibility mode, hyphens are ambiguous between - // actual hyphens and converted spaces. - // - // @todo There is the potential for username clashes between 'foo bar' - // and 'foo-bar' in compatibility mode. Come up with a system for - // unique mentionnames. + /* + * In username compatibility mode, hyphens are ambiguous between + * actual hyphens and converted spaces. + * + * @todo There is the potential for username clashes between 'foo bar' + * and 'foo-bar' in compatibility mode. Come up with a system for + * unique mentionnames. + */ if ( bp_is_username_compatibility_mode() ) { - // First, try the raw username + // First, try the raw username. $userdata = get_user_by( 'login', $mentionname ); // Doing a direct query to use proper regex. Necessary to @@ -297,7 +310,7 @@ function bp_activity_get_userid_from_mentionname( $mentionname ) { } // When username compatibility mode is disabled, the mentionname is - // the same as the nicename + // the same as the nicename. } else { $user_id = bp_core_get_userid_from_nicename( $mentionname ); } @@ -322,7 +335,7 @@ function bp_activity_get_userid_from_mentionname( $mentionname ) { * panel, and dynamic action generation (which is essential for multilingual * sites, etc) will not work. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $component_id The unique string ID of the component. * @param string $type The action type. @@ -332,23 +345,22 @@ function bp_activity_get_userid_from_mentionname( $mentionname ) { * @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(), $position = 0 ) { $bp = buddypress(); - // Return false if any of the above values are not set + // Return false if any of the above values are not set. if ( empty( $component_id ) || empty( $type ) || empty( $description ) ) { return false; } - // Set activity action + // Set activity action. if ( ! isset( $bp->activity->actions ) || ! is_object( $bp->activity->actions ) ) { $bp->activity->actions = new stdClass; } - // Verify callback + // Verify callback. if ( ! is_callable( $format_callback ) ) { $format_callback = ''; } @@ -360,7 +372,7 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal /** * Filters the action type being set for the current activity item. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -380,20 +392,29 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal 'position' => $position, ), $component_id, $type, $description, $format_callback, $label, $context ); + // Sort the actions of the affected component. + $action_array = (array) $bp->activity->actions->{$component_id}; + $action_array = bp_sort_by_key( $action_array, 'position', 'num' ); + + // Restore keys. + $bp->activity->actions->{$component_id} = new stdClass; + foreach ( $action_array as $key_ordered ) { + $bp->activity->actions->{$component_id}->{$key_ordered['key']} = $key_ordered; + } + return true; } /** * Set tracking arguments for a given post type. * - * @since BuddyPress (2.2.0) + * @since 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 @@ -415,7 +436,6 @@ function bp_activity_set_action( $component_id, $type, $description, $format_cal * @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() ) { @@ -425,11 +445,24 @@ function bp_activity_set_post_type_tracking_args( $post_type = '', $args = array return false; } + $activity_labels = array( + /* Post labels */ + 'bp_activity_admin_filter', + 'bp_activity_front_filter', + 'bp_activity_new_post', + 'bp_activity_new_post_ms', + /* Comment labels */ + 'bp_activity_comments_admin_filter', + 'bp_activity_comments_front_filter', + 'bp_activity_new_comment', + 'bp_activity_new_comment_ms' + ); + // 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 ) { + foreach ( $activity_labels as $label_type ) { if ( ! empty( $args[ $label_type ] ) ) { $wp_post_types[ $post_type ]->labels->{$label_type} = $args[ $label_type ]; - unset( $args[ $post_type ] ); + unset( $args[ $label_type ] ); } } @@ -442,10 +475,10 @@ function bp_activity_set_post_type_tracking_args( $post_type = '', $args = array /** * Get tracking arguments for a specific post type. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 + * @since 2.5.0 Add post type comments tracking args * * @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 ) { @@ -453,17 +486,20 @@ function bp_activity_get_post_type_tracking_args( $post_type ) { return false; } - $post_type_object = get_post_type_object( $post_type ); + $post_type_object = get_post_type_object( $post_type ); + $post_type_support_comments = post_type_supports( $post_type, 'comments' ); $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' ), + '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_support_comments, + 'comment_action_id' => false, + 'comment_format_callback' => 'bp_activity_format_activity_action_custom_post_type_comment', ); if ( ! empty( $post_type_object->bp_activity ) ) { @@ -496,10 +532,56 @@ function bp_activity_get_post_type_tracking_args( $post_type ) { $post_type_activity->new_post_type_action_ms = $post_type_object->labels->bp_activity_new_post_ms; } + // If the post type supports comments and has a comment action id, build the comments tracking args + if ( $post_type_support_comments && ! empty( $post_type_activity->comment_action_id ) ) { + // Init a new container for the activity type for comments + $post_type_activity->comments_tracking = new stdClass(); + + // Build the activity type for comments + $post_type_activity->comments_tracking->component_id = $post_type_activity->component_id; + $post_type_activity->comments_tracking->action_id = $post_type_activity->comment_action_id; + + // Try to get the comments admin filter from the post type labels. + if ( ! empty( $post_type_object->labels->bp_activity_comments_admin_filter ) ) { + $post_type_activity->comments_tracking->admin_filter = $post_type_object->labels->bp_activity_comments_admin_filter; + + // Fall back to a generic name. + } else { + $post_type_activity->comments_tracking->admin_filter = _x( 'New item comment posted', 'Post Type generic comments activity admin filter', 'buddypress' ); + } + + $post_type_activity->comments_tracking->format_callback = $post_type_activity->comment_format_callback; + + // Check for the comments front filter in the post type labels. + if ( ! empty( $post_type_object->labels->bp_activity_comments_front_filter ) ) { + $post_type_activity->comments_tracking->front_filter = $post_type_object->labels->bp_activity_comments_front_filter; + + // Fall back to a generic name. + } else { + $post_type_activity->comments_tracking->front_filter = _x( 'Item comments', 'Post Type generic comments activity front filter', 'buddypress' ); + } + + $post_type_activity->comments_tracking->contexts = $post_type_activity->contexts; + $post_type_activity->comments_tracking->position = (int) $post_type_activity->position + 1; + + // Try to get the action for new post type comment action on non-multisite installations. + if ( ! empty( $post_type_object->labels->bp_activity_new_comment ) ) { + $post_type_activity->comments_tracking->new_post_type_comment_action = $post_type_object->labels->bp_activity_new_comment; + } + + // Try to get the action for new post type comment action on multisite installations. + if ( ! empty( $post_type_object->labels->bp_activity_new_comment_ms ) ) { + $post_type_activity->comments_tracking->new_post_type_comment_action_ms = $post_type_object->labels->bp_activity_new_comment_ms; + } + } + + // Finally make sure we'll be able to find the post type this activity type is associated to. + $post_type_activity->post_type = $post_type; + /** * Filters tracking arguments for a specific post type. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param object $post_type_activity The tracking arguments of the post type. * @param string $post_type Name of the post type. @@ -510,12 +592,13 @@ function bp_activity_get_post_type_tracking_args( $post_type ) { /** * Get tracking arguments for all post types. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 + * @since 2.5.0 Include post type comments tracking args if needed * * @return array List of post types with their tracking arguments. */ function bp_activity_get_post_types_tracking_args() { - // Fetch all public post types + // Fetch all public post types. $post_types = get_post_types( array( 'public' => true ), 'names' ); $post_types_tracking_args = array(); @@ -524,6 +607,20 @@ function bp_activity_get_post_types_tracking_args() { $track_post_type = bp_activity_get_post_type_tracking_args( $post_type ); if ( ! empty( $track_post_type ) ) { + // Set the post type comments tracking args + if ( ! empty( $track_post_type->comments_tracking->action_id ) ) { + // Used to check support for comment tracking by activity type (new_post_type_comment) + $track_post_type->comments_tracking->comments_tracking = true; + + // Used to be able to find the post type this activity type is associated to. + $track_post_type->comments_tracking->post_type = $post_type; + + $post_types_tracking_args[ $track_post_type->comments_tracking->action_id ] = $track_post_type->comments_tracking; + + // Used to check support for comment tracking by activity type (new_post_type) + $track_post_type->comments_tracking = true; + } + $post_types_tracking_args[ $track_post_type->action_id ] = $track_post_type; } @@ -532,7 +629,7 @@ function bp_activity_get_post_types_tracking_args() { /** * Filters tracking arguments for all post types. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $post_types_tracking_args Array of post types with * their tracking arguments. @@ -540,10 +637,121 @@ function bp_activity_get_post_types_tracking_args() { return apply_filters( 'bp_activity_get_post_types_tracking_args', $post_types_tracking_args ); } +/** + * Check if the *Post Type* activity supports a specific feature. + * + * @since 2.5.0 + * + * @param string $activity_type The activity type to check. + * @param string $feature The feature to check. Currently supports: + * 'post-type-comment-tracking', 'post-type-comment-reply' & 'comment-reply'. + * See inline doc for more info. + * @return bool + */ +function bp_activity_type_supports( $activity_type = '', $feature = '' ) { + $retval = false; + + $bp = buddypress(); + + switch ( $feature ) { + /** + * Does this activity type support comment tracking? + * + * eg. 'new_blog_post' and 'new_blog_comment' will both return true. + */ + case 'post-type-comment-tracking' : + // Set the activity track global if not set yet + if ( empty( $bp->activity->track ) ) { + $bp->activity->track = bp_activity_get_post_types_tracking_args(); + } + + if ( ! empty( $bp->activity->track[ $activity_type ]->comments_tracking ) ) { + $retval = true; + } + break; + + /** + * Is this a parent activity type that support post comments? + * + * eg. 'new_blog_post' will return true; 'new_blog_comment' will return false. + */ + case 'post-type-comment-reply' : + // Set the activity track global if not set yet. + if ( empty( $bp->activity->track ) ) { + $bp->activity->track = bp_activity_get_post_types_tracking_args(); + } + + if ( ! empty( $bp->activity->track[ $activity_type ]->comments_tracking ) && ! empty( $bp->activity->track[ $activity_type ]->comment_action_id ) ) { + $retval = true; + } + break; + + /** + * Does this activity type support comment & reply? + */ + case 'comment-reply' : + // Set the activity track global if not set yet. + if ( empty( $bp->activity->track ) ) { + $bp->activity->track = bp_activity_get_post_types_tracking_args(); + } + + // Post Type activities + if ( ! empty( $bp->activity->track[ $activity_type ] ) ) { + if ( isset( $bp->activity->track[ $activity_type ]->activity_comment ) ) { + $retval = $bp->activity->track[ $activity_type ]->activity_comment; + } + + // Eventually override with comment synchronization feature. + if ( isset( $bp->activity->track[ $activity_type ]->comments_tracking ) ) { + $retval = $bp->activity->track[ $activity_type ]->comments_tracking && ! bp_disable_blogforum_comments(); + } + + // Retired Forums component + } elseif ( 'new_forum_topic' === $activity_type || 'new_forum_post' === $activity_type ) { + $retval = ! bp_disable_blogforum_comments(); + + // By Default, all other activity types are supporting comments. + } else { + $retval = true; + } + break; + } + + return $retval; +} + +/** + * Get a specific tracking argument for a given activity type + * + * @since 2.5.0 + * + * @param string $activity_type the activity type. + * @param string $arg the key of the tracking argument. + * @return mixed the value of the tracking arg, false if not found. + */ +function bp_activity_post_type_get_tracking_arg( $activity_type, $arg = '' ) { + if ( empty( $activity_type ) || empty( $arg ) ) { + return false; + } + + $bp = buddypress(); + + // Set the activity track global if not set yet + if ( empty( $bp->activity->track ) ) { + $bp->activity->track = bp_activity_get_post_types_tracking_args(); + } + + if ( isset( $bp->activity->track[ $activity_type ]->{$arg} ) ) { + return $bp->activity->track[ $activity_type ]->{$arg}; + } else { + return false; + } +} + /** * Get all components' activity actions, sorted by their position attribute. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return object Actions ordered by their position. */ @@ -571,36 +779,23 @@ function bp_activity_get_actions() { } } - // 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) + * @since 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. - * * @return string|bool Action value if found, otherwise false. */ function bp_activity_get_action( $component_id, $key ) { - // Return false if any of the above values are not set + // Return false if any of the above values are not set. if ( empty( $component_id ) || empty( $key ) ) { return false; } @@ -615,7 +810,7 @@ function bp_activity_get_action( $component_id, $key ) { /** * Filters the current action by component and key. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string|bool $retval The action key. * @param string $component_id The unique string ID of the component. @@ -627,7 +822,7 @@ function bp_activity_get_action( $component_id, $key ) { /** * Fetch details of all registered activity types. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return array array( type => description ), ... */ @@ -643,13 +838,13 @@ function bp_activity_get_types() { } } - // This was a mis-named activity type from before BP 1.6 + // 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) + * @since 1.7.0 * * @param array $actions Array of registered activity types. */ @@ -661,29 +856,28 @@ function bp_activity_get_types() { /** * Get a users favorite activity stream items. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_user_meta() * @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 ) { - // Fallback to logged in user if no user_id is passed + // Fallback to logged in user if no user_id is passed. if ( empty( $user_id ) ) { $user_id = bp_displayed_user_id(); } - // Get favorites for user + // 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) + * @since 1.2.0 * * @param array $favs Array of user's favorited activity items. */ @@ -693,7 +887,7 @@ function bp_activity_get_user_favorites( $user_id = 0 ) { /** * Add an activity stream item as a favorite for a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_get_user_meta() @@ -705,17 +899,16 @@ function bp_activity_get_user_favorites( $user_id = 0 ) { * * @param int $activity_id ID of the activity item being favorited. * @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 ) { - // Favorite activity stream items are for logged in users only + // Favorite activity stream items are for logged in users only. if ( ! is_user_logged_in() ) { return false; } - // Fallback to logged in user if no user_id is passed + // Fallback to logged in user if no user_id is passed. if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } @@ -725,44 +918,44 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) { $my_favs = array(); } - // Bail if the user has already favorited this activity item + // Bail if the user has already favorited this activity item. if ( in_array( $activity_id, $my_favs ) ) { return false; } - // Add to user's favorites + // Add to user's favorites. $my_favs[] = $activity_id; - // Update the total number of users who have favorited this activity + // Update the total number of users who have favorited this activity. $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' ); $fav_count = !empty( $fav_count ) ? (int) $fav_count + 1 : 1; - // Update user meta + // Update user meta. bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ); - // Update activity meta counts + // Update activity meta counts. if ( bp_activity_update_meta( $activity_id, 'favorite_count', $fav_count ) ) { /** * Fires if bp_activity_update_meta() for favorite_count is successful and before returning a true value for success. * - * @since BuddyPress (1.2.1) + * @since 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 + // Success. return true; - // Saving meta was unsuccessful for an unknown reason + // Saving meta was unsuccessful for an unknown reason. } else { /** * Fires if bp_activity_update_meta() for favorite_count is unsuccessful and before returning a false value for failure. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -776,7 +969,7 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) { /** * Remove an activity stream item as a favorite for a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_get_user_meta() @@ -787,17 +980,16 @@ function bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) { * * @param int $activity_id ID of the activity item being unfavorited. * @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 ) { - // Favorite activity stream items are for logged in users only + // Favorite activity stream items are for logged in users only. if ( ! is_user_logged_in() ) { return false; } - // Fallback to logged in user if no user_id is passed + // Fallback to logged in user if no user_id is passed. if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } @@ -805,49 +997,49 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) { $my_favs = bp_get_user_meta( $user_id, 'bp_favorite_activities', true ); $my_favs = array_flip( (array) $my_favs ); - // Bail if the user has not previously favorited the item + // Bail if the user has not previously favorited the item. if ( ! isset( $my_favs[ $activity_id ] ) ) { return false; } - // Remove the fav from the user's favs + // Remove the fav from the user's favs. unset( $my_favs[$activity_id] ); $my_favs = array_unique( array_flip( $my_favs ) ); - // Update the total number of users who have favorited this activity + // Update the total number of users who have favorited this activity. $fav_count = bp_activity_get_meta( $activity_id, 'favorite_count' ); if ( ! empty( $fav_count ) ) { - // Deduct from total favorites + // Deduct from total favorites. if ( bp_activity_update_meta( $activity_id, 'favorite_count', (int) $fav_count - 1 ) ) { - // Update users favorites + // Update users favorites. if ( bp_update_user_meta( $user_id, 'bp_favorite_activities', $my_favs ) ) { /** * Fires if bp_update_user_meta() is successful and before returning a true value for success. * - * @since BuddyPress (1.2.1) + * @since 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 + // Success. return true; - // Error updating + // Error updating. } else { return false; } - // Error updating favorite count + // Error updating favorite count. } else { return false; } - // Error getting favorite count + // Error getting favorite count. } else { return false; } @@ -856,13 +1048,12 @@ function bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) { /** * Check whether an activity item exists with a given content string. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity} * @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 ) { @@ -870,7 +1061,7 @@ 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) + * @since 1.1.0 * * @param BP_Activity_Activity $content_exists ID of the activity if found, else null. */ @@ -880,7 +1071,7 @@ function bp_activity_check_exists_by_content( $content ) { /** * Retrieve the last time activity was updated. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses BP_Activity_Activity::get_last_updated() {@link BP_Activity_Activity} * @uses apply_filters() To call the 'bp_activity_get_last_updated' hook. @@ -892,7 +1083,7 @@ function bp_activity_get_last_updated() { /** * Filters the value for the last updated time for an activity item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param BP_Activity_Activity $last_updated Date last updated. */ @@ -902,17 +1093,16 @@ function bp_activity_get_last_updated() { /** * Retrieve the number of favorite activity stream items a user has. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @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 ) { - // Fallback on displayed user, and then logged in user + // Fallback on displayed user, and then logged in user. if ( empty( $user_id ) ) { $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); } @@ -925,7 +1115,7 @@ function bp_activity_total_favorites_for_user( $user_id = 0 ) { /** * Delete a meta entry from the DB for an activity stream item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $wpdb WordPress database access object. * @@ -937,19 +1127,18 @@ function bp_activity_total_favorites_for_user( $user_id = 0 ) { * 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. - * + * 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 ) { - // Legacy - if no meta_key is passed, delete all for the item + // Legacy - if no meta_key is passed, delete all for the item. if ( empty( $meta_key ) ) { $all_meta = bp_activity_get_meta( $activity_id ); $keys = ! empty( $all_meta ) ? array_keys( $all_meta ) : array(); - // With no meta_key, ignore $delete_all + // With no meta_key, ignore $delete_all. $delete_all = false; } else { $keys = array( $meta_key ); @@ -969,7 +1158,7 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '' /** * Get metadata for a given activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses apply_filters() To call the 'bp_activity_get_meta' hook. * @@ -978,9 +1167,8 @@ function bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '' * 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. - * + * 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 ) { @@ -991,7 +1179,7 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true /** * Filters the metadata for a specified activity item. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param mixed $retval The meta values for the activity item. * @param int $activity_id ID of the activity item. @@ -1004,14 +1192,13 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true /** * Update a piece of activity meta. * - * @since BuddyPress (1.2.0) + * @since 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. - * * @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. @@ -1027,7 +1214,7 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_va /** * Add a piece of activity metadata. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $activity_id ID of the activity item. * @param string $meta_key Metadata key. @@ -1035,7 +1222,6 @@ function bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_va * @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 ) { @@ -1051,7 +1237,7 @@ function bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = f /** * Completely remove a user's activity data. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses is_user_logged_in() * @uses bp_activity_delete() @@ -1060,20 +1246,19 @@ 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 ) { - // Do not delete user data unless a logged in user says so + // Do not delete user data unless a logged in user says so. if ( empty( $user_id ) || ! is_user_logged_in() ) { return false; } - // Clear the user's activity from the sitewide stream and clear their activity tables + // Clear the user's activity from the sitewide stream and clear their activity tables. bp_activity_delete( array( 'user_id' => $user_id ) ); - // Remove any usermeta + // Remove any usermeta. bp_delete_user_meta( $user_id, 'bp_latest_update' ); bp_delete_user_meta( $user_id, 'bp_favorite_activities' ); @@ -1083,7 +1268,7 @@ function bp_activity_remove_all_user_data( $user_id = 0 ) { /** * Fires after the removal of all of a user's activity data. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $user_id ID of the user being deleted. */ @@ -1095,18 +1280,17 @@ add_action( 'delete_user', 'bp_activity_remove_all_user_data' ); /** * Mark all of the user's activity as spam. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global object $wpdb WordPress database access object. * * @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; - // Do not delete user data unless a logged in user says so + // Do not delete user data unless a logged in user says so. if ( empty( $user_id ) || ! is_user_logged_in() ) { return false; } @@ -1120,16 +1304,16 @@ function bp_activity_spam_all_user_data( $user_id = 0 ) { $bp = buddypress(); - // Mark each as spam + // Mark each as spam. foreach ( (array) $activities['activities'] as $activity ) { - // Create an activity object + // Create an activity object. $activity_obj = new BP_Activity_Activity; foreach ( $activity as $k => $v ) { $activity_obj->$k = $v; } - // Mark as spam + // Mark as spam. bp_activity_mark_as_spam( $activity_obj ); /* @@ -1143,17 +1327,17 @@ function bp_activity_spam_all_user_data( $user_id = 0 ) { $bp->activity->akismet->update_activity_spam_meta( $activity_obj ); } - // Tidy up + // Tidy up. unset( $activity_obj ); } - // Mark all of this user's activities as spam + // 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 ) ); /** * Fires after all activity data from a user has been marked as spam. * - * @since BuddyPress (1.6.0) + * @since 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. @@ -1165,18 +1349,17 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' ); /** * Mark all of the user's activity as ham (not spam). * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global object $wpdb WordPress database access object. * * @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; - // Do not delete user data unless a logged in user says so + // Do not delete user data unless a logged in user says so. if ( empty( $user_id ) || ! is_user_logged_in() ) { return false; } @@ -1191,16 +1374,16 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) { $bp = buddypress(); - // Mark each as not spam + // Mark each as not spam. foreach ( (array) $activities['activities'] as $activity ) { - // Create an activity object + // Create an activity object. $activity_obj = new BP_Activity_Activity; foreach ( $activity as $k => $v ) { $activity_obj->$k = $v; } - // Mark as not spam + // Mark as not spam. bp_activity_mark_as_ham( $activity_obj ); /* @@ -1214,17 +1397,17 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) { $bp->activity->akismet->update_activity_ham_meta( $activity_obj ); } - // Tidy up + // Tidy up. unset( $activity_obj ); } - // Mark all of this user's activities as not 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 ) ); /** * Fires after all activity data from a user has been marked as ham. * - * @since BuddyPress (1.6.0) + * @since 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. @@ -1236,7 +1419,7 @@ add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' ); /** * Register the activity stream actions for updates. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_activity_register_activity_actions() { $bp = buddypress(); @@ -1263,7 +1446,7 @@ function bp_activity_register_activity_actions() { * * Allows plugin authors to add their own activity actions alongside the core actions. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_activity_register_activity_actions' ); @@ -1275,38 +1458,39 @@ 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. + * @since 2.0.0 * + * @param object $activity Activity data object. * @return string|bool Returns false if no callback is found, otherwise returns * the formatted action string. */ function bp_activity_generate_action_string( $activity ) { - // Check for valid input + // Check for valid input. if ( empty( $activity->component ) || empty( $activity->type ) ) { return false; } - // Check for registered format callback + // Check for registered 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 + // We apply the format_callback as a filter. add_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 ); /** * Filters the string for the activity action being returned. * - * @since BuddyPress (2.0.0) + * @since 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 the filter for future activity items. remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 ); return $action; @@ -1315,12 +1499,11 @@ function bp_activity_generate_action_string( $activity ) { /** * Format 'activity_update' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action Static activity action. * @param object $activity Activity data object. - * - * @return string + * @return string $action */ function bp_activity_format_activity_action_activity_update( $action, $activity ) { $action = sprintf( __( '%s posted an update', 'buddypress' ), bp_core_get_userlink( $activity->user_id ) ); @@ -1328,7 +1511,7 @@ function bp_activity_format_activity_action_activity_update( $action, $activity /** * Filters the formatted activity action update string. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $action Activity action string value. * @param BP_Activity_Activity $activity Activity item object. @@ -1339,12 +1522,11 @@ function bp_activity_format_activity_action_activity_update( $action, $activity /** * Format 'activity_comment' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action Static activity action. * @param object $activity Activity data object. - * - * @return string + * @return string $action */ 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 ) ); @@ -1352,7 +1534,7 @@ function bp_activity_format_activity_action_activity_comment( $action, $activity /** * Filters the formatted activity action comment string. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $action Activity action string value. * @param BP_Activity_Activity $activity Activity item object. @@ -1363,12 +1545,11 @@ function bp_activity_format_activity_action_activity_comment( $action, $activity /** * Format activity action strings for custom post types. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $action Static activity action. * @param object $activity Activity data object. - * - * @return string + * @return string $action */ function bp_activity_format_activity_action_custom_post_type_post( $action, $activity ) { $bp = buddypress(); @@ -1410,7 +1591,7 @@ function bp_activity_format_activity_action_custom_post_type_post( $action, $act /** * Filters the formatted custom post type activity post action string. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $action Activity action string value. * @param BP_Activity_Activity $activity Activity item object. @@ -1418,7 +1599,58 @@ function bp_activity_format_activity_action_custom_post_type_post( $action, $act return apply_filters( 'bp_activity_custom_post_type_post_action', $action, $activity ); } -/****************************************************************************** +/** + * Format activity action strings for custom post types comments. + * + * @since 2.5.0 + * + * @param string $action Static activity action. + * @param object $activity Activity data object. + * + * @return string + */ +function bp_activity_format_activity_action_custom_post_type_comment( $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 ); + + if ( is_multisite() ) { + $blog_link = '<a href="' . esc_url( get_home_url( $activity->item_id ) ) . '">' . get_blog_option( $activity->item_id, 'blogname' ) . '</a>'; + + if ( ! empty( $bp->activity->track[ $activity->type ]->new_post_type_comment_action_ms ) ) { + $action = sprintf( $bp->activity->track[ $activity->type ]->new_post_type_comment_action_ms, $user_link, $activity->primary_link, $blog_link ); + } else { + $action = sprintf( _x( '%1$s commented on the <a href="%2$s">item</a>, on the site %3$s', 'Activity Custom Post Type comment action', 'buddypress' ), $user_link, $activity->primary_link, $blog_link ); + } + } else { + if ( ! empty( $bp->activity->track[ $activity->type ]->new_post_type_comment_action ) ) { + $action = sprintf( $bp->activity->track[ $activity->type ]->new_post_type_comment_action, $user_link, $activity->primary_link ); + } else { + $action = sprintf( _x( '%1$s commented on the <a href="%2$s">item</a>', 'Activity Custom Post Type post comment action', 'buddypress' ), $user_link, $activity->primary_link ); + } + } + + /** + * Filters the formatted custom post type activity comment action string. + * + * @since 2.5.0 + * + * @param string $action Activity action string value. + * @param BP_Activity_Activity $activity Activity item object. + */ + return apply_filters( 'bp_activity_custom_post_type_comment_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 * hand off to a database class for data access, then return @@ -1428,13 +1660,14 @@ function bp_activity_format_activity_action_custom_post_type_post( $action, $act /** * Retrieve an activity or activities. * - * bp_activity_get() shares all arguments with BP_Activity_Activity::get(). The - * following is a list of bp_activity_get() parameters that have different + * The bp_activity_get() function shares all arguments with BP_Activity_Activity::get(). + * The following is a list of bp_activity_get() parameters that have different * default values from BP_Activity_Activity::get() (value in parentheses is * the default for the bp_activity_get()). * - 'per_page' (false) * - * @since BuddyPress (1.2.0) + * @since 1.2.0 + * @since 2.4.0 Introduced the `$fields` parameter. * * @see BP_Activity_Activity::get() For more information on accepted arguments * and the format of the returned value. @@ -1445,25 +1678,26 @@ function bp_activity_format_activity_action_custom_post_type_post( $action, $act * @uses apply_filters_ref_array() To call the 'bp_activity_get' hook. * * @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 = '' ) { $r = bp_parse_args( $args, array( - 'max' => false, // Maximum number of results to return - 'page' => 1, // page 1 without a per_page will result in no pagination. + 'max' => false, // Maximum number of results to return. + 'fields' => 'all', + 'page' => 1, // Page 1 without a per_page will result in no pagination. 'per_page' => false, // results per page 'sort' => 'DESC', // sort ASC or DESC - 'display_comments' => false, // false for no comments. 'stream' for within stream display, 'threaded' for below each activity item + 'display_comments' => false, // False for no comments. 'stream' for within stream display, 'threaded' for below each activity item. '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 + '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 + '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, @@ -1472,18 +1706,18 @@ function bp_activity_get( $args = '' ) { /** * Pass filters as an array -- all filter items can be multiple values comma separated: * array( - * 'user_id' => false, // user_id to filter on - * 'object' => false, // object to filter on e.g. groups, profile, status, friends - * 'action' => false, // action to filter on e.g. activity_update, profile_updated - * 'primary_id' => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. - * 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id + * 'user_id' => false, // User ID to filter on. + * 'object' => false, // Object to filter on e.g. groups, profile, status, friends. + * 'action' => false, // Action to filter on e.g. activity_update, profile_updated. + * 'primary_id' => false, // Object ID to filter on e.g. a group_id or forum_id or blog_id etc. + * 'secondary_id' => false, // Secondary object ID to filter on e.g. a post_id. * ); */ 'filter' => array() ) ); // 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_query'] ) && empty( $r['filter'] ) && empty( $r['scope'] )&& empty( $r['exclude'] ) && empty( $r['in'] ) && ( 'DESC' === $r['sort'] ) && empty( $r['exclude'] ) && ( 'ham_only' === $r['spam'] ) ) { + if ( ( 1 === (int) $r['page'] ) && empty( $r['max'] ) && ( 'all' === $r['fields'] ) && 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 ) { @@ -1492,6 +1726,7 @@ function bp_activity_get( $args = '' ) { 'page' => $r['page'], 'per_page' => $r['per_page'], 'max' => $r['max'], + 'fields' => $r['fields'], 'sort' => $r['sort'], 'search_terms' => $r['search_terms'], 'meta_query' => $r['meta_query'], @@ -1533,7 +1768,7 @@ function bp_activity_get( $args = '' ) { /** * Filters the requested activity item(s). * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param BP_Activity_Activity $activity Requested activity object. * @param array $r Arguments used for the activity query. @@ -1544,7 +1779,7 @@ function bp_activity_get( $args = '' ) { /** * Fetch specific activity items. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see BP_Activity_Activity::get() For more information on accepted arguments. * @uses wp_parse_args() @@ -1555,7 +1790,7 @@ function bp_activity_get( $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, - * or array of IDs. + * or array of IDs. * } * @return array $activity See BP_Activity_Activity::get() for description. */ @@ -1563,13 +1798,13 @@ function bp_activity_get_specific( $args = '' ) { $r = bp_parse_args( $args, array( 'activity_ids' => false, // A single activity_id or array of IDs. - 'display_comments' => false, // true or false to display threaded comments for these specific activity items - 'max' => false, // Maximum number of results to return - 'page' => 1, // page 1 without a per_page will result in no pagination. - 'per_page' => false, // results per page - 'show_hidden' => true, // When fetching specific items, show all - 'sort' => 'DESC', // sort ASC or DESC - 'spam' => 'ham_only', // Retrieve items marked as spam + 'display_comments' => false, // True or false to display threaded comments for these specific activity items. + 'max' => false, // Maximum number of results to return. + 'page' => 1, // Page 1 without a per_page will result in no pagination. + 'per_page' => false, // Results per page. + 'show_hidden' => true, // When fetching specific items, show all. + 'sort' => 'DESC', // Sort ASC or DESC + 'spam' => 'ham_only', // Retrieve items marked as spam. 'update_meta_cache' => true, ) ); @@ -1588,7 +1823,7 @@ function bp_activity_get_specific( $args = '' ) { /** * Filters the requested specific activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param BP_Activity_Activity $activity Requested activity object. * @param array $args Original passed in arguments. @@ -1600,7 +1835,7 @@ function bp_activity_get_specific( $args = '' ) { /** * Add an activity item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses wp_parse_args() * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity} @@ -1647,18 +1882,18 @@ function bp_activity_add( $args = '' ) { 'id' => false, // Pass an existing activity ID to update an existing entry. 'action' => '', // The activity action - e.g. "Jon Doe posted an update" 'content' => '', // Optional: The content of the activity item e.g. "BuddyPress is awesome guys!" - 'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent - 'type' => false, // The activity type e.g. activity_update, profile_updated - 'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink) + 'component' => false, // The name/ID of the component e.g. groups, profile, mycomponent. + 'type' => false, // The activity type e.g. activity_update, profile_updated. + 'primary_link' => '', // Optional: The primary URL for this item in RSS feeds (defaults to activity permalink). 'user_id' => bp_loggedin_user_id(), // Optional: The user to record the activity for, can be false if this activity is not for a user. - 'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id - 'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id - 'recorded_time' => bp_core_current_time(), // The GMT time that this activity was recorded + 'item_id' => false, // Optional: The ID of the specific item being recorded, e.g. a blog_id. + 'secondary_item_id' => false, // Optional: A second ID used to further filter e.g. a comment_id. + '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 + // Make sure we are backwards compatible. if ( empty( $r['component'] ) && !empty( $r['component_name'] ) ) { $r['component'] = $r['component_name']; } @@ -1667,7 +1902,7 @@ function bp_activity_add( $args = '' ) { $r['type'] = $r['component_action']; } - // Setup activity to be added + // Setup activity to be added. $activity = new BP_Activity_Activity( $r['id'] ); $activity->user_id = $r['user_id']; $activity->component = $r['component']; @@ -1687,9 +1922,9 @@ function bp_activity_add( $args = '' ) { return false; } - // If this is an activity comment, rebuild the tree + // If this is an activity comment, rebuild the tree. if ( 'activity_comment' === $activity->type ) { - // Also clear the comment cache for the parent activity ID + // Also clear the comment cache for the parent activity ID. wp_cache_delete( $activity->item_id, 'bp_activity_comments' ); BP_Activity_Activity::rebuild_activity_comment_tree( $activity->item_id ); @@ -1700,7 +1935,7 @@ function bp_activity_add( $args = '' ) { /** * 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) + * @since 1.1.0 * * @param array $r Array of parsed arguments for the activity item being added. */ @@ -1712,7 +1947,7 @@ function bp_activity_add( $args = '' ) { /** * Post an activity update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses wp_parse_args() * @uses bp_is_user_inactive() @@ -1746,14 +1981,14 @@ function bp_activity_post_update( $args = '' ) { return false; } - // Record this on the user's profile + // Record this on the user's profile. $activity_content = $r['content']; $primary_link = bp_core_get_userlink( $r['user_id'], false, true ); /** * Filters the new activity content for current activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_content Activity content posted by user. */ @@ -1762,13 +1997,13 @@ function bp_activity_post_update( $args = '' ) { /** * Filters the activity primary link for current activity item. * - * @since BuddyPress (1.2.0) + * @since 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 + // Now write the values. $activity_id = bp_activity_add( array( 'user_id' => $r['user_id'], 'content' => $add_content, @@ -1780,7 +2015,7 @@ function bp_activity_post_update( $args = '' ) { /** * Filters the latest update content for the activity item. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $r Content of the activity update. * @param string $activity_content Content of the activity update. @@ -1796,7 +2031,7 @@ function bp_activity_post_update( $args = '' ) { /** * Fires at the end of an activity post update, before returning the updated activity item ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $content Content of the activity post update. * @param int $user_id ID of the user posting the activity update. @@ -1810,12 +2045,11 @@ function bp_activity_post_update( $args = '' ) { /** * 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. + * @since 2.2.0 * + * @param int $post_id ID of the new post. + * @param WP_Post|null $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 ) { @@ -1860,7 +2094,7 @@ function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 * This is a variable filter, dependent on the post type, * that lets components or plugins bail early if needed. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param bool $value Whether or not to continue. * @param int $blog_id ID of the current site. @@ -1934,7 +2168,7 @@ function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 /** * Fires after the publishing of an activity item for a newly published post type post. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $activity_id ID of the newly published activity item. * @param WP_Post $post Post object. @@ -1948,11 +2182,10 @@ function bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 /** * Update the activity item for a custom post type entry. * - * @since BuddyPress (2.2.0) - * - * @param WP_Post $post Post item. + * @since 2.2.0 * - * @return bool True on success, false on failure. + * @param WP_Post|null $post Post item. + * @return bool True on success, false on failure. */ function bp_activity_post_type_update( $post = null ) { @@ -2004,12 +2237,14 @@ function bp_activity_post_type_update( $post = null ) { /** * Fires after the updating of an activity item for a custom post type entry. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 + * @since 2.5.0 Add the post type tracking args parameter * - * @param WP_Post $post Post object. - * @param BP_Activity_Activity $activity Activity object. + * @param WP_Post $post Post object. + * @param BP_Activity_Activity $activity Activity object. + * @param object $activity_post_object The post type tracking args object. */ - do_action( 'bp_activity_post_type_updated', $post, $activity ); + do_action( 'bp_activity_post_type_updated', $post, $activity, $activity_post_object ); return $updated; } @@ -2017,12 +2252,11 @@ function bp_activity_post_type_update( $post = null ) { /** * Unpublish an activity for the custom post type. * - * @since BuddyPress (2.2.0) + * @since 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. + * @param int $post_id ID of the post being unpublished. + * @param WP_Post|null $post Post object. + * @return bool True on success, false on failure. */ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { @@ -2030,7 +2264,7 @@ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { return; } - // Get the post type tracking args + // 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 ) ) { @@ -2054,7 +2288,7 @@ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { /** * Fires after the unpublishing for the custom post type. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $delete_activity_args Array of arguments for activity deletion. * @param WP_Post $post Post object. @@ -2065,10 +2299,271 @@ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { return $deleted; } +/** + * Create an activity item for a newly posted post type comment. + * + * @since 2.5.0 + * + * @param int $comment_id ID of the comment. + * @param bool $is_approved Whether the comment is approved or not. + * @param object $activity_post_object the post type tracking args object. + * + * @return int|bool The ID of the activity on success. False on error. + */ +function bp_activity_post_type_comment( $comment_id = 0, $is_approved = true, $activity_post_object = null ) { + // Get the users comment + $post_type_comment = get_comment( $comment_id ); + + // Don't record activity if the comment hasn't been approved + if ( empty( $is_approved ) ) { + return false; + } + + // Don't record activity if no email address has been included + if ( empty( $post_type_comment->comment_author_email ) ) { + return false; + } + + // Don't record activity if the comment has already been marked as spam + if ( 'spam' === $is_approved ) { + return false; + } + + // Get the user by the comment author email. + $user = get_user_by( 'email', $post_type_comment->comment_author_email ); + + // If user isn't registered, don't record activity + if ( empty( $user ) ) { + return false; + } + + // Get the user_id + $user_id = (int) $user->ID; + + // Get blog and post data + $blog_id = get_current_blog_id(); + + // Get the post + $post_type_comment->post = get_post( $post_type_comment->comment_post_ID ); + + if ( ! is_a( $post_type_comment->post, 'WP_Post' ) ) { + return false; + } + + /** + * Filters whether to publish activities about the comment regarding the post status + * + * @since 2.5.0 + * + * @param bool true to bail, false otherwise. + */ + $is_post_status_not_allowed = (bool) apply_filters( 'bp_activity_post_type_is_post_status_allowed', 'publish' !== $post_type_comment->post->post_status || ! empty( $post_type_comment->post->post_password ) ); + + // If this is a password protected post, or not a public post don't record the comment + if ( $is_post_status_not_allowed ) { + return false; + } + + // Set post type + $post_type = $post_type_comment->post->post_type; + + if ( empty( $activity_post_object ) ) { + // Get the post type tracking args. + $activity_post_object = bp_activity_get_post_type_tracking_args( $post_type ); + + // Bail if the activity type does not exist + if ( empty( $activity_post_object->comments_tracking->action_id ) ) { + return false; + } + } + + // Set the $activity_comment_object + $activity_comment_object = $activity_post_object->comments_tracking; + + /** + * Filters whether or not to post the activity about the comment. + * + * This is a variable filter, dependent on the post type, + * that lets components or plugins bail early if needed. + * + * @since 2.5.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 commented. + * @param int $user_id ID of the current user. + * @param int $comment_id ID of the current comment being posted. + */ + if ( false === apply_filters( "bp_activity_{$post_type}_pre_comment", true, $blog_id, $post_type_comment->post->ID, $user_id, $comment_id ) ) { + return false; + } + + // Is this an update ? + $activity_id = bp_activity_get_activity_id( array( + 'user_id' => $user_id, + 'component' => $activity_comment_object->component_id, + 'type' => $activity_comment_object->action_id, + 'item_id' => $blog_id, + 'secondary_item_id' => $comment_id, + ) ); + + // Record this in activity streams. + $comment_link = get_comment_link( $post_type_comment->comment_ID ); + + // Backward compatibility filters for the 'blogs' component. + if ( 'blogs' == $activity_comment_object->component_id ) { + $activity_content = apply_filters_ref_array( 'bp_blogs_activity_new_comment_content', array( $post_type_comment->comment_content, &$post_type_comment, $comment_link ) ); + $activity_primary_link = apply_filters_ref_array( 'bp_blogs_activity_new_comment_primary_link', array( $comment_link, &$post_type_comment ) ); + } else { + $activity_content = $post_type_comment->comment_content; + $activity_primary_link = $comment_link; + } + + $activity_args = array( + 'id' => $activity_id, + 'user_id' => $user_id, + 'content' => $activity_content, + 'primary_link' => $activity_primary_link, + 'component' => $activity_comment_object->component_id, + 'recorded_time' => $post_type_comment->comment_date_gmt, + ); + + if ( bp_disable_blogforum_comments() ) { + $blog_url = get_home_url( $blog_id ); + $post_url = add_query_arg( + 'p', + $post_type_comment->post->ID, + trailingslashit( $blog_url ) + ); + + $activity_args['type'] = $activity_comment_object->action_id; + $activity_args['item_id'] = $blog_id; + $activity_args['secondary_item_id'] = $post_type_comment->comment_ID; + + if ( ! empty( $activity_args['content'] ) ) { + // Create the excerpt. + $activity_summary = bp_activity_create_summary( $activity_args['content'], $activity_args ); + + // Backward compatibility filter for blog comments. + 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_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_type_comment->post->post_title, + 'post_url' => $post_url, + 'blog_url' => $blog_url, + 'blog_name' => get_blog_option( $blog_id, 'blogname' ), + ) ); + + $activity_args['action'] = call_user_func_array( $activity_comment_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 2.5.0 + * + * @param int $activity_id ID of the newly published activity item. + * @param WP_Comment $post_type_comment Comment object. + * @param array $activity_args Array of activity arguments. + * @param object $activity_post_object the post type tracking args object. + */ + do_action_ref_array( 'bp_activity_post_type_comment', array( &$activity_id, $post_type_comment, $activity_args, $activity_post_object ) ); + + return $activity_id; +} +add_action( 'comment_post', 'bp_activity_post_type_comment', 10, 2 ); +add_action( 'edit_comment', 'bp_activity_post_type_comment', 10 ); + +/** + * Remove an activity item when a comment about a post type is deleted. + * + * @since 2.5.0 + * + * @param int $comment_id ID of the comment. + * @param object $activity_post_object The post type tracking args object. + * + * @return bool True on success. False on error. + */ +function bp_activity_post_type_remove_comment( $comment_id = 0, $activity_post_object = null ) { + if ( empty( $activity_post_object ) ) { + $comment = get_comment( $comment_id ); + if ( ! $comment ) { + return; + } + + $post_type = get_post_type( $comment->comment_post_ID ); + if ( ! $post_type ) { + return; + } + + // Get the post type tracking args. + $activity_post_object = bp_activity_get_post_type_tracking_args( $post_type ); + + // Bail if the activity type does not exist + if ( empty( $activity_post_object->comments_tracking->action_id ) ) { + return false; + } + } + + // Set the $activity_comment_object + $activity_comment_object = $activity_post_object->comments_tracking; + + if ( empty( $activity_comment_object->action_id ) ) { + return false; + } + + $deleted = false; + + if ( bp_disable_blogforum_comments() ) { + $deleted = bp_activity_delete_by_item_id( array( + 'item_id' => get_current_blog_id(), + 'secondary_item_id' => $comment_id, + 'component' => $activity_comment_object->component_id, + 'type' => $activity_comment_object->action_id, + 'user_id' => false, + ) ); + } + + /** + * Fires after the custom post type comment activity was removed. + * + * @since 2.5.0 + * + * @param bool $deleted True if the activity was deleted false otherwise + * @param WP_Comment $comment Comment object. + * @param object $activity_post_object The post type tracking args object. + * @param string $value The post type comment activity type. + */ + do_action( 'bp_activity_post_type_remove_comment', $deleted, $comment_id, $activity_post_object, $activity_comment_object->action_id ); + + return $deleted; +} +add_action( 'delete_comment', 'bp_activity_post_type_remove_comment', 10, 1 ); + /** * Add an activity comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 + * @since 2.5.0 Add a new possible parameter $skip_notification for the array of arguments. + * Add the $primary_link parameter for the array of arguments. * * @uses wp_parse_args() * @uses bp_activity_add() @@ -2078,15 +2573,19 @@ function bp_activity_post_type_unpublish( $post_id = 0, $post = null ) { * @uses do_action() To call the 'bp_activity_comment_posted' hook. * * @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. + * @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. + * @type string $primary_link Optional. the primary link for the comment. + * Defaults to an empty string. + * @type bool $skip_notification Optional. false to send a comment notification, false otherwise. + * Defaults to false. * } * @return int|bool The ID of the comment on success, otherwise false. */ @@ -2100,14 +2599,16 @@ function bp_activity_new_comment( $args = '' ) { } $r = wp_parse_args( $args, array( - 'id' => false, - 'content' => false, - 'user_id' => bp_loggedin_user_id(), - 'activity_id' => false, // ID of the root activity item - 'parent_id' => false // ID of a parent comment (optional) + 'id' => false, + 'content' => false, + 'user_id' => bp_loggedin_user_id(), + 'activity_id' => false, // ID of the root activity item. + 'parent_id' => false, // ID of a parent comment (optional). + 'primary_link' => '', + 'skip_notification' => false, ) ); - // Bail if missing necessary data + // 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; @@ -2115,17 +2616,17 @@ function bp_activity_new_comment( $args = '' ) { return false; } - // Maybe set current activity ID as the parent + // Maybe set current activity ID as the parent. if ( empty( $r['parent_id'] ) ) { $r['parent_id'] = $r['activity_id']; } $activity_id = $r['activity_id']; - // Get the parent activity + // Get the parent activity. $activity = new BP_Activity_Activity( $activity_id ); - // Bail if the parent activity does not exist + // 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; @@ -2139,28 +2640,29 @@ function bp_activity_new_comment( $args = '' ) { /** * Filters the content of a new comment. * - * @since BuddyPress (1.2.0) + * @since 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 + // Insert the activity comment. $comment_id = bp_activity_add( array( 'id' => $r['id'], 'content' => $comment_content, 'component' => buddypress()->activity->id, 'type' => 'activity_comment', + 'primary_link' => $r['primary_link'], 'user_id' => $r['user_id'], 'item_id' => $activity_id, 'secondary_item_id' => $r['parent_id'], 'hide_sitewide' => $is_hidden ) ); - // Comment caches are stored only with the top-level item + // Comment caches are stored only with the top-level item. wp_cache_delete( $activity_id, 'bp_activity_comments' ); - // Walk the tree to clear caches for all parent items + // Walk the tree to clear caches for all parent items. $clear_id = $r['parent_id']; while ( $clear_id != $activity_id ) { $clear_object = new BP_Activity_Activity( $clear_id ); @@ -2169,16 +2671,31 @@ 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( $r[ 'skip_notification' ] ) ) { + /** + * Fires near the end of an activity comment posting, before the returning of the comment ID. + * Sends a notification to the user @see bp_activity_new_comment_notification_helper(). + * + * @since 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 ); + } else { + /** + * Fires near the end of an activity comment posting, before the returning of the comment ID. + * without sending a notification to the user + * + * @since 2.5.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_notification_skipped', $comment_id, $r, $activity ); + } if ( empty( $comment_id ) ) { $errors->add( 'comment_failed', $feedback ); @@ -2191,7 +2708,7 @@ function bp_activity_new_comment( $args = '' ) { /** * Fetch the activity_id for an existing activity entry in the DB. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see BP_Activity_Activity::get() For more information on accepted arguments. * @uses wp_parse_args() @@ -2199,7 +2716,6 @@ function bp_activity_new_comment( $args = '' ) { * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity} * * @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 = '' ) { @@ -2218,9 +2734,12 @@ function bp_activity_get_activity_id( $args = '' ) { /** * Filters the activity ID being requested. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 + * @since 2.5.0 Added the `$r` and `$args` parameters. * * @param BP_Activity_Activity $value ID returned by BP_Activity_Activity get_id() method with provided arguments. + * @param array $r Parsed function arguments. + * @param array $args Arguments passed to the function. */ return apply_filters( 'bp_activity_get_activity_id', BP_Activity_Activity::get_id( $r['user_id'], @@ -2231,7 +2750,7 @@ function bp_activity_get_activity_id( $args = '' ) { $r['action'], $r['content'], $r['date_recorded'] - ) ); + ), $r, $args ); } /** @@ -2247,7 +2766,7 @@ function bp_activity_get_activity_id( $args = '' ) { * * If you are deleting an activity comment please use bp_activity_delete_comment(); * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see BP_Activity_Activity::get() For more information on accepted arguments. * @uses wp_parse_args() @@ -2265,12 +2784,11 @@ function bp_activity_get_activity_id( $args = '' ) { * 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 = '' ) { - // Pass one or more the of following variables to delete by those variables + // Pass one or more the of following variables to delete by those variables. $args = bp_parse_args( $args, array( 'id' => false, 'action' => false, @@ -2288,13 +2806,13 @@ function bp_activity_delete( $args = '' ) { /** * Fires before an activity item proceeds to be deleted. * - * @since BuddyPress (1.5.0) + * @since 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 + // Adjust the new mention count of any mentioned member. bp_activity_adjust_mention_count( $args['id'], 'delete' ); $activity_ids_deleted = BP_Activity_Activity::delete( $args ); @@ -2302,7 +2820,7 @@ function bp_activity_delete( $args = '' ) { return false; } - // Check if the user's latest update has been deleted + // Check if the user's latest update has been deleted. $user_id = empty( $args['user_id'] ) ? bp_loggedin_user_id() : $args['user_id']; @@ -2317,7 +2835,7 @@ function bp_activity_delete( $args = '' ) { /** * Fires after the activity item has been deleted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $args Array of arguments used with the activity deletion. */ @@ -2326,7 +2844,7 @@ function bp_activity_delete( $args = '' ) { /** * Fires after the activity item has been deleted. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $activity_ids_deleted Array of affected activity item IDs. */ @@ -2342,15 +2860,14 @@ function bp_activity_delete( $args = '' ) { * * You should use bp_activity_delete() instead. * - * @since BuddyPress (1.1.0) - * @deprecated BuddyPress (1.2.0) + * @since 1.1.0 + * @deprecated 1.2.0 * * @uses wp_parse_args() * @uses bp_activity_delete() * * @param array|string $args See BP_Activity_Activity::get for a * description of accepted arguments. - * * @return bool True on success, false on failure. */ function bp_activity_delete_by_item_id( $args = '' ) { @@ -2369,12 +2886,11 @@ function bp_activity_delete( $args = '' ) { /** * Delete an activity item by activity id. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses bp_activity_delete() * * @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 ) { @@ -2386,8 +2902,8 @@ function bp_activity_delete( $args = '' ) { * * You should use bp_activity_delete() instead. * - * @since BuddyPress (1.1.0) - * @deprecated BuddyPress (1.2.0) + * @since 1.1.0 + * @deprecated 1.2.0 * * @uses bp_activity_delete() * @@ -2395,7 +2911,6 @@ function bp_activity_delete( $args = '' ) { * @param string $content The activity id. * @param string $component The activity component. * @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 ) { @@ -2412,14 +2927,13 @@ function bp_activity_delete( $args = '' ) { * * You should use bp_activity_delete() instead. * - * @since BuddyPress (1.1.0) - * @deprecated BuddyPress (1.2.0) + * @since 1.1.0 + * @deprecated 1.2.0 * * @uses bp_activity_delete() * * @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 ) { @@ -2432,7 +2946,7 @@ function bp_activity_delete( $args = '' ) { /** * Delete an activity comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses apply_filters() To call the 'bp_activity_delete_comment_pre' hook. * @uses bp_activity_delete_children() @@ -2447,10 +2961,10 @@ 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. */ function bp_activity_delete_comment( $activity_id, $comment_id ) { + $deleted = false; /** * Filters whether BuddyPress should delete an activity comment or not. @@ -2458,47 +2972,51 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) { * 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) + * @since 1.2.0 + * @since 2.5.0 Add the deleted parameter (passed by reference) * * @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. + * @param bool $deleted Whether the activity comment has been deleted or not. */ - if ( ! apply_filters( 'bp_activity_delete_comment_pre', true, $activity_id, $comment_id ) ) { - return false; + if ( ! apply_filters_ref_array( 'bp_activity_delete_comment_pre', array( true, $activity_id, $comment_id, &$deleted ) ) ) { + return $deleted; } // Delete any children of this comment. bp_activity_delete_children( $activity_id, $comment_id ); - // Delete the actual comment + // Delete the actual comment. if ( ! bp_activity_delete( array( 'id' => $comment_id, 'type' => 'activity_comment' ) ) ) { return false; + } else { + $deleted = true; } - // Purge comment cache for the root activity update + // Purge comment cache for the root activity update. wp_cache_delete( $activity_id, 'bp_activity_comments' ); - // Recalculate the comment tree + // 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) + * @since 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; + return $deleted; } /** * Delete an activity comment's children. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses BP_Activity_Activity::get_child_comments() {@link BP_Activity_Activity} * @uses bp_activity_delete_children() @@ -2510,7 +3028,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) { */ function bp_activity_delete_children( $activity_id, $comment_id ) { - // Get activity children to delete + // Get activity children to delete. $children = BP_Activity_Activity::get_child_comments( $comment_id ); // Recursively delete all children of this comment. @@ -2520,7 +3038,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) { } } - // Delete the comment itself + // Delete the comment itself. bp_activity_delete( array( 'secondary_item_id' => $comment_id, 'type' => 'activity_comment', @@ -2536,7 +3054,7 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) { * be sure to pass the full $activity_obj parameter as well, if you already * have it available. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_root_domain() * @uses bp_get_activity_root_slug() @@ -2544,7 +3062,6 @@ function bp_activity_delete_comment( $activity_id, $comment_id ) { * * @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 ) { @@ -2582,7 +3099,7 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) { /** * Filters the activity permalink for the specified activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $array Array holding activity permalink and activity item object. */ @@ -2592,12 +3109,11 @@ function bp_activity_get_permalink( $activity_id, $activity_obj = false ) { /** * Hide a user's activity. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @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 ) { @@ -2616,7 +3132,7 @@ function bp_activity_hide_user_activity( $user_id ) { * * As of BuddyPress 2.3, this function is no longer in use. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses esc_attr() * @uses apply_filters() To call the 'bp_activity_thumbnail_content_images' hook. @@ -2626,7 +3142,6 @@ function bp_activity_hide_user_activity( $user_id ) { * 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()). - * * @return string $content The content with images stripped and replaced with a * single thumb. */ @@ -2634,15 +3149,15 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args = preg_match_all( '/<img[^>]*>/Ui', $content, $matches ); - // Remove <img> tags. Also remove caption shortcodes and caption text if present + // Remove <img> tags. Also remove caption shortcodes and caption text if present. $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>([^\[\[]*\[\/caption\])?|', '', $content ); if ( !empty( $matches ) && !empty( $matches[0] ) ) { - // Get the SRC value + // Get the SRC value. preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src ); - // Get the width and height + // Get the width and height. 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 ); @@ -2678,7 +3193,7 @@ 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) + * @since 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. @@ -2694,13 +3209,12 @@ function bp_activity_thumbnail_content_images( $content, $link = false, $args = * 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) + * @since 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 + * @return string $summary */ function bp_activity_create_summary( $content, $activity ) { $args = array( @@ -2717,7 +3231,7 @@ function bp_activity_create_summary( $content, $activity ) { * * Use this filter to change the media extractor used to extract media info for the activity item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string $extractor Class name. * @param string $content The content of the activity item. @@ -2729,7 +3243,7 @@ function bp_activity_create_summary( $content, $activity ) { /** * Filter the arguments passed to the media extractor when creating an Activity summary. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $args Array of bespoke data for the media extractor. * @param string $content The content of the activity item. @@ -2802,7 +3316,7 @@ function bp_activity_create_summary( $content, $activity ) { /** * Filter the results of the media extractor when creating an Activity summary. * - * @since BuddyPress (2.3.0) + * @since 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. @@ -2839,7 +3353,7 @@ function bp_activity_create_summary( $content, $activity ) { /** * Filters the newly-generated summary for the activity item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string $summary Activity summary HTML. * @param string $content Content of the activity item. @@ -2852,7 +3366,7 @@ function bp_activity_create_summary( $content, $activity ) { /** * Fetch whether the current user is allowed to mark items as spam. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return bool True if user is allowed to mark activity items as spam. */ @@ -2861,7 +3375,7 @@ 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) + * @since 1.6.0 * * @param bool $moderate Whether or not the current user has bp_moderate capability. */ @@ -2871,7 +3385,7 @@ function bp_activity_user_can_mark_spam() { /** * Mark an activity item as spam. * - * @since BuddyPress (1.6.0) + * @since 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 @@ -2883,30 +3397,30 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { $activity->is_spam = 1; - // Clear the activity stream first page cache + // Clear the activity stream first page cache. wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); - // Clear the activity comment cache for this activity item + // Clear the activity comment cache for this activity item. wp_cache_delete( $activity->id, 'bp_activity_comments' ); - // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity + // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity. if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 ); - // Build data package for Akismet + // Build data package for Akismet. $activity_data = BP_Akismet::build_akismet_data_package( $activity ); - // Tell Akismet this is spam + // Tell Akismet this is spam. $activity_data = $bp->activity->akismet->send_akismet_request( $activity_data, 'submit', 'spam' ); - // Update meta + // Update meta. 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) + * @since 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 @@ -2918,7 +3432,7 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { /** * Mark an activity item as ham. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @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 @@ -2930,30 +3444,30 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { $activity->is_spam = 0; - // Clear the activity stream first page cache + // Clear the activity stream first page cache. wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); - // Clear the activity comment cache for this activity item + // Clear the activity comment cache for this activity item. wp_cache_delete( $activity->id, 'bp_activity_comments' ); - // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity + // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity. if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) { remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 ); - // Build data package for Akismet + // Build data package for Akismet. $activity_data = BP_Akismet::build_akismet_data_package( $activity ); - // Tell Akismet this is spam + // Tell Akismet this is spam. $activity_data = $bp->activity->akismet->send_akismet_request( $activity_data, 'submit', 'ham' ); - // Update meta + // Update meta. 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) + * @since 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 @@ -2975,7 +3489,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { * This does not cover recursive activity comments, as they do not use a real loop. * For that, see {@link bp_activity_comment_embed()}. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed * @see bp_embed_activity_cache() @@ -3000,7 +3514,7 @@ add_action( 'activity_loop_start', 'bp_activity_embed' ); * necessary to grab each comment's embeds from the cache, or put them in * the cache if they are not there yet. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed * @see bp_embed_activity_cache() @@ -3020,7 +3534,7 @@ add_action( 'bp_before_activity_comment', 'bp_activity_comment_embed' ); /** * When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed * @uses add_filter() To attach create_function() to 'embed_post_id'. @@ -3045,7 +3559,7 @@ add_action( 'bp_legacy_theme_get_single_activity_content', 'bp_dtheme_embed_read * This filter must be removed so that the non-comment filters take over again * once the comments are done being processed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see bp_activity_comment_embed() * @uses remove_filter() To remove 'bp_get_activity_comment_id' from 'embed_post_id'. @@ -3060,7 +3574,7 @@ add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurs * * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed::parse_oembed() * @uses bp_activity_get_meta() @@ -3069,7 +3583,6 @@ add_action( 'bp_after_activity_comment', 'bp_activity_comment_embed_after_recurs * 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 ) { @@ -3081,7 +3594,7 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) { * * Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed::parse_oembed() * @uses bp_activity_update_meta() @@ -3090,8 +3603,6 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) { * 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. - * - * @return bool True on success, false on failure. */ function bp_embed_activity_save_cache( $cache, $cachekey, $id ) { bp_activity_update_meta( $id, $cachekey, $cache ); @@ -3100,16 +3611,13 @@ function bp_embed_activity_save_cache( $cache, $cachekey, $id ) { /** * Should we use Heartbeat to refresh activities? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @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. * @uses bp_is_group_activity() to check if on a single group, the current page * is the group activities. - * @uses bp_is_group_home() to check if the current page is a single group home - * page. * * @return bool True if activity heartbeat is enabled, otherwise false. */ @@ -3120,18 +3628,9 @@ function bp_activity_do_heartbeat() { return $retval; } - if ( bp_is_activity_directory() ) { + if ( bp_is_activity_directory() || bp_is_group_activity() ) { $retval = true; } - if ( bp_is_active( 'groups') ) { - // If no custom front, then activities are loaded in group's home - $has_custom_front = bp_locate_template( array( 'groups/single/front.php' ), false, true ); - - if ( bp_is_group_activity() || ( ! $has_custom_front && bp_is_group_home() ) ) { - $retval = true; - } - } - return $retval; } 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 2a34acaa7e646d5e71ef99575d9bdf86f25370b1..518dacf9a7887e326c2159622ec6bb80bcb0cd8f 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Activity Streams Loader. * @@ -7,385 +6,18 @@ * * @package BuddyPress * @subpackage ActivityCore + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/** - * Main Activity Class. - * - * @since BuddyPress (1.5.0) - */ -class BP_Activity_Component extends BP_Component { - - /** - * Start the activity component setup process. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'activity', - __( 'Activity Streams', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 10 - ) - ); - } - - /** - * Include component files. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::includes() for a description of arguments. - * - * @param array $includes See BP_Component::includes() for a description. - */ - public function includes( $includes = array() ) { - // Files to include - $includes = array( - 'cssjs', - 'actions', - 'screens', - 'filters', - 'classes', - 'template', - 'functions', - 'notifications', - 'cache' - ); - - // Load Akismet support if Akismet is configured - $akismet_key = bp_get_option( 'wordpress_api_key' ); - - /** 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'; - } - - if ( is_admin() ) { - $includes[] = 'admin'; - } - - parent::includes( $includes ); - } - - /** - * Set up component global variables. - * - * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for a description of arguments. - * - * @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_ACTIVITY_SLUG' ) ) - define( 'BP_ACTIVITY_SLUG', $this->id ); - - // Global tables for activity component - $global_tables = array( - 'table_name' => $bp->table_prefix . 'bp_activity', - 'table_name_meta' => $bp->table_prefix . 'bp_activity_meta', - ); - - // Metadata tables for groups component - $meta_tables = array( - 'activity' => $bp->table_prefix . 'bp_activity_meta', - ); - - // All globals for activity component. - // Note that global_tables is included in this array. - $args = array( - 'slug' => BP_ACTIVITY_SLUG, - 'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, - 'has_directory' => true, - 'directory_title' => _x( 'Site-Wide Activity', 'component directory title', 'buddypress' ), - 'notification_callback' => 'bp_activity_format_notifications', - 'search_string' => __( 'Search Activity...', 'buddypress' ), - 'global_tables' => $global_tables, - 'meta_tables' => $meta_tables, - ); - - parent::setup_globals( $args ); - } - - /** - * Set up component navigation. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_nav() for a description of arguments. - * @uses bp_is_active() - * @uses is_user_logged_in() - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Add 'Activity' to the main navigation - $main_nav = array( - 'name' => _x( 'Activity', 'Profile activity screen nav', 'buddypress' ), - 'slug' => $this->slug, - 'position' => 10, - 'screen_function' => 'bp_activity_screen_my_activity', - 'default_subnav_slug' => 'just-me', - 'item_css_id' => $this->id - ); - - // Stop if there is no user displayed or logged in - if ( !is_user_logged_in() && !bp_displayed_user_id() ) - return; - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - // User link - $activity_link = trailingslashit( $user_domain . $this->slug ); - - // Add the subnav items to the activity nav item if we are using a theme that supports this - $sub_nav[] = array( - 'name' => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ), - 'slug' => 'just-me', - 'parent_url' => $activity_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_activity_screen_my_activity', - 'position' => 10 - ); - - // @ mentions - if ( bp_activity_do_mentions() ) { - $sub_nav[] = array( - 'name' => _x( 'Mentions', 'Profile activity screen sub nav', 'buddypress' ), - 'slug' => 'mentions', - 'parent_url' => $activity_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_activity_screen_mentions', - 'position' => 20, - 'item_css_id' => 'activity-mentions' - ); - } - - // Favorite activity items - 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' ) ) { - $sub_nav[] = array( - 'name' => _x( 'Friends', 'Profile activity screen sub nav', 'buddypress' ), - 'slug' => bp_get_friends_slug(), - 'parent_url' => $activity_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_activity_screen_friends', - 'position' => 40, - 'item_css_id' => 'activity-friends' - ) ; - } - - // Additional menu if groups is active - if ( bp_is_active( 'groups' ) ) { - $sub_nav[] = array( - 'name' => _x( 'Groups', 'Profile activity screen sub nav', 'buddypress' ), - 'slug' => bp_get_groups_slug(), - 'parent_url' => $activity_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_activity_screen_groups', - 'position' => 50, - 'item_css_id' => 'activity-groups' - ); - } - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the component entries in the WordPress Admin Bar. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_nav() for a description of the $wp_admin_nav - * parameter array. - * @uses is_user_logged_in() - * @uses trailingslashit() - * @uses bp_get_total_mention_count_for_user() - * @uses bp_loggedin_user_id() - * @uses bp_is_active() - * @uses bp_get_friends_slug() - * @uses bp_get_groups_slug() - * - * @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(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $user_domain = bp_loggedin_user_domain(); - $activity_link = trailingslashit( $user_domain . $this->slug ); - - // Unread message count - if ( bp_activity_do_mentions() ) { - $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); - if ( !empty( $count ) ) { - $title = sprintf( _x( 'Mentions <span class="count">%s</span>', 'Toolbar Mention logged in user', 'buddypress' ), number_format_i18n( $count ) ); - } else { - $title = _x( 'Mentions', 'Toolbar Mention logged in user', 'buddypress' ); - } - } - - // Add the "Activity" sub menu - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => _x( 'Activity', 'My Account Activity sub nav', 'buddypress' ), - 'href' => trailingslashit( $activity_link ) - ); - - // Personal - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-personal', - 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), - 'href' => trailingslashit( $activity_link ) - ); - - // Mentions - if ( bp_activity_do_mentions() ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-mentions', - 'title' => $title, - 'href' => trailingslashit( $activity_link . 'mentions' ) - ); - } - - // 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' ) ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-friends', - 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), - 'href' => trailingslashit( $activity_link . bp_get_friends_slug() ) - ); - } - - // Groups? - if ( bp_is_active( 'groups' ) ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-groups', - 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), - 'href' => trailingslashit( $activity_link . bp_get_groups_slug() ) - ); - } - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title>. - * - * @since BuddyPress (1.5.0) - * - * @uses bp_is_activity_component() - * @uses bp_is_my_profile() - * @uses bp_core_fetch_avatar() - */ - public function setup_title() { - $bp = buddypress(); - - // Adjust title based on view - if ( bp_is_activity_component() ) { - if ( bp_is_my_profile() ) { - $bp->bp_options_title = _x( 'My Activity', 'Page and <title>', 'buddypress' ); - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - parent::setup_title(); - } - - /** - * Set up actions necessary for the component. - * - * @since BuddyPress (1.6.0) - */ - public function setup_actions() { - // Spam prevention - add_action( 'bp_include', 'bp_activity_setup_akismet' ); - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-activity-component.php'; /** * Bootstrap the Activity component. + * + * @since 1.6.0 */ function bp_setup_activity() { buddypress()->activity = new BP_Activity_Component(); 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 3d14cc217bb49b600b3cd56c3d39819ab8eae502..610df261a7addfc29d18d7306a040c8871c896e5 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Activity Notifications. * * @package BuddyPress * @subpackage ActivityNotifications + * @since 1.2.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /* Emails *********************************************************************/ @@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit; /** * Send email and BP notifications when a user is mentioned in an update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_notifications_add_notification() * @uses bp_get_user_meta() @@ -40,118 +40,73 @@ defined( 'ABSPATH' ) || exit; * @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 ) { - - // Don't leave multiple notifications for the same activity item $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' ); + // Don't leave multiple notifications for the same activity item. foreach( $notifications as $notification ) { if ( $activity_id == $notification->item_id ) { return; } } - $activity = new BP_Activity_Activity( $activity_id ); - - $subject = ''; - $message = ''; - $content = ''; + $activity = new BP_Activity_Activity( $activity_id ); + $email_type = 'activity-at-message'; + $group_name = ''; + $message_link = bp_activity_get_permalink( $activity_id ); + $poster_name = bp_core_get_user_displayname( $activity->user_id ); - // Now email the user with the contents of the message (if they have enabled email notifications) - if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { - $poster_name = bp_core_get_user_displayname( $activity->user_id ); - - $message_link = bp_activity_get_permalink( $activity_id ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $receiver_user_id ) . $settings_slug . '/notifications/'; + remove_filter( 'bp_get_activity_content_body', 'convert_smilies' ); + remove_filter( 'bp_get_activity_content_body', 'wpautop' ); + remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); - $poster_name = stripslashes( $poster_name ); - $content = bp_activity_filter_kses( strip_tags( stripslashes( $activity->content ) ) ); + /** This filter is documented in bp-activity/bp-activity-template.php */ + $content = apply_filters( 'bp_get_activity_content_body', $activity->content ); - // Set up and send the message - $ud = bp_core_get_core_userdata( $receiver_user_id ); - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ) ) ); + add_filter( 'bp_get_activity_content_body', 'convert_smilies' ); + add_filter( 'bp_get_activity_content_body', 'wpautop' ); + add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); + // Now email the user with the contents of the message (if they have enabled email notifications). + if ( 'no' != bp_get_user_meta( $receiver_user_id, 'notification_activity_new_mention', true ) ) { if ( bp_is_active( 'groups' ) && bp_is_group() ) { - $message = sprintf( __( -'%1$s mentioned you in the group "%2$s": - -"%3$s" - -To view and respond to the message, log in and visit: %4$s - ---------------------- -', 'buddypress' ), $poster_name, bp_get_current_group_name(), $content, $message_link ); - } else { - $message = sprintf( __( -'%1$s mentioned you in an update: - -"%2$s" - -To view and respond to the message, log in and visit: %3$s - ---------------------- -', 'buddypress' ), $poster_name, $content, $message_link ); + $email_type = 'groups-at-message'; + $group_name = bp_get_current_group_name(); } - // 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 ); - } - - /** - * 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 ); + $args = array( + 'tokens' => array( + 'activity' => $activity, + 'usermessage' => wp_strip_all_tags( $content ), + 'group.name' => $group_name, + 'mentioned.url' => $message_link, + 'poster.name' => $poster_name, + 'receiver-user.id' => $receiver_user_id, + ), + ); + + bp_send_email( $email_type, $receiver_user_id, $args ); } /** * Fires after the sending of an @mention email notification. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * @since 2.5.0 $subject, $message, $content arguments unset and deprecated. * * @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 string $deprecated Removed in 2.5; now an empty string. + * @param string $deprecated Removed in 2.5; now an empty string. + * @param string $deprecated Removed in 2.5; now an empty string. * @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 ); + do_action( 'bp_activity_sent_mention_email', $activity, '', '', '', $receiver_user_id ); } /** * Send email and BP notifications when an activity item receives a comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 + * @since 2.5.0 Updated to use new email APIs. * * @uses bp_get_user_meta() * @uses bp_core_get_user_displayname() @@ -175,193 +130,73 @@ To view and respond to the message, log in and visit: %3$s * * @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 + * @param array $params {@link bp_activity_new_comment()}. */ function bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() ) { + $original_activity = new BP_Activity_Activity( $params['activity_id'] ); + $poster_name = bp_core_get_user_displayname( $commenter_id ); + $thread_link = bp_activity_get_permalink( $params['activity_id'] ); - // Set some default parameters - $activity_id = 0; - $parent_id = 0; + remove_filter( 'bp_get_activity_content_body', 'convert_smilies' ); + remove_filter( 'bp_get_activity_content_body', 'wpautop' ); + remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); - extract( $params ); + /** This filter is documented in bp-activity/bp-activity-template.php */ + $content = apply_filters( 'bp_get_activity_content_body', $params['content'] ); - $original_activity = new BP_Activity_Activity( $activity_id ); + add_filter( 'bp_get_activity_content_body', 'convert_smilies' ); + add_filter( 'bp_get_activity_content_body', 'wpautop' ); + add_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); if ( $original_activity->user_id != $commenter_id && 'no' != bp_get_user_meta( $original_activity->user_id, 'notification_activity_new_reply', true ) ) { - $poster_name = bp_core_get_user_displayname( $commenter_id ); - $thread_link = bp_activity_get_permalink( $activity_id ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $original_activity->user_id ) . $settings_slug . '/notifications/'; - - $poster_name = stripslashes( $poster_name ); - $content = bp_activity_filter_kses( stripslashes($content) ); - - // Set up and send the message - $ud = bp_core_get_core_userdata( $original_activity->user_id ); - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ) ) ); - $message = sprintf( __( -'%1$s replied to one of your updates: - -"%2$s" - -To view your original update and all comments, log in and visit: %3$s - ---------------------- -', 'buddypress' ), $poster_name, $content, $thread_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 ); - } - - /** - * 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 ); + $args = array( + 'tokens' => array( + 'comment.id' => $comment_id, + 'commenter.id' => $commenter_id, + 'usermessage' => wp_strip_all_tags( $content ), + 'original_activity.user_id' => $original_activity->user_id, + 'poster.name' => $poster_name, + 'thread.url' => esc_url( $thread_link ), + ), + ); + + bp_send_email( 'activity-comment', $original_activity->user_id, $args ); } - /*** + + /* * If this is a reply to another comment, send an email notification to the * author of the immediate parent comment. */ - if ( empty( $parent_id ) || ( $activity_id == $parent_id ) ) { - return false; + if ( empty( $params['parent_id'] ) || ( $params['activity_id'] == $params['parent_id'] ) ) { + return; } - $parent_comment = new BP_Activity_Activity( $parent_id ); + $parent_comment = new BP_Activity_Activity( $params['parent_id'] ); if ( $parent_comment->user_id != $commenter_id && $original_activity->user_id != $parent_comment->user_id && 'no' != bp_get_user_meta( $parent_comment->user_id, 'notification_activity_new_reply', true ) ) { - $poster_name = bp_core_get_user_displayname( $commenter_id ); - $thread_link = bp_activity_get_permalink( $activity_id ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $parent_comment->user_id ) . $settings_slug . '/notifications/'; - - // Set up and send the message - $ud = bp_core_get_core_userdata( $parent_comment->user_id ); - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ) ) ); - - $poster_name = stripslashes( $poster_name ); - $content = bp_activity_filter_kses( stripslashes( $content ) ); - -$message = sprintf( __( -'%1$s replied to one of your comments: - -"%2$s" - -To view the original activity, your comment and all replies, log in and visit: %3$s - ---------------------- -', 'buddypress' ), $poster_name, $content, $thread_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 ); - } - - /** - * 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 ); - - /** - * 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 ); + $args = array( + 'tokens' => array( + 'comment.id' => $comment_id, + 'commenter.id' => $commenter_id, + 'usermessage' => wp_strip_all_tags( $content ), + 'parent-comment-user.id' => $parent_comment->user_id, + 'poster.name' => $poster_name, + 'thread.url' => esc_url( $thread_link ), + ), + ); + + bp_send_email( 'activity-comment-author', $parent_comment->user_id, $args ); } } /** * Helper method to map action arguments to function parameters. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $comment_id - * @param array $params + * @param int $comment_id ID of the comment being notified about. + * @param array $params Parameters to use with notification. */ function bp_activity_new_comment_notification_helper( $comment_id, $params ) { bp_activity_new_comment_notification( $comment_id, $params['user_id'], $params ); @@ -373,7 +208,7 @@ add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_ /** * Format notifications related to activity. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_loggedin_user_domain() * @uses bp_get_activity_slug() @@ -387,7 +222,6 @@ add_action( 'bp_activity_comment_posted', 'bp_activity_new_comment_notification_ * @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' ) { @@ -419,7 +253,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id * 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) + * @since 1.5.0 * * @param string $string HTML anchor tag for the mention. * @param string $at_mention_link The permalink for the mention. @@ -437,7 +271,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id * The two possible hooks are bp_activity_single_at_mentions_notification * or bp_activity_multiple_at_mentions_notification. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -454,7 +288,7 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id /** * Fires right before returning the formatted activity notifications. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $action The type of activity item. * @param int $item_id The activity ID. @@ -474,13 +308,13 @@ function bp_activity_format_notifications( $action, $item_id, $secondary_item_id * future when we separate emails from Notifications, this will need its own * 'bp_activity_at_name_send_emails' equivalent helper function. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param object $activity - * @param string $subject (not used) - * @param string $message (not used) - * @param string $content (not used) - * @param int $receiver_user_id + * @param object $activity Activity object. + * @param string $subject (not used) Notification subject. + * @param string $message (not used) Notification message. + * @param string $content (not used) Notification content. + * @param int $receiver_user_id ID of user receiving notification. */ function bp_activity_at_mention_add_notification( $activity, $subject, $message, $content, $receiver_user_id ) { if ( bp_is_active( 'notifications' ) ) { @@ -500,30 +334,32 @@ 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.0) + * @since 1.5.0 + * @since 2.5.0 Add the $user_id parameter * + * @param int $user_id The id of the user whose notifications are marked as read. * @uses bp_notifications_mark_all_notifications_by_type() */ -function bp_activity_remove_screen_notifications() { +function bp_activity_remove_screen_notifications( $user_id = 0 ) { if ( ! bp_is_active( 'notifications' ) ) { return; } - // Only mark read if you're looking at your own mentions - if ( ! bp_is_my_profile() ) { + // Only mark read if the current user is looking at his own mentions. + if ( empty( $user_id ) || (int) $user_id !== (int) bp_loggedin_user_id() ) { return; } - bp_notifications_mark_notifications_by_type( bp_loggedin_user_id(), buddypress()->activity->id, 'new_at_mention' ); + bp_notifications_mark_notifications_by_type( $user_id, buddypress()->activity->id, 'new_at_mention' ); } -add_action( 'bp_activity_screen_mentions', 'bp_activity_remove_screen_notifications' ); +add_action( 'bp_activity_clear_new_mentions', 'bp_activity_remove_screen_notifications', 10, 1 ); /** * Mark at-mention notification as read when user visits the activity with the mention. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param object BP_Activity_Activity + * @param BP_Activity_Activity $activity Activity object. */ function bp_activity_remove_screen_notifications_single_activity_permalink( $activity ) { if ( ! bp_is_active( 'notifications' ) ) { @@ -534,8 +370,7 @@ function bp_activity_remove_screen_notifications_single_activity_permalink( $act return; } - // Mark as read any notifications for the current user related to this - // activity item + // Mark as read any notifications for the current user related to this activity item. bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), $activity->id, buddypress()->activity->id, 'new_at_mention' ); } add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_screen_notifications_single_activity_permalink' ); @@ -543,13 +378,13 @@ add_action( 'bp_activity_screen_single_activity_permalink', 'bp_activity_remove_ /** * Delete at-mention notifications when the corresponding activity item is deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activity_ids_deleted IDs of deleted activity items. */ function bp_activity_at_mention_delete_notification( $activity_ids_deleted = array() ) { // Let's delete all without checking if content contains any mentions - // to avoid a query to get the activity + // to avoid a query to get the activity. if ( bp_is_active( 'notifications' ) && ! empty( $activity_ids_deleted ) ) { foreach ( $activity_ids_deleted as $activity_id ) { bp_notifications_delete_all_notifications_by_type( $activity_id, buddypress()->activity->id ); 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 8ac5f3abf6983274b23ee9a2d13a276f937669bf..1865f416bb34b14d27ed0e59700f08c95b30d494 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Activity Screens. * @@ -9,15 +8,18 @@ * * @package BuddyPress * @subpackage ActivityScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-activity-theme-compat.php'; + /** * Load the Activity directory. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_displayed_user_id() * @uses bp_is_activity_component() @@ -34,14 +36,14 @@ function bp_activity_screen_index() { /** * Fires right before the loading of the Activity directory screen template file. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_activity_screen_index' ); /** * Filters the template to load for the Activity directory screen. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $template Path to the activity template to load. */ @@ -53,7 +55,7 @@ add_action( 'bp_screens', 'bp_activity_screen_index' ); /** * Load the 'My Activity' page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses do_action() To call the 'bp_activity_screen_my_activity' hook. * @uses bp_core_load_template() @@ -64,14 +66,14 @@ function bp_activity_screen_my_activity() { /** * Fires right before the loading of the "My Activity" screen template file. * - * @since BuddyPress (1.0.0) + * @since 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) + * @since 1.0.0 * * @param string $template Path to the activity template to load. */ @@ -81,7 +83,7 @@ function bp_activity_screen_my_activity() { /** * Load the 'My Friends' activity page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_is_active() * @uses bp_update_is_item_admin() @@ -99,14 +101,14 @@ function bp_activity_screen_friends() { /** * Fires right before the loading of the "My Friends" screen template file. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_screen_friends' ); /** * Filters the template to load for the "My Friends" screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the activity template to load. */ @@ -116,7 +118,7 @@ function bp_activity_screen_friends() { /** * Load the 'My Groups' activity page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_active() * @uses bp_update_is_item_admin() @@ -134,14 +136,14 @@ function bp_activity_screen_groups() { /** * Fires right before the loading of the "My Groups" screen template file. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_screen_groups' ); /** * Filters the template to load for the "My Groups" screen. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $template Path to the activity template to load. */ @@ -151,7 +153,7 @@ function bp_activity_screen_groups() { /** * Load the 'Favorites' activity page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_update_is_item_admin() * @uses bp_current_user_can() @@ -165,14 +167,14 @@ function bp_activity_screen_favorites() { /** * Fires right before the loading of the "Favorites" screen template file. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_screen_favorites' ); /** * Filters the template to load for the "Favorites" screen. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $template Path to the activity template to load. */ @@ -182,7 +184,7 @@ function bp_activity_screen_favorites() { /** * Load the 'Mentions' activity page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_update_is_item_admin() * @uses bp_current_user_can() @@ -196,14 +198,14 @@ function bp_activity_screen_mentions() { /** * Fires right before the loading of the "Mentions" screen template file. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_screen_mentions' ); /** * Filters the template to load for the "Mentions" screen. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $template Path to the activity template to load. */ @@ -213,7 +215,7 @@ function bp_activity_screen_mentions() { /** * Reset the logged-in user's new mentions data when he visits his mentions screen. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_is_my_profile() * @uses bp_activity_clear_new_mentions() @@ -228,7 +230,7 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' ) /** * Load the page for a single activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_activity_component() * @uses bp_activity_get_specific() @@ -253,14 +255,14 @@ add_action( 'bp_activity_screen_mentions', 'bp_activity_reset_my_new_mentions' ) function bp_activity_screen_single_activity_permalink() { $bp = buddypress(); - // No displayed user or not viewing activity component + // No displayed user or not viewing activity component. if ( !bp_is_activity_component() ) return false; if ( ! bp_current_action() || !is_numeric( bp_current_action() ) ) return false; - // Get the activity details + // Get the activity details. $activity = bp_activity_get_specific( array( 'activity_ids' => bp_current_action(), 'show_hidden' => true, 'spam' => 'ham_only', ) ); // 404 if activity does not exist @@ -272,26 +274,26 @@ function bp_activity_screen_single_activity_permalink() { $activity = $activity['activities'][0]; } - // Default access is true + // Default access is true. $has_access = true; - // If activity is from a group, do an extra cap check + // If activity is from a group, do an extra cap check. if ( isset( $bp->groups->id ) && $activity->component == $bp->groups->id ) { - // Activity is from a group, but groups is currently disabled + // Activity is from a group, but groups is currently disabled. if ( !bp_is_active( 'groups') ) { bp_do_404(); return; } // Check to see if the group is not public, if so, check the - // user has access to see this activity + // user has access to see this activity. if ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) { - // Group is not public + // Group is not public. if ( 'public' != $group->status ) { - // User is not a member of group + // User is not a member of group. if ( !groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { $has_access = false; } @@ -302,7 +304,7 @@ function bp_activity_screen_single_activity_permalink() { /** * Filters the access permission for a single activity view. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $access Array holding the current $has_access value and current activity item instance. */ @@ -311,20 +313,20 @@ function bp_activity_screen_single_activity_permalink() { /** * Fires before the loading of a single activity template file. * - * @since BuddyPress (1.2.0) + * @since 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 + // Access is specifically disallowed. if ( false === $has_access ) { - // User feedback + // User feedback. bp_core_add_message( __( 'You do not have access to this activity.', 'buddypress' ), 'error' ); - // Redirect based on logged in status + // Redirect based on logged in status. if ( is_user_logged_in() ) { $url = bp_loggedin_user_domain(); @@ -341,7 +343,7 @@ function bp_activity_screen_single_activity_permalink() { /** * Filters the template to load for a single activity screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the activity template to load. */ @@ -352,7 +354,7 @@ add_action( 'bp_screens', 'bp_activity_screen_single_activity_permalink' ); /** * Add activity notifications settings to the notifications settings page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_user_meta() * @uses bp_core_get_username() @@ -387,16 +389,16 @@ function bp_activity_screen_notification_settings() { <tr id="activity-notification-settings-mentions"> <td> </td> <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( bp_displayed_user_id() ) ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" id="notification-activity-new-mention-yes" value="yes" <?php checked( $mention, 'yes', true ) ?>/><label for="notification-activity-new-mention-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" id="notification-activity-new-mention-no" value="no" <?php checked( $mention, 'no', true ) ?>/><label for="notification-activity-new-mention-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <?php endif; ?> <tr id="activity-notification-settings-replies"> <td> </td> <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php checked( $reply, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php checked( $reply, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" id="notification-activity-new-reply-yes" value="yes" <?php checked( $reply, 'yes', true ) ?>/><label for="notification-activity-new-reply-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" id="notification-activity-new-reply-no" value="no" <?php checked( $reply, 'no', true ) ?>/><label for="notification-activity-new-reply-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <?php @@ -404,7 +406,7 @@ function bp_activity_screen_notification_settings() { /** * Fires inside the closing </tbody> tag for activity screen notification settings. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_screen_notification_settings' ) ?> </tbody> @@ -416,175 +418,4 @@ add_action( 'bp_notification_settings', 'bp_activity_screen_notification_setting /** Theme Compatibility *******************************************************/ -/** - * The main theme compat class for BuddyPress Activity. - * - * 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.0) - */ -class BP_Activity_Theme_Compat { - - /** - * Set up the activity component theme compatibility. - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) ); - } - - /** - * Set up the theme compatibility hooks, if we're looking at an activity page. - * - * @since BuddyPress (1.7.0) - */ - public function is_activity() { - - // Bail if not looking at a group - if ( ! bp_is_activity_component() ) - return; - - // Activity Directory - 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' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); - - // Single activity - } elseif ( bp_is_single_activity() ) { - add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); - } - } - - /** Directory *************************************************************/ - - /** - * Add template hierarchy to theme compat for the activity directory page. - * - * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with directory data. - * - * @since BuddyPress (1.7.0) - */ - public function directory_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => bp_get_directory_title( 'activity' ), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the groups index template part. - * - * @since BuddyPress (1.7.0) - */ - public function directory_content() { - return bp_buffer_template_part( 'activity/index', null, false ); - } - - /** Single ****************************************************************/ - - /** - * Add custom template hierarchy to theme compat for activity permalink pages. - * - * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with the displayed user's data. - * - * @since BuddyPress (1.7.0) - */ - public function single_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => __( 'Activity', 'buddypress' ), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the members' activity permalink template part. - * - * @since BuddyPress (1.7.0) - */ - public function single_dummy_content() { - return bp_buffer_template_part( 'activity/single/home', null, false ); - } -} new BP_Activity_Theme_Compat(); 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 e73a2598fcabe4580849364c31753ffc16c1f264..a957cb5a696d1118bc885382418ef6ab624b8918 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php @@ -1,19 +1,21 @@ <?php - /** * BuddyPress Activity Template Functions. * * @package BuddyPress * @subpackage ActivityTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-activity-template.php'; + /** * Output the activity component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_slug() */ @@ -23,7 +25,7 @@ function bp_activity_slug() { /** * Return the activity component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() To call the 'bp_get_activity_slug' hook. * @@ -34,7 +36,7 @@ function bp_activity_slug() { /** * Filters the activity component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Activity component slug. */ @@ -44,7 +46,7 @@ function bp_activity_slug() { /** * Output the activity component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_root_slug() */ @@ -54,7 +56,7 @@ function bp_activity_root_slug() { /** * Return the activity component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() To call the 'bp_get_activity_root_slug' hook. * @@ -65,7 +67,7 @@ function bp_activity_root_slug() { /** * Filters the activity component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Activity component root slug. */ @@ -75,7 +77,7 @@ function bp_activity_root_slug() { /** * Output activity directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_directory_permalink() */ @@ -85,7 +87,7 @@ function bp_activity_directory_permalink() { /** * Return activity directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses trailingslashit() * @uses bp_get_root_domain() @@ -99,407 +101,13 @@ function bp_activity_directory_permalink() { /** * Filters the activity directory permalink. * - * @since BuddyPress (1.5.0) + * @since 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() ) ); } -/** - * The main activity template loop class. - * - * This is responsible for loading a group of activity items and displaying them. - * - * @since BuddyPress (1.0.0) - */ -class BP_Activity_Template { - /** - * The loop iterator. - * - * @since BuddyPress (1.5.0) - * @access public - * @var int - */ - public $current_activity = -1; - - /** - * 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'. - * - * @since BuddyPress (2.1.0) - * @var string - */ - public $pag_arg; - - /** - * The page number being requested. - * - * @since BuddyPress (1.5.0) - * @access public - * @var int - */ - public $pag_page; - - /** - * 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. - * - * The arguments passed to this class constructor are of the same - * format as {@link BP_Activity_Activity::get()}. - * - * @see BP_Activity_Activity::get() for a description of the argument - * structure, as well as default values. - * - * @param array $args { - * Array of arguments. Supports all arguments from - * 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|bool $display_comments Default: 'threaded'. - * } - */ - public function __construct( $args ) { - $bp = buddypress(); - - // 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 => 'page', - 1 => 'per_page', - 2 => 'max', - 3 => 'include', - 4 => 'sort', - 5 => 'filter', - 6 => 'search_terms', - 7 => 'display_comments', - 8 => 'show_hidden', - 9 => 'exclude', - 10 => 'in', - 11 => 'spam', - 12 => 'page_arg' - ); - - $func_args = func_get_args(); - $args = bp_core_parse_args_array( $old_args_keys, $func_args ); - } - - $defaults = array( - 'page' => 1, - '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', - 'update_meta_cache' => true, - ); - $r = wp_parse_args( $args, $defaults ); - extract( $r ); - - $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 = (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 ) ); - - // Fetch specific activity items based on ID's - if ( !empty( $include ) ) { - $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, - 'display_comments' => $display_comments, - 'show_hidden' => $show_hidden, - 'spam' => $spam, - 'update_meta_cache' => $update_meta_cache, - ) ); - - // Fetch all activity items - } else { - $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, - 'spam' => $spam, - 'update_meta_cache' => $update_meta_cache, - ) ); - } - - // The total_activity_count property will be set only if a - // 'count_total' query has taken place - if ( ! is_null( $this->activities['total'] ) ) { - if ( ! $max || $max >= (int) $this->activities['total'] ) { - $this->total_activity_count = (int) $this->activities['total']; - } else { - $this->total_activity_count = (int) $max; - } - } - - $this->has_more_items = $this->activities['has_more_items']; - - $this->activities = $this->activities['activities']; - - if ( $max ) { - if ( $max >= count($this->activities) ) { - $this->activity_count = count( $this->activities ); - } else { - $this->activity_count = (int) $max; - } - } else { - $this->activity_count = count( $this->activities ); - } - - $this->full_name = bp_get_displayed_user_fullname(); - - // 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 ) { - continue; - } - - $parent_ids[] = $activity->item_id; - } - - 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 ) { - $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( $this->pag_arg, '%#%' ), - 'format' => '', - 'total' => ceil( (int) $this->total_activity_count / (int) $this->pag_num ), - 'current' => (int) $this->pag_page, - 'prev_text' => _x( '←', 'Activity pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Activity pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => array(), - ) ); - } - } - - /** - * Whether there are activity items available in the loop. - * - * @see bp_has_activities() - * - * @return bool True if there are items in the loop, otherwise false. - */ - function has_activities() { - if ( $this->activity_count ) { - return true; - } - - return false; - } - - /** - * Set up the next activity item and iterate index. - * - * @return object The next activity item to iterate over. - */ - public function next_activity() { - $this->current_activity++; - $this->activity = $this->activities[ $this->current_activity ]; - - return $this->activity; - } - - /** - * Rewind the posts and reset post index. - */ - public function rewind_activities() { - $this->current_activity = -1; - if ( $this->activity_count > 0 ) { - $this->activity = $this->activities[0]; - } - } - - /** - * Whether there are activity items left in the loop to iterate over. - * - * This method is used by {@link bp_activities()} as part of the while loop - * that controls iteration inside the activities loop, eg: - * while ( bp_activities() ) { ... - * - * @see bp_activities() - * - * @return bool True if there are more activity items to show, - * otherwise false. - */ - public function user_activities() { - if ( ( $this->current_activity + 1 ) < $this->activity_count ) { - return true; - } 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; - } - - /** - * Set up the current activity item inside the loop. - * - * Used by {@link bp_the_activity()} to set up the current activity item - * data while looping, so that template tags used during that iteration - * make reference to the current activity item. - * - * @see bp_the_activity() - */ - public function the_activity() { - - $this->in_the_loop = true; - $this->activity = $this->next_activity(); - - if ( is_array( $this->activity ) ) { - $this->activity = (object) $this->activity; - } - - // 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'); - } - } -} - /** * Initialize the activity loop. * @@ -507,7 +115,8 @@ 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.0) + * @since 1.0.0 + * @since 2.4.0 Introduced the `$fields` parameter. * * @global object $activities_template {@link BP_Activity_Template} * @uses groups_is_user_member() @@ -537,6 +146,8 @@ class BP_Activity_Template { * @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 $fields Activity fields to retrieve. 'all' to fetch entire activity objects, + * 'ids' to get only the activity IDs. Default 'all'. * @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'. @@ -611,17 +222,19 @@ class BP_Activity_Template { function bp_has_activities( $args = '' ) { global $activities_template; - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - /** Smart Defaults ********************************************************/ + /* + * Smart Defaults. + */ - // User filtering + // User filtering. $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : false; - // Group filtering + // Group filtering. if ( bp_is_group() ) { $object = $bp->groups->id; $primary_id = bp_get_current_group_id(); @@ -632,75 +245,86 @@ function bp_has_activities( $args = '' ) { $show_hidden = false; } - // The default scope should recognize custom slugs + // The default scope should recognize custom slugs. $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/ + // Support for permalinks on single item pages: /groups/my-group/activity/124/. $include = bp_is_current_action( bp_get_activity_slug() ) ? bp_action_variable( 0 ) : false; - /** Parse Args ************************************************************/ + $search_terms_default = false; + $search_query_arg = bp_core_get_component_search_query_arg( 'activity' ); + if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) { + $search_terms_default = stripslashes( $_REQUEST[ $search_query_arg ] ); + } + + /* + * Parse Args. + */ // 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' => 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 + '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' => 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. + 'fields' => 'all', 'count_total' => false, 'show_hidden' => $show_hidden, // Show activity items that are hidden site-wide? - 'spam' => 'ham_only', // Hide spammed items + 'spam' => 'ham_only', // Hide spammed items. - // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions) + // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions). 'scope' => $scope, // Filtering - 'user_id' => $user_id, // user_id to filter on - 'object' => $object, // object to filter on e.g. groups, profile, status, friends - 'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated - 'primary_id' => $primary_id, // object ID to filter on e.g. a group_id or forum_id or blog_id etc. - 'secondary_id' => false, // secondary object ID to filter on e.g. a post_id - 'offset' => false, // return only items >= this ID - 'since' => false, // return only items recorded since this Y-m-d H:i:s date - - '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 + 'user_id' => $user_id, // user_id to filter on. + 'object' => $object, // Object to filter on e.g. groups, profile, status, friends. + 'action' => false, // Action to filter on e.g. activity_update, new_forum_post, profile_updated. + 'primary_id' => $primary_id, // Object ID to filter on e.g. a group_id or forum_id or blog_id etc. + 'secondary_id' => false, // Secondary object ID to filter on e.g. a post_id. + 'offset' => false, // Return only items >= this ID. + 'since' => false, // Return only items recorded since this Y-m-d H:i:s date. + + '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' => $search_terms_default, 'update_meta_cache' => true, ), 'has_activities' ); - /** Smart Overrides *******************************************************/ + /* + * 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 + // or =none or =false. Final true is a strict type check. See #5029. if ( in_array( $r['display_comments'], array( 0, '0', 'none', 'false' ), true ) ) { $r['display_comments'] = false; } - // Ignore pagination if an offset is passed + // Ignore pagination if an offset is passed. if ( ! empty( $r['offset'] ) ) { $r['page'] = 0; } - // Search terms + // Search terms. if ( ! empty( $_REQUEST['s'] ) && empty( $r['search_terms'] ) ) { $r['search_terms'] = $_REQUEST['s']; } - // Do not exceed the maximum per page + // Do not exceed the maximum per page. if ( ! empty( $r['max'] ) && ( (int) $r['per_page'] > (int) $r['max'] ) ) { $r['per_page'] = $r['max']; } @@ -712,7 +336,7 @@ function bp_has_activities( $args = '' ) { * 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) + * @since 1.6.0 * * @param bool $value True if BuddyPress should enable afilter support. */ @@ -740,14 +364,16 @@ function bp_has_activities( $args = '' ) { $r['spam'] = 'all'; } - /** Query *****************************************************************/ + /* + * Query + */ $activities_template = new BP_Activity_Template( $r ); /** * Filters whether or not there are activity items to display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param bool $value Whether or not there are activity items to display. * @param string $activities_template Current activities template being used. @@ -759,7 +385,7 @@ function bp_has_activities( $args = '' ) { /** * Determine if there are still activities left in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses BP_Activity_Template::user_activities() {@link BP_Activity_Template::user_activities()} @@ -774,7 +400,7 @@ function bp_activities() { /** * Get the current activity object in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()} @@ -789,7 +415,7 @@ function bp_the_activity() { /** * Output the URL for the Load More link. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_activity_load_more_link() { echo esc_url( bp_get_activity_load_more_link() ); @@ -797,7 +423,9 @@ function bp_activity_load_more_link() { /** * Get the URL for the Load More link. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * + * @return string $link */ function bp_get_activity_load_more_link() { global $activities_template; @@ -808,7 +436,7 @@ function bp_activity_load_more_link() { /** * Filters the Load More link URL. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $link The "Load More" link URL with appropriate query args. * @param string $url The original URL. @@ -820,7 +448,7 @@ function bp_activity_load_more_link() { /** * Output the activity pagination count. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses BP_Activity_Template::the_activity() {@link BP_Activity_Template::the_activity()} @@ -832,7 +460,7 @@ function bp_activity_pagination_count() { /** * Return the activity pagination count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_core_number_format() @@ -859,7 +487,7 @@ function bp_activity_pagination_count() { /** * Output the activity pagination links. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_pagination_links() */ @@ -870,7 +498,7 @@ function bp_activity_pagination_links() { /** * Return the activity pagination links. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_pagination_links' hook. @@ -883,7 +511,7 @@ function bp_activity_pagination_links() { /** * Filters the activity pagination link output. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $pag_links Output for the activity pagination links. */ @@ -893,7 +521,7 @@ function bp_activity_pagination_links() { /** * Return true when there are more activity items to be shown than currently appear. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_activity_has_more_items' hook. @@ -918,7 +546,7 @@ function bp_activity_has_more_items() { /** * Filters whether there are more activity items to display. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $has_more_items Whether or not there are more activity items to display. */ @@ -928,7 +556,7 @@ function bp_activity_has_more_items() { /** * Output the activity count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_count() */ @@ -939,7 +567,7 @@ function bp_activity_count() { /** * Return the activity count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_count' hook. @@ -952,7 +580,7 @@ function bp_activity_count() { /** * Filters the activity count for the activity template. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $activity_count The count for total activity. */ @@ -962,7 +590,7 @@ function bp_activity_count() { /** * Output the number of activities per page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_per_page() */ @@ -973,7 +601,7 @@ function bp_activity_per_page() { /** * Return the number of activities per page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_per_page' hook. @@ -986,7 +614,7 @@ function bp_activity_per_page() { /** * Filters the activity posts per page value. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $pag_num How many post should be displayed for pagination. */ @@ -996,7 +624,7 @@ function bp_activity_per_page() { /** * Output the activities title. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activities_title() * @todo Deprecate. @@ -1008,7 +636,7 @@ function bp_activities_title() { /** * Return the activities title. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global string $bp_activity_title * @uses apply_filters() To call the 'bp_get_activities_title' hook. @@ -1022,7 +650,7 @@ function bp_activities_title() { /** * Filters the activities title for the activity template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $bp_activity_title The title to be displayed. */ @@ -1032,7 +660,7 @@ function bp_activities_title() { /** * {@internal Missing Description} * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activities_no_activity() * @todo Deprecate. @@ -1044,7 +672,7 @@ function bp_activities_no_activity() { /** * {@internal Missing Description} * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global string $bp_activity_no_activity * @uses apply_filters() To call the 'bp_get_activities_no_activity' hook. @@ -1058,7 +686,7 @@ function bp_activities_no_activity() { /** * Filters the text used when there is no activity to display. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $bp_activity_no_activity Text to display for no activity. */ @@ -1068,7 +696,7 @@ function bp_activities_no_activity() { /** * Output the activity ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_id() */ @@ -1079,7 +707,7 @@ function bp_activity_id() { /** * Return the activity ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_id' hook. @@ -1092,7 +720,7 @@ function bp_activity_id() { /** * Filters the activity ID being displayed. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $id The activity ID. */ @@ -1102,7 +730,7 @@ function bp_activity_id() { /** * Output the activity item ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_item_id() */ @@ -1113,7 +741,7 @@ function bp_activity_item_id() { /** * Return the activity item ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_item_id' hook. @@ -1126,7 +754,7 @@ function bp_activity_item_id() { /** * Filters the activity item ID being displayed. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $item_id The activity item ID. */ @@ -1136,7 +764,7 @@ function bp_activity_item_id() { /** * Output the activity secondary item ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_secondary_item_id() */ @@ -1147,7 +775,7 @@ function bp_activity_secondary_item_id() { /** * Return the activity secondary item ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_secondary_item_id' hook. @@ -1160,7 +788,7 @@ function bp_activity_secondary_item_id() { /** * Filters the activity secondary item ID being displayed. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $secondary_item_id The activity secondary item ID. */ @@ -1170,7 +798,7 @@ function bp_activity_secondary_item_id() { /** * Output the date the activity was recorded. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_date_recorded() */ @@ -1181,7 +809,7 @@ function bp_activity_date_recorded() { /** * Return the date the activity was recorded. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_date_recorded' hook. @@ -1194,7 +822,7 @@ function bp_activity_date_recorded() { /** * Filters the date the activity was recorded. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $date_recorded The activity's date. */ @@ -1204,7 +832,7 @@ function bp_activity_date_recorded() { /** * Output the display name of the member who posted the activity. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses bp_get_activity_member_display_name() */ @@ -1215,7 +843,7 @@ function bp_activity_member_display_name() { /** * Return the display name of the member who posted the activity. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_member_display_name' hook. @@ -1232,7 +860,7 @@ function bp_activity_member_display_name() { /** * Filters the display name of the member who posted the activity. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param int $retval Display name for the member who posted. */ @@ -1242,7 +870,7 @@ function bp_activity_member_display_name() { /** * Output the activity object name. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_object_name() */ @@ -1253,7 +881,7 @@ function bp_activity_object_name() { /** * Return the activity object name. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_object_name' hook. @@ -1266,7 +894,7 @@ function bp_activity_object_name() { /** * Filters the activity object name. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_component The activity object name. */ @@ -1276,7 +904,7 @@ function bp_activity_object_name() { /** * Output the activity type. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_type() */ @@ -1287,7 +915,7 @@ function bp_activity_type() { /** * Return the activity type. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_type' hook. @@ -1300,7 +928,7 @@ function bp_activity_type() { /** * Filters the activity type. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_type The activity type. */ @@ -1312,11 +940,11 @@ function bp_activity_type() { * * Just a wrapper for bp_activity_type(). * - * @since BuddyPress (1.2.0) - * @deprecated BuddyPress (1.5.0) + * @since 1.2.0 + * @deprecated 1.5.0 * * @todo Properly deprecate in favor of bp_activity_type() and - * remove redundant echo + * remove redundant echo * * @uses bp_activity_type() */ @@ -1327,8 +955,8 @@ function bp_activity_type() { * * Just a wrapper for bp_get_activity_type(). * - * @since BuddyPress (1.2.0) - * @deprecated BuddyPress (1.5.0) + * @since 1.2.0 + * @deprecated 1.5.0 * * @todo Properly deprecate in favor of bp_get_activity_type(). * @@ -1341,7 +969,7 @@ function bp_activity_type() { /** * Output the activity user ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses bp_get_activity_user_id() */ @@ -1352,7 +980,7 @@ function bp_activity_user_id() { /** * Return the activity user ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_user_id' hook. @@ -1365,7 +993,7 @@ function bp_activity_user_id() { /** * Filters the activity user ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $user_id The activity user ID. */ @@ -1375,7 +1003,7 @@ function bp_activity_user_id() { /** * Output the activity user link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_user_link() */ @@ -1386,7 +1014,7 @@ function bp_activity_user_link() { /** * Return the activity user link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_core_get_user_domain() @@ -1406,7 +1034,7 @@ function bp_activity_user_link() { /** * Filters the activity user link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $link The activity user link. */ @@ -1416,7 +1044,7 @@ function bp_activity_user_link() { /** * Output the avatar of the user that performed the action. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @see bp_get_activity_avatar() for description of arguments. * @uses bp_get_activity_avatar() @@ -1429,7 +1057,7 @@ function bp_activity_avatar( $args = '' ) { /** * Return the avatar of the user that performed the action. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @see bp_core_fetch_avatar() For a description of the arguments. * @global object $activities_template {@link BP_Activity_Template} @@ -1460,17 +1088,17 @@ function bp_activity_avatar( $args = '' ) { $bp = buddypress(); - // On activity permalink pages, default to the full-size avatar + // On activity permalink pages, default to the full-size avatar. $type_default = bp_is_single_activity() ? 'full' : 'thumb'; // Within the activity comment loop, the current activity should be set // to current_comment. Otherwise, just use activity. $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity; - // Activity user display name + // Activity user display name. $dn_default = isset( $current_activity_item->display_name ) ? $current_activity_item->display_name : ''; - // Prepend some descriptive text to alt + // Prepend some descriptive text to alt. $alt_default = !empty( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $dn_default ) : __( 'Profile picture', 'buddypress' ); $defaults = array( @@ -1486,14 +1114,14 @@ function bp_activity_avatar( $args = '' ) { if ( !isset( $height ) && !isset( $width ) ) { - // Backpat + // Backpat. if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) { $height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height; } else { $height = 20; } - // Backpat + // Backpat. if ( isset( $bp->avatar->full->width ) || isset( $bp->avatar->thumb->width ) ) { $width = ( 'full' == $type ) ? $bp->avatar->full->width : $bp->avatar->thumb->width; } else { @@ -1508,7 +1136,7 @@ function bp_activity_avatar( $args = '' ) { * 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) + * @since 1.1.0 * * @param string $component Component being displayed. */ @@ -1518,7 +1146,7 @@ function bp_activity_avatar( $args = '' ) { /** * Filters the activity avatar item ID. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param int $item_id Item ID for the activity avatar. */ @@ -1532,7 +1160,7 @@ function bp_activity_avatar( $args = '' ) { /** * Filters the value returned by bp_core_fetch_avatar. * - * @since BuddyPress (1.1.3) + * @since 1.1.3 * * @param array $value Array of arguments calculated for use with bp_core_fetch_avatar. */ @@ -1551,7 +1179,7 @@ function bp_activity_avatar( $args = '' ) { /** * Output the avatar of the object that action was performed on. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_activity_secondary_avatar() for description of arguments. * @uses bp_get_activity_secondary_avatar() @@ -1565,7 +1193,7 @@ function bp_activity_secondary_avatar( $args = '' ) { /** * Return the avatar of the object that action was performed on. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_core_fetch_avatar() for description of arguments. * @global object $activities_template {@link BP_Activity_Template} @@ -1586,7 +1214,7 @@ function bp_activity_secondary_avatar( $args = '' ) { * @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 + * @return string The secondary avatar. */ function bp_get_activity_secondary_avatar( $args = '' ) { global $activities_template; @@ -1603,7 +1231,7 @@ function bp_activity_secondary_avatar( $args = '' ) { ) ); extract( $r, EXTR_SKIP ); - // Set item_id and object (default to user) + // Set item_id and object (default to user). switch ( $activities_template->activity->component ) { case 'groups' : if ( bp_disable_group_avatar_uploads() ) { @@ -1615,7 +1243,7 @@ function bp_activity_secondary_avatar( $args = '' ) { $link = ''; $name = ''; - // Only if groups is active + // Only if groups is active. if ( bp_is_active( 'groups' ) ) { $group = groups_get_group( array( 'group_id' => $item_id, @@ -1675,7 +1303,7 @@ function bp_activity_secondary_avatar( $args = '' ) { * 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) + * @since 1.2.10 * * @param string $object Component being displayed. */ @@ -1684,18 +1312,18 @@ function bp_activity_secondary_avatar( $args = '' ) { /** * Filters the activity secondary avatar item ID. * - * @since BuddyPress (1.2.10) + * @since 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 + // If we have no item_id or object, there is no avatar to display. if ( empty( $item_id ) || empty( $object ) ) { return false; } - // Get the avatar + // Get the avatar. $avatar = bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, @@ -1712,7 +1340,7 @@ function bp_activity_secondary_avatar( $args = '' ) { /** * Filters the secondary avatar link for current activity. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $link Link to wrap the avatar image in. * @param string $component Activity component being acted on. @@ -1722,7 +1350,7 @@ function bp_activity_secondary_avatar( $args = '' ) { /** * Filters the determined avatar for the secondary activity item. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param string $avatar Formatted HTML <img> element, or raw avatar URL. */ @@ -1742,9 +1370,9 @@ function bp_activity_secondary_avatar( $args = '' ) { /** * Output the activity action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * - * @param array $args See bp_get_activity_action() + * @param array $args See bp_get_activity_action(). * @uses bp_get_activity_action() */ function bp_activity_action( $args = array() ) { @@ -1754,10 +1382,9 @@ function bp_activity_action( $args = array() ) { /** * Return the activity action. * - * @since BuddyPress (1.2.0) + * @since 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 bp_insert_activity_meta() * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook. @@ -1778,7 +1405,7 @@ function bp_activity_action( $args = array() ) { /** * Filters the activity action before the action is inserted as meta. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param array $value Array containing the current action, the current activity, and the $args array passed into the function. */ @@ -1788,7 +1415,7 @@ function bp_activity_action( $args = array() ) { $r ) ); - // Prepend the activity action meta (link, time since, etc...) + // Prepend the activity action meta (link, time since, etc...). if ( ! empty( $action ) && empty( $r['no_timestamp'] ) ) { $action = bp_insert_activity_meta( $action ); } @@ -1796,7 +1423,7 @@ function bp_activity_action( $args = array() ) { /** * Filters the activity action after the action has been inserted as meta. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $value Array containing the current action, the current activity, and the $args array passed into the function. */ @@ -1810,7 +1437,7 @@ function bp_activity_action( $args = array() ) { /** * Output the activity content body. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_content_body() */ @@ -1821,7 +1448,7 @@ function bp_activity_content_body() { /** * Return the activity content body. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_insert_activity_meta() @@ -1832,7 +1459,7 @@ function bp_activity_content_body() { function bp_get_activity_content_body() { global $activities_template; - // Backwards compatibility if action is not being used + // Backwards compatibility if action is not being used. if ( empty( $activities_template->activity->action ) && ! empty( $activities_template->activity->content ) ) { $activities_template->activity->content = bp_insert_activity_meta( $activities_template->activity->content ); } @@ -1840,7 +1467,7 @@ function bp_activity_content_body() { /** * Filters the activity content body. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $value Array containing the current activity content body and the current activity. */ @@ -1850,7 +1477,7 @@ function bp_activity_content_body() { /** * Does the activity have content? * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @@ -1869,8 +1496,8 @@ function bp_activity_has_content() { /** * Output the activity content. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.5.0) + * @since 1.0.0 + * @deprecated 1.5.0 * * @todo properly deprecate this function. * @@ -1883,8 +1510,8 @@ function bp_activity_content() { /** * Return the activity content. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.5.0) + * @since 1.0.0 + * @deprecated 1.5.0 * * @todo properly deprecate this function. * @@ -1912,7 +1539,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.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_core_time_since() @@ -1924,22 +1551,21 @@ 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 = '' ) { global $activities_template; - // Strip any legacy time since placeholders from BP 1.0-1.1 + // Strip any legacy time since placeholders from BP 1.0-1.1. $new_content = str_replace( '<span class="time-since">%s</span>', '', $content ); - // Get the time since this activity was recorded + // Get the time since this activity was recorded. $date_recorded = bp_core_time_since( $activities_template->activity->date_recorded ); /** * Filters the activity item time since markup. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $value Array containing the time since markup and the current activity component. */ @@ -1948,10 +1574,10 @@ function bp_insert_activity_meta( $content = '' ) { &$activities_template->activity ) ); - // Insert the permalink + // Insert the permalink. if ( ! bp_is_single_activity() ) { - // Setup variables for activity meta + // 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, @@ -1963,9 +1589,10 @@ function bp_insert_activity_meta( $content = '' ) { /** * Filters the activity permalink to be added to the activity content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * - * @param array $value Array containing the html markup for the activity permalink, after being parsed by sprintf and current activity component. + * @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, @@ -1978,7 +1605,7 @@ function bp_insert_activity_meta( $content = '' ) { /** * Filters the activity content after activity metadata has been attached. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $content Activity content with the activity metadata added. */ @@ -1988,35 +1615,34 @@ function bp_insert_activity_meta( $content = '' ) { /** * Determine if the current user can delete an activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @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. - * * @return bool True if can delete, false otherwise. */ function bp_activity_user_can_delete( $activity = false ) { global $activities_template; - // Try to use current activity if none was passed + // Try to use current activity if none was passed. if ( empty( $activity ) && ! empty( $activities_template->activity ) ) { $activity = $activities_template->activity; } - // If current_comment is set, we'll use that in place of the main activity + // If current_comment is set, we'll use that in place of the main activity. if ( isset( $activity->current_comment ) ) { $activity = $activity->current_comment; } - // Assume the user cannot delete the activity item + // Assume the user cannot delete the activity item. $can_delete = false; - // Only logged in users can delete activity + // Only logged in users can delete activity. if ( is_user_logged_in() ) { - // Community moderators can always delete activity (at least for now) + // Community moderators can always delete activity (at least for now). if ( bp_current_user_can( 'bp_moderate' ) ) { $can_delete = true; } @@ -2028,7 +1654,7 @@ function bp_activity_user_can_delete( $activity = false ) { $can_delete = true; } - // Viewing a single item, and this user is an admin of that item + // Viewing a single item, and this user is an admin of that item. if ( bp_is_single_item() && bp_is_item_admin() ) { $can_delete = true; } @@ -2037,7 +1663,7 @@ function bp_activity_user_can_delete( $activity = false ) { /** * Filters whether the current user can delete an activity item. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $can_delete Whether the user can delete the item. * @param object $activity Current activity item object. @@ -2048,7 +1674,7 @@ function bp_activity_user_can_delete( $activity = false ) { /** * Output the activity parent content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_activity_parent_content() for a description of arguments. * @uses bp_get_activity_parent_content() @@ -2062,54 +1688,53 @@ function bp_activity_parent_content( $args = '' ) { /** * Return the activity content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_parent_content' hook. * * @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; - // Bail if no activity on no item ID + // 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 + // Get the ID of the parent activity content. $parent_id = (int) $activities_template->activity->item_id; - // Bail if no parent content + // Bail if no parent content. if ( empty( $activities_template->activity_parents[ $parent_id ] ) ) { return false; } - // Bail if no action + // Bail if no action. if ( empty( $activities_template->activity_parents[ $parent_id ]->action ) ) { return false; } - // Content always includes action + // Content always includes action. $content = $activities_template->activity_parents[ $parent_id ]->action; - // Maybe append activity content, if it exists + // Maybe append activity content, if it exists. 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 + // Remove the time since content for backwards compatibility. $content = str_replace( '<span class="time-since">%s</span>', '', $content ); - // Remove images + // Remove images. $content = preg_replace( '/<img[^>]*>/Ui', '', $content ); /** * Filters the activity parent content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $content Content set to be displayed as parent content. */ @@ -2119,7 +1744,7 @@ function bp_activity_parent_content( $args = '' ) { /** * Output the parent activity's user ID. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_activity_parent_user_id() { echo bp_get_activity_parent_user_id(); @@ -2128,7 +1753,7 @@ function bp_activity_parent_user_id() { /** * Return the parent activity's user ID. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Activity_Template $activities_template * @@ -2138,20 +1763,20 @@ function bp_activity_parent_user_id() { function bp_get_activity_parent_user_id() { global $activities_template; - // Bail if no activity on no item ID + // 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 + // Get the ID of the parent activity content. $parent_id = (int) $activities_template->activity->item_id; - // Bail if no parent item + // Bail if no parent item. if ( empty( $activities_template->activity_parents[ $parent_id ] ) ) { return false; } - // Bail if no parent user ID + // Bail if no parent user ID. if ( empty( $activities_template->activity_parents[ $parent_id ]->user_id ) ) { return false; } @@ -2161,7 +1786,7 @@ function bp_activity_parent_user_id() { /** * Filters the activity parent item's user ID. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param int $retval ID for the activity parent's user. */ @@ -2171,7 +1796,7 @@ function bp_activity_parent_user_id() { /** * Output whether or not the current activity is in a current user's favorites. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_is_favorite() */ @@ -2182,7 +1807,7 @@ function bp_activity_is_favorite() { /** * Return whether the current activity is in a current user's favorites. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_is_favorite' hook. @@ -2195,17 +1820,17 @@ function bp_activity_is_favorite() { /** * Filters whether the current activity item is in the current user's favorites. * - * @since BuddyPress (1.2.0) + * @since 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 ) ); + 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.0) + * @since 1.2.0 * * @todo deprecate $args param * @@ -2218,18 +1843,16 @@ function bp_activity_comments( $args = '' ) { /** * Get the comment markup for an activity item. * - * @since BuddyPress (1.2.0) + * @since 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. Left over from an earlier implementation. + * this function can probably be streamlined or removed. * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_activity_recurse_comments() * + * @param string $args Unused. Left over from an earlier implementation. * @return bool */ function bp_activity_get_comments( $args = '' ) { @@ -2248,13 +1871,12 @@ function bp_activity_comments( $args = '' ) { * 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.0) - * - * @param object $comment The activity object currently being recursed. + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses locate_template() * + * @param object $comment The activity object currently being recursed. * @return bool|string */ function bp_activity_recurse_comments( $comment ) { @@ -2271,14 +1893,14 @@ function bp_activity_comments( $args = '' ) { /** * Filters the opening tag for the template that lists activity comments. * - * @since BuddyPress (1.6.0) + * @since 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 + // Put the comment into the global so it's available to filters. $activities_template->activity->current_comment = $comment_child; $template = bp_locate_template( 'activity/comment.php', false, false ); @@ -2299,7 +1921,7 @@ function bp_activity_comments( $args = '' ) { /** * Filters the closing tag for the template that list activity comments. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Closing tag for the HTML markup to use. */ @@ -2309,7 +1931,7 @@ function bp_activity_comments( $args = '' ) { /** * Utility function that returns the comment currently being recursed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_activity_current_comment' hook. @@ -2327,7 +1949,7 @@ function bp_activity_current_comment() { /** * Filters the current comment being recursed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param object|bool $current_comment The activity comment currently being displayed. False on failure. */ @@ -2338,7 +1960,7 @@ function bp_activity_current_comment() { /** * Output the ID of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_id() */ @@ -2349,7 +1971,7 @@ function bp_activity_comment_id() { /** * Return the ID of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_activity_comment_id' hook. @@ -2365,7 +1987,7 @@ function bp_activity_comment_id() { /** * Filters the ID of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int|bool $comment_id ID for the comment currently being displayed. */ @@ -2375,7 +1997,7 @@ function bp_activity_comment_id() { /** * Output the ID of the author of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_user_id() */ @@ -2386,7 +2008,7 @@ function bp_activity_comment_user_id() { /** * Return the ID of the author of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_activity_comment_user_id' hook. @@ -2402,7 +2024,7 @@ function bp_activity_comment_user_id() { /** * Filters the ID of the author of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int|bool $user_id ID for the author of the comment currently being displayed. */ @@ -2412,7 +2034,7 @@ function bp_activity_comment_user_id() { /** * Output the author link for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_user_link() */ @@ -2423,7 +2045,7 @@ function bp_activity_comment_user_link() { /** * Return the author link for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_core_get_user_domain() * @uses bp_get_activity_comment_user_id() @@ -2437,7 +2059,7 @@ function bp_activity_comment_user_link() { /** * Filters the author link for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $user_link Link for the author of the activity comment currently being displayed. */ @@ -2447,7 +2069,7 @@ function bp_activity_comment_user_link() { /** * Output the author name for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_name() */ @@ -2461,7 +2083,7 @@ 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.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_acomment_name' hook. @@ -2474,7 +2096,7 @@ function bp_activity_comment_name() { 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 + $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; } @@ -2482,7 +2104,7 @@ function bp_activity_comment_name() { /** * Filters the name of the author for the activity comment. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $name Name to be displayed with the activity comment. */ @@ -2492,7 +2114,7 @@ function bp_activity_comment_name() { /** * Output the formatted date_recorded of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_date_recorded() */ @@ -2503,7 +2125,7 @@ function bp_activity_comment_date_recorded() { /** * Return the formatted date_recorded for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_core_time_since() * @uses apply_filters() To call the 'bp_activity_comment_date_recorded' hook. @@ -2516,7 +2138,7 @@ function bp_activity_comment_date_recorded() { /** * Filters the recorded date of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string|bool Date for the activity comment currently being displayed. */ @@ -2526,7 +2148,7 @@ function bp_activity_comment_date_recorded() { /** * Output the date_recorded of the activity comment currently being displayed. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @uses bp_get_activity_comment_date_recorded() */ @@ -2537,7 +2159,7 @@ function bp_activity_comment_date_recorded_raw() { /** * Return the date_recorded for the activity comment currently being displayed. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_core_time_since() @@ -2552,7 +2174,7 @@ function bp_activity_comment_date_recorded_raw() { /** * Filters the raw recorded date of the activity comment currently being displayed. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string|bool Raw date for the activity comment currently being displayed. */ @@ -2562,7 +2184,7 @@ function bp_activity_comment_date_recorded_raw() { /** * Output the 'delete' URL for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_delete_link() */ @@ -2573,7 +2195,7 @@ function bp_activity_comment_delete_link() { /** * Gets the 'delete' URL for the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses wp_nonce_url() * @uses bp_get_root_domain() @@ -2590,7 +2212,7 @@ function bp_activity_comment_delete_link() { /** * Filters the link used for deleting the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $link Link to use for deleting the currently displayed activity comment. */ @@ -2600,7 +2222,7 @@ function bp_activity_comment_delete_link() { /** * Output the content of the activity comment currently being displayed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activity_comment_content() */ @@ -2616,7 +2238,7 @@ function bp_activity_comment_content() { * 'bp_activity_comment_content' to modify the content of activity * comments only. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_content' hook. @@ -2633,7 +2255,7 @@ function bp_activity_comment_content() { /** * Filters the content of the current activity comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $content The content of the current activity comment. */ @@ -2643,7 +2265,7 @@ function bp_activity_comment_content() { /** * Output the activity comment count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_activity_get_comment_count() */ @@ -2654,25 +2276,24 @@ function bp_activity_comment_count() { /** * Return the comment count of an activity item. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_activity_recurse_comment_count() * @uses apply_filters() To call the 'bp_activity_get_comment_count' hook. * - * @param array $deprecated Deprecated. - * + * @param array|null $deprecated Deprecated. * @return int $count The activity comment count. */ function bp_activity_get_comment_count( $deprecated = null ) { global $activities_template; - // Deprecated notice about $args + // Deprecated notice about $args. if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '1.2', sprintf( __( '%1$s no longer accepts arguments. See the inline documentation at %2$s for more details.', 'buddypress' ), __FUNCTION__, __FILE__ ) ); } - // Get the count using the purpose-built recursive function + // Get the count using the purpose-built recursive function. $count = ! empty( $activities_template->activity->children ) ? bp_activity_recurse_comment_count( $activities_template->activity ) : 0; @@ -2680,7 +2301,7 @@ function bp_activity_comment_count() { /** * Filters the activity comment count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $count The activity comment count. */ @@ -2693,22 +2314,21 @@ 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.0) + * @since 1.2.0 * * @uses bp_activity_recurse_comment_count() * @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. - * * @return int $count The activity comment count. */ function bp_activity_recurse_comment_count( $comment, $count = 0 ) { - // Copy the count + // Copy the count. $new_count = $count; - // Loop through children and recursively count comments + // Loop through children and recursively count comments. if ( ! empty( $comment->children ) ) { foreach ( (array) $comment->children as $comment ) { $new_count++; @@ -2719,7 +2339,7 @@ function bp_activity_comment_count() { /** * Filters the total number of comments for the current comment. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param int $new_count New total count for the current comment. * @param object $comment Activity comment object. @@ -2731,7 +2351,7 @@ function bp_activity_comment_count() { /** * Output the depth of the current activity comment. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_activity_comment_depth() { echo bp_activity_get_comment_depth(); @@ -2739,7 +2359,7 @@ function bp_activity_comment_depth() { /** * Return the current activity comment depth. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return int $depth Depth for the current activity comment. */ @@ -2749,7 +2369,7 @@ function bp_activity_comment_depth() { /** * Filters the comment depth of the current activity comment. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $depth Depth for the current activity comment. */ @@ -2759,7 +2379,7 @@ function bp_activity_comment_depth() { /** * Output the activity comment link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_comment_link() */ @@ -2770,7 +2390,7 @@ function bp_activity_comment_link() { /** * Return the activity comment link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_comment_link' hook. @@ -2783,7 +2403,7 @@ function bp_activity_comment_link() { /** * Filters the comment link for the current activity comment. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Constructed URL parameters with activity IDs. */ @@ -2793,7 +2413,7 @@ function bp_activity_comment_link() { /** * Output the activity comment form no JavaScript display CSS. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_comment_form_nojs_display() */ @@ -2804,7 +2424,7 @@ function bp_activity_comment_form_nojs_display() { /** * Return the activity comment form no JavaScript display CSS. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @@ -2824,7 +2444,7 @@ function bp_activity_comment_form_nojs_display() { /** * Output the activity comment form action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_comment_form_action() */ @@ -2835,7 +2455,7 @@ function bp_activity_comment_form_action() { /** * Return the activity comment form action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses home_url() * @uses bp_get_activity_root_slug() @@ -2848,7 +2468,7 @@ function bp_activity_comment_form_action() { /** * Filters the activity comment form action URL. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value URL to use in the comment form's action attribute. */ @@ -2858,7 +2478,7 @@ function bp_activity_comment_form_action() { /** * Output the activity permalink ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_permalink_id() */ @@ -2869,7 +2489,7 @@ function bp_activity_permalink_id() { /** * Return the activity permalink ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses apply_filters() To call the 'bp_get_activity_permalink_id' hook. * @@ -2880,7 +2500,7 @@ function bp_activity_permalink_id() { /** * Filters the activity action permalink ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Current action for the activity item. */ @@ -2890,7 +2510,7 @@ function bp_activity_permalink_id() { /** * Output the activity thread permalink. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_permalink_id() */ @@ -2901,7 +2521,7 @@ function bp_activity_thread_permalink() { /** * Return the activity thread permalink. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_activity_get_permalink() * @uses apply_filters() To call the 'bp_get_activity_thread_permalink' hook. @@ -2916,17 +2536,17 @@ function bp_activity_thread_permalink() { /** * Filters the activity thread permalink. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $link The activity thread permalink. */ - return apply_filters( 'bp_get_activity_thread_permalink', $link ); + return apply_filters( 'bp_get_activity_thread_permalink', $link ); } /** * Output the activity comment permalink. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @uses bp_get_activity_permalink_id() */ @@ -2936,7 +2556,7 @@ function bp_activity_comment_permalink() { /** * Return the activity comment permalink. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @uses bp_activity_get_permalink() * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook. @@ -2946,23 +2566,23 @@ function bp_activity_comment_permalink() { function bp_get_activity_comment_permalink() { global $activities_template; - // Check that comment exists + // Check that comment exists. $comment_id = isset( $activities_template->activity->current_comment->id ) ? $activities_template->activity->current_comment->id : 0; - // Setup the comment link + // Setup the comment link. $comment_link = ! empty( $comment_id ) ? '#acomment-' .$comment_id : false; - // Append comment ID to end of activity 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) + * @since 1.8.0 * * @param string $link Activity comment permalink. * @param int $comment_id ID for the current activity comment. @@ -2973,7 +2593,7 @@ function bp_activity_comment_permalink() { /** * Output the activity favorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_favorite_link() */ @@ -2984,7 +2604,7 @@ function bp_activity_favorite_link() { /** * Return the activity favorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses wp_nonce_url() @@ -3000,7 +2620,7 @@ function bp_activity_favorite_link() { /** * Filters the activity favorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Constructed link for favoriting the activity comment. */ @@ -3010,7 +2630,7 @@ function bp_activity_favorite_link() { /** * Output the activity unfavorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_unfavorite_link() */ @@ -3021,7 +2641,7 @@ function bp_activity_unfavorite_link() { /** * Return the activity unfavorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses wp_nonce_url() @@ -3037,7 +2657,7 @@ function bp_activity_unfavorite_link() { /** * Filters the activity unfavorite link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Constructed link for unfavoriting the activity comment. */ @@ -3047,7 +2667,7 @@ function bp_activity_unfavorite_link() { /** * Output the activity CSS class. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_css_class() */ @@ -3058,7 +2678,7 @@ function bp_activity_css_class() { /** * Return the current activity item's CSS class. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_activity_mini_activity_types' hook. @@ -3074,7 +2694,7 @@ function bp_activity_css_class() { /** * Filters the available mini activity actions available as CSS classes. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $value Array of classes used to determine classes applied to HTML element. */ @@ -3100,7 +2720,7 @@ function bp_activity_css_class() { /** * Filters the determined classes to add to the HTML element. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Classes to be added to the HTML element. */ @@ -3110,7 +2730,7 @@ function bp_activity_css_class() { /** * Output the activity delete link. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses bp_get_activity_delete_link() */ @@ -3121,7 +2741,7 @@ function bp_activity_delete_link() { /** * Return the activity delete link. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_get_root_domain() @@ -3140,7 +2760,7 @@ function bp_activity_delete_link() { $url = bp_get_activity_delete_url(); $class = 'delete-activity'; - // Determine if we're on a single activity page, and customize accordingly + // Determine if we're on a single activity page, and customize accordingly. if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { $class = 'delete-activity-single'; } @@ -3150,7 +2770,7 @@ function bp_activity_delete_link() { /** * Filters the activity delete link. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $link Activity delete HTML link. */ @@ -3160,7 +2780,7 @@ function bp_activity_delete_link() { /** * Output the URL to delete a single activity stream item. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses bp_get_activity_delete_link() */ @@ -3170,7 +2790,7 @@ function bp_activity_delete_url() { /** * Return the URL to delete a single activity item. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_get_root_domain() @@ -3190,7 +2810,7 @@ function bp_activity_delete_url() { $url = trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/delete/' . $activities_template->activity->id ); - // Determine if we're on a single activity page, and customize accordingly + // Determine if we're on a single activity page, and customize accordingly. if ( bp_is_activity_component() && is_numeric( bp_current_action() ) ) { $url = add_query_arg( array( 'redirect_to' => wp_get_referer() ), $url ); } @@ -3200,7 +2820,7 @@ function bp_activity_delete_url() { /** * Filters the activity delete URL. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $url Activity delete URL. */ @@ -3210,7 +2830,7 @@ function bp_activity_delete_url() { /** * Output the activity latest update link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_activity_latest_update() for description of parameters. * @uses bp_get_activity_latest_update() @@ -3224,7 +2844,7 @@ function bp_activity_latest_update( $user_id = 0 ) { /** * Return the activity latest update link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_user_inactive() * @uses bp_core_is_user_deleted() @@ -3236,7 +2856,6 @@ function bp_activity_latest_update( $user_id = 0 ) { * @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. */ @@ -3257,7 +2876,7 @@ function bp_activity_latest_update( $user_id = 0 ) { /** * Filters the latest update excerpt. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param string $value The excerpt for the latest update. */ @@ -3273,7 +2892,7 @@ function bp_activity_latest_update( $user_id = 0 ) { /** * Filters the latest update excerpt with view link appended to the end. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $latest_update The latest update with "view" link appended to it. */ @@ -3283,7 +2902,7 @@ function bp_activity_latest_update( $user_id = 0 ) { /** * Output the activity filter links. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @see bp_get_activity_filter_links() for description of parameters. * @uses bp_get_activity_filter_links() @@ -3297,7 +2916,7 @@ function bp_activity_filter_links( $args = false ) { /** * Return the activity filter links. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses wp_parse_args() * @uses BP_Activity_Activity::get_recorded_components() {@link BP_Activity_Activity} @@ -3320,10 +2939,10 @@ function bp_activity_filter_links( $args = false ) { 'style' => 'list' ) ); - // Define local variable + // Define local variable. $component_links = array(); - // Fetch the names of components that have activity recorded in the DB + // Fetch the names of components that have activity recorded in the DB. $components = BP_Activity_Activity::get_recorded_components(); if ( empty( $components ) ) { @@ -3332,7 +2951,7 @@ function bp_activity_filter_links( $args = false ) { foreach ( (array) $components as $component ) { - // Skip the activity comment filter + // Skip the activity comment filter. if ( 'activity' == $component ) { continue; } @@ -3369,7 +2988,7 @@ function bp_activity_filter_links( $args = false ) { /** * Filters the activity filter link URL for the current activity component. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $link The URL for the current component. * @param string $component The current component getting links constructed for. @@ -3388,17 +3007,17 @@ function bp_activity_filter_links( $args = false ) { /** * Filters all of the constructed filter links. * - * @since BuddyPress (1.1.0) + * @since 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 ) ); + 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.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses bp_get_activity_action_name() @@ -3410,54 +3029,33 @@ 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 type name. + $activity_type = bp_get_activity_type(); - // Determine ability to comment based on activity action name - $activity_action = bp_get_activity_action_name(); + // Get the 'comment-reply' support for the current activity type. + $can_comment = bp_activity_type_supports( $activity_type, 'comment-reply' ); - $turn_off = 0; - if ( ! empty( $activities_template->disable_blogforum_replies ) ) { - $turn_off = 1; + // Neutralize activity_comment. + if ( 'activity_comment' === $activity_type ) { + $can_comment = false; } - $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) + * @since 1.5.0 + * @since 2.5.0 Use $activity_type instead of $activity_name for the second parameter. * * @param bool $can_comment Status on if activity can be commented on. - * @param string $activity_action Current activity action being checked on. + * @param string $activity_type Current activity type being checked on. */ - return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_action ); + return apply_filters( 'bp_activity_can_comment', $can_comment, $activity_type ); } /** * Determine whether a comment can be made on an activity reply item. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool|object $comment Activity comment. * @return bool $can_comment True if comment can receive comments, @@ -3465,26 +3063,26 @@ function bp_activity_can_comment() { */ function bp_activity_can_comment_reply( $comment = false ) { - // Assume activity can be commented on + // Assume activity can be commented on. $can_comment = true; - // Check that comment exists + // Check that comment exists. if ( empty( $comment ) ) { $comment = bp_activity_current_comment(); } if ( ! empty( $comment ) ) { - // Fall back on current comment in activity loop + // Fall back on current comment in activity loop. $comment_depth = isset( $comment->depth ) ? intval( $comment->depth ) : bp_activity_get_comment_depth(); - // Threading is turned on, so check the depth + // Threading is turned on, so check the depth. if ( get_option( 'thread_comments' ) ) { $can_comment = (bool) ( $comment_depth < get_option( 'thread_comments_depth' ) ); - // No threading for comment replies if no threading for comments + // No threading for comment replies if no threading for comments. } else { $can_comment = false; } @@ -3493,7 +3091,7 @@ function bp_activity_can_comment_reply( $comment = false ) { /** * Filters whether a comment can be made on an activity reply item. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $can_comment Status on if activity reply can be commented on. * @param string $comment Current comment being checked on. @@ -3506,7 +3104,7 @@ function bp_activity_can_comment_reply( $comment = false ) { * * Defaults to true, but can be modified by plugins. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() To call the 'bp_activity_can_favorite' hook. * @@ -3517,7 +3115,7 @@ function bp_activity_can_favorite() { /** * Filters whether or not users can favorite activity items. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $value Whether or not favoriting is enabled. */ @@ -3527,7 +3125,7 @@ function bp_activity_can_favorite() { /** * Output the total favorite count for a specified user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_total_favorite_count_for_user() for description of parameters. * @uses bp_get_total_favorite_count_for_user() @@ -3541,25 +3139,24 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) { /** * Return the total favorite count for a specified user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_activity_total_favorites_for_user() * @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; if ( bp_activity_can_favorite() ) { - // Default to displayed user if none is passed + // 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 + // Get user meta if user ID exists. if ( ! empty( $user_id ) ) { $retval = bp_activity_total_favorites_for_user( $user_id ); } @@ -3568,7 +3165,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) { /** * Filters the total favorite count for a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int|bool $retval Total favorite count for a user. False on no favorites. */ @@ -3579,7 +3176,7 @@ function bp_total_favorite_count_for_user( $user_id = 0 ) { /** * Output the total mention count for a specified user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_total_mention_count_for_user() for description of parameters. * @uses bp_get_total_favorite_count_for_user() @@ -3593,23 +3190,22 @@ function bp_total_mention_count_for_user( $user_id = 0 ) { /** * Return the total mention count for a specified user. * - * @since BuddyPress (1.2.0) + * @since 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 ) { - // Default to displayed user if none is passed + // 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 + // Get user meta if user ID exists. $retval = ! empty( $user_id ) ? bp_get_user_meta( $user_id, 'bp_new_mention_count', true ) : false; @@ -3617,7 +3213,7 @@ function bp_total_mention_count_for_user( $user_id = 0 ) { /** * Filters the total mention count for a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int|bool $retval Total mention count for a user. False on no mentions. */ @@ -3627,7 +3223,7 @@ function bp_total_mention_count_for_user( $user_id = 0 ) { /** * Output the public message link for displayed user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_send_public_message_link() */ @@ -3638,7 +3234,7 @@ function bp_send_public_message_link() { /** * Return the public message link for the displayed user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses is_user_logged_in() * @uses bp_is_my_profile() @@ -3651,7 +3247,7 @@ function bp_send_public_message_link() { */ function bp_get_send_public_message_link() { - // No link if not logged in, not looking at someone else's profile + // No link if not logged in, not looking at someone else's profile. if ( ! is_user_logged_in() || ! bp_is_user() || bp_is_my_profile() ) { $retval = ''; } else { @@ -3663,7 +3259,7 @@ function bp_send_public_message_link() { /** * Filters the public message link for the displayed user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $retval The URL for the public message link. */ @@ -3673,11 +3269,10 @@ function bp_send_public_message_link() { /** * Recurse through all activity comments and return the activity comment IDs. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @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() ) { @@ -3701,7 +3296,7 @@ function bp_activity_recurse_comments_activity_ids( $activity = array(), $activi /** * Output the mentioned user display name. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_mentioned_user_display_name() for description of parameters. * @uses bp_get_mentioned_user_display_name() @@ -3715,21 +3310,20 @@ function bp_mentioned_user_display_name( $user_id_or_username = false ) { /** * Returns the mentioned user display name. * - * @since BuddyPress (1.2.0) + * @since 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|bool User ID or username. - * + * @param int|string|bool $user_id_or_username User ID or username. * @return string The mentioned user's display name. */ function bp_get_mentioned_user_display_name( $user_id_or_username = false ) { - // Get user display name + // Get user display name. $name = bp_core_get_user_displayname( $user_id_or_username ); - // If user somehow has no name, return this really lame string + // If user somehow has no name, return this really lame string. if ( empty( $name ) ) { $name = __( 'a user', 'buddypress' ); } @@ -3737,7 +3331,7 @@ function bp_mentioned_user_display_name( $user_id_or_username = false ) { /** * Filters the mentioned user display name. * - * @since BuddyPress (1.2.0) + * @since 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. @@ -3748,7 +3342,7 @@ function bp_mentioned_user_display_name( $user_id_or_username = false ) { /** * Output button for sending a public message (an @-mention). * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @see bp_get_send_public_message_button() for description of parameters. * @uses bp_get_send_public_message_button() @@ -3762,7 +3356,7 @@ function bp_send_public_message_button( $args = '' ) { /** * Return button for sending a public message (an @-mention). * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_send_public_message_link() * @uses wp_parse_args() @@ -3803,7 +3397,7 @@ function bp_send_public_message_button( $args = '' ) { /** * Filters the public message button HTML. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param array $r Array of arguments for the public message button HTML. */ @@ -3813,7 +3407,7 @@ function bp_send_public_message_button( $args = '' ) { /** * Output the activity post form action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_activity_post_form_action() */ @@ -3824,7 +3418,7 @@ function bp_activity_post_form_action() { /** * Return the activity post form action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses home_url() * @uses bp_get_activity_root_slug() @@ -3837,7 +3431,7 @@ function bp_activity_post_form_action() { /** * Filters the action url used for the activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value URL to be used for the activity post form. */ @@ -3852,7 +3446,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.0) + * @since 1.7.0 * * @see bp_core_fetch_avatar() for a description of arguments. * @@ -3867,7 +3461,7 @@ function bp_activity_comments_user_avatars( $args = array() ) { 'width' => false, ) ); - // Get the user IDs of everyone who has left a comment to the current activity item + // Get the user IDs of everyone who has left a comment to the current activity item. $user_ids = bp_activity_get_comments_user_ids(); $output = array(); $retval = ''; @@ -3875,15 +3469,15 @@ function bp_activity_comments_user_avatars( $args = array() ) { if ( ! empty( $user_ids ) ) { foreach ( (array) $user_ids as $user_id ) { - // Skip an empty user ID + // Skip an empty user ID. if ( empty( $user_id ) ) { continue; } - // Get profile link for this user + // Get profile link for this user. $profile_link = bp_core_get_user_domain( $user_id ); - // Get avatar for this user + // Get avatar for this user. $image_html = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'height' => $r['height'], @@ -3892,13 +3486,13 @@ function bp_activity_comments_user_avatars( $args = array() ) { 'width' => $r['width'] ) ); - // If user has link & avatar, add them to the output array + // If user has link & avatar, add them to the output array. if ( ! empty( $profile_link ) && ! empty( $image_html ) ) { $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html ); } } - // If output array is not empty, wrap everything in some list items + // If output array is not empty, wrap everything in some list items. if ( ! empty( $output ) ) { $retval = '<li>' . implode( '</li><li>', $output ) . '</li>'; } @@ -3907,7 +3501,7 @@ 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) + * @since 1.7.0 * * @param string $retval HTML markup for the list of avatars. * @param array $r Array of arguments used for each avatar. @@ -3919,7 +3513,7 @@ function bp_activity_comments_user_avatars( $args = array() ) { /** * Return the IDs of every user who's left a comment on the current activity item. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return bool|array An array of IDs, or false if none are found. */ @@ -3933,7 +3527,7 @@ function bp_activity_get_comments_user_ids() { /** * Filters the list of user IDs for the current activity item. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $value Array of unique user IDs for the current activity item. */ @@ -3943,18 +3537,17 @@ function bp_activity_get_comments_user_ids() { /** * Recurse through all activity comments and collect the IDs of the users who wrote them. * - * @since BuddyPress (1.7.0) + * @since 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() ) { - // Default user ID's array + // Default user ID's array. $user_ids = array(); - // Loop through comments and try to get user ID's + // Loop through comments and try to get user ID's. if ( ! empty( $comments ) ) { foreach ( $comments as $comment ) { @@ -3964,10 +3557,10 @@ function bp_activity_get_comments_user_ids() { continue; } - // Add user ID to array + // Add user ID to array. $user_ids[] = $comment->user_id; - // Check for commentception + // Check for commentception. if ( ! empty( $comment->children ) ) { $user_ids = array_merge( $user_ids, bp_activity_recurse_comments_user_ids( $comment->children ) ); } @@ -3977,7 +3570,7 @@ function bp_activity_get_comments_user_ids() { /** * Filters the list of user IDs for the current activity comment item. * - * @since BuddyPress (2.1.0) + * @since 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. @@ -3988,7 +3581,7 @@ function bp_activity_get_comments_user_ids() { /** * Output the mentionname for the displayed user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_displayed_user_mentionname() { echo bp_get_displayed_user_mentionname(); @@ -3996,7 +3589,7 @@ function bp_displayed_user_mentionname() { /** * Get the mentionname for the displayed user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Mentionname for the displayed user, if available. */ @@ -4005,7 +3598,7 @@ function bp_displayed_user_mentionname() { /** * Filters the mentionname for the displayed user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $value The mentionanme for the displayed user. */ @@ -4015,7 +3608,7 @@ function bp_displayed_user_mentionname() { /** * Echo a list of all registered activity types for use in dropdowns or checkbox lists. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $output Optional. Either 'select' or 'checkbox'. Default: 'select'. * @param array|string $args { @@ -4036,20 +3629,20 @@ function bp_activity_types_list( $output = 'select', $args = '' ) { $activities = bp_activity_get_types(); natsort( $activities ); - // Loop through the activity types and output markup + // Loop through the activity types and output markup. foreach ( $activities as $type => $description ) { - // See if we need to preselect the current type + // See if we need to preselect the current type. $checked = checked( true, in_array( $type, (array) $args['selected'] ), false ); $selected = selected( true, in_array( $type, (array) $args['selected'] ), false ); - // Switch output based on the element + // Switch output based on the element. switch ( $output ) { case 'select' : printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $type ), $selected, esc_html( $description ) ); break; case 'checkbox' : - printf( '<label style="">%1$s<input type="checkbox" name="%2$s[]" value="%3$s" %4$s/></label>', esc_html( $description ), esc_attr( $args['checkbox_name'] ), esc_attr( $type ), $checked ); + printf( '<label style="" for="%1$s[]">%2$s<input type="checkbox" id="%1$s[]" name="%1$s[]" value="%3$s" %4$s/></label>', esc_attr( $args['checkbox_name'] ), esc_html( $description ), esc_attr( $args['checkbox_name'] ), esc_attr( $args['checkbox_name'] ), esc_attr( $type ), $checked ); break; } @@ -4059,7 +3652,7 @@ function bp_activity_types_list( $output = 'select', $args = '' ) { * 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) + * @since 1.7.0 * * @param array $args Array of arguments passed into function. * @param string $type Activity type being rendered in the output. @@ -4068,7 +3661,7 @@ function bp_activity_types_list( $output = 'select', $args = '' ) { do_action( 'bp_activity_types_list_' . $output, $args, $type, $description ); } - // Backpat with BP-Default for dropdown boxes only + // Backpat with BP-Default for dropdown boxes only. if ( 'select' === $output ) { do_action( 'bp_activity_filter_options' ); } @@ -4080,7 +3673,7 @@ function bp_activity_types_list( $output = 'select', $args = '' ) { /** * Output the sitewide activity feed link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_sitewide_activity_feed_link() */ @@ -4091,7 +3684,7 @@ function bp_sitewide_activity_feed_link() { /** * Returns the sitewide activity feed link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses home_url() * @uses bp_get_activity_root_slug() @@ -4104,7 +3697,7 @@ function bp_sitewide_activity_feed_link() { /** * Filters the sidewide activity feed link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value The feed link for sitewide activity. */ @@ -4114,7 +3707,7 @@ function bp_sitewide_activity_feed_link() { /** * Output the member activity feed link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_member_activity_feed_link() */ @@ -4125,8 +3718,8 @@ function bp_member_activity_feed_link() { /** * Output the member activity feed link. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.2.0) + * @since 1.0.0 + * @deprecated 1.2.0 * * @todo properly deprecate in favor of bp_member_activity_feed_link(). * @@ -4137,7 +3730,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link /** * Return the member activity feed link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_is_profile_component() * @uses bp_is_current_action() @@ -4152,27 +3745,27 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link */ function bp_get_member_activity_feed_link() { - // Single member activity feed link + // Single member activity feed link. if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) { $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/'; - // Friend feed link + // Friend feed link. } elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) { $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/'; - // Group feed link + // Group feed link. } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/'; - // Favorites activity feed link + // Favorites activity feed link. } elseif ( 'favorites' === bp_current_action() ) { $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/'; - // Mentions activity feed link + // Mentions activity feed link. } elseif ( ( 'mentions' === bp_current_action() ) && bp_activity_do_mentions() ) { $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed/'; - // No feed link + // No feed link. } else { $link = ''; } @@ -4180,7 +3773,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link /** * Filters the member activity feed link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $link URL for the member activity feed. */ @@ -4190,8 +3783,8 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link /** * Return the member activity feed link. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.2.0) + * @since 1.0.0 + * @deprecated 1.2.0 * * @todo properly deprecate in favor of bp_get_member_activity_feed_link(). * @@ -4207,7 +3800,7 @@ function bp_activities_member_rss_link() { echo bp_get_member_activity_feed_link /** * Outputs the activity feed item guid. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_activity_feed_item_guid() */ @@ -4218,7 +3811,7 @@ function bp_activity_feed_item_guid() { /** * Returns the activity feed item guid. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_feed_item_guid' hook. @@ -4231,7 +3824,7 @@ function bp_activity_feed_item_guid() { /** * Filters the activity feed item guid. * - * @since BuddyPress (1.1.3) + * @since 1.1.3 * * @param string $value Calculated md5 value for the activity feed item. */ @@ -4241,7 +3834,7 @@ function bp_activity_feed_item_guid() { /** * Output the activity feed item title. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_feed_item_title() */ @@ -4252,7 +3845,7 @@ function bp_activity_feed_item_title() { /** * Return the activity feed item title. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses ent2ncr() @@ -4285,7 +3878,7 @@ function bp_activity_feed_item_title() { /** * Filters the activity feed item title. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $title The title for the activity feed item. */ @@ -4295,7 +3888,7 @@ function bp_activity_feed_item_title() { /** * Output the activity feed item link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_feed_item_link() */ @@ -4306,7 +3899,7 @@ function bp_activity_feed_item_link() { /** * Return the activity feed item link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_feed_item_link' hook. @@ -4323,7 +3916,7 @@ function bp_activity_feed_item_link() { /** * Filters the activity feed item link. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $retval The URL for the activity feed item. */ @@ -4333,7 +3926,7 @@ function bp_activity_feed_item_link() { /** * Output the activity feed item date. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_feed_item_date() */ @@ -4344,7 +3937,7 @@ function bp_activity_feed_item_date() { /** * Return the activity feed item date. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses apply_filters() To call the 'bp_get_activity_feed_item_date' hook. @@ -4361,7 +3954,7 @@ function bp_activity_feed_item_date() { /** * Filters the activity feed item date. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $retval The date for the activity feed item. */ @@ -4371,7 +3964,7 @@ function bp_activity_feed_item_date() { /** * Output the activity feed item description. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_get_activity_feed_item_description() */ @@ -4382,7 +3975,7 @@ function bp_activity_feed_item_description() { /** * Return the activity feed item description. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $activities_template {@link BP_Activity_Template} * @uses ent2ncr() @@ -4394,12 +3987,12 @@ function bp_activity_feed_item_description() { function bp_get_activity_feed_item_description() { global $activities_template; - // Get the content, if exists + // Get the content, if exists. $content = ! empty( $activities_template->activity->content ) ? $activities_template->activity->content : ''; - // Perform a few string conversions on the content, if it's not empty + // Perform a few string conversions on the content, if it's not empty. if ( ! empty( $content ) ) { $content = ent2ncr( convert_chars( str_replace( '%s', '', $content ) ) ); } @@ -4407,7 +4000,7 @@ function bp_activity_feed_item_description() { /** * Filters the activity feed item description. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $content The description for the activity feed item. */ @@ -4417,7 +4010,7 @@ function bp_activity_feed_item_description() { /** * Template tag so we can hook activity feed to <head>. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bloginfo() * @uses bp_sitewide_activity_feed_link() @@ -4434,10 +4027,10 @@ add_action( 'bp_head', 'bp_activity_sitewide_feed' ); /** * Display available filters depending on the scope. * - * @since BuddyPress (2.1.0) + * @since 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 = '' ) { @@ -4446,19 +4039,19 @@ function bp_activity_show_filters( $context = '' ) { /** * Get available filters depending on the scope. * - * @since BuddyPress (2.1.0) + * @since 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 = '' ) { - // Set default context based on current page + // Set default context based on current page. if ( empty( $context ) ) { // On member pages, default to 'member', unless this - // is a user's Groups activity + // is a user's Groups activity. if ( bp_is_user() ) { if ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { $context = 'member_groups'; @@ -4466,11 +4059,11 @@ function bp_activity_show_filters( $context = '' ) { $context = 'member'; } - // On individual group pages, default to 'group' + // On individual group pages, default to 'group'. } elseif ( bp_is_active( 'groups' ) && bp_is_group() ) { $context = 'group'; - // 'activity' everywhere else + // 'activity' everywhere else. } else { $context = 'activity'; } @@ -4486,7 +4079,7 @@ function bp_activity_show_filters( $context = '' ) { continue; } - // Friends activity collapses two filters into one + // Friends activity collapses two filters into one. if ( in_array( $action['key'], array( 'friendship_accepted', 'friendship_created' ) ) ) { $action['key'] = 'friendship_accepted,friendship_created'; } @@ -4498,14 +4091,14 @@ function bp_activity_show_filters( $context = '' ) { /** * Filters the options available in the activity filter dropdown. * - * @since BuddyPress (2.2.0) + * @since 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'. */ $filters = apply_filters( 'bp_get_activity_show_filters_options', $filters, $context ); - // Build the options output + // Build the options output. $output = ''; if ( ! empty( $filters ) ) { @@ -4517,7 +4110,7 @@ function bp_activity_show_filters( $context = '' ) { /** * Filters the HTML markup result for the activity filter dropdown. * - * @since BuddyPress (2.1.0) + * @since 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. 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 index e6040fbfede7e29332128be1791c44e954447a7d..a4e82ba8c8126d57fec51496aa47870074d73378 100644 --- 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 @@ -4,18 +4,18 @@ * * @package BuddyPress * @subpackage Activity + * @since 1.0.0 */ -// Exit if accessed directly +// 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) + * @since 1.0.0 */ class BP_Activity_Activity { @@ -24,6 +24,7 @@ class BP_Activity_Activity { /** * ID of the activity item. * + * @since 1.0.0 * @var int */ var $id; @@ -31,6 +32,7 @@ class BP_Activity_Activity { /** * ID of the associated item. * + * @since 1.0.0 * @var int */ var $item_id; @@ -38,6 +40,7 @@ class BP_Activity_Activity { /** * ID of the associated secondary item. * + * @since 1.0.0 * @var int */ var $secondary_item_id; @@ -45,6 +48,7 @@ class BP_Activity_Activity { /** * ID of user associated with the activity item. * + * @since 1.0.0 * @var int */ var $user_id; @@ -52,6 +56,7 @@ class BP_Activity_Activity { /** * The primary URL for the activity in RSS feeds. * + * @since 1.0.0 * @var string */ var $primary_link; @@ -59,6 +64,7 @@ class BP_Activity_Activity { /** * BuddyPress component the activity item relates to. * + * @since 1.2.0 * @var string */ var $component; @@ -66,6 +72,7 @@ class BP_Activity_Activity { /** * Activity type, eg 'new_blog_post'. * + * @since 1.2.0 * @var string */ var $type; @@ -73,6 +80,7 @@ class BP_Activity_Activity { /** * Description of the activity, eg 'Alex updated his profile.'. * + * @since 1.2.0 * @var string */ var $action; @@ -80,6 +88,7 @@ class BP_Activity_Activity { /** * The content of the activity item. * + * @since 1.2.0 * @var string */ var $content; @@ -87,6 +96,7 @@ class BP_Activity_Activity { /** * The date the activity item was recorded, in 'Y-m-d h:i:s' format. * + * @since 1.0.0 * @var string */ var $date_recorded; @@ -94,6 +104,7 @@ class BP_Activity_Activity { /** * Whether the item should be hidden in sitewide streams. * + * @since 1.1.0 * @var int */ var $hide_sitewide = false; @@ -101,6 +112,7 @@ class BP_Activity_Activity { /** * Node boundary start for activity or activity comment. * + * @since 1.5.0 * @var int */ var $mptt_left; @@ -108,6 +120,7 @@ class BP_Activity_Activity { /** * Node boundary end for activity or activity comment. * + * @since 1.5.0 * @var int */ var $mptt_right; @@ -115,6 +128,7 @@ class BP_Activity_Activity { /** * Whether this item is marked as spam. * + * @since 1.6.0 * @var int */ var $is_spam; @@ -122,6 +136,8 @@ class BP_Activity_Activity { /** * Constructor method. * + * @since 1.5.0 + * * @param int|bool $id Optional. The ID of a specific activity item. */ public function __construct( $id = false ) { @@ -133,6 +149,8 @@ class BP_Activity_Activity { /** * Populate the object with data about the specific activity item. + * + * @since 1.0.0 */ public function populate() { global $wpdb; @@ -163,17 +181,17 @@ class BP_Activity_Activity { $this->is_spam = $row->is_spam; } - // Generate dynamic 'action' when possible + // 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 + // 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 + // Provide a fallback to avoid PHP notices. } else { $this->action = ''; } @@ -182,6 +200,8 @@ class BP_Activity_Activity { /** * Save the activity item to the database. * + * @since 1.0.0 + * * @return bool True on success. */ public function save() { @@ -209,7 +229,7 @@ class BP_Activity_Activity { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Activity_Activity $this Current instance of the activity item being saved. Passed by reference. */ @@ -234,11 +254,11 @@ class BP_Activity_Activity { return false; } - // If this is a new activity item, set the $id property + // 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. + // 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' ); } @@ -246,7 +266,7 @@ class BP_Activity_Activity { /** * Fires after an activity item has been saved to the database. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Activity_Activity $this Current instance of activity item being saved. Passed by reference. */ @@ -260,6 +280,9 @@ class BP_Activity_Activity { /** * Get activity items, as specified by parameters. * + * @since 1.2.0 + * @since 2.4.0 Introduced the `$fields` parameter. + * * @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' @@ -267,11 +290,12 @@ class BP_Activity_Activity { * * @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 $fields Activity fields to return. Pass 'ids' to get only the activity IDs. + * 'all' returns full activity objects. * @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. @@ -290,13 +314,13 @@ class BP_Activity_Activity { * 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 + * - '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 + // 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__ ) ); @@ -320,53 +344,54 @@ class BP_Activity_Activity { $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, + 'page' => 1, // The current page. + 'per_page' => 25, // Activity items per page. + 'max' => false, // Max number of items to return. + 'fields' => 'all', // Fields to include. + '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, // Whether or not to update meta cache. + 'count_total' => false, // Whether or not to use count_total. ) ); - // Select conditions + // Select conditions. $select_sql = "SELECT DISTINCT a.id"; $from_sql = " FROM {$bp->activity->table_name} a"; $join_sql = ''; - // Where conditions + // Where conditions. $where_conditions = array(); - // Excluded types + // Excluded types. $excluded_types = array(); - // Scope takes precedence + // 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 + // 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 + // Override some arguments if needed. if ( ! empty( $scope_query['override'] ) ) { $r = self::array_replace_recursive( $r, $scope_query['override'] ); } - // Advanced filtering + // Advanced filtering. } elseif ( ! empty( $r['filter_query'] ) ) { $filter_query = new BP_Activity_Query( $r['filter_query'] ); $sql = $filter_query->get_sql(); @@ -375,25 +400,25 @@ class BP_Activity_Activity { } } - // Regular filtering + // Regular filtering. if ( $r['filter'] && $filter_sql = BP_Activity_Activity::get_filter_sql( $r['filter'] ) ) { $where_conditions['filter_sql'] = $filter_sql; } - // Spam + // 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 + // 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 + // Sorting. $sort = $r['sort']; if ( $sort != 'ASC' && $sort != 'DESC' ) { $sort = 'DESC'; @@ -404,19 +429,19 @@ class BP_Activity_Activity { $where_conditions['hidden_sql'] = "a.hide_sitewide = 0"; } - // Exclude specified items + // 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 + // 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 + // Process meta_query into SQL. $meta_query_sql = self::get_meta_query_sql( $r['meta_query'] ); if ( ! empty( $meta_query_sql['join'] ) ) { @@ -427,7 +452,7 @@ class BP_Activity_Activity { $where_conditions[] = $meta_query_sql['where']; } - // Process date_query into SQL + // Process date_query into SQL. $date_query_sql = self::get_date_query_sql( $r['date_query'] ); if ( ! empty( $date_query_sql ) ) { @@ -442,12 +467,12 @@ class BP_Activity_Activity { } // Exclude 'last_activity' items unless the 'action' filter has - // been explicitly set + // been explicitly set. if ( empty( $r['filter']['object'] ) ) { $excluded_types[] = 'last_activity'; } - // Build the excluded type sql part + // 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})"; @@ -456,7 +481,7 @@ class BP_Activity_Activity { /** * Filters the MySQL WHERE conditions for the Activity items get method. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param array $where_conditions Current conditions for MySQL WHERE statement. * @param array $r Parsed arguments passed into method. @@ -466,22 +491,35 @@ class BP_Activity_Activity { */ $where_conditions = apply_filters( 'bp_activity_get_where_conditions', $where_conditions, $r, $select_sql, $from_sql, $join_sql ); - // Join the where conditions together + // Join the where conditions together. $where_sql = 'WHERE ' . join( ' AND ', $where_conditions ); + /** + * Filter the MySQL JOIN clause for the main activity query. + * + * @since 2.5.0 + * + * @param string $join_sql JOIN clause. + * @param array $r Method parameters. + * @param string $select_sql Current SELECT MySQL statement. + * @param string $from_sql Current FROM MySQL statement. + * @param string $where_sql Current WHERE MySQL statement. + */ + $join_sql = apply_filters( 'bp_activity_get_join_sql', $join_sql, $r, $select_sql, $from_sql, $where_sql ); + /** * Filters the preferred order of indexes for activity item. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param array Array of indexes in preferred order. + * @param array $value 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 + break; // Take the first one we find. } } @@ -491,7 +529,7 @@ class BP_Activity_Activity { $index_hint_sql = ''; } - // Sanitize page and per_page parameters + // Sanitize page and per_page parameters. $page = absint( $r['page'] ); $per_page = absint( $r['per_page'] ); @@ -506,7 +544,7 @@ class BP_Activity_Activity { * * It is not recommended to use the legacy structure, but allowed to if needed. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param bool $value Whether to use legacy structure or not. * @param BP_Activity_Activity $value Current method being called. @@ -514,22 +552,22 @@ class BP_Activity_Activity { */ if ( apply_filters( 'bp_use_legacy_activity_query', false, __METHOD__, $r ) ) { - // Legacy queries joined against the user table + // 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 ) ); + /** 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}, a.id {$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) + * @since 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. @@ -537,23 +575,23 @@ class BP_Activity_Activity { * @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 ) ); + $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}, a.id {$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}"; + // Query first for activity IDs. + $activity_ids_sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} ORDER BY a.date_recorded {$sort}, a.id {$sort}"; if ( ! empty( $per_page ) && ! empty( $page ) ) { // We query for $per_page + 1 items in order to - // populate the has_more_items flag + // 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) + * @since 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. @@ -565,46 +603,52 @@ class BP_Activity_Activity { $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 + // 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 ); + if ( 'ids' === $r['fields'] ) { + $activities = array_map( 'intval', $activity_ids ); + } else { + $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 ); + if ( 'ids' !== $r['fields'] ) { + // 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; - } + // 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 ( ! 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'] ); - } + 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 ); + // 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 ); + // 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 $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) + * @since 1.5.0 * * @param string $value MySQL statement used to query for total activities. * @param string $where_sql MySQL WHERE statement portion. @@ -628,53 +672,52 @@ class BP_Activity_Activity { /** * Convert activity IDs to activity objects, as expected in template loop. * - * @since BuddyPress (2.0.0) + * @since 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 + // Bail if no activity ID's passed. if ( empty( $activity_ids ) ) { return array(); } - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); $activities = array(); $uncached_ids = bp_get_non_cached_ids( $activity_ids, 'bp_activity' ); - // Prime caches as necessary + // Prime caches as necessary. if ( ! empty( $uncached_ids ) ) { - // Format the activity ID's for use in the query below + // 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 + // 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 + // 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 + // Now fetch data from the cache. foreach ( $activity_ids as $activity_id ) { $activities[] = wp_cache_get( $activity_id, 'bp_activity' ); } - // Then fetch user data + // 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 + // 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 ] : ''; @@ -693,10 +736,9 @@ class BP_Activity_Activity { /** * Append xProfile fullnames to an activity array. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Activities array. - * * @return array */ protected static function append_user_fullnames( $activities ) { @@ -734,10 +776,9 @@ class BP_Activity_Activity { * 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) + * @since 2.0.0 * * @param array $activities Array of activities. - * * @return array $activities Array of activities. */ protected static function prefetch_object_data( $activities ) { @@ -745,7 +786,7 @@ class BP_Activity_Activity { /** * Filters inside prefetch_object_data method to aid in pre-fetching object data associated with activity item. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Array of activities. */ @@ -760,10 +801,9 @@ class BP_Activity_Activity { * registered), the static 'action' value pulled from the database will * be left in place. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Array of activities. - * * @return array */ protected static function generate_action_strings( $activities ) { @@ -788,11 +828,10 @@ class BP_Activity_Activity { * WP_Query, we have to alter the return value (stripping the leading * AND keyword from the 'where' clause). * - * @since BuddyPress (1.8.0) + * @since 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() ) { @@ -807,12 +846,12 @@ class BP_Activity_Activity { $activity_meta_query = new WP_Meta_Query( $meta_query ); // WP_Meta_Query expects the table name at - // $wpdb->activitymeta + // $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() + // Strip the leading AND - BP handles it in get(). $sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] ); $sql_array['join'] = $meta_sql['join']; } @@ -829,18 +868,17 @@ class BP_Activity_Activity { * WP_Query, we have to alter the return value (stripping the leading AND * keyword from the query). * - * @since BuddyPress (2.1.0) + * @since 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. + if ( ! empty( $date_query ) && is_array( $date_query ) ) { $date_query = new BP_Date_Query( $date_query, 'date_recorded' ); $sql = preg_replace( '/^\sAND/', '', $date_query->get_sql() ); } @@ -856,41 +894,40 @@ class BP_Activity_Activity { * * Can handle multiple scopes. * - * @since BuddyPress (2.2.0) + * @since 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 + // Define arrays for future use. $query_args = array(); $override = array(); $retval = array(); - // Check for array of scopes + // Check for array of scopes. if ( is_array( $scope ) ) { $scopes = $scope; - // Explode a comma separated string of scopes + // Explode a comma separated string of scopes. } elseif ( is_string( $scope ) ) { $scopes = explode( ',', $scope ); } - // Bail if no scope passed + // Bail if no scope passed. if ( empty( $scopes ) ) { return false; } - // Helper to easily grab the 'user_id' + // 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! + // Parse each scope; yes! we handle multiples! foreach ( $scopes as $scope ) { $scope_args = array(); @@ -905,30 +942,30 @@ class BP_Activity_Activity { * - bp_groups_filter_activity_scope() - used for 'groups' scope * - bp_friends_filter_activity_scope() - used for 'friends' scope * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param array { + * @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. + * @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 + // 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 + // Save scope args. if ( ! empty( $scope_args ) ) { $query_args[] = $scope_args; } @@ -936,7 +973,7 @@ class BP_Activity_Activity { } if ( ! empty( $query_args ) ) { - // set relation to OR + // Set relation to OR. $query_args['relation'] = 'OR'; $query = new BP_Activity_Query( $query_args ); @@ -958,7 +995,7 @@ class BP_Activity_Activity { * * As of 1.5.x, use BP_Activity_Activity::get() with an 'in' parameter instead. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @deprecated 1.5 * @deprecated Use BP_Activity_Activity::get() with an 'in' parameter instead. @@ -969,7 +1006,6 @@ class BP_Activity_Activity { * @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 ) { @@ -980,6 +1016,10 @@ class BP_Activity_Activity { /** * Get the first activity ID that matches a set of criteria. * + * @since 1.2.0 + * + * @todo Should parameters be optional? + * * @param int $user_id User ID to filter by. * @param string $component Component to filter by. * @param string $type Activity type to filter by. @@ -988,9 +1028,6 @@ class BP_Activity_Activity { * @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 ) { @@ -1046,7 +1083,7 @@ class BP_Activity_Activity { * To delete a specific activity item, pass an 'id' parameter. * Otherwise use the filters. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $args { * @int $id Optional. The ID of a specific item to delete. @@ -1061,7 +1098,6 @@ class BP_Activity_Activity { * @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() ) { @@ -1082,89 +1118,89 @@ class BP_Activity_Activity { 'hide_sitewide' => false ) ); - // Setup empty array from where query arguments + // Setup empty array from where query arguments. $where_args = array(); - // ID + // ID. if ( ! empty( $r['id'] ) ) { $where_args[] = $wpdb->prepare( "id = %d", $r['id'] ); } - // User ID + // User ID. if ( ! empty( $r['user_id'] ) ) { $where_args[] = $wpdb->prepare( "user_id = %d", $r['user_id'] ); } - // Action + // Action. if ( ! empty( $r['action'] ) ) { $where_args[] = $wpdb->prepare( "action = %s", $r['action'] ); } - // Content + // Content. if ( ! empty( $r['content'] ) ) { $where_args[] = $wpdb->prepare( "content = %s", $r['content'] ); } - // Component + // Component. if ( ! empty( $r['component'] ) ) { $where_args[] = $wpdb->prepare( "component = %s", $r['component'] ); } - // Type + // Type. if ( ! empty( $r['type'] ) ) { $where_args[] = $wpdb->prepare( "type = %s", $r['type'] ); } - // Primary Link + // Primary Link. if ( ! empty( $r['primary_link'] ) ) { $where_args[] = $wpdb->prepare( "primary_link = %s", $r['primary_link'] ); } - // Item ID + // Item ID. if ( ! empty( $r['item_id'] ) ) { $where_args[] = $wpdb->prepare( "item_id = %d", $r['item_id'] ); } - // Secondary 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 + // Date Recorded. if ( ! empty( $r['date_recorded'] ) ) { $where_args[] = $wpdb->prepare( "date_recorded = %s", $r['date_recorded'] ); } - // Hidden sitewide + // Hidden sitewide. if ( ! empty( $r['hide_sitewide'] ) ) { $where_args[] = $wpdb->prepare( "hide_sitewide = %d", $r['hide_sitewide'] ); } - // Bail if no where arguments + // Bail if no where arguments. if ( empty( $where_args ) ) { return false; } - // Join the where arguments for querying + // Join the where arguments for querying. $where_sql = 'WHERE ' . join( ' AND ', $where_args ); - // Fetch all activities being deleted so we can perform more actions + // 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) + * @since 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 + // Attempt to delete activities from the database. $deleted = $wpdb->query( "DELETE FROM {$bp->activity->table_name} {$where_sql}" ); - // Bail if nothing was deleted + // Bail if nothing was deleted. if ( empty( $deleted ) ) { return false; } @@ -1172,41 +1208,41 @@ class BP_Activity_Activity { /** * Action to allow intercepting activity items just deleted. * - * @since BuddyPress (2.3.0) + * @since 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 + // 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 + // Handle accompanying activity comments and meta deletion. if ( ! empty( $activity_ids ) ) { - // Delete all activity meta entries for activity items + // Delete all activity meta entries for activity items. BP_Activity_Activity::delete_activity_meta_entries( $activity_ids ); - // Setup empty array for comments + // Setup empty array for comments. $comment_ids = array(); - // Loop through activity ids and attempt to delete comments + // Loop through activity ids and attempt to delete comments. foreach ( $activity_ids as $activity_id ) { - // Attempt to delete comments + // Attempt to delete comments. $comments = BP_Activity_Activity::delete( array( 'type' => 'activity_comment', 'item_id' => $activity_id ) ); - // Merge IDs together + // Merge IDs together. if ( ! empty( $comments ) ) { $comment_ids = array_merge( $comment_ids, $comments ); } } - // Merge activity IDs with any deleted comment IDs + // Merge activity IDs with any deleted comment IDs. if ( ! empty( $comment_ids ) ) { $activity_ids = array_unique( array_merge( $activity_ids, $comment_ids ) ); } @@ -1221,12 +1257,12 @@ class BP_Activity_Activity { * 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) + * @since 1.2.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? + * @deprecated 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 ) { @@ -1238,7 +1274,7 @@ class BP_Activity_Activity { $activity_ids = implode( ',', wp_parse_id_list( $activity_ids ) ); if ( $delete_meta ) { - // Fetch the activity comment IDs for our deleted activity items + // 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 ) ) { @@ -1252,10 +1288,9 @@ class BP_Activity_Activity { /** * Delete the meta entries associated with a set of activity items. * - * @since BuddyPress (1.2.0) + * @since 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() ) { @@ -1271,13 +1306,12 @@ class BP_Activity_Activity { /** * Append activity comments to their associated activity items. * - * @since BuddyPress (1.2.0) + * @since 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' ) { @@ -1289,7 +1323,7 @@ class BP_Activity_Activity { $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 + // 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]; @@ -1302,7 +1336,7 @@ class BP_Activity_Activity { /** * Get activity comments that are associated with a specific activity ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global wpdb $wpdb WordPress database object. * @@ -1311,7 +1345,6 @@ class BP_Activity_Activity { * @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 ) { @@ -1324,27 +1357,27 @@ class BP_Activity_Activity { $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 + // activity item has no comments. if ( 'none' === $comments ) { $comments = false; - // A true cache miss + // A true cache miss. } elseif ( empty( $comments ) ) { $bp = buddypress(); - // Select the user's fullname with the query + // 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 + // Prevent debug errors. } else { $fullname_select = $fullname_from = $fullname_where = ''; } - // Don't retrieve activity comments marked as spam + // Don't retrieve activity comments marked as spam. if ( 'ham_only' == $spam ) { $spam_sql = 'AND a.is_spam = 0'; } elseif ( 'spam_only' == $spam ) { @@ -1353,13 +1386,13 @@ class BP_Activity_Activity { $spam_sql = ''; } - // Legacy query - not recommended + // Legacy query - not recommended. $func_args = func_get_args(); /** * Filters if BuddyPress should use the legacy activity query. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -1370,7 +1403,7 @@ class BP_Activity_Activity { /** * Filters the MySQL prepared statement for the legacy activity query. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Prepared statement for the activity query. * @param int $activity_id Activity ID to fetch comments for. @@ -1382,8 +1415,8 @@ class BP_Activity_Activity { $descendants = $wpdb->get_results( $sql ); - // We use the mptt BETWEEN clause to limit returned - // descendants to the correct part of the tree. + // 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 ); @@ -1394,41 +1427,46 @@ class BP_Activity_Activity { $ref = array(); - // Loop descendants and build an assoc 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 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 + // 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 + // 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 + // 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; + // If the direct parent is not an activity update, that means we've reached + // the parent activity item (eg. new_blog_post). + if ( 'activity_update' !== $direct_parent->type ) { + $parent_id = $r->item_id; + + } else { + $parent_id = $direct_parent->secondary_item_id; + } + } else { - // Something went wrong - // Short-circuit the - // depth calculation + // Something went wrong. Short-circuit the depth calculation. $parent_id = $r->item_id; } } else { @@ -1457,52 +1495,51 @@ class BP_Activity_Activity { /** * Rebuild nested comment tree under an activity or activity comment. * - * @since BuddyPress (1.2.0) + * @since 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. + * @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 + // The right value of this node is the left value + 1. $right = intval( $left + 1 ); - // Get all descendants of this node + // 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 + // 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 + // 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 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) + * @since 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 ) { @@ -1516,12 +1553,13 @@ class BP_Activity_Activity { /** * 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. + * @since 1.2.0 * + * @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 ) { @@ -1541,8 +1579,9 @@ class BP_Activity_Activity { /** * Get sitewide activity items for use in an RSS feed. * - * @param int $limit Optional. Number of items to fetch. Default: 35. + * @since 1.0.0 * + * @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 ) { @@ -1563,35 +1602,34 @@ class BP_Activity_Activity { /** * Create SQL IN clause for filter queries. * - * @since BuddyPress (1.5.0) + * @since 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. + * @return string|bool */ public static function get_in_operator_sql( $field, $items ) { global $wpdb; - // split items at the comma + // Split items at the comma. if ( ! is_array( $items ) ) { $items = explode( ',', $items ); } - // array of prepared integers or quoted strings + // Array of prepared integers or quoted strings. $items_prepared = array(); - // clean up and format each item + // Clean up and format each item. foreach ( $items as $item ) { - // clean up the string + // Clean up the string. $item = trim( $item ); - // pass everything through prepare for security and to safely quote strings + // 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 + // Build IN operator sql syntax. if ( count( $items_prepared ) ) return sprintf( '%s IN ( %s )', trim( $field ), implode( ',', $items_prepared ) ); else @@ -1601,12 +1639,12 @@ class BP_Activity_Activity { /** * Create filter SQL clauses. * - * @since BuddyPress (1.5.0) + * @since 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|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 @@ -1621,7 +1659,6 @@ class BP_Activity_Activity { * 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 ) { @@ -1664,8 +1701,8 @@ class BP_Activity_Activity { } 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 + // 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}'"; @@ -1681,7 +1718,7 @@ class BP_Activity_Activity { /** * Get the date/time of last recorded activity. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @return string ISO timestamp. */ @@ -1696,29 +1733,29 @@ class BP_Activity_Activity { /** * Get favorite count for a given user. * - * @since BuddyPress (1.2.0) + * @since 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 + // 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 + // No favorites. return 0; } /** * Check whether an activity item exists with a given string content. * - * @param string $content The content to filter by. + * @since 1.1.0 * + * @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 ) { @@ -1732,8 +1769,9 @@ class BP_Activity_Activity { /** * Hide all activity for a given user. * - * @param int $user_id The ID of the user whose activity you want to mark hidden. + * @since 1.2.0 * + * @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 ) { @@ -1747,7 +1785,7 @@ class BP_Activity_Activity { /** * PHP-agnostic version of {@link array_replace_recursive()}. * - * array_replace_recursive() is a PHP 5.3 function. BuddyPress (and + * The array_replace_recursive() function 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. * @@ -1756,13 +1794,12 @@ class BP_Activity_Activity { * * Subject to removal once WordPress makes PHP 5.3.0 the minimum requirement. * - * @since BuddyPress (2.2.0) + * @since 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() ) { @@ -1771,7 +1808,7 @@ class BP_Activity_Activity { } // PHP 5.2-compatible version - // http://php.net/manual/en/function.array-replace-recursive.php#109390 + // 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 ); diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-component.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-component.php new file mode 100644 index 0000000000000000000000000000000000000000..246b3e55bfd847fa4deb0c193d56a911b613420c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-component.php @@ -0,0 +1,393 @@ +<?php +/** + * BuddyPress Activity Streams Loader. + * + * An activity stream component, for users, groups, and site tracking. + * + * @package BuddyPress + * @subpackage ActivityCore + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Main Activity Class. + * + * @since 1.5.0 + */ +class BP_Activity_Component extends BP_Component { + + /** + * Start the activity component setup process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'activity', + __( 'Activity Streams', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 10, + 'search_query_arg' => 'activity_search', + ) + ); + } + + /** + * Include component files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes( $includes = array() ) { + + // Files to include. + $includes = array( + 'cssjs', + 'actions', + 'screens', + 'filters', + 'classes', + 'template', + 'functions', + 'notifications', + 'cache' + ); + + // Load Akismet support if Akismet is configured. + $akismet_key = bp_get_option( 'wordpress_api_key' ); + + /** 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'; + } + + if ( is_admin() ) { + $includes[] = 'admin'; + } + + parent::includes( $includes ); + } + + /** + * Set up component global variables. + * + * The BP_ACTIVITY_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @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_ACTIVITY_SLUG' ) ) { + define( 'BP_ACTIVITY_SLUG', $this->id ); + } + + // Global tables for activity component. + $global_tables = array( + 'table_name' => $bp->table_prefix . 'bp_activity', + 'table_name_meta' => $bp->table_prefix . 'bp_activity_meta', + ); + + // Metadata tables for groups component. + $meta_tables = array( + 'activity' => $bp->table_prefix . 'bp_activity_meta', + ); + + // All globals for activity component. + // Note that global_tables is included in this array. + $args = array( + 'slug' => BP_ACTIVITY_SLUG, + 'root_slug' => isset( $bp->pages->activity->slug ) ? $bp->pages->activity->slug : BP_ACTIVITY_SLUG, + 'has_directory' => true, + 'directory_title' => _x( 'Site-Wide Activity', 'component directory title', 'buddypress' ), + 'notification_callback' => 'bp_activity_format_notifications', + 'search_string' => __( 'Search Activity...', 'buddypress' ), + 'global_tables' => $global_tables, + 'meta_tables' => $meta_tables, + ); + + parent::setup_globals( $args ); + } + + /** + * Set up component navigation. + * + * @since 1.5.0 + * + * @see BP_Component::setup_nav() for a description of arguments. + * @uses bp_is_active() + * @uses is_user_logged_in() + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Stop if there is no user displayed or logged in. + if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { + return; + } + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $slug = bp_get_activity_slug(); + $activity_link = trailingslashit( $user_domain . $slug ); + + // Add 'Activity' to the main navigation. + $main_nav = array( + 'name' => _x( 'Activity', 'Profile activity screen nav', 'buddypress' ), + 'slug' => $slug, + 'position' => 10, + 'screen_function' => 'bp_activity_screen_my_activity', + 'default_subnav_slug' => 'just-me', + 'item_css_id' => $this->id + ); + + // Add the subnav items to the activity nav item if we are using a theme that supports this. + $sub_nav[] = array( + 'name' => _x( 'Personal', 'Profile activity screen sub nav', 'buddypress' ), + 'slug' => 'just-me', + 'parent_url' => $activity_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_activity_screen_my_activity', + 'position' => 10 + ); + + // Check @mentions. + if ( bp_activity_do_mentions() ) { + $sub_nav[] = array( + 'name' => _x( 'Mentions', 'Profile activity screen sub nav', 'buddypress' ), + 'slug' => 'mentions', + 'parent_url' => $activity_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_activity_screen_mentions', + 'position' => 20, + 'item_css_id' => 'activity-mentions' + ); + } + + // Favorite activity items. + 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' => $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' ) ) { + $sub_nav[] = array( + 'name' => _x( 'Friends', 'Profile activity screen sub nav', 'buddypress' ), + 'slug' => bp_get_friends_slug(), + 'parent_url' => $activity_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_activity_screen_friends', + 'position' => 40, + 'item_css_id' => 'activity-friends' + ) ; + } + + // Additional menu if groups is active. + if ( bp_is_active( 'groups' ) ) { + $sub_nav[] = array( + 'name' => _x( 'Groups', 'Profile activity screen sub nav', 'buddypress' ), + 'slug' => bp_get_groups_slug(), + 'parent_url' => $activity_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_activity_screen_groups', + 'position' => 50, + 'item_css_id' => 'activity-groups' + ); + } + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_nav() for a description of the $wp_admin_nav + * parameter array. + * @uses is_user_logged_in() + * @uses trailingslashit() + * @uses bp_get_total_mention_count_for_user() + * @uses bp_loggedin_user_id() + * @uses bp_is_active() + * @uses bp_get_friends_slug() + * @uses bp_get_groups_slug() + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a + * description. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $activity_link = trailingslashit( bp_loggedin_user_domain() . bp_get_activity_slug() ); + + // Unread message count. + if ( bp_activity_do_mentions() ) { + $count = bp_get_total_mention_count_for_user( bp_loggedin_user_id() ); + if ( !empty( $count ) ) { + $title = sprintf( _x( 'Mentions <span class="count">%s</span>', 'Toolbar Mention logged in user', 'buddypress' ), bp_core_number_format( $count ) ); + } else { + $title = _x( 'Mentions', 'Toolbar Mention logged in user', 'buddypress' ); + } + } + + // Add the "Activity" sub menu. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => _x( 'Activity', 'My Account Activity sub nav', 'buddypress' ), + 'href' => $activity_link + ); + + // Personal. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-personal', + 'title' => _x( 'Personal', 'My Account Activity sub nav', 'buddypress' ), + 'href' => $activity_link, + 'position' => 10 + ); + + // Mentions. + if ( bp_activity_do_mentions() ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-mentions', + 'title' => $title, + 'href' => trailingslashit( $activity_link . 'mentions' ), + 'position' => 20 + ); + } + + // 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' ), + 'position' => 30 + ); + } + + // Friends? + if ( bp_is_active( 'friends' ) ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-friends', + 'title' => _x( 'Friends', 'My Account Activity sub nav', 'buddypress' ), + 'href' => trailingslashit( $activity_link . bp_get_friends_slug() ), + 'position' => 40 + ); + } + + // Groups? + if ( bp_is_active( 'groups' ) ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-groups', + 'title' => _x( 'Groups', 'My Account Activity sub nav', 'buddypress' ), + 'href' => trailingslashit( $activity_link . bp_get_groups_slug() ), + 'position' => 50 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + * + * @uses bp_is_activity_component() + * @uses bp_is_my_profile() + * @uses bp_core_fetch_avatar() + */ + public function setup_title() { + + // Adjust title based on view. + if ( bp_is_activity_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = _x( 'My Activity', 'Page and <title>', 'buddypress' ); + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Set up actions necessary for the component. + * + * @since 1.6.0 + */ + public function setup_actions() { + + // Spam prevention. + add_action( 'bp_include', 'bp_activity_setup_akismet' ); + + parent::setup_actions(); + } + + /** + * Setup cache groups. + * + * @since 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/classes/class-bp-activity-feed.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-feed.php index b1302eb00314ede6da85f6853fc968c2745ed4e9..e319101e62888628fd9b6d03bbfab739152cccaf 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Activity Classes + * BuddyPress Activity Classes. * * @package BuddyPress - * @subpackage Activity + * @subpackage ActivityFeeds + * @since 1.8.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,10 +16,12 @@ defined( 'ABSPATH' ) || exit; * You should only construct a new feed when you've validated that you're on * the appropriate screen. * + * @since 1.8.0 + * * 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 $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. @@ -30,7 +33,6 @@ defined( 'ABSPATH' ) || exit; * @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 { @@ -41,6 +43,8 @@ class BP_Activity_Feed { * updated using PHP 5.2+ methods. * * @see BP_Feed::__construct() This is where $data is added. + * + * @since 1.8.0 * @var array */ protected $data; @@ -48,8 +52,9 @@ class BP_Activity_Feed { /** * Magic method for checking the existence of a certain data variable. * - * @param string $key + * @since 1.8.0 * + * @param string $key Property to check. * @return bool Whether or not data variable exists. */ public function __isset( $key ) { return isset( $this->data[$key] ); } @@ -57,15 +62,28 @@ class BP_Activity_Feed { /** * Magic method for getting a certain data variable. * - * @param string $key + * @since 1.8.0 * + * @param string $key Property to get. * @return mixed Data in variable if available or null. */ public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; } + /** + * Magic method for setting a certain data variable. + * + * @since 2.4.0 + * + * @param string $key The property to set. + * @param mixed $value The value to set. + */ + public function __set( $key, $value ) { $this->data[$key] = $value; } + /** * Constructor. * + * @since 1.8.0 + * * @param array $args Optional. */ public function __construct( $args = array() ) { @@ -73,68 +91,68 @@ class BP_Activity_Feed { /** * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early. * - * @since BuddyPress (1.8.0) + * @since 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 + // Set feed flag to false. $wp_query->is_feed = false; return false; } - // Setup data + // Setup data. $this->data = wp_parse_args( $args, array( - // Internal identifier for the RSS feed - should be alphanumeric only + // Internal identifier for the RSS feed - should be alphanumeric only. 'id' => '', - // RSS title - should be plain-text + // RSS title - should be plain-text. 'title' => '', - // relevant link for the RSS feed + // Relevant link for the RSS feed. 'link' => '', - // RSS description - should be plain-text + // 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 + // See: http://www.rssboard.org/rss-profile#element-channel-ttl. + // See: 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 + // See: http://web.resource.org/rss/1.0/modules/syndication/#description. + // See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule. 'update_period' => 'hourly', 'update_frequency' => 2, - // Number of items to display + // Number of items to display. 'max' => 50, - // Activity arguments passed to bp_has_activities() + // 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) + * @since 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 + // Setup class properties. $this->setup_properties(); - // Check if id is valid + // 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; @@ -143,19 +161,19 @@ class BP_Activity_Feed { /** * Fires after the feed is setup so plugins can modify. * - * @since BuddyPress (1.8.0) + * @since 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 + // Setup feed hooks. $this->setup_hooks(); - // Output the feed + // Output the feed. $this->output(); - // Kill the rest of the output + // Kill the rest of the output. die(); } @@ -164,7 +182,7 @@ class BP_Activity_Feed { /** * Setup and validate the class properties. * - * @access protected + * @since 1.8.0 */ protected function setup_properties() { $this->id = sanitize_title( $this->id ); @@ -189,7 +207,7 @@ class BP_Activity_Feed { * Currently, these hooks are used to maintain backwards compatibility with * the RSS feeds previous to BP 1.8. * - * @access protected + * @since 1.8.0 */ protected function setup_hooks() { add_action( 'bp_activity_feed_rss_attributes', array( $this, 'backpat_rss_attributes' ) ); @@ -201,6 +219,8 @@ class BP_Activity_Feed { /** * Fire a hook to ensure backward compatibility for RSS attributes. + * + * @since 1.8.0 */ public function backpat_rss_attributes() { @@ -209,13 +229,15 @@ class BP_Activity_Feed { * * 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) + * @since 1.0.0 */ do_action( 'bp_activity_' . $this->id . '_feed' ); } /** * Fire a hook to ensure backward compatibility for channel elements. + * + * @since 1.8.0 */ public function backpat_channel_elements() { @@ -224,18 +246,20 @@ class BP_Activity_Feed { * * 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) + * @since 1.0.0 */ do_action( 'bp_activity_' . $this->id . '_feed_head' ); } /** * Fire a hook to ensure backward compatibility for item elements. + * + * @since 1.8.0 */ public function backpat_item_elements() { switch ( $this->id ) { - // sitewide and friends feeds use the 'personal' hook + // Sitewide and friends feeds use the 'personal' hook. case 'sitewide' : case 'friends' : $id = 'personal'; @@ -253,7 +277,7 @@ class BP_Activity_Feed { * * 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) + * @since 1.0.0 */ do_action( 'bp_activity_' . $id . '_feed_item' ); } @@ -263,14 +287,14 @@ class BP_Activity_Feed { /** * Output the feed's item content. * - * @access protected + * @since 1.8.0 */ protected function feed_content() { bp_activity_content_body(); switch ( $this->id ) { - // also output parent activity item if we're on a specific feed + // Also output parent activity item if we're on a specific feed. case 'favorites' : case 'friends' : case 'mentions' : @@ -292,13 +316,11 @@ class BP_Activity_Feed { * * Most of this class method is derived from {@link WP::send_headers()}. * - * @since BuddyPress (1.9.0) - * - * @access protected + * @since 1.9.0 */ protected function http_headers() { - // set up some additional headers if not on a directory page - // this is done b/c BP uses pseudo-pages + // 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; @@ -306,46 +328,46 @@ class BP_Activity_Feed { status_header( 200 ); } - // Set content-type + // Set content-type. @header( 'Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); send_nosniff_header(); - // Cache-related variables + // 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 + // Set cache-related headers. @header( 'Last-Modified: ' . $last_modified ); @header( 'Pragma: no-cache' ); @header( 'ETag: ' . '"' . $etag . '"' ); - // First commit of BuddyPress! (Easter egg) + // First commit of BuddyPress! (Easter egg). @header( 'Expires: Tue, 25 Mar 2008 17:13:55 GMT'); - // Get ETag from supported user agents + // 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 + // Remove quotes from ETag. $client_etag = trim( $client_etag, '"' ); - // Strip suffixes from ETag if they exist (eg. "-gzip") + // 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 + // No ETag found. } else { $client_etag = false; } - // Get client last modified timestamp from supported user agents + // 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 + // 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 ) ) ) { @@ -354,11 +376,11 @@ class BP_Activity_Feed { $status = false; } - // If feed hasn't changed as reported by the user agent, set 304 status header + // 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! + // Cached response, so stop now! if ( $status == 304 ) { exit(); } @@ -370,7 +392,7 @@ class BP_Activity_Feed { /** * Output the RSS feed. * - * @access protected + * @since 1.8.0 */ protected function output() { $this->http_headers(); @@ -387,7 +409,7 @@ class BP_Activity_Feed { /** * Fires at the end of the opening RSS tag for feed output so plugins can add extra attributes. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ do_action( 'bp_activity_feed_rss_attributes' ); ?> > @@ -402,13 +424,13 @@ class BP_Activity_Feed { <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> + <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) + * @since 1.8.0 */ do_action( 'bp_activity_feed_channel_elements' ); ?> @@ -433,7 +455,7 @@ class BP_Activity_Feed { /** * 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) + * @since 1.8.0 */ do_action( 'bp_activity_feed_item_elements' ); ?> </item> diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-list-table.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-list-table.php new file mode 100644 index 0000000000000000000000000000000000000000..05ad4c7ee78c46fa36c61e549a0a102cbd632dee --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-list-table.php @@ -0,0 +1,834 @@ +<?php +/** + * BuddyPress Activity component admin list table. + * + * Props to WordPress core for the Comments admin screen, and its contextual + * help text, on which this implementation is heavily based. + * + * @package BuddyPress + * @subpackage ActivityAdmin + * @since 1.6.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * List table class for the Activity component admin page. + * + * @since 1.6.0 + */ +class BP_Activity_List_Table extends WP_List_Table { + + /** + * What type of view is being displayed? + * + * E.g. "all", "pending", "approved", "spam"... + * + * @since 1.6.0 + * @var string $view + */ + public $view = 'all'; + + /** + * How many activity items have been marked as spam. + * + * @since 1.6.0 + * @var int $spam_count + */ + public $spam_count = 0; + + /** + * Store activity-to-user-ID mappings for use in the In Response To column. + * + * @since 1.6.0 + * @var array $activity_user_id + */ + protected $activity_user_id = array(); + + /** + * If users can comment on blog & forum activity items. + * + * @link https://buddypress.trac.wordpress.org/ticket/6277 + * + * @since 2.2.2 + * @var bool $disable_blogforum_comments + */ + public $disable_blogforum_comments = false; + + /** + * Constructor. + * + * @since 1.6.0 + */ + public function __construct() { + + // See if activity commenting is enabled for blog / forum activity items. + $this->disable_blogforum_comments = bp_disable_blogforum_comments(); + + // Define singular and plural labels, as well as whether we support AJAX. + parent::__construct( array( + 'ajax' => false, + 'plural' => 'activities', + 'singular' => 'activity', + 'screen' => get_current_screen(), + ) ); + } + + /** + * Handle filtering of data, sorting, pagination, and any other data manipulation prior to rendering. + * + * @since 1.6.0 + */ + function prepare_items() { + + // Option defaults. + $filter = array(); + $filter_query = false; + $include_id = false; + $search_terms = false; + $sort = 'DESC'; + $spam = 'ham_only'; + + // Set current page. + $page = $this->get_pagenum(); + + // Set per page from the screen options. + $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) ); + + // Check if we're on the "Spam" view. + if ( !empty( $_REQUEST['activity_status'] ) && 'spam' == $_REQUEST['activity_status'] ) { + $spam = 'spam_only'; + $this->view = 'spam'; + } + + // Sort order. + if ( !empty( $_REQUEST['order'] ) && 'desc' != $_REQUEST['order'] ) + $sort = 'ASC'; + + // Order by. + /*if ( !empty( $_REQUEST['orderby'] ) ) { + }*/ + + // Filter. + if ( ! empty( $_REQUEST['activity_type'] ) ) { + $filter = array( 'action' => $_REQUEST['activity_type'] ); + + /** + * Filter here to override the filter with a filter query + * + * @since 2.5.0 + * + * @param array $filter + */ + $has_filter_query = apply_filters( 'bp_activity_list_table_filter_activity_type_items', $filter ); + + if ( ! empty( $has_filter_query['filter_query'] ) ) { + // Reset the filter + $filter = array(); + + // And use the filter query instead + $filter_query = $has_filter_query['filter_query']; + } + } + + // Are we doing a search? + if ( !empty( $_REQUEST['s'] ) ) + $search_terms = $_REQUEST['s']; + + // Check if user has clicked on a specific activity (if so, fetch only that, and any related, activity). + if ( !empty( $_REQUEST['aid'] ) ) + $include_id = (int) $_REQUEST['aid']; + + // Get the spam total (ignoring any search query or filter). + $spams = bp_activity_get( array( + 'display_comments' => 'stream', + 'show_hidden' => true, + 'spam' => 'spam_only', + 'count_total' => 'count_query', + ) ); + $this->spam_count = $spams['total']; + unset( $spams ); + + // Get the activities from the database. + $activities = bp_activity_get( array( + 'display_comments' => 'stream', + 'filter' => $filter, + 'in' => $include_id, + 'page' => $page, + 'per_page' => $per_page, + 'search_terms' => $search_terms, + 'filter_query' => $filter_query, + 'show_hidden' => true, + // 'sort' => $sort, + 'spam' => $spam, + 'count_total' => 'count_query', + ) ); + + // 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'] ); + + // Sort the array by the activity object's date_recorded value. + usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ) ); + } + + // The bp_activity_get function returns an array of objects; cast these to arrays for WP_List_Table. + $new_activities = array(); + foreach ( $activities['activities'] as $activity_item ) { + $new_activities[] = (array) $activity_item; + + // 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; + } + + // Set raw data to display. + $this->items = $new_activities; + + // Store information needed for handling table pagination. + $this->set_pagination_args( array( + 'per_page' => $per_page, + 'total_items' => $activities['total'], + 'total_pages' => ceil( $activities['total'] / $per_page ) + ) ); + + // Don't truncate activity items; bp_activity_truncate_entry() needs to be used inside a BP_Activity_Template loop. + remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); + } + + /** + * Get an array of all the columns on the page. + * + * @since 1.6.0 + * + * @return array Column headers. + */ + function get_column_info() { + $this->_column_headers = array( + $this->get_columns(), + array(), + $this->get_sortable_columns(), + $this->get_default_primary_column_name(), + ); + + return $this->_column_headers; + } + + /** + * Get name of default primary column + * + * @since 2.3.3 + * + * @return string + */ + protected function get_default_primary_column_name() { + return 'author'; + } + + /** + * Display a message on screen when no items are found (e.g. no search matches). + * + * @since 1.6.0 + */ + function no_items() { + _e( 'No activities found.', 'buddypress' ); + } + + /** + * Output the Activity data table. + * + * @since 1.6.0 + */ + function display() { + $this->display_tablenav( 'top' ); ?> + + <h2 class="screen-reader-text"><?php _e( 'Activities list', 'buddypress' ); ?></h2> + + <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> + <thead> + <tr> + <?php $this->print_column_headers(); ?> + </tr> + </thead> + + <tfoot> + <tr> + <?php $this->print_column_headers( false ); ?> + </tr> + </tfoot> + + <tbody id="the-comment-list"> + <?php $this->display_rows_or_placeholder(); ?> + </tbody> + </table> + <?php + + $this->display_tablenav( 'bottom' ); + } + + /** + * Generate content for a single row of the table. + * + * @since 1.6.0 + * + * @param object $item The current item. + */ + function single_row( $item ) { + static $even = false; + + if ( $even ) { + $row_class = ' class="even"'; + } else { + $row_class = ' class="alternate odd"'; + } + + if ( 'activity_comment' === $item['type'] ) { + $root_id = $item['item_id']; + } else { + $root_id = $item['id']; + } + + echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $root_id ) . '">'; + echo $this->single_row_columns( $item ); + echo '</tr>'; + + $even = ! $even; + } + + /** + * Get the list of views available on this table (e.g. "all", "spam"). + * + * @since 1.6.0 + */ + function get_views() { + $url_base = add_query_arg( array( 'page' => 'bp-activity' ), bp_get_admin_url( 'admin.php' ) ); ?> + + <h2 class="screen-reader-text"><?php _e( 'Filter activities list', 'buddypress' ); ?></h2> + + <ul class="subsubsub"> + <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 + + /** + * Fires inside listing of views so plugins can add their own. + * + * @since 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 + } + + /** + * Get bulk actions. + * + * @since 1.6.0 + * + * @return array Key/value pairs for the bulk actions dropdown. + */ + function get_bulk_actions() { + $actions = array(); + $actions['bulk_spam'] = __( 'Mark as Spam', 'buddypress' ); + $actions['bulk_ham'] = __( 'Not Spam', 'buddypress' ); + $actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' ); + + /** + * Filters the default bulk actions so plugins can add custom actions. + * + * @since 1.6.0 + * + * @param array $actions Default available actions for bulk operations. + */ + return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions ); + } + + /** + * Get the table column titles. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @return array The columns to appear in the Activity list table. + */ + function get_columns() { + /** + * Filters the titles for the columns for the activity list table. + * + * @since 2.4.0 + * + * @param array $value Array of slugs and titles for the columns. + */ + return apply_filters( 'bp_activity_list_table_get_columns', array( + 'cb' => '<input name type="checkbox" />', + 'author' => _x('Author', 'Admin SWA column header', 'buddypress' ), + 'comment' => _x( 'Activity', 'Admin SWA column header', 'buddypress' ), + 'action' => _x( 'Action', 'Admin SWA column header', 'buddypress' ), + 'response' => _x( 'In Response To', 'Admin SWA column header', 'buddypress' ), + ) ); + } + + /** + * Get the column names for sortable columns. + * + * Currently, returns an empty array (no columns are sortable). + * + * @since 1.6.0 + * @todo For this to work, BP_Activity_Activity::get() needs updating + * to support ordering by specific fields. + * + * @return array The columns that can be sorted on the Activity screen. + */ + function get_sortable_columns() { + return array(); + + /*return array( + 'author' => array( 'activity_author', false ), // Intentionally not using "=>" + );*/ + } + + /** + * Markup for the "filter" part of the form (i.e. which activity type to display). + * + * @since 1.6.0 + * + * @param string $which 'top' or 'bottom'. + */ + function extra_tablenav( $which ) { + + // Bail on bottom table nav. + if ( 'bottom' === $which ) { + return; + } + + // Is any filter currently selected? + $selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : ''; + + // Get the actions. + $activity_actions = bp_activity_get_actions(); ?> + + <div class="alignleft actions"> + <label for="activity-type" class="screen-reader-text"><?php _e( 'Filter by activity type', 'buddypress' ); ?></label> + <select name="activity_type" id="activity-type"> + <option value="" <?php selected( ! $selected ); ?>><?php _e( 'View all actions', 'buddypress' ); ?></option> + + <?php foreach ( $activity_actions as $component => $actions ) : ?> + + <optgroup label="<?php echo ucfirst( $component ); ?>"> + + <?php foreach ( $actions as $action_key => $action_values ) : ?> + + <?php + + // Skip the incorrectly named pre-1.6 action. + if ( 'friends_register_activity_action' !== $action_key ) : ?> + + <option value="<?php echo esc_attr( $action_key ); ?>" <?php selected( $action_key, $selected ); ?>><?php echo esc_html( $action_values[ 'value' ] ); ?></option> + + <?php endif; ?> + + <?php endforeach; ?> + + </optgroup> + + <?php endforeach; ?> + + </select> + + <?php submit_button( __( 'Filter', 'buddypress' ), 'secondary', false, false, array( 'id' => 'post-query-submit' ) ); ?> + </div> + + <?php + } + + /** + * Override WP_List_Table::row_actions(). + * + * Basically a duplicate of the row_actions() method, but removes the + * unnecessary <button> addition. + * + * @since 2.3.3 + * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. + * + * @param array $actions The list of actions. + * @param bool $always_visible Whether the actions should be always visible. + * @return string + */ + public function row_actions( $actions, $always_visible = false ) { + $action_count = count( $actions ); + $i = 0; + + if ( !$action_count ) + return ''; + + $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + $out .= "<span class='$action'>$link$sep</span>"; + } + $out .= '</div>'; + + return $out; + } + + /** + * Checkbox column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_cb( $item ) { + printf( '<label class="screen-reader-text" for="aid-%1$d">' . __( 'Select activity item %1$d', 'buddypress' ) . '</label><input type="checkbox" name="aid[]" value="%1$d" id="aid-%1$d" />', $item['id'] ); + } + + /** + * Author column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_author( $item ) { + echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>'; + } + + /** + * Action column markup. + * + * @since 2.0.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_action( $item ) { + $actions = bp_activity_admin_get_activity_actions(); + + if ( isset( $actions[ $item['type'] ] ) ) { + echo $actions[ $item['type'] ]; + } else { + printf( __( 'Unregistered action - %s', 'buddypress' ), $item['type'] ); + } + } + + /** + * Content column, and "quick admin" rollover actions. + * + * Called "comment" in the CSS so we can re-use some WP core CSS. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_comment( $item ) { + // Determine what type of item (row) we're dealing with. + if ( $item['is_spam'] ) + $item_status = 'spam'; + else + $item_status = 'all'; + + // Preorder items: Reply | Edit | Spam | Delete Permanently. + $actions = array( + 'reply' => '', + 'edit' => '', + 'spam' => '', 'unspam' => '', + 'delete' => '', + ); + + // Build actions URLs. + $base_url = bp_get_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); + $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) ); + + $delete_url = $base_url . "&action=delete&$spam_nonce"; + $edit_url = $base_url . '&action=edit'; + $ham_url = $base_url . "&action=ham&$spam_nonce"; + $spam_url = $base_url . "&action=spam&$spam_nonce"; + + // Rollover actions. + // 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' ) ); + } else { + $actions['reply'] = sprintf( '<span class="form-input-tip" title="%s">%s</span>', __( 'Replies are disabled for this activity item', 'buddypress' ), __( 'Replies disabled', 'buddypress' ) ); + } + + // Edit. + $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) ); + } + + // Spam/unspam. + if ( 'spam' == $item_status ) + $actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) ); + else + $actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) ); + + // Delete. + $actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) ); + + // Start timestamp. + echo '<div class="submitted-on">'; + + /** + * Filters available actions for plugins to alter. + * + * @since 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 ); + + printf( + /* translators: %s: activity date and time */ + __( 'Submitted on %s', 'buddypress' ), + sprintf( + '<a href="%1$s">%2$s</a>', + bp_activity_get_permalink( $item['id'] ), + sprintf( + /* translators: 1: activity date, 2: activity time */ + __( '%1$s at %2$s', 'buddypress' ), + date_i18n( bp_get_option( 'date_format' ), strtotime( $item['date_recorded'] ) ), + get_date_from_gmt( $item['date_recorded'], bp_get_option( 'time_format' ) ) + ) + ) + ); + + // End timestamp. + echo '</div>'; + + // Get activity content - if not set, use the action. + if ( ! empty( $item['content'] ) ) { + + /** + * Filters current activity item content. + * + * @since 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 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'] ) ); + } + + /** + * Filter here to add extra output to the activity content into the Administration. + * + * @since 2.4.0 + * + * @param string $content The activity content. + * @param array $item The activity object converted into an array. + */ + echo apply_filters( 'bp_activity_admin_comment_content', $content, $item ) . ' ' . $this->row_actions( $actions ); + } + + /** + * "In response to" column markup. + * + * @since 1.6.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + function column_response( $item ) { + + // Is $item is a root activity? + ?> + + <div class="response-links"> + + <?php + // Activity permalink. + $activity_permalink = ''; + if ( ! $item['is_spam'] ) { + $activity_permalink = '<a href="' . bp_activity_get_permalink( $item['id'], (object) $item ) . '" class="comments-view-item-link">' . __( 'View Activity', 'buddypress' ) . '</a>'; + } + + /** + * Filters default list of default root activity types. + * + * @since 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 ) ) ) { + echo $activity_permalink; + + $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&aid=' . $item['id'] ); + + // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble. + if ( $comment_count ) { + $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) ); + printf( '<a href="%1$s" title="%2$s" class="post-com-count post-com-count-approved"><span class="comment-count comment-count-approved">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) ); + } + + // For non-root activities, display a link to the replied-to activity's author's profile. + } else { + echo '<strong>' . get_avatar( $this->get_activity_user_id( $item['item_id'] ), '32' ) . ' ' . bp_core_get_userlink( $this->get_activity_user_id( $item['item_id'] ) ) . '</strong><br />'; + echo $activity_permalink; + } + ?> + + </div> + + <?php + } + + /** + * Allow plugins to add their custom column. + * + * @since 2.4.0 + * + * @param array $item Information about the current row. + * @param string $column_name 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 2.4.0 + * + * @param string $value Empty string. + * @param string $column_name Name of the column being rendered. + * @param array $item The current activity item in the loop. + */ + return apply_filters( 'bp_activity_admin_get_custom_column', '', $column_name, $item ); + } + + /** + * Get the user id associated with a given activity item. + * + * Wraps bp_activity_get_specific(), with some additional logic for + * avoiding duplicate queries. + * + * @since 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 ) { + // If there is an existing activity/user ID mapping, just return the user ID. + if ( ! empty( $this->activity_user_id[$activity_id] ) ) { + return $this->activity_user_id[$activity_id]; + + /* + * We don't have a mapping. This means the $activity_id is not on the current + * page of results, so fetch its details from the database. + */ + } else { + $activity = bp_activity_get_specific( array( 'activity_ids' => $activity_id, 'show_hidden' => true, 'spam' => 'all', ) ); + + /* + * If, somehow, the referenced activity has been deleted, leaving its associated + * activities as orphans, use the logged in user's ID to avoid errors. + */ + if ( empty( $activity['activities'] ) ) + return bp_loggedin_user_id(); + + // Store the new activity/user ID mapping for any later re-use. + $this->activity_user_id[ $activity['activities'][0]->id ] = $activity['activities'][0]->user_id; + + // Return the user ID. + return $activity['activities'][0]->user_id; + } + } + + /** + * 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 + * list table doesn't use a BuddyPress activity loop, which prevents those + * functions from working as intended. + * + * @since 2.0.0 + * @since 2.5.0 Include Post type activities types + * + * @param array $item An array version of the BP_Activity_Activity object. + * @return bool $can_comment + */ + protected function can_comment( $item ) { + $can_comment = bp_activity_type_supports( $item['type'], 'comment-reply' ); + + if ( ! $this->disable_blogforum_comments && bp_is_active( 'blogs' ) ) { + $parent_activity = false; + + if ( bp_activity_type_supports( $item['type'], 'post-type-comment-tracking' ) ) { + $parent_activity = (object) $item; + } elseif ( 'activity_comment' === $item['type'] ) { + $parent_activity = new BP_Activity_Activity( $item['item_id'] ); + } + + if ( isset( $parent_activity->type ) && bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ) ) { + // Fetch blog post comment depth and if the blog post's comments are open. + bp_blogs_setup_activity_loop_globals( $parent_activity ); + + $can_comment = bp_blogs_can_comment_reply( true, $item ); + } + } + + /** + * Filters if an activity item can be commented on or not. + * + * @since 2.0.0 + * @since 2.5.0 Add a second parameter to include the activity item into the filter. + * + * @param bool $can_comment Whether an activity item can be commented on or not. + * @param array $item An array version of the BP_Activity_Activity object. + */ + return apply_filters( 'bp_activity_list_table_can_comment', $can_comment, $item ); + } + + /** + * Flatten the activity array. + * + * In some cases, BuddyPress gives us a structured tree of activity + * items plus their comments. This method converts it to a flat array. + * + * @since 1.6.0 + * + * @param array $tree Source array. + * @return array Flattened array. + */ + public static function flatten_activity_array( $tree ){ + foreach ( (array) $tree as $node ) { + if ( isset( $node->children ) ) { + + foreach ( BP_Activity_List_Table::flatten_activity_array( $node->children ) as $child ) { + $tree[] = $child; + } + + unset( $node->children ); + } + } + + return $tree; + } +} 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 index 5945f38190cf0c3b29510f91faf7975b4dc5809f..3f7559af77254b28374cdd351eadf7f1efc2b848 100644 --- 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 @@ -3,10 +3,11 @@ * BuddyPress Activity Classes * * @package BuddyPress - * @subpackage Activity + * @subpackage ActivityQuery + * @since 2.2.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,7 +16,7 @@ defined( 'ABSPATH' ) || exit; * This is notably used in {@link BP_Activity_Activity::get()} with the * 'filter_query' parameter. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ class BP_Activity_Query extends BP_Recursive_Query { /** @@ -23,8 +24,7 @@ class BP_Activity_Query extends BP_Recursive_Query { * * See {@see BP_Activity_Query::__construct()} for information on query arguments. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * @var array */ public $queries = array(); @@ -32,8 +32,7 @@ class BP_Activity_Query extends BP_Recursive_Query { /** * Table alias. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * @var string */ public $table_alias = ''; @@ -43,8 +42,7 @@ class BP_Activity_Query extends BP_Recursive_Query { * * See the 'wp_bp_activity' DB table schema. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * @var array */ public $db_columns = array( @@ -55,11 +53,10 @@ class BP_Activity_Query extends BP_Recursive_Query { /** * Constructor. * - * @since BuddyPress (2.2.0) + * @since 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. @@ -86,12 +83,10 @@ class BP_Activity_Query extends BP_Recursive_Query { /** * Generates WHERE SQL clause to be appended to a main query. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * * @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' ) { @@ -101,22 +96,20 @@ class BP_Activity_Query extends BP_Recursive_Query { $sql = $this->get_sql_clauses(); - // we only need the 'where' clause + // 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 + // 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 + * @since 2.2.0 * * @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. @@ -142,7 +135,7 @@ class BP_Activity_Query extends BP_Recursive_Query { $clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '='; } - // default 'compare' to '=' if no valid operator is found + // Default 'compare' to '=' if no valid operator is found. if ( ! in_array( $clause['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'LIKE', 'NOT LIKE', @@ -160,7 +153,7 @@ class BP_Activity_Query extends BP_Recursive_Query { // Next, Build the WHERE clause. $where = ''; - // value. + // Value. if ( isset( $clause['value'] ) ) { if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) ) { if ( ! is_array( $value ) ) { @@ -168,13 +161,13 @@ class BP_Activity_Query extends BP_Recursive_Query { } } - // tinyint + // 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 + // IN uses different syntax. case 'IN' : case 'NOT IN' : $in_sql = BP_Activity_Activity::get_in_operator_sql( "{$alias}{$column}", $value ); @@ -224,11 +217,9 @@ class BP_Activity_Query extends BP_Recursive_Query { /** * Determine whether a clause is first-order. * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 * * @param array $query Clause to check. - * * @return bool */ protected function is_first_order_clause( $query ) { @@ -241,11 +232,9 @@ class BP_Activity_Query extends BP_Recursive_Query { * Column names are checked against a whitelist of known tables. * See {@link BP_Activity_Query::db_tables}. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * * @param string $column The user-supplied column name. - * * @return string A validated column name value. */ public function validate_column( $column = '' ) { diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-template.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-template.php new file mode 100644 index 0000000000000000000000000000000000000000..864e5516e9381a5ca786ac1567e8b2e16a053419 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-template.php @@ -0,0 +1,409 @@ +<?php +/** + * BuddyPress Activity Template. + * + * @package BuddyPress + * @subpackage ActivityTemplate + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main activity template loop class. + * + * This is responsible for loading a group of activity items and displaying them. + * + * @since 1.0.0 + */ +class BP_Activity_Template { + + /** + * The loop iterator. + * + * @since 1.0.0 + * @var int + */ + public $current_activity = -1; + + /** + * The activity count. + * + * @since 1.0.0 + * @var int + */ + public $activity_count; + + /** + * The total activity count. + * + * @since 1.0.0 + * @var int + */ + public $total_activity_count; + + /** + * Array of activities located by the query. + * + * @since 1.0.0 + * @var array + */ + public $activities; + + /** + * The activity object currently being iterated on. + * + * @since 1.0.0 + * @var object + */ + public $activity; + + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.0.0 + * @var bool + */ + public $in_the_loop; + + /** + * URL parameter key for activity pagination. Default: 'acpage'. + * + * @since 2.1.0 + * @var string + */ + public $pag_arg; + + /** + * The page number being requested. + * + * @since 1.0.0 + * @var int + */ + public $pag_page; + + /** + * The number of items being requested per page. + * + * @since 1.0.0 + * @var int + */ + public $pag_num; + + /** + * An HTML string containing pagination links. + * + * @since 1.0.0 + * @var string + */ + public $pag_links; + + /** + * The displayed user's full name. + * + * @since 1.0.0 + * @var string + */ + public $full_name; + + /** + * Constructor method. + * + * The arguments passed to this class constructor are of the same + * format as {@link BP_Activity_Activity::get()}. + * + * @since 1.5.0 + * + * @see BP_Activity_Activity::get() for a description of the argument + * structure, as well as default values. + * + * @param array $args { + * Array of arguments. Supports all arguments from + * 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|bool $display_comments Default: 'threaded'. + * } + */ + public function __construct( $args ) { + $bp = buddypress(); + + // 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 => 'page', + 1 => 'per_page', + 2 => 'max', + 3 => 'include', + 4 => 'sort', + 5 => 'filter', + 6 => 'search_terms', + 7 => 'display_comments', + 8 => 'show_hidden', + 9 => 'exclude', + 10 => 'in', + 11 => 'spam', + 12 => 'page_arg' + ); + + $func_args = func_get_args(); + $args = bp_core_parse_args_array( $old_args_keys, $func_args ); + } + + $defaults = array( + 'page' => 1, + 'per_page' => 20, + 'page_arg' => 'acpage', + 'max' => false, + 'fields' => 'all', + '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', + 'update_meta_cache' => true, + ); + $r = wp_parse_args( $args, $defaults ); + extract( $r ); + + $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 = (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 ) ); + + // Fetch specific activity items based on ID's. + if ( !empty( $include ) ) { + $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, + 'display_comments' => $display_comments, + 'show_hidden' => $show_hidden, + 'spam' => $spam, + 'update_meta_cache' => $update_meta_cache, + ) ); + + // Fetch all activity items. + } else { + $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, + 'spam' => $spam, + 'update_meta_cache' => $update_meta_cache, + ) ); + } + + // The total_activity_count property will be set only if a + // 'count_total' query has taken place. + if ( ! is_null( $this->activities['total'] ) ) { + if ( ! $max || $max >= (int) $this->activities['total'] ) { + $this->total_activity_count = (int) $this->activities['total']; + } else { + $this->total_activity_count = (int) $max; + } + } + + $this->has_more_items = $this->activities['has_more_items']; + + $this->activities = $this->activities['activities']; + + if ( $max ) { + if ( $max >= count($this->activities) ) { + $this->activity_count = count( $this->activities ); + } else { + $this->activity_count = (int) $max; + } + } else { + $this->activity_count = count( $this->activities ); + } + + $this->full_name = bp_get_displayed_user_fullname(); + + // 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 ) { + continue; + } + + $parent_ids[] = $activity->item_id; + } + + 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 ) { + $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( $this->pag_arg, '%#%' ), + 'format' => '', + 'total' => ceil( (int) $this->total_activity_count / (int) $this->pag_num ), + 'current' => (int) $this->pag_page, + 'prev_text' => _x( '←', 'Activity pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Activity pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => array(), + ) ); + } + } + + /** + * Whether there are activity items available in the loop. + * + * @since 1.0.0 + * + * @see bp_has_activities() + * + * @return bool True if there are items in the loop, otherwise false. + */ + function has_activities() { + if ( $this->activity_count ) { + return true; + } + + return false; + } + + /** + * Set up the next activity item and iterate index. + * + * @since 1.0.0 + * + * @return object The next activity item to iterate over. + */ + public function next_activity() { + $this->current_activity++; + $this->activity = $this->activities[ $this->current_activity ]; + + return $this->activity; + } + + /** + * Rewind the posts and reset post index. + * + * @since 1.0.0 + */ + public function rewind_activities() { + $this->current_activity = -1; + if ( $this->activity_count > 0 ) { + $this->activity = $this->activities[0]; + } + } + + /** + * Whether there are activity items left in the loop to iterate over. + * + * This method is used by {@link bp_activities()} as part of the while loop + * that controls iteration inside the activities loop, eg: + * while ( bp_activities() ) { ... + * + * @since 1.0.0 + * + * @see bp_activities() + * + * @return bool True if there are more activity items to show, + * otherwise false. + */ + public function user_activities() { + if ( ( $this->current_activity + 1 ) < $this->activity_count ) { + return true; + } elseif ( ( $this->current_activity + 1 ) == $this->activity_count ) { + + /** + * Fires right before the rewinding of activity posts. + * + * @since 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; + } + + /** + * Set up the current activity item inside the loop. + * + * Used by {@link bp_the_activity()} to set up the current activity item + * data while looping, so that template tags used during that iteration + * make reference to the current activity item. + * + * @since 1.0.0 + * + * @see bp_the_activity() + */ + public function the_activity() { + + $this->in_the_loop = true; + $this->activity = $this->next_activity(); + + if ( is_array( $this->activity ) ) { + $this->activity = (object) $this->activity; + } + + // Loop has just started. + if ( $this->current_activity == 0 ) { + + /** + * Fires if the current activity item is the first in the activity loop. + * + * @since 1.1.0 + */ + do_action('activity_loop_start'); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-theme-compat.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..a5d170a3415d8c015be6e476f66c2d0aa2101e7f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-activity-theme-compat.php @@ -0,0 +1,180 @@ +<?php +/** + * BuddyPress Activity Theme Compatibility. + * + * @package BuddyPress + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main theme compat class for BuddyPress Activity. + * + * 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 1.7.0 + */ +class BP_Activity_Theme_Compat { + + /** + * Set up the activity component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) ); + } + + /** + * Set up the theme compatibility hooks, if we're looking at an activity page. + * + * @since 1.7.0 + */ + public function is_activity() { + + // Bail if not looking at a group. + if ( ! bp_is_activity_component() ) + return; + + // Activity Directory. + 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' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Single activity. + } elseif ( bp_is_single_activity() ) { + add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); + } + } + + /** Directory *************************************************************/ + + /** + * Add template hierarchy to theme compat for the activity directory page. + * + * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the template hierarchy for the activity directory page. + * + * @since 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' + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => bp_get_directory_title( 'activity' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part. + * + * @since 1.7.0 + */ + public function directory_content() { + return bp_buffer_template_part( 'activity/index', null, false ); + } + + /** Single ****************************************************************/ + + /** + * Add custom template hierarchy to theme compat for activity permalink pages. + * + * This is to mirror how WordPress has {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the template hierarchy for the activity permalink pages. + * + * @since 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' + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with the displayed user's data. + * + * @since 1.7.0 + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => __( 'Activity', 'buddypress' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members' activity permalink template part. + * + * @since 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/classes/class-bp-akismet.php b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-akismet.php new file mode 100644 index 0000000000000000000000000000000000000000..6b54fbb4a9a731152d4b48e59f14e9179ebc955f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/classes/class-bp-akismet.php @@ -0,0 +1,651 @@ +<?php +/** + * Akismet support for BuddyPress' Activity Stream. + * + * @package BuddyPress + * @subpackage ActivityAkismet + * @since 1.6.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Akismet support for the Activity component. + * + * @since 1.6.0 + * @since 2.3.0 We only support Akismet 3+. + */ +class BP_Akismet { + + /** + * The activity last marked as spam. + * + * @since 1.6.0 + * @var BP_Activity_Activity + */ + protected $last_activity = null; + + /** + * Constructor. + * + * @since 1.6.0 + */ + public function __construct() { + $this->setup_actions(); + } + + /** + * Hook Akismet into the activity stream. + * + * @since 1.6.0 + */ + protected function setup_actions() { + // Add nonces to activity stream lists. + add_action( 'bp_after_activity_post_form', array( $this, 'add_activity_stream_nonce' ) ); + add_action( 'bp_activity_entry_comments', array( $this, 'add_activity_stream_nonce' ) ); + + // Add a "mark as spam" button to individual activity items. + add_action( 'bp_activity_entry_meta', array( $this, 'add_activity_spam_button' ) ); + add_action( 'bp_activity_comment_options', array( $this, 'add_activity_comment_spam_button' ) ); + + // Check activity for spam. + add_action( 'bp_activity_before_save', array( $this, 'check_activity' ), 4, 1 ); + + // Tidy up member's latest (activity) update. + add_action( 'bp_activity_posted_update', array( $this, 'check_member_activity_update' ), 1, 3 ); + + // Hooks to extend Activity core spam/ham functions for Akismet. + add_action( 'bp_activity_mark_as_spam', array( $this, 'mark_as_spam' ), 10, 2 ); + add_action( 'bp_activity_mark_as_ham', array( $this, 'mark_as_ham' ), 10, 2 ); + + // Hook into the Activity wp-admin screen. + add_action( 'bp_activity_admin_comment_row_actions', array( $this, 'comment_row_action' ), 10, 2 ); + add_action( 'bp_activity_admin_load', array( $this, 'add_history_metabox' ) ); + } + + /** + * Add a history item to the hover links in an activity's row. + * + * This function lifted with love from the Akismet WordPress plugin's + * akismet_comment_row_action() function. Thanks! + * + * @since 1.6.0 + * + * @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 ) { + $akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' ); + $user_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_user_result' ); + $desc = ''; + + if ( !$user_result || $user_result == $akismet_result ) { + // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same. + if ( 'true' == $akismet_result && $activity['is_spam'] ) + $desc = __( 'Flagged as spam by Akismet', 'buddypress' ); + + elseif ( 'false' == $akismet_result && !$activity['is_spam'] ) + $desc = __( 'Cleared by Akismet', 'buddypress' ); + + } else { + $who = bp_activity_get_meta( $activity['id'], '_bp_akismet_user' ); + + if ( 'true' == $user_result ) + $desc = sprintf( __( 'Flagged as spam by %s', 'buddypress' ), $who ); + else + $desc = sprintf( __( 'Un-spammed by %s', 'buddypress' ), $who ); + } + + // Add a History item to the hover links, just after Edit. + if ( $akismet_result ) { + $b = array(); + foreach ( $actions as $k => $item ) { + $b[ $k ] = $item; + if ( $k == 'edit' ) + $b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; + } + + $actions = $b; + } + + if ( $desc ) + echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>'; + + /** + * Filters the list of actions for the current activity's row. + * + * @since 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 ); + } + + /** + * Generate nonces for activity forms. + * + * These nonces appear in the member profile status form, as well as in + * the reply form of each activity item. The nonces are, in turn, used + * by Akismet to help detect spam activity. + * + * @since 1.6.0 + * + * @see https://plugins.trac.wordpress.org/ticket/1232 + */ + public function add_activity_stream_nonce() { + $form_id = '_bp_as_nonce'; + $value = '_bp_as_nonce_' . bp_loggedin_user_id(); + + // If we're in the activity stream loop, we can use the current item's ID to make the nonce unique. + if ( 'bp_activity_entry_comments' == current_filter() ) { + $form_id .= '_' . bp_get_activity_id(); + $value .= '_' . bp_get_activity_id(); + } + + wp_nonce_field( $value, $form_id, false ); + } + + /** + * Clean up the bp_latest_update usermeta in case of spamming. + * + * Run just after an update is posted, this method check to see whether + * the newly created update has been marked as spam by Akismet. If so, + * the cached update is cleared from the user's 'bp_latest_update' + * usermeta, ensuring that it won't appear in the member header and + * elsewhere in the theme. + * + * This can't be done in BP_Akismet::check_activity() due to the + * default AJAX implementation; see bp_dtheme_post_update(). + * + * @since 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. + */ + public function check_member_activity_update( $content, $user_id, $activity_id ) { + // By default, only handle activity updates and activity comments. + if ( empty( $this->last_activity ) || !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) ) + return; + + // Was this $activity_id just marked as spam? If not, bail out. + if ( !$this->last_activity->id || $activity_id != $this->last_activity->id || 'false' == $this->last_activity->akismet_submission['bp_as_result'] ) + return; + + // It was, so delete the member's latest activity update. + bp_delete_user_meta( $user_id, 'bp_latest_update' ); + } + + /** + * Adds a "mark as spam" button to each activity item for site admins. + * + * This function is intended to be used inside the activity stream loop. + * + * @since 1.6.0 + */ + public function add_activity_spam_button() { + if ( !bp_activity_user_can_mark_spam() ) + return; + + // By default, only handle activity updates and activity comments. + if ( !in_array( bp_get_activity_type(), BP_Akismet::get_activity_types() ) ) + return; + + bp_button( + array( + 'block_self' => false, + 'component' => 'activity', + 'id' => 'activity_make_spam_' . bp_get_activity_id(), + 'link_class' => 'bp-secondary-action spam-activity confirm button item-button', + 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_id() . '/', 'bp_activity_akismet_spam_' . bp_get_activity_id() ), + 'link_text' => __( 'Spam', 'buddypress' ), + 'wrapper' => false, + ) + ); + } + + /** + * Adds a "mark as spam" button to each activity COMMENT item for site admins. + * + * This function is intended to be used inside the activity stream loop. + * + * @since 1.6.0 + */ + public function add_activity_comment_spam_button() { + if ( !bp_activity_user_can_mark_spam() ) + return; + + // By default, only handle activity updates and activity comments. + $current_comment = bp_activity_current_comment(); + if ( empty( $current_comment ) || !in_array( $current_comment->type, BP_Akismet::get_activity_types() ) ) + return; + + bp_button( + array( + 'block_self' => false, + 'component' => 'activity', + 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), + 'link_class' => 'bp-secondary-action spam-activity-comment confirm', + 'link_href' => wp_nonce_url( bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id() ), + 'link_text' => __( 'Spam', 'buddypress' ), + 'wrapper' => false, + ) + ); + } + + /** + * Get a filterable list of activity types that Akismet should automatically check for spam. + * + * @since 1.6.0 + * + * @static + * + * @return array $value List of activity types. + */ + public static function get_activity_types() { + + /** + * Filters the list of activity types that Akismet should automatically check for spam. + * + * @since 1.6.0 + * + * @param array $value 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 1.6.0 + * + * @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 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 1.6.0 + * + * @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 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 1.6.0 + * + * @see http://akismet.com/development/api/#comment-check + * @static + * + * @param BP_Activity_Activity $activity Activity item data. + * @return array $activity_data + */ + public static function build_akismet_data_package( $activity ) { + $userdata = get_userdata( $activity->user_id ); + + $activity_data = array(); + $activity_data['akismet_comment_nonce'] = 'inactive'; + $activity_data['comment_author'] = $userdata->display_name; + $activity_data['comment_author_email'] = $userdata->user_email; + $activity_data['comment_author_url'] = bp_core_get_userlink( $userdata->ID, false, true); + $activity_data['comment_content'] = $activity->content; + $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 ); + + /** + * Get the nonce if the new activity was submitted through the "what's up, Paul?" form. + * This helps Akismet ensure that the update was a valid form submission. + */ + if ( !empty( $_POST['_bp_as_nonce'] ) ) + $activity_data['akismet_comment_nonce'] = wp_verify_nonce( $_POST['_bp_as_nonce'], "_bp_as_nonce_{$userdata->ID}" ) ? 'passed' : 'failed'; + + /** + * If the new activity was a reply to an existing item, check the nonce with the activity parent ID. + * This helps Akismet ensure that the update was a valid form submission. + */ + 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 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 1.6.0 + * + * @see http://akismet.com/development/api/ + * @todo Spam counter? + * @todo Auto-delete old spam? + * + * @param BP_Activity_Activity $activity The activity item to check. + */ + public function check_activity( $activity ) { + // By default, only handle activity updates and activity comments. + if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) + return; + + // Make sure last_activity is clear to avoid any confusion. + $this->last_activity = null; + + // Build data package for Akismet. + $activity_data = BP_Akismet::build_akismet_data_package( $activity ); + + // Check with Akismet to see if this is spam. + $activity_data = $this->send_akismet_request( $activity_data, 'check', 'spam' ); + + // Record this item. + $this->last_activity = $activity; + + // Store a copy of the data that was submitted to Akismet. + $this->last_activity->akismet_submission = $activity_data; + + // Spam. + if ( 'true' == $activity_data['bp_as_result'] ) { + /** + * Fires after an activity item has been proven to be spam, but before officially being marked as spam. + * + * @since 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. + bp_activity_mark_as_spam( $activity, 'by_akismet' ); + } + + // Update activity meta after a spam check. + add_action( 'bp_activity_after_save', array( $this, 'update_activity_akismet_meta' ), 1, 1 ); + } + + /** + * Update activity meta after a manual spam change (user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_spam_meta( $activity ) { + // By default, only handle activity updates and activity comments. + if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) + return; + + $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-spam' ); + bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'true' ); + bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() ); + } + + /** + * Update activity meta after a manual ham change (user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_ham_meta( $activity ) { + // By default, only handle activity updates and activity comments. + if ( !in_array( $activity->type, BP_Akismet::get_activity_types() ) ) + return; + + $this->update_activity_history( $activity->id, sprintf( __( '%s reported this activity as not spam', 'buddypress' ), bp_get_loggedin_user_username() ), 'report-ham' ); + bp_activity_update_meta( $activity->id, '_bp_akismet_user_result', 'false' ); + bp_activity_update_meta( $activity->id, '_bp_akismet_user', bp_get_loggedin_user_username() ); + } + + /** + * Update activity meta after an automatic spam check (not user-initiated). + * + * @since 1.6.0 + * + * @param BP_Activity_Activity $activity The activity to check. + */ + public function update_activity_akismet_meta( $activity ) { + // Check we're dealing with what was last updated by Akismet. + if ( empty( $this->last_activity ) || !empty( $this->last_activity ) && $activity->id != $this->last_activity->id ) + return; + + // By default, only handle activity updates and activity comments. + if ( !in_array( $this->last_activity->type, BP_Akismet::get_activity_types() ) ) + return; + + // Spam. + if ( 'true' == $this->last_activity->akismet_submission['bp_as_result'] ) { + bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'true' ); + $this->update_activity_history( $activity->id, __( 'Akismet caught this item as spam', 'buddypress' ), 'check-spam' ); + + // Not spam. + } elseif ( 'false' == $this->last_activity->akismet_submission['bp_as_result'] ) { + bp_activity_update_meta( $activity->id, '_bp_akismet_result', 'false' ); + $this->update_activity_history( $activity->id, __( 'Akismet cleared this item', 'buddypress' ), 'check-ham' ); + + // Uh oh, something's gone horribly wrong. Unexpected result. + } else { + bp_activity_update_meta( $activity->id, '_bp_akismet_error', bp_core_current_time() ); + $this->update_activity_history( $activity->id, sprintf( __( 'Akismet was unable to check this item (response: %s), will automatically retry again later.', 'buddypress' ), $this->last_activity->akismet_submission['bp_as_result'] ), 'check-error' ); + } + + // Record the original data which was submitted to Akismet for checking. + bp_activity_update_meta( $activity->id, '_bp_akismet_submission', $this->last_activity->akismet_submission ); + } + + /** + * Contact Akismet to check if this is spam or ham. + * + * Props to WordPress core Akismet plugin for a lot of this. + * + * @since 1.6.0 + * + * @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' ) { + $query_string = $path = ''; + + $activity_data['blog'] = bp_get_option( 'home' ); + $activity_data['blog_charset'] = bp_get_option( 'blog_charset' ); + $activity_data['blog_lang'] = get_locale(); + $activity_data['referrer'] = $_SERVER['HTTP_REFERER']; + $activity_data['user_agent'] = bp_core_current_user_ua(); + $activity_data['user_ip'] = bp_core_current_user_ip(); + + if ( Akismet::is_test_mode() ) + $activity_data['is_test'] = 'true'; + + // Loop through _POST args and rekey strings. + foreach ( $_POST as $key => $value ) + if ( is_string( $value ) && 'cookie' != $key ) + $activity_data['POST_' . $key] = $value; + + // Keys to ignore. + $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ); + + // Loop through _SERVER args and remove whitelisted keys. + foreach ( $_SERVER as $key => $value ) { + + // Key should not be ignored. + if ( !in_array( $key, $ignore ) && is_string( $value ) ) { + $activity_data[$key] = $value; + + // Key should be ignored. + } else { + $activity_data[$key] = ''; + } + } + + foreach ( $activity_data as $key => $data ) + $query_string .= $key . '=' . urlencode( stripslashes( $data ) ) . '&'; + + if ( 'check' == $check ) + $path = 'comment-check'; + elseif ( 'submit' == $check ) + $path = 'submit-' . $spam; + + // Send to Akismet. + add_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) ); + $response = Akismet::http_post( $query_string, $path ); + remove_filter( 'akismet_ua', array( $this, 'buddypress_ua' ) ); + + // Get the response. + if ( ! empty( $response[1] ) && ! is_wp_error( $response[1] ) ) + $activity_data['bp_as_result'] = $response[1]; + else + $activity_data['bp_as_result'] = false; + + // Perform a daily tidy up. + if ( ! wp_next_scheduled( 'bp_activity_akismet_delete_old_metadata' ) ) + wp_schedule_event( time(), 'daily', 'bp_activity_akismet_delete_old_metadata' ); + + return $activity_data; + } + + /** + * Filters user agent when sending to Akismet to add BuddyPress info. + * + * @since 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 ) { + $user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' ); + return $user_agent; + } + + /** + * Adds a "History" meta box to the activity edit screen. + * + * @since 1.6.0 + * + * @param string $screen_action The type of screen that has been requested. + */ + function add_history_metabox( $screen_action ) { + // Only proceed if we're on the edit screen. + if ( 'edit' != $screen_action ) + return; + + // Display meta box with a low priority (low position on screen by default). + add_meta_box( 'bp_activity_history', __( 'Activity History', 'buddypress' ), array( $this, 'history_metabox' ), get_current_screen()->id, 'normal', 'low' ); + } + + /** + * History meta box for the Activity admin edit screen. + * + * @since 1.6.0 + * + * @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. + */ + function history_metabox( $item ) { + $history = BP_Akismet::get_activity_history( $item->id ); + + if ( empty( $history ) ) + return; + + echo '<div class="akismet-history"><div>'; + printf( _x( '%1$s — %2$s', 'x hours ago - akismet cleared this item', 'buddypress' ), '<span>' . bp_core_time_since( $history[2] ) . '</span>', esc_html( $history[1] ) ); + echo '</div></div>'; + } + + /** + * Update an activity item's Akismet history. + * + * @since 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. + */ + public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) { + $event = array( + 'event' => $event, + 'message' => $message, + 'time' => Akismet::_get_microtime(), + 'user' => bp_loggedin_user_id(), + ); + + // Save the history data. + bp_activity_update_meta( $activity_id, '_bp_akismet_history', $event ); + } + + /** + * Get an activity item's Akismet history. + * + * @since 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 ) { + $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' ); + if ( $history === false ) + $history = array(); + + // Sort it by the time recorded. + usort( $history, 'akismet_cmp_time' ); + + return $history; + } +} diff --git a/wp-content/plugins/buddypress/bp-activity/js/mentions.js b/wp-content/plugins/buddypress/bp-activity/js/mentions.js index 17d8bfca9376ac7696396255680eea4ec450b903..f9a1e82ee3010c230bcd2e8c30b945e8424a7a11 100644 --- a/wp-content/plugins/buddypress/bp-activity/js/mentions.js +++ b/wp-content/plugins/buddypress/bp-activity/js/mentions.js @@ -17,7 +17,7 @@ window.bp = window.bp || {}; * Adds BuddyPress @mentions to form inputs. * * @param {array|object} options If array, becomes the suggestions' data source. If object, passed as config to $.atwho(). - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ $.fn.bp_mentions = function( options ) { if ( $.isArray( options ) ) { @@ -44,7 +44,7 @@ window.bp = window.bp || {}; * @param {array} data * @param {string} search_key * @return {array} - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ filter: function( query, data, search_key ) { var item, _i, _len, _results = [], @@ -67,7 +67,7 @@ window.bp = window.bp || {}; * @param {unknown} li * @param {string} query * @return {string} - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ highlighter: function( li, query ) { if ( ! query ) { @@ -84,7 +84,7 @@ window.bp = window.bp || {}; * Reposition the suggestion list dynamically. * * @param {unknown} offset - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ before_reposition: function( offset ) { // get the iframe, if any, already applied with atwho @@ -141,7 +141,7 @@ window.bp = window.bp || {}; * @param {string) content The content that will be inserted. * @param {string) suffix Applied to the end of the content string. * @return {string} - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ inserting_wrapper: function( $inputor, content, suffix ) { return '' + content + suffix; @@ -159,7 +159,7 @@ window.bp = window.bp || {}; * * @param {string} query Partial @mention to search for. * @param {function} render_view Render page callback function. - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ remote_filter: function( query, render_view ) { var self = $( this ), @@ -186,7 +186,7 @@ window.bp = window.bp || {}; * Success callback for the @suggestions lookup. * * @param {object} response Details of users matching the query. - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ .done(function( response ) { if ( ! response.success ) { @@ -200,7 +200,7 @@ window.bp = window.bp || {}; * * @param {array} suggestion A suggestion's original data. * @return {array} A suggestion's new data. - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function( suggestion ) { suggestion.search = suggestion.search || suggestion.ID + ' ' + suggestion.name; @@ -221,7 +221,7 @@ window.bp = window.bp || {}; * * @param {array} suggestion A suggestion's original data. * @return {array} A suggestion's new data. - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function( suggestion ) { suggestion.search = suggestion.search || suggestion.ID + ' ' + suggestion.name; @@ -252,4 +252,4 @@ window.bp = window.bp || {}; .bp_mentions( bp.mentions.users ); } }; -})( bp, jQuery ); \ No newline at end of file +})( bp, 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 31b952033a83de7d8b9f010f033789df69aaf4f2..0564f84e7763993b7fae3763b84f4ca178514605 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ -window.bp=window.bp||{},function(a,b){var c,d=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});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(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(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-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(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),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,e){var f=b(this),g={};return c=d[a],"object"==typeof c?void e(c):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(c){if(c.success){var f=b.map(c.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});d[a]=f,e(f)}})))}},data:b.map(a.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=b.extend(!0,{},e,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b("#content_ifr")[0]).bp_mentions(a.mentions.users)}}(bp,jQuery); \ No newline at end of file +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */ +window.bp=window.bp||{},function(a,b,c){var d,e=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var c={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(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(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-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(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),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,c){var f=b(this),g={};return d=e[a],"object"==typeof d?void c(d):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(d){if(d.success){var f=b.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});e[a]=f,c(f)}})))}},data:b.map(a.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=b.extend(!0,{},c,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b("#content_ifr")[0]).bp_mentions(a.mentions.users)}}(bp,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 2d77f1141813fd59a6cae211698f1816a4673858..16e226d4bd8f344faf88bb129d69b496c92c9bcf 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php @@ -1,32 +1,32 @@ <?php - /** * BuddyPress Blogs Actions. * * @package BuddyPress * @subpackage BlogsActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Redirect to a random blog in the multisite network. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ function bp_blogs_redirect_to_random_blog() { - // Bail if not looking for a random blog + // Bail if not looking for a random blog. if ( ! bp_is_blogs_component() || ! isset( $_GET['random-blog'] ) ) return; - // Multisite is active so find a random blog + // Multisite is active so find a random blog. if ( is_multisite() ) { $blog = bp_blogs_get_random_blogs( 1, 1 ); bp_core_redirect( get_home_url( $blog['blogs'][0]->blog_id ) ); - // No multisite and still called, always redirect to root + // No multisite and still called, always redirect to root. } else { bp_core_redirect( bp_core_get_root_domain() ); } 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 c29e56bc50f1d1efa4999246c7acc8533bfdb903..b822f500b535d1439c5fd0c5bd1e3c4612fb75c6 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php @@ -1,33 +1,26 @@ <?php - /** * BuddyPress Blogs Activity. * * @package BuddyPress * @subpackage BlogsActivity + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Register activity actions for the blogs component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return bool|null Returns false if activity component is not active. */ function bp_blogs_register_activity_actions() { - $bp = buddypress(); - - // Bail if activity is not active - if ( ! bp_is_active( 'activity' ) ) { - return false; - } - if ( is_multisite() ) { bp_activity_set_action( - $bp->blogs->id, + buddypress()->blogs->id, 'new_blog', __( 'New site created', 'buddypress' ), 'bp_blogs_format_activity_action_new_blog', @@ -37,35 +30,98 @@ function bp_blogs_register_activity_actions() { ); } - // 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) + * @since 1.1.0 */ do_action( 'bp_blogs_register_activity_actions' ); } add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' ); +/** + * Set up the tracking arguments for the 'post' post type. + * + * @since 2.5.0 This was moved out of the BP_Blogs_Component class. + * + * @see bp_activity_get_post_type_tracking_args() for information on parameters. + * + * @param object|null $params Tracking arguments. + * @param string|int $post_type Post type to track. + * @return object + */ +function bp_blogs_register_post_tracking_args( $params = null, $post_type = 0 ) { + + /** + * Filters the post types to track for the Blogs component. + * + * @since 1.5.0 + * @deprecated 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 = buddypress()->blogs->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; + + if ( post_type_supports( $post_type, 'comments' ) ) { + $params->comment_action_id = 'new_blog_comment'; + + /** + * Filters the post types to track for the Blogs component. + * + * @since 1.5.0 + * @deprecated 2.5.0 + * + * Make sure plugins still using 'bp_blogs_record_comment_post_types' + * to track comment about their post types will generate new_blog_comment activities + * See https://buddypress.trac.wordpress.org/ticket/6306 + * + * @param array $value Array of post types to track. + */ + $comment_post_types = apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) ); + $comment_post_types_array = array_flip( $comment_post_types ); + + if ( isset( $comment_post_types_array[ $post_type ] ) ) { + $params->comments_tracking = new stdClass(); + $params->comments_tracking->component_id = buddypress()->blogs->id; + $params->comments_tracking->action_id = 'new_blog_comment'; + $params->comments_tracking->admin_filter = __( 'New post comment posted', 'buddypress' ); + $params->comments_tracking->format_callback = 'bp_blogs_format_activity_action_new_blog_comment'; + $params->comments_tracking->front_filter = __( 'Comments', 'buddypress' ); + $params->comments_tracking->contexts = array( 'activity', 'member' ); + $params->comments_tracking->position = 10; + } + } + + return $params; +} +add_filter( 'bp_activity_get_post_type_tracking_args', 'bp_blogs_register_post_tracking_args', 10, 2 ); + /** * Format 'new_blog' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. - * @param obj $activity Activity data object. + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string */ function bp_blogs_format_activity_action_new_blog( $action, $activity ) { $blog_url = bp_blogs_get_blogmeta( $activity->item_id, 'url' ); @@ -73,7 +129,7 @@ function bp_blogs_format_activity_action_new_blog( $action, $activity ) { $action = sprintf( __( '%s created the site %s', 'buddypress' ), bp_core_get_userlink( $activity->user_id ), '<a href="' . esc_url( $blog_url ) . '">' . esc_html( $blog_name ) . '</a>' ); - // Legacy filter - requires the BP_Blogs_Blog object + // Legacy filter - requires the BP_Blogs_Blog object. if ( has_filter( 'bp_blogs_activity_created_blog_action' ) ) { $user_blog = BP_Blogs_Blog::get_user_blog( $activity->user_id, $activity->item_id ); if ( $user_blog ) { @@ -88,10 +144,10 @@ 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) + * @since 2.0.0 * * @param string $action Constructed activity action. - * @param obj $activity Activity data object. + * @param object $activity Activity data object. */ return apply_filters( 'bp_blogs_format_activity_action_new_blog', $action, $activity ); } @@ -99,10 +155,11 @@ function bp_blogs_format_activity_action_new_blog( $action, $activity ) { /** * Format 'new_blog_post' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. - * @param obj $activity Activity data object. + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string Constructed activity action. */ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { $blog_url = bp_blogs_get_blogmeta( $activity->item_id, 'url' ); @@ -137,21 +194,21 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { $post_url = add_query_arg( 'p', $activity->secondary_item_id, trailingslashit( $blog_url ) ); } - // Should be the case when the post has just been published + // Should be the case when the post has just been published. if ( isset( $activity->post_title ) ) { $post_title = $activity->post_title; - // If activity already exists try to get the post title from activity meta + // 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 + * or the activity meta was not found. */ if ( empty( $post_title ) ) { - // Defaults to no title + // Defaults to no title. $post_title = esc_html__( '(no title)', 'buddypress' ); switch_to_blog( $activity->item_id ); @@ -163,7 +220,7 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { $post_title = $post->post_title; } - // Make sure the activity exists before saving the post title in activity meta + // 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 ); } @@ -172,19 +229,19 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { restore_current_blog(); } - // Build the 'post link' part of the activity action string + // 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 + // 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 { $action = sprintf( __( '%1$s wrote a new post, %2$s', 'buddypress' ), $user_link, $post_link ); } - // Legacy filter - requires the post object + // Legacy filter - requires the post object. if ( has_filter( 'bp_blogs_activity_new_post_action' ) ) { switch_to_blog( $activity->item_id ); $post = get_post( $activity->secondary_item_id ); @@ -198,10 +255,10 @@ 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) + * @since 2.0.0 * * @param string $action Constructed activity action. - * @param obj $activity Activity data object. + * @param object $activity Activity data object. */ return apply_filters( 'bp_blogs_format_activity_action_new_blog_post', $action, $activity ); } @@ -209,14 +266,42 @@ function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) { /** * Format 'new_blog_comment' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. - * @param obj $activity Activity data object. + * @param string $action Static activity action. + * @param object $activity Activity data object. + * @return string Constructed activity action. */ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) { - $blog_url = bp_blogs_get_blogmeta( $activity->item_id, 'url' ); - $blog_name = bp_blogs_get_blogmeta( $activity->item_id, 'name' ); + /** + * When the comment is published we are faking an activity object + * to which we add 4 properties : + * - the post url + * - the post title + * - the blog url + * - the blog name + * 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. + */ + + $blog_url = false; + + // Try to get the blog url from the activity object + if ( isset( $activity->blog_url ) ) { + $blog_url = $activity->blog_url; + } else { + $blog_url = bp_blogs_get_blogmeta( $activity->item_id, 'url' ); + } + + $blog_name = false; + + // Try to get the blog name from the activity object + if ( isset( $activity->blog_name ) ) { + $blog_name = $activity->blog_name; + } else { + $blog_name = bp_blogs_get_blogmeta( $activity->item_id, 'name' ); + } if ( empty( $blog_url ) || empty( $blog_name ) ) { $blog_url = get_home_url( $activity->item_id ); @@ -226,10 +311,33 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) bp_blogs_update_blogmeta( $activity->item_id, 'name', $blog_name ); } - $post_url = bp_activity_get_meta( $activity->id, 'post_url' ); - $post_title = bp_activity_get_meta( $activity->id, 'post_title' ); + $post_url = false; + + // Try to get the post url from the activity object + 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. + */ + } elseif ( ! empty( $activity->id ) ) { + $post_url = bp_activity_get_meta( $activity->id, 'post_url' ); + } + + $post_title = false; + + // Should be the case when the comment has just been published + if ( isset( $activity->post_title ) ) { + $post_title = $activity->post_title; + + // If activity already exists try to get the post title from activity meta + } elseif ( ! empty( $activity->id ) ) { + $post_title = bp_activity_get_meta( $activity->id, 'post_title' ); + } - // Should only be empty at the time of post creation + // Should only be empty at the time of post creation. if ( empty( $post_url ) || empty( $post_title ) ) { switch_to_blog( $activity->item_id ); @@ -259,7 +367,7 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) $action = sprintf( __( '%1$s commented on the post, %2$s', 'buddypress' ), $user_link, $post_link ); } - // Legacy filter - requires the comment object + // Legacy filter - requires the comment object. if ( has_filter( 'bp_blogs_activity_new_comment_action' ) ) { switch_to_blog( $activity->item_id ); $comment = get_comment( $activity->secondary_item_id ); @@ -273,10 +381,10 @@ 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) + * @since 2.0.0 * * @param string $action Constructed activity action. - * @param obj $activity Activity data object. + * @param object $activity Activity data object. */ return apply_filters( 'bp_blogs_format_activity_action_new_blog_comment', $action, $activity ); } @@ -286,7 +394,7 @@ function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) * * This reduces database overhead during the activity loop. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Array of activity items. * @return array @@ -317,11 +425,11 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_blogs_prefetch_activity_obje /** * Record blog-related activity to the activity stream. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see bp_activity_add() for description of parameters. * - * @param array $args { + * @param array|string $args { * See {@link bp_activity_add()} for complete description of arguments. * The arguments listed here have different default values from * bp_activity_add(). @@ -330,20 +438,12 @@ 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 = '' ) { - - // Bail if activity is not active - if ( ! bp_is_active( 'activity' ) ) { - return false; - } - - $bp = buddypress(); - $defaults = array( 'user_id' => bp_loggedin_user_id(), 'action' => '', 'content' => '', 'primary_link' => '', - 'component' => $bp->blogs->id, + 'component' => buddypress()->blogs->id, 'type' => false, 'item_id' => false, 'secondary_item_id' => false, @@ -358,7 +458,7 @@ function bp_blogs_record_activity( $args = '' ) { /** * Filters the action associated with activity for activity stream. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Action for the activity stream. */ @@ -370,7 +470,7 @@ function bp_blogs_record_activity( $args = '' ) { /** * Filters the content associated with activity for activity stream. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Generated summary from content for the activity stream. * @param string $value Content for the activity stream. @@ -394,11 +494,11 @@ function bp_blogs_record_activity( $args = '' ) { /** * Delete a blog-related activity stream item. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see bp_activity_delete() for description of parameters. * - * @param array $args { + * @param array|string $args { * See {@link bp_activity_delete()} for complete description of arguments. * The arguments listed here have different default values from * bp_activity_add(). @@ -407,12 +507,6 @@ function bp_blogs_record_activity( $args = '' ) { * @return bool True on success, false on failure. */ function bp_blogs_delete_activity( $args = '' ) { - - // Bail if activity is not active - if ( ! bp_is_active( 'activity' ) ) { - return false; - } - $r = bp_parse_args( $args, array( 'item_id' => false, 'component' => buddypress()->blogs->id, @@ -435,9 +529,9 @@ function bp_blogs_delete_activity( $args = '' ) { * to blogmeta and checks the values in blogmeta instead. This is to prevent * multiple {@link switch_to_blog()} calls in the activity stream. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param object $activity The BP_Activity_Activity object + * @param object $activity The BP_Activity_Activity object. * @return bool */ function bp_blogs_comments_open( $activity ) { @@ -445,24 +539,24 @@ function bp_blogs_comments_open( $activity ) { $blog_id = $activity->item_id; - // see if we've mirrored the close comments option before + // See if we've mirrored the close comments option before. $days_old = bp_blogs_get_blogmeta( $blog_id, 'close_comments_days_old' ); - // we've never cached these items before, so do it now + // We've never cached these items before, so do it now. if ( '' === $days_old ) { switch_to_blog( $blog_id ); - // use comments_open() + // Use comments_open(). remove_filter( 'comments_open', 'bp_comments_open', 10, 2 ); $open = comments_open( $activity->secondary_item_id ); add_filter( 'comments_open', 'bp_comments_open', 10, 2 ); - // might as well mirror values to blogmeta since we're here! + // Might as well mirror values to blogmeta since we're here! $thread_depth = get_option( 'thread_comments' ); if ( ! empty( $thread_depth ) ) { $thread_depth = get_option( 'thread_comments_depth' ); } else { - // perhaps filter this? + // Perhaps filter this? $thread_depth = 1; } @@ -472,11 +566,11 @@ function bp_blogs_comments_open( $activity ) { restore_current_blog(); - // check blogmeta and manually check activity item - // basically a copy of _close_comments_for_old_post() + // Check blogmeta and manually check activity item. + // Basically a copy of _close_comments_for_old_post(). } else { - // comments are closed + // Comments are closed. if ( 'closed' == bp_activity_get_meta( $activity->id, 'post_comment_status' ) ) { return false; } @@ -490,7 +584,8 @@ function bp_blogs_comments_open( $activity ) { return $open; } - /* commenting out for now - needs some more thought... + /* + Commenting out for now - needs some more thought... should we add the post type to activity meta? $post = get_post($post_id); @@ -518,97 +613,107 @@ function bp_blogs_comments_open( $activity ) { * * Note: This is only a one-way sync - activity comments -> blog comment. * - * For blog post -> activity comment, see {@link bp_blogs_record_comment()}. + * For blog post -> activity comment, see {@link bp_activity_post_type_comment()}. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * @since 2.5.0 Allow custom post types to sync their comments with activity ones * - * @param int $comment_id The activity ID for the posted activity comment. - * @param array $params Parameters for the activity comment. - * @param object Parameters of the parent activity item (in this case, the blog post). + * @param int $comment_id The activity ID for the posted activity comment. + * @param array $params Parameters for the activity comment. + * @param object $parent_activity Parameters of the parent activity item (in this case, the blog post). */ function bp_blogs_sync_add_from_activity_comment( $comment_id, $params, $parent_activity ) { - // if parent activity isn't a blog post, stop now! - if ( $parent_activity->type != 'new_blog_post' ) { + // if parent activity isn't a post type having the buddypress-activity support, stop now! + if ( ! bp_activity_type_supports( $parent_activity->type, 'post-type-comment-tracking' ) ) { return; } - // if activity comments are disabled for blog posts, stop now! + // If activity comments are disabled for blog posts, stop now! if ( bp_disable_blogforum_comments() ) { return; } - // get userdata + // Get userdata. if ( $params['user_id'] == bp_loggedin_user_id() ) { $user = buddypress()->loggedin_user->userdata; } else { $user = bp_core_get_core_userdata( $params['user_id'] ); } - // see if a parent WP comment ID exists - if ( ! empty( $params['parent_id'] ) ) { - $comment_parent = bp_activity_get_meta( $params['parent_id'], 'bp_blogs_post_comment_id' ); - } else { - $comment_parent = 0; + // Get associated post type and set default comment parent + $post_type = bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ); + $comment_parent = 0; + + // See if a parent WP comment ID exists. + if ( ! empty( $params['parent_id'] ) && ! empty( $post_type ) ) { + $comment_parent = bp_activity_get_meta( $params['parent_id'], "bp_blogs_{$post_type}_comment_id" ); } - // comment args + // Comment args. $args = array( 'comment_post_ID' => $parent_activity->secondary_item_id, 'comment_author' => bp_core_get_user_displayname( $params['user_id'] ), 'comment_author_email' => $user->user_email, 'comment_author_url' => bp_core_get_user_domain( $params['user_id'], $user->user_nicename, $user->user_login ), 'comment_content' => $params['content'], - 'comment_type' => '', // could be interesting to add 'buddypress' here... + 'comment_type' => '', // Could be interesting to add 'buddypress' here... 'comment_parent' => (int) $comment_parent, 'user_id' => $params['user_id'], - - // commenting these out for now - //'comment_author_IP' => '127.0.0.1', - //'comment_agent' => '', - 'comment_approved' => 1 ); - // prevent separate activity entry being made - remove_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 ); + // Prevent separate activity entry being made. + remove_action( 'comment_post', 'bp_activity_post_type_comment', 10, 2 ); - // handle multisite + // Handle multisite. switch_to_blog( $parent_activity->item_id ); - // handle timestamps for the WP comment after we've switched to the blog + // Handle timestamps for the WP comment after we've switched to the blog. $args['comment_date'] = current_time( 'mysql' ); $args['comment_date_gmt'] = current_time( 'mysql', 1 ); - // post the comment + // Post the comment. $post_comment_id = wp_insert_comment( $args ); - // add meta to comment + // Add meta to comment. add_comment_meta( $post_comment_id, 'bp_activity_comment_id', $comment_id ); - // add meta to activity comment - bp_activity_update_meta( $comment_id, 'bp_blogs_post_comment_id', $post_comment_id ); + // Add meta to activity comment. + if ( ! empty( $post_type ) ) { + bp_activity_update_meta( $comment_id, "bp_blogs_{$post_type}_comment_id", $post_comment_id ); + } - // resave activity comment with WP comment permalink + // Resave activity comment with WP comment permalink. // // in bp_blogs_activity_comment_permalink(), we change activity comment // permalinks to use the post comment link // // @todo since this is done after AJAX posting, the activity comment permalink - // doesn't change on the frontend until the next page refresh. + // doesn't change on the frontend until the next page refresh. $resave_activity = new BP_Activity_Activity( $comment_id ); $resave_activity->primary_link = get_comment_link( $post_comment_id ); + + /** + * Now that the activity id exists and the post comment was created, we don't need to update + * the content of the comment as there are no chances it has evolved. + */ + remove_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 ); + $resave_activity->save(); - // multisite again! + // Add the edit activity comment hook back. + add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 ); + + // Multisite again! restore_current_blog(); - // add the comment hook back - add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 ); + // Add the comment hook back. + add_action( 'comment_post', 'bp_activity_post_type_comment', 10, 2 ); /** * Fires after activity comments have been synced and posted as blog comments. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -626,94 +731,124 @@ add_action( 'bp_activity_comment_posted', 'bp_blogs_sync_add_from_activity_comme * of the 'bp_activity_delete_comment' action because we need to fetch the * activity comment children before they are deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * @since 2.5.0 Add the $delected parameter * - * @param bool $retval - * @param int $parent_activity_id The parent activity ID for the activity comment. - * @param int $activity_id The activity ID for the pending deleted activity comment. + * @param bool $retval Whether BuddyPress should continue or not. + * @param int $parent_activity_id The parent activity ID for the activity comment. + * @param int $activity_id The activity ID for the pending deleted activity comment. + * @param bool $deleted Whether the comment was deleted or not. + * @return bool */ -function bp_blogs_sync_delete_from_activity_comment( $retval, $parent_activity_id, $activity_id ) { - // check if parent activity is a blog post +function bp_blogs_sync_delete_from_activity_comment( $retval, $parent_activity_id, $activity_id, &$deleted ) { + // Check if parent activity is a blog post. $parent_activity = new BP_Activity_Activity( $parent_activity_id ); - if ( 'new_blog_post' != $parent_activity->type ) { + + // if parent activity isn't a post type having the buddypress-activity support, stop now! + if ( ! bp_activity_type_supports( $parent_activity->type, 'post-type-comment-tracking' ) ) { return $retval; } - // fetch the activity comments for the activity item + // Fetch the activity comments for the activity item. $activity = bp_activity_get( array( 'in' => $activity_id, 'display_comments' => 'stream', + 'spam' => 'all', ) ); - // get all activity comment IDs for the pending deleted item + // Get all activity comment IDs for the pending deleted item. $activity_ids = bp_activity_recurse_comments_activity_ids( $activity ); $activity_ids[] = $activity_id; - // handle multisite - // switch to the blog where the comment was made + // Handle multisite + // switch to the blog where the comment was made. switch_to_blog( $parent_activity->item_id ); - // remove associated blog comments + // Remove associated blog comments. bp_blogs_remove_associated_blog_comments( $activity_ids, current_user_can( 'moderate_comments' ) ); - // multisite again! + // Multisite again! restore_current_blog(); - // rebuild activity comment tree - // emulate bp_activity_delete_comment() + // Rebuild activity comment tree + // emulate bp_activity_delete_comment(). BP_Activity_Activity::rebuild_activity_comment_tree( $parent_activity_id ); - // we're overriding the default bp_activity_delete_comment() functionality - // so we need to return false + // Avoid the error message although the comments were successfully deleted + $deleted = true; + + // We're overriding the default bp_activity_delete_comment() functionality + // so we need to return false. return false; } -add_filter( 'bp_activity_delete_comment_pre', 'bp_blogs_sync_delete_from_activity_comment', 10, 3 ); +add_filter( 'bp_activity_delete_comment_pre', 'bp_blogs_sync_delete_from_activity_comment', 10, 4 ); /** * Updates the blog comment when the associated activity comment is edited. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_Activity_Activity $activity The activity object. */ function bp_blogs_sync_activity_edit_to_post_comment( BP_Activity_Activity $activity ) { - // not an activity comment? stop now! - if ( 'activity_comment' !== $activity->type ) { + // This is a new entry, so stop! + // We only want edits! + if ( empty( $activity->id ) || bp_disable_blogforum_comments() ) { return; } - // this is a new entry, so stop! - // we only want edits! - if ( empty( $activity->id ) ) { + // fetch parent activity item + $parent_activity = new BP_Activity_Activity( $activity->item_id ); + + // if parent activity isn't a post type having the buddypress-activity support for comments, stop now! + if ( ! bp_activity_type_supports( $parent_activity->type, 'post-type-comment-tracking' ) ) { return; } - // prevent recursion - remove_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 ); - - // Try to see if a corresponding blog comment exists - $post_comment_id = bp_activity_get_meta( $activity->id, 'bp_blogs_post_comment_id' ); + $post_type = bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ); - if ( empty( $post_comment_id ) ) { + // No associated post type for this activity comment, stop. + if ( ! $post_type ) { return; } - // fetch parent activity item - $parent_activity = new BP_Activity_Activity( $activity->item_id ); + // Try to see if a corresponding blog comment exists. + $post_comment_id = bp_activity_get_meta( $activity->id, "bp_blogs_{$post_type}_comment_id" ); - // sanity check - if ( 'new_blog_post' !== $parent_activity->type ) { + if ( empty( $post_comment_id ) ) { return; } - // handle multisite + // Handle multisite. switch_to_blog( $parent_activity->item_id ); - // update the blog post comment - wp_update_comment( array( - 'comment_ID' => $post_comment_id, - 'comment_content' => $activity->content - ) ); + // Get the comment status + $post_comment_status = wp_get_comment_status( $post_comment_id ); + $old_comment_status = $post_comment_status; + + // No need to edit the activity, as it's the activity who's updating the comment + remove_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 ); + remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment', 10, 4 ); + + if ( 1 === (int) $activity->is_spam && 'spam' !== $post_comment_status ) { + wp_spam_comment( $post_comment_id ); + } elseif ( ! $activity->is_spam ) { + if ( 'spam' === $post_comment_status ) { + wp_unspam_comment( $post_comment_id ); + } elseif ( 'trash' === $post_comment_status ) { + wp_untrash_comment( $post_comment_id ); + } else { + // Update the blog post comment. + wp_update_comment( array( + 'comment_ID' => $post_comment_id, + 'comment_content' => $activity->content, + ) ); + } + } + + // Restore actions + add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 ); + add_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment', 10, 4 ); restore_current_blog(); } @@ -729,11 +864,11 @@ add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comm * Since these activity entries are deleted, we need to remove the deleted * activity comment IDs from each comment's meta when a post is trashed. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $post_id The post ID + * @param int $post_id The post ID. * @param array $comments Array of comment statuses. The key is comment ID, the - * value is the $comment->comment_approved value. + * value is the $comment->comment_approved value. */ function bp_blogs_remove_activity_meta_for_trashed_comments( $post_id = 0, $comments = array() ) { if ( ! empty( $comments ) ) { @@ -755,62 +890,84 @@ add_action( 'trashed_post_comments', 'bp_blogs_remove_activity_meta_for_trashed_ * powers the 'Comments' filter in the activity directory dropdown) includes * both old-style and new-style activity comments. * - * This implementation involves filtering the activity queries directly, and - * should be considered a stopgap. The proper solution would involve enabling - * multiple query condition clauses, connected by an OR, in the bp_has_activities() - * API. - * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.5.0 Used for any synced Post type comments, in wp-admin or front-end contexts. * * @param array $args Arguments passed from bp_parse_args() in bp_has_activities(). * @return array $args */ function bp_blogs_new_blog_comment_query_backpat( $args ) { - // Bail if this is not a 'new_blog_comment' query - if ( 'new_blog_comment' !== $args['action'] ) { + global $wpdb; + $bp = buddypress(); + + // If activity comments are disabled for blog posts, stop now! + if ( bp_disable_blogforum_comments() ) { return $args; } - // display_comments=stream is required to show new-style - // 'activity_comment' items inline - $args['display_comments'] = 'stream'; + // Get the associated post type + $post_type = bp_activity_post_type_get_tracking_arg( $args['action'], 'post_type' ); - // For the remaining clauses, we filter the SQL query directly - add_filter( 'bp_activity_paged_activities_sql', '_bp_blogs_new_blog_comment_query_backpat_filter' ); - add_filter( 'bp_activity_total_activities_sql', '_bp_blogs_new_blog_comment_query_backpat_filter' ); + // Bail if this is not an activity associated with a post type + if ( empty( $post_type ) ) { + return $args; + } - // Return the original arguments - return $args; -} -add_filter( 'bp_after_has_activities_parse_args', 'bp_blogs_new_blog_comment_query_backpat' ); + // Bail if this is an activity about posts and not comments + if ( bp_activity_post_type_get_tracking_arg( $args['action'], 'comment_action_id' ) ) { + return $args; + } -/** - * Filter activity SQL to include new- and old-style 'new_blog_comment' activity items. - * - * @since BuddyPress (2.1.0) - * - * @access private - * @see bp_blogs_new_blog_comment_query_backpat() - * - * @param string $query SQL query as assembled in BP_Activity_Activity::get(). - * @return string $query Modified SQL query. - */ -function _bp_blogs_new_blog_comment_query_backpat_filter( $query ) { - $bp = buddypress(); + // Comment synced ? + $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT activity_id FROM {$bp->activity->table_name_meta} WHERE meta_key = %s", "bp_blogs_{$post_type}_comment_id" ) ); + + if ( empty( $activity_ids ) ) { + return $args; + } + + // Init the filter query. + $filter_query = array(); + + if ( ! isset( $args['scope'] ) || 'null' === $args['scope'] ) { + $args['scope'] = ''; + } elseif ( 'just-me' === $args['scope'] ) { + $filter_query = array( + 'relation' => 'AND', + array( + 'column' => 'user_id', + 'value' => bp_displayed_user_id(), + ), + ); + $args['scope'] = ''; + } + + $filter_query[] = array( + 'relation' => 'OR', + array( + 'column' => 'type', + 'value' => $args['action'], + ), + array( + 'column' => 'id', + 'value' => $activity_ids, + 'compare' => 'IN' + ), + ); - // The query passed to the filter is for old-style 'new_blog_comment' - // items. We include new-style 'activity_comment' items by running a - // subquery inside of a large OR clause. - $activity_comment_subquery = "SELECT a.id FROM {$bp->activity->table_name} a INNER JOIN {$bp->activity->table_name_meta} am ON (a.id = am.activity_id) WHERE am.meta_key = 'bp_blogs_post_comment_id' AND a.type = 'activity_comment'"; + $args['filter_query'] = $filter_query; - // WHERE ( [original WHERE clauses] OR a.id IN (activity_comment subquery) ) - $query = preg_replace( '|WHERE (.*?) ORDER|', 'WHERE ( ( $1 ) OR ( a.id IN ( ' . $activity_comment_subquery . ' ) ) ) ORDER', $query ); + // Make sure to have comment in stream mode && avoid duplicate content. + $args['display_comments'] = 'stream'; - // Don't run this on future queries - remove_filter( current_filter(), '_bp_blogs_new_blog_comment_query_backpat_filter' ); + // Finally reset the action. + $args['action'] = ''; + $args['type'] = ''; - return $query; + // Return the original arguments. + return $args; } +add_filter( 'bp_after_has_activities_parse_args', 'bp_blogs_new_blog_comment_query_backpat' ); +add_filter( 'bp_activity_list_table_filter_activity_type_items', 'bp_blogs_new_blog_comment_query_backpat' ); /** * Utility function to set up some variables for use in the activity loop. @@ -820,20 +977,20 @@ function _bp_blogs_new_blog_comment_query_backpat_filter( $query ) { * * This is to prevent having to requery these items later on. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @see bp_blogs_disable_activity_commenting() * @see bp_blogs_setup_comment_loop_globals_on_ajax() * - * @param object $activity The BP_Activity_Activity object + * @param object $activity The BP_Activity_Activity object. */ function bp_blogs_setup_activity_loop_globals( $activity ) { if ( ! is_object( $activity ) ) { return; } - // parent not a blog post? stop now! - if ( 'new_blog_post' !== $activity->type ) { + // The activity type does not support comments or replies ? stop now! + if ( ! bp_activity_type_supports( $activity->type, 'post-type-comment-reply' ) ) { return; } @@ -841,7 +998,7 @@ function bp_blogs_setup_activity_loop_globals( $activity ) { return; } - // if we've already done this before, stop now! + // If we've already done this before, stop now! if ( isset( buddypress()->blogs->allow_comments[ $activity->id ] ) ) { return; } @@ -849,8 +1006,8 @@ function bp_blogs_setup_activity_loop_globals( $activity ) { $allow_comments = bp_blogs_comments_open( $activity ); $thread_depth = bp_blogs_get_blogmeta( $activity->item_id, 'thread_comments_depth' ); - // initialize a local object so we won't have to query this again in the - // comment loop + // Initialize a local object so we won't have to query this again in the + // comment loop. if ( empty( buddypress()->blogs->allow_comments ) ) { buddypress()->blogs->allow_comments = array(); } @@ -858,7 +1015,7 @@ function bp_blogs_setup_activity_loop_globals( $activity ) { buddypress()->blogs->thread_depth = array(); } - // cache comment settings in the buddypress() singleton to reference later in + // Cache comment settings in the buddypress() singleton to reference later in // the activity comment loop // @see bp_blogs_disable_activity_replies() // @@ -872,12 +1029,12 @@ function bp_blogs_setup_activity_loop_globals( $activity ) { /** * Set up some globals used in the activity comment loop when AJAX is used. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @see bp_blogs_setup_activity_loop_globals() */ function bp_blogs_setup_comment_loop_globals_on_ajax() { - // not AJAX? stop now! + // Not AJAX? stop now! if ( ! defined( 'DOING_AJAX' ) ) { return; } @@ -885,11 +1042,11 @@ function bp_blogs_setup_comment_loop_globals_on_ajax() { return; } - // get the parent activity item + // Get the parent activity item. $comment = bp_activity_current_comment(); $parent_activity = new BP_Activity_Activity( $comment->item_id ); - // setup the globals + // Setup the globals. bp_blogs_setup_activity_loop_globals( $parent_activity ); } add_action( 'bp_before_activity_comment', 'bp_blogs_setup_comment_loop_globals_on_ajax' ); @@ -904,47 +1061,78 @@ add_action( 'bp_before_activity_comment', 'bp_blogs_setup_comment_loop_globals_o * based on a certain age * - the activity entry is a 'new_blog_comment' type * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param bool $retval Is activity commenting enabled for this activity entry? + * @param bool $retval Is activity commenting enabled for this activity entry. * @return bool */ function bp_blogs_disable_activity_commenting( $retval ) { - // if activity commenting is disabled, return current value - if ( bp_disable_blogforum_comments() ) { + global $activities_template; + + // If activity commenting is disabled, return current value. + if ( bp_disable_blogforum_comments() || ! isset( $activities_template->in_the_loop ) ) { return $retval; } - // activity commenting is enabled for blog posts - switch ( bp_get_activity_action_name() ) { + $type = bp_get_activity_type(); - // we still have to disable activity commenting for 'new_blog_comment' items - // commenting should only be done on the parent 'new_blog_post' item - case 'new_blog_comment' : + // It's a post type supporting comment tracking. + if ( bp_activity_type_supports( $type, 'post-type-comment-tracking' ) ) { + // The activity type is supporting comments or replies + if ( bp_activity_type_supports( $type, 'post-type-comment-reply' ) ) { + // Setup some globals we'll need to reference later. + bp_blogs_setup_activity_loop_globals( $activities_template->activity ); + + // If comments are closed for the WP blog post, we should disable + // activity comments for this activity entry. + if ( empty( buddypress()->blogs->allow_comments[ bp_get_activity_id() ] ) ) { + $retval = false; + } + // The activity type does not support comments or replies + } else { $retval = false; + } + } - break; + return $retval; +} +add_filter( 'bp_activity_can_comment', 'bp_blogs_disable_activity_commenting' ); - // check if commenting is disabled for the WP blog post - // we should extrapolate this and automate this for plugins... or not - case 'new_blog_post' : - global $activities_template; +/** + * Limit the display of post type synced comments. + * + * @since 2.5.0 + * + * When viewing the synced comments in stream mode, this prevents comments to + * be displayed twice, and avoids a Javascript error as the form to add replies + * is not available. + * + * @param int $retval The comment count for the activity. + * @return int The comment count, or 0 to hide activity comment replies. + */ +function bp_blogs_post_type_comments_avoid_duplicates( $retval ) { + /** + * Only limit the display when Post type comments are synced with + * activity comments. + */ + if ( bp_disable_blogforum_comments() ) { + return $retval; + } - // setup some globals we'll need to reference later - bp_blogs_setup_activity_loop_globals( $activities_template->activity ); + if ( 'activity_comment' !== bp_get_activity_type() ) { + return $retval; + } - // if comments are closed for the WP blog post, we should disable - // activity comments for this activity entry - if ( empty( buddypress()->blogs->allow_comments[bp_get_activity_id()] ) ) { - $retval = false; - } + // Check the parent activity + $parent_activity = new BP_Activity_Activity( bp_get_activity_item_id() ); - break; + if ( isset( $parent_activity->type ) && bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ) ) { + $retval = 0; } return $retval; } -add_filter( 'bp_activity_can_comment', 'bp_blogs_disable_activity_commenting' ); +add_filter( 'bp_activity_get_comment_count', 'bp_blogs_post_type_comments_avoid_duplicates' ); /** * Check if an activity comment associated with a blog post can be replied to. @@ -955,10 +1143,11 @@ add_filter( 'bp_activity_can_comment', 'bp_blogs_disable_activity_commenting' ); * This check uses a locally-cached value set in {@link bp_blogs_disable_activity_commenting()} * via {@link bp_blogs_setup_activity_loop_globals()}. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @param bool $retval Are replies allowed for this activity reply. + * @param object|array $comment The activity comment object. * - * @param bool $retval Are replies allowed for this activity reply? - * @param object $comment The activity comment object * @return bool */ function bp_blogs_can_comment_reply( $retval, $comment ) { @@ -966,17 +1155,17 @@ function bp_blogs_can_comment_reply( $retval, $comment ) { $comment = (object) $comment; } - // check comment depth and disable if depth is too large + // Check comment depth and disable if depth is too large. if ( isset( buddypress()->blogs->thread_depth[$comment->item_id] ) ){ if ( $comment->mptt_left > buddypress()->blogs->thread_depth[$comment->item_id] ) { $retval = false; } } - // check if we should disable activity replies based on the parent activity + // Check if we should disable activity replies based on the parent activity. if ( isset( buddypress()->blogs->allow_comments[$comment->item_id] ) ){ - // the blog post has closed off commenting, so we should disable all activity - // comments under the parent 'new_blog_post' activity entry + // The blog post has closed off commenting, so we should disable all activity + // comments under the parent 'new_blog_post' activity entry. if ( empty( buddypress()->blogs->allow_comments[$comment->item_id] ) ) { $retval = false; } @@ -993,20 +1182,20 @@ add_filter( 'bp_activity_can_comment_reply', 'bp_blogs_can_comment_reply', 10, 2 * This is only done if activity commenting is allowed and whether the parent * activity item is a 'new_blog_post' entry. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $retval The activity comment permalink + * @param string $retval The activity comment permalink. * @return string */ function bp_blogs_activity_comment_permalink( $retval = '' ) { global $activities_template; - // Get the current comment ID + // Get the current comment ID. $item_id = isset( $activities_template->activity->current_comment->item_id ) ? $activities_template->activity->current_comment->item_id : false; - // Maybe adjust the link if item ID exists + // Maybe adjust the link if item ID exists. if ( ( false !== $item_id ) && isset( buddypress()->blogs->allow_comments[ $item_id ] ) ) { $retval = $activities_template->activity->current_comment->primary_link; } @@ -1020,10 +1209,10 @@ add_filter( 'bp_get_activity_comment_permalink', 'bp_blogs_activity_comment_perm * * This is only done if the activity comment is associated with a blog comment. * - * @since BuddyPress (2.0.1) + * @since 2.0.1 * - * @param string $retval The activity permalink - * @param BP_Activity_Activity $activity + * @param string $retval The activity permalink. + * @param BP_Activity_Activity $activity Activity object. * @return string */ function bp_blogs_activity_comment_single_permalink( $retval, $activity ) { @@ -1031,9 +1220,13 @@ function bp_blogs_activity_comment_single_permalink( $retval, $activity ) { return $retval; } - $blog_comment_id = bp_activity_get_meta( $activity->id, 'bp_blogs_post_comment_id' ); + if ( bp_disable_blogforum_comments() ) { + return $retval; + } - if ( ! empty( $blog_comment_id ) ) { + $parent_activity = new BP_Activity_Activity( $activity->item_id ); + + if ( isset( $parent_activity->type ) && bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ) ) { $retval = $activity->primary_link; } @@ -1046,10 +1239,10 @@ add_filter( 'bp_activity_get_permalink', 'bp_blogs_activity_comment_single_perma * * This is only done if the activity comment is associated with a blog comment. * - * @since BuddyPress (2.0.1) + * @since 2.0.1 * - * @param string $retval The activity action - * @param BP_Activity_Activity $activity + * @param string $retval The activity action. + * @param BP_Activity_Activity $activity Activity object. * @return string */ function bp_blogs_activity_comment_single_action( $retval, $activity ) { @@ -1057,23 +1250,52 @@ function bp_blogs_activity_comment_single_action( $retval, $activity ) { return $retval; } - $blog_comment_id = bp_activity_get_meta( $activity->id, 'bp_blogs_post_comment_id' ); + if ( bp_disable_blogforum_comments() ) { + return $retval; + } + + $parent_activity = new BP_Activity_Activity( $activity->item_id ); + + if ( ! isset( $parent_activity->type ) ) { + return $retval; + } + + $post_type = bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'post_type' ); + + if ( ! $post_type ) { + return $retval; + } + + $blog_comment_id = bp_activity_get_meta( $activity->id, "bp_blogs_{$post_type}_comment_id" ); if ( ! empty( $blog_comment_id ) ) { - // fetch the parent blog post activity item - $parent_blog_post_activity = new BP_Activity_Activity( $activity->item_id ); + $bp = buddypress(); + + // Check if a comment action id is set for the parent activity + $comment_action_id = bp_activity_post_type_get_tracking_arg( $parent_activity->type, 'comment_action_id' ); + + // Use the action string callback for the activity type + if ( ! empty( $comment_action_id ) ) { + // Fake a 'new_{post_type}_comment' by cloning the activity object. + $object = clone $activity; - // fake a 'new_blog_comment' activity object - $object = $activity; + // Set the type of the activity to be a comment about a post type + $object->type = $comment_action_id; - // override 'item_id' to use blog ID - $object->item_id = $parent_blog_post_activity->item_id; + // Use the blog ID as the item_id. + $object->item_id = $parent_activity->item_id; - // override 'secondary_item_id' to use comment ID - $object->secondary_item_id = $blog_comment_id; + // Use comment ID as the secondary_item_id. + $object->secondary_item_id = $blog_comment_id; - // now format the activity action using the 'new_blog_comment' action callback - $retval = bp_blogs_format_activity_action_new_blog_comment( '', $object ); + // Get the format callback for this activity comment + $format_callback = bp_activity_post_type_get_tracking_arg( $comment_action_id, 'format_callback' ); + + // now format the activity action using the 'new_{post_type}_comment' action callback + if ( is_callable( $format_callback ) ) { + $retval = call_user_func_array( $format_callback, array( '', $object ) ); + } + } } return $retval; 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 df751d223ee19154f210932a1f5a41d2f966ce93..19e339145647d8985177ee3e230a3688b66f4c9c 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Blogs Caching. * @@ -8,9 +7,10 @@ * * @package BuddyPress * @subpackage BlogsCache + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -20,16 +20,16 @@ defined( 'ABSPATH' ) || exit; * in $blog_ids and adds it to the WP cache. This improves efficiency when * using querying blogmeta inline. * - * @param int|str|array $blog_ids Accepts a single blog ID, or a comma- - * separated list or array of blog IDs. + * @param int|string|array|bool $blog_ids Accepts a single blog ID, or a comma- + * separated list or array of blog IDs. */ function bp_blogs_update_meta_cache( $blog_ids = false ) { $cache_args = array( - 'object_ids' => $blog_ids, - 'object_type' => buddypress()->blogs->id, - 'object_column' => 'blog_id', - 'cache_group' => 'blog_meta', - 'meta_table' => buddypress()->blogs->table_name_blogmeta, + 'object_ids' => $blog_ids, + 'object_type' => buddypress()->blogs->id, + 'object_column' => 'blog_id', + 'cache_group' => 'blog_meta', + 'meta_table' => buddypress()->blogs->table_name_blogmeta, ); bp_update_meta_cache( $cache_args ); @@ -37,7 +37,7 @@ function bp_blogs_update_meta_cache( $blog_ids = false ) { /** * Clear the blog object cache. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $blog_id ID of the current blog. * @param int $user_id ID of the user whose blog cache should be cleared. @@ -51,12 +51,12 @@ function bp_blogs_clear_blog_object_cache( $blog_id = 0, $user_id = 0 ) { wp_cache_delete( 'bp_total_blogs', 'bp' ); } -// List actions to clear object caches on +// 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( '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 +// 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' ); add_action( 'bp_blogs_remove_comment', 'bp_core_clear_cache' ); add_action( 'bp_blogs_remove_post', '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 bd4219227153e2211a7bd062866bed0b41c5b462..49c55dcc0f363bcdd91ce84285e51ec6cd126e93 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Blogs Classes. * * @package BuddyPress * @subpackage BlogsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; 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 2b96a34252ccfa12121b2d7cfdbcef38541634b0..bfd96f09d824d9e0cbab6f909af6314e8ddd82ab 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php @@ -1,11 +1,10 @@ <?php - /** * Filters related to the Blogs component. * * @package BuddyPress - * @subpackage Blogs - * @since BuddyPress (1.6.0) + * @subpackage BlogFilters + * @since 1.6.0 */ /** Display Filters **********************************************************/ @@ -24,7 +23,7 @@ add_filter( 'bp_blog_latest_post_content', 'prepend_attachment' ); /** * Ensure that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Filter 'bp_blogs_creation_location' to alter the * returned value. @@ -37,7 +36,7 @@ function bp_blogs_creation_location( $url ) { /** * Filters the 'Create a new site' link URL. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value URL for the 'Create a new site' signup page. */ @@ -48,11 +47,11 @@ add_filter( 'wp_signup_location', 'bp_blogs_creation_location' ); /** * Only select comments by ID instead of all fields when using get_comments(). * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @see bp_blogs_update_post_activity_meta() * - * @param array Current SQL clauses in array format + * @param array $retval Current SQL clauses in array format. * @return array */ function bp_blogs_comments_clauses_select_by_id( $retval ) { @@ -62,16 +61,16 @@ function bp_blogs_comments_clauses_select_by_id( $retval ) { } /** - * Check whether the current post can be published. + * Check whether the current activity about a post or a comment can be published. * * Abstracted from the deprecated `bp_blogs_record_post()`. * - * @since BuddyPress (2.2.0) + * @since 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. + * @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 ) { @@ -98,7 +97,7 @@ function bp_blogs_post_pre_publish( $return = true, $blog_id = 0, $post_id = 0, /** * Filters whether or not BuddyPress should block sitewide tags activity. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param bool $value Current status of the sitewide tags activity. */ @@ -109,7 +108,7 @@ function bp_blogs_post_pre_publish( $return = true, $blog_id = 0, $post_id = 0, /** * Filters whether or not the current blog is public. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $value Value from the blog_public option for the current blog. */ @@ -122,3 +121,4 @@ function bp_blogs_post_pre_publish( $return = true, $blog_id = 0, $post_id = 0, return $return; } add_filter( 'bp_activity_post_pre_publish', 'bp_blogs_post_pre_publish', 10, 4 ); +add_filter( 'bp_activity_post_pre_comment', '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 c45590af743059b70740094555b910332c3b4066..c5383f5f20b7d7a4c793a944531f39032bfb5730 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php @@ -4,15 +4,16 @@ * * @package BuddyPress * @subpackage BlogsFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Check whether the $bp global lists an activity directory page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if set, false if empty. */ @@ -23,26 +24,26 @@ function bp_blogs_has_directory() { } /** - * Retrieve a set of blogs + * Retrieve a set of blogs. * * @see BP_Blogs_Blog::get() for a description of arguments and return value. * - * @param array $args { + * @param array|string $args { * Arguments are listed here with their default values. For more * information about the arguments, see {@link BP_Blogs_Blog::get()}. - * @type string $type Default: 'active'. - * @type int|bool $user_id Default: false. - * @type array $include_blog_ids Default: false. - * @type string|bool $search_terms Default: false. - * @type int $per_page Default: 20. - * @type int $page Default: 1. - * @type bool $update_meta_cache Whether to pre-fetch blogmeta. Default: true. + * @type string $type Default: 'active'. + * @type int|bool $user_id Default: false. + * @type array $include_blog_ids Default: false. + * @type string|bool $search_terms Default: false. + * @type int $per_page Default: 20. + * @type int $page Default: 1. + * @type bool $update_meta_cache Whether to pre-fetch blogmeta. Default: true. * } * @return array See {@link BP_Blogs_Blog::get()}. */ function bp_blogs_get_blogs( $args = '' ) { - // Parse query arguments + // Parse query arguments. $r = bp_parse_args( $args, array( 'type' => 'active', // 'active', 'alphabetical', 'newest', or 'random' 'include_blog_ids' => false, // Array of blog IDs to include @@ -53,7 +54,7 @@ function bp_blogs_get_blogs( $args = '' ) { 'update_meta_cache' => true // Whether to pre-fetch blogmeta ), 'blogs_get_blogs' ); - // Get the blogs + // Get the blogs. $blogs = BP_Blogs_Blog::get( $r['type'], $r['per_page'], @@ -64,87 +65,96 @@ function bp_blogs_get_blogs( $args = '' ) { $r['include_blog_ids'] ); - // Filter and return + // Filter and return. return apply_filters( 'bp_blogs_get_blogs', $blogs, $r ); } /** * Populate the BP blogs table with existing blogs. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @global object $wpdb WordPress database object + * @global object $wpdb WordPress database object. * @uses get_users() * @uses bp_blogs_record_blog() + * + * @return bool */ function bp_blogs_record_existing_blogs() { global $wpdb; - // Query for all sites in network + // Query for all sites in network. if ( is_multisite() ) { - // Get blog ID's if not a large network + // Get blog ID's if not a large network. if ( ! wp_is_large_network() ) { $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d", $wpdb->siteid ) ); - // If error running this query, set blog ID's to false + // If error running this query, set blog ID's to false. if ( is_wp_error( $blog_ids ) ) { $blog_ids = false; } - // Large networks are not currently supported + // Large networks are not currently supported. } else { $blog_ids = false; } - // Record a single site + // Record a single site. } else { $blog_ids = $wpdb->blogid; } - // Bail if there are no blogs in the network + // Bail if there are no blogs in the network. if ( empty( $blog_ids ) ) { return false; } - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - // Truncate user blogs table + // Truncate user blogs table. $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name}" ); if ( is_wp_error( $truncate ) ) { return false; } - // Truncate user blogsmeta table + // Truncate user blogsmeta table. $truncate = $wpdb->query( "TRUNCATE {$bp->blogs->table_name_blogmeta}" ); if ( is_wp_error( $truncate ) ) { return false; } - // Loop through users of blogs and record the relationship + // Loop through users of blogs and record the relationship. foreach ( (array) $blog_ids as $blog_id ) { - // Ensure that the cache is clear after the table TRUNCATE above + // Ensure that the cache is clear after the table TRUNCATE above. wp_cache_delete( $blog_id, 'blog_meta' ); - // Get all users + // Get all users. $users = get_users( array( 'blog_id' => $blog_id ) ); - // Continue on if no users exist for this site (how did this happen?) + // Continue on if no users exist for this site (how did this happen?). if ( empty( $users ) ) { continue; } - // Loop through users and record their relationship to this blog + // Loop through users and record their relationship to this blog. foreach ( (array) $users as $user ) { bp_blogs_add_user_to_blog( $user->ID, false, $blog_id ); } } - // No errors + /** + * Fires after the BP blogs tables have been populated with existing blogs. + * + * @since 2.4.0 + */ + do_action( 'bp_blogs_recorded_existing_blogs' ); + + // No errors. return true; } @@ -154,7 +164,7 @@ function bp_blogs_record_existing_blogs() { * If $user_id is provided, you can restrict site from being recordable * only to particular users. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -185,7 +195,7 @@ function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) { * If $user_id is provided, the developer can restrict site from * being trackable only to particular users. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_blogs_is_blog_recordable * @uses apply_filters() @@ -214,14 +224,14 @@ function bp_blogs_is_blog_trackable( $blog_id, $user_id = 0 ) { /** * Make BuddyPress aware of a new site so that it can track its activity. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses BP_Blogs_Blog * - * @param int $blog_id ID of the blog being recorded. - * @param int $user_id ID of the user for whom the blog is being recorded. + * @param int $blog_id ID of the blog being recorded. + * @param int $user_id ID of the user for whom the blog is being recorded. * @param bool $no_activity Optional. Whether to skip recording an activity - * item about this blog creation. Default: false. + * item about this blog creation. Default: false. * @return bool|null Returns false on failure. */ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { @@ -248,7 +258,7 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { if ( ! empty( $thread_depth ) ) { $thread_depth = get_blog_option( $blog_id, 'thread_comments_depth' ); } else { - // perhaps filter this? + // Perhaps filter this? $thread_depth = 1; } @@ -269,10 +279,10 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { $is_private = !empty( $_POST['blog_public'] ) && (int) $_POST['blog_public'] ? false : true; $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); - // Only record this activity if the blog is public - if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) { + // Only record this activity if the activity component is active and the blog is public. + if ( bp_is_active( 'activity' ) && !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) { - // Record this in activity streams + // Record this in activity streams. bp_blogs_record_activity( array( 'user_id' => $recorded_blog->user_id, 'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', $url, $recorded_blog->blog_id ), @@ -284,7 +294,7 @@ 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) + * @since 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. @@ -300,7 +310,7 @@ add_action( 'wpmu_new_blog', 'bp_blogs_record_blog', 10, 2 ); * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_blogname( $oldvalue, $newvalue ) { @@ -311,12 +321,12 @@ function bp_blogs_update_option_blogname( $oldvalue, $newvalue ) { add_action( 'update_option_blogname', 'bp_blogs_update_option_blogname', 10, 2 ); /** - * Update blog description in BuddyPress blogmeta table + * Update blog description in BuddyPress blogmeta table. * * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_blogdescription( $oldvalue, $newvalue ) { @@ -329,12 +339,12 @@ add_action( 'update_option_blogdescription', 'bp_blogs_update_option_blogdescrip /** * Update "Close comments for old posts" option in BuddyPress blogmeta table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_close_comments_for_old_posts( $oldvalue, $newvalue ) { @@ -347,12 +357,12 @@ add_action( 'update_option_close_comments_for_old_posts', 'bp_blogs_update_optio /** * Update "Close comments after days old" option in BuddyPress blogmeta table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_close_comments_days_old( $oldvalue, $newvalue ) { @@ -365,12 +375,12 @@ add_action( 'update_option_close_comments_days_old', 'bp_blogs_update_option_clo /** * When toggling threaded comments, update thread depth in blogmeta table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_thread_comments( $oldvalue, $newvalue ) { @@ -389,12 +399,12 @@ add_action( 'update_option_thread_comments', 'bp_blogs_update_option_thread_comm /** * When updating comment depth, update thread depth in blogmeta table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global object $wpdb DB Layer. * * @param string $oldvalue Value before save. Passed by do_action() but - * unused here. + * unused here. * @param string $newvalue Value to change meta to. */ function bp_blogs_update_option_thread_comments_depth( $oldvalue, $newvalue ) { @@ -414,9 +424,9 @@ add_action( 'update_option_thread_comments_depth', 'bp_blogs_update_option_threa * Hooked to 'refresh_blog_details', which is notably used when editing a site * under "Network Admin > Sites". * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param int $site_id The site ID + * @param int $site_id The site ID. */ function bp_blogs_delete_url_blogmeta( $site_id = 0 ) { bp_blogs_delete_blogmeta( (int) $site_id, 'url' ); @@ -426,10 +436,11 @@ add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' ); /** * Record activity metadata about a published blog post. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param int $activity_id ID of the activity item. - * @param WP_Post $post Post object. + * @param int $activity_id ID of the activity item. + * @param WP_Post $post Post object. + * @param array $args Array of arguments. */ function bp_blogs_publish_post_activity_meta( $activity_id, $post, $args ) { if ( empty( $activity_id ) || 'post' != $post->post_type ) { @@ -452,7 +463,7 @@ function bp_blogs_publish_post_activity_meta( $activity_id, $post, $args ) { /** * Fires after BuddyPress has recorded metadata about a published blog post. * - * @since BuddyPress (1.0.0) + * @since 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. @@ -465,13 +476,15 @@ add_action( 'bp_activity_post_type_published', 'bp_blogs_publish_post_activity_m /** * Updates a blog post's activity meta entry during a post edit. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 + * @since 2.5.0 Add the post type tracking args object parameter * - * @param WP_Post $post Post object. - * @param BP_Activity_Activity $activity Activity object. + * @param WP_Post $post Post object. + * @param BP_Activity_Activity $activity Activity object. + * @param object $activity_post_object The post type tracking args object. */ -function bp_blogs_update_post_activity_meta( $post, $activity ) { - if ( empty( $activity->id ) || 'post' != $post->post_type ) { +function bp_blogs_update_post_activity_meta( $post, $activity, $activity_post_object ) { + if ( empty( $activity->id ) || empty( $activity_post_object->action_id ) ) { return; } @@ -480,57 +493,59 @@ function bp_blogs_update_post_activity_meta( $post, $activity ) { if ( $post->post_title !== $existing_title ) { bp_activity_update_meta( $activity->id, 'post_title', $post->post_title ); - // 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' ); - - if ( ! empty( $comments ) ) { - $activity_ids = array(); - $comment_ids = wp_list_pluck( $comments, 'comment_ID' ); - - // 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. - $args['filter'] = array( - 'object' => buddypress()->blogs->id, - 'action' => 'new_blog_comment', - 'secondary_id' => implode( ',', $comment_ids ), - ); - - $activities = bp_activity_get( $args ); - if ( ! empty( $activities['activities'] ) ) { - $activity_ids = (array) wp_list_pluck( $activities['activities'], 'id' ); - } - - // Query for activity comments connected to a blog post. - unset( $args['filter'] ); - $args['meta_query'] = array( array( - 'key' => 'bp_blogs_post_comment_id', - 'value' => $comment_ids, - 'compare' => 'IN', - ) ); - $args['type'] = 'activity_comment'; - $args['display_comments'] = 'stream'; + if ( ! empty( $activity_post_object->comments_tracking->action_id ) ) { + // 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' ); + + if ( ! empty( $comments ) ) { + $activity_ids = array(); + $comment_ids = wp_list_pluck( $comments, 'comment_ID' ); + + // 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. + $args['filter'] = array( + 'object' => $activity_post_object->comments_tracking->component_id, + 'action' => $activity_post_object->comments_tracking->action_id, + 'secondary_id' => implode( ',', $comment_ids ), + ); + + $activities = bp_activity_get( $args ); + if ( ! empty( $activities['activities'] ) ) { + $activity_ids = (array) wp_list_pluck( $activities['activities'], 'id' ); + } - $activities = bp_activity_get( $args ); - if ( ! empty( $activities['activities'] ) ) { - $activity_ids = array_merge( $activity_ids, (array) wp_list_pluck( $activities['activities'], 'id' ) ); - } + // Query for activity comments connected to a blog post. + unset( $args['filter'] ); + $args['meta_query'] = array( array( + 'key' => 'bp_blogs_' . $post->post_type . '_comment_id', + 'value' => $comment_ids, + 'compare' => 'IN', + ) ); + $args['type'] = 'activity_comment'; + $args['display_comments'] = 'stream'; + + $activities = bp_activity_get( $args ); + if ( ! empty( $activities['activities'] ) ) { + $activity_ids = array_merge( $activity_ids, (array) wp_list_pluck( $activities['activities'], 'id' ) ); + } - // 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 ); + // 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 ); + } } - } - unset( $activities, $activity_ids, $comment_ids, $comments ); + unset( $activities, $activity_ids, $comment_ids, $comments ); + } } } @@ -541,182 +556,130 @@ function bp_blogs_update_post_activity_meta( $post, $activity ) { bp_activity_delete_meta( $activity->id, 'post_comment_status' ); } } -add_action( 'bp_activity_post_type_updated', 'bp_blogs_update_post_activity_meta', 10, 2 ); +add_action( 'bp_activity_post_type_updated', 'bp_blogs_update_post_activity_meta', 10, 3 ); /** - * Record a new blog comment in the BuddyPress activity stream. + * Update Activity and blogs meta and eventually sync comment with activity comment * - * Only posts the item if blog is public and post is not password-protected. + * @since 2.5.0 * - * @param int $comment_id ID of the comment being recorded. - * @param bool|string $is_approved Optional. The $is_approved value passed to - * the 'comment_post' action. Default: true. - * @return bool|object Returns false on failure, the comment object on success. + * @param int|bool $activity_id ID of recorded activity, or false if sync is active. + * @param WP_Comment $comment The comment object. + * @param array $activity_args Array of activity arguments. + * @param object $activity_post_object The post type tracking args object. + * @return int|bool Returns false if no activity, the activity id otherwise. */ -function bp_blogs_record_comment( $comment_id, $is_approved = true ) { - // bail if activity component is not active - if ( ! bp_is_active( 'activity' ) ) { - return; - } - - // Get the users comment - $recorded_comment = get_comment( $comment_id ); - - // Don't record activity if the comment hasn't been approved - if ( empty( $is_approved ) ) - return false; - - // Don't record activity if no email address has been included - if ( empty( $recorded_comment->comment_author_email ) ) - return false; - - // Don't record activity if the comment has already been marked as spam - if ( 'spam' === $is_approved ) +function bp_blogs_comment_sync_activity_comment( &$activity_id, $comment = null, $activity_args = array(), $activity_post_object = null ) { + if ( empty( $activity_args ) || empty( $comment->post->ID ) || empty( $activity_post_object->comment_action_id ) ) { return false; + } - // Get the user by the comment author email. - $user = get_user_by( 'email', $recorded_comment->comment_author_email ); - - // If user isn't registered, don't record activity - if ( empty( $user ) ) - return false; - - // Get the user_id - $user_id = (int) $user->ID; - - // Get blog and post data + // Set the current blog id. $blog_id = get_current_blog_id(); - // If blog is not trackable, do not record the activity. - if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) - return false; - - $recorded_comment->post = get_post( $recorded_comment->comment_post_ID ); - - if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) ) - return false; - - // If this is a password protected post, don't record the comment - if ( !empty( $recorded_comment->post->post_password ) ) - return false; - - // Don't record activity if the comment's associated post isn't a WordPress Post - if ( !in_array( $recorded_comment->post->post_type, apply_filters( 'bp_blogs_record_comment_post_types', array( 'post' ) ) ) ) - return false; - - $is_blog_public = apply_filters( 'bp_is_blog_public', (int)get_blog_option( $blog_id, 'blog_public' ) ); - - // If blog is public allow activity to be posted - if ( $is_blog_public ) { - - // Get activity related links - $post_permalink = get_permalink( $recorded_comment->comment_post_ID ); - $comment_link = get_comment_link( $recorded_comment->comment_ID ); + // These activity metadatas are used to build the new_blog_comment action string + if ( ! empty( $activity_id ) && ! empty( $activity_args['item_id'] ) && 'new_blog_comment' === $activity_post_object->comment_action_id ) { + // add some post info in activity meta + bp_activity_update_meta( $activity_id, 'post_title', $comment->post->post_title ); + bp_activity_update_meta( $activity_id, 'post_url', esc_url_raw( add_query_arg( 'p', $comment->post->ID, home_url( '/' ) ) ) ); + } - // Setup activity args - $args = array(); + // Sync comment - activity comment + if ( ! bp_disable_blogforum_comments() ) { - $args['user_id'] = $user_id; - $args['content'] = apply_filters_ref_array( 'bp_blogs_activity_new_comment_content', array( $recorded_comment->comment_content, &$recorded_comment, $comment_link ) ); - $args['primary_link'] = apply_filters_ref_array( 'bp_blogs_activity_new_comment_primary_link', array( $comment_link, &$recorded_comment ) ); - $args['recorded_time'] = $recorded_comment->comment_date_gmt; + if ( ! empty( $_REQUEST['action'] ) ) { + $existing_activity_id = get_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', true ); - // Setup some different activity args depending if activity commenting is - // enabled or not + if ( ! empty( $existing_activity_id ) ) { + $activity_args['id'] = $existing_activity_id; + } + } - // if cannot comment, record separate activity entry - // this is the old way of doing things - if ( bp_disable_blogforum_comments() ) { - $args['type'] = 'new_blog_comment'; - $args['item_id'] = $blog_id; - $args['secondary_item_id'] = $comment_id; + if ( empty( $activity_post_object ) ) { + $activity_post_object = bp_activity_get_post_type_tracking_args( $comment->post->post_type ); + } - // record the activity entry - $activity_id = bp_blogs_record_activity( $args ); + if ( isset( $activity_post_object->action_id ) && isset( $activity_post_object->component_id ) ) { + // find the parent 'new_post_type' activity entry + $parent_activity_id = bp_activity_get_activity_id( array( + 'component' => $activity_post_object->component_id, + 'type' => $activity_post_object->action_id, + 'item_id' => $blog_id, + 'secondary_item_id' => $comment->comment_post_ID + ) ); - // add some post info in activity meta - bp_activity_update_meta( $activity_id, 'post_title', $recorded_comment->post->post_title ); - bp_activity_update_meta( $activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) ); + // Try to create a new activity item for the parent blog post. + if ( empty( $parent_activity_id ) ) { + $parent_activity_id = bp_activity_post_type_publish( $comment->post->ID, $comment->post ); + } + } - // record comment as BP activity comment under the parent 'new_blog_post' - // activity item - } else { - // this is a comment edit - // check to see if corresponding activity entry already exists - if ( ! empty( $_REQUEST['action'] ) ) { - $existing_activity_id = get_comment_meta( $comment_id, 'bp_activity_comment_id', true ); + // we found the parent activity entry + // so let's go ahead and reconfigure some activity args + if ( ! empty( $parent_activity_id ) ) { + // set the parent activity entry ID + $activity_args['activity_id'] = $parent_activity_id; - if ( ! empty( $existing_activity_id ) ) { - $args['id'] = $existing_activity_id; - } + // now see if the WP parent comment has a BP activity ID + $comment_parent = 0; + if ( ! empty( $comment->comment_parent ) ) { + $comment_parent = get_comment_meta( $comment->comment_parent, 'bp_activity_comment_id', true ); } - // find the parent 'new_blog_post' activity entry - $parent_activity_id = bp_activity_get_activity_id( array( - 'component' => 'blogs', - 'type' => 'new_blog_post', - 'item_id' => $blog_id, - 'secondary_item_id' => $recorded_comment->comment_post_ID - ) ); + // WP parent comment does not have a BP activity ID + // so set to 'new_' . post_type activity ID + if ( empty( $comment_parent ) ) { + $comment_parent = $parent_activity_id; + } - // we found the parent activity entry - // so let's go ahead and reconfigure some activity args - if ( ! empty( $parent_activity_id ) ) { - // set the 'item_id' with the parent activity entry ID - $args['item_id'] = $parent_activity_id; + $activity_args['parent_id'] = $comment_parent; + $activity_args['skip_notification'] = true; - // now see if the WP parent comment has a BP activity ID - $comment_parent = 0; - if ( ! empty( $recorded_comment->comment_parent ) ) { - $comment_parent = get_comment_meta( $recorded_comment->comment_parent, 'bp_activity_comment_id', true ); - } + // could not find corresponding parent activity entry + // so wipe out $args array + } else { + $activity_args = array(); + } - // WP parent comment does not have a BP activity ID - // so set to 'new_blog_post' activity ID - if ( empty( $comment_parent ) ) { - $comment_parent = $parent_activity_id; - } + // Record in activity streams + if ( ! empty( $activity_args ) ) { + $activity_id = bp_activity_new_comment( $activity_args ); - $args['secondary_item_id'] = $comment_parent; - $args['component'] = 'activity'; - $args['type'] = 'activity_comment'; + if ( empty( $activity_args['id'] ) ) { + // The activity metadata to inform about the corresponding comment ID + bp_activity_update_meta( $activity_id, "bp_blogs_{$comment->post->post_type}_comment_id", $comment->comment_ID ); - // could not find corresponding parent activity entry - // so wipe out $args array - } else { - $args = array(); - } + // The comment metadata to inform about the corresponding activity ID + add_comment_meta( $comment->comment_ID, 'bp_activity_comment_id', $activity_id ); - // Record in activity streams - if ( ! empty( $args ) ) { - // @todo should we use bp_activity_new_comment()? that function will also send - // an email to people in the activity comment thread - // - // what if a site already has some comment email notification plugin setup? - // this is why I decided to go with bp_activity_add() to avoid any conflict - // with existing comment email notification plugins - $comment_activity_id = bp_activity_add( $args ); - - if ( empty( $args['id'] ) ) { - // add meta to activity comment - bp_activity_update_meta( $comment_activity_id, 'bp_blogs_post_comment_id', $comment_id ); - bp_activity_update_meta( $comment_activity_id, 'post_title', $recorded_comment->post->post_title ); - bp_activity_update_meta( $comment_activity_id, 'post_url', add_query_arg( 'p', $recorded_comment->post->ID, home_url( '/' ) ) ); - - // add meta to comment - add_comment_meta( $comment_id, 'bp_activity_comment_id', $comment_activity_id ); + // These activity metadatas are used to build the new_blog_comment action string + if ( 'new_blog_comment' === $activity_post_object->comment_action_id ) { + bp_activity_update_meta( $activity_id, 'post_title', $comment->post->post_title ); + bp_activity_update_meta( $activity_id, 'post_url', esc_url_raw( add_query_arg( 'p', $comment->post->ID, home_url( '/' ) ) ) ); } } } + } - // Update the blogs last active date - bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); + // Update the blogs last active date + bp_blogs_update_blogmeta( $blog_id, 'last_activity', bp_core_current_time() ); + + if ( 'new_blog_comment' === $activity_post_object->comment_action_id ) { + /** + * Fires after BuddyPress has recorded metadata about a published blog post comment. + * + * @since 2.5.0 + * + * @param int $value Comment ID of the blog post comment being recorded. + * @param WP_Post $post WP_Comment object for the current blog post. + * @param string $value ID of the user associated with the current blog post comment. + */ + do_action( 'bp_blogs_new_blog_comment', $comment->comment_ID, $comment, bp_loggedin_user_id() ); } - return $recorded_comment; + return $activity_id; } -add_action( 'comment_post', 'bp_blogs_record_comment', 10, 2 ); -add_action( 'edit_comment', 'bp_blogs_record_comment', 10 ); +add_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment', 10, 4 ); /** * Record a user's association with a blog. @@ -729,34 +692,33 @@ add_action( 'edit_comment', 'bp_blogs_record_comment', 10 ); * default, though as of 2.1.0 you can filter 'bp_blogs_get_allowed_roles' to * modify this behavior. * - * @param int $user_id The ID of the user - * @param string|bool $role User's WordPress role for this blog ID - * @param int $blog_id Blog ID user is being added to - * + * @param int $user_id The ID of the user. + * @param string|bool $role User's WordPress role for this blog ID. + * @param int $blog_id Blog ID user is being added to. * @return bool|null False on failure. */ function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) { global $wpdb; - // If no blog ID was passed, use the root blog ID + // If no blog ID was passed, use the root blog ID. if ( empty( $blog_id ) ) { $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id(); } - // If no role was passed, try to find the blog role + // If no role was passed, try to find the blog role. if ( empty( $role ) ) { - // Get user capabilities + // Get user capabilities. $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities'; $user_roles = array_keys( (array) bp_get_user_meta( $user_id, $key, true ) ); - // User has roles so lets + // User has roles so lets. if ( ! empty( $user_roles ) ) { - // Get blog roles + // Get blog roles. $blog_roles = array_keys( bp_get_current_blog_roles() ); - // Look for blog only roles of the user + // Look for blog only roles of the user. $intersect_roles = array_intersect( $user_roles, $blog_roles ); // If there's a role in the array, use the first one. This isn't @@ -769,12 +731,12 @@ function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) { } } - // Bail if no role was found or role is not in the allowed roles array + // Bail if no role was found or role is not in the allowed roles array. if ( empty( $role ) || ! in_array( $role, bp_blogs_get_allowed_roles() ) ) { return false; } - // Record the blog activity for this user being added to this blog + // Record the blog activity for this user being added to this blog. bp_blogs_record_blog( $blog_id, $user_id, true ); } add_action( 'add_user_to_blog', 'bp_blogs_add_user_to_blog', 10, 3 ); @@ -788,7 +750,7 @@ add_action( 'user_register', 'bp_blogs_add_user_to_blog' ); * This added and was made filterable in BuddyPress 2.1.0 to make it easier * to extend the functionality of the Blogs component. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string */ @@ -814,15 +776,14 @@ function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) { add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 ); /** - * Rehook WP's maybe_add_existing_user_to_blog with a later priority + * Rehook WP's maybe_add_existing_user_to_blog with a later priority. * * 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 https://buddypress.trac.wordpress.org/ticket/3916. * - * @since BuddyPress (1.6.0) - * @access private + * @since 1.6.0 */ function bp_blogs_maybe_add_user_to_blog() { if ( ! is_multisite() ) @@ -846,7 +807,7 @@ function bp_blogs_remove_blog( $blog_id ) { * Fires before a "blog created" item is removed from blogs * tracker and activity stream. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $blog_id ID of the blog having its item removed. */ @@ -854,18 +815,24 @@ function bp_blogs_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' => buddypress()->blogs->id, - 'type' => 'new_blog' - ) ); + /** + * Delete activity stream item only if the Activity component is active + * + * @see https://buddypress.trac.wordpress.org/ticket/6937 + */ + if ( bp_is_active( 'activity' ) ) { + 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) + * @since 1.0.0 * * @param int $blog_id ID of the blog who had its item removed. */ @@ -887,7 +854,7 @@ function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) { /** * Fires before a blog is removed from the tracker for a specific user. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -896,17 +863,23 @@ function bp_blogs_remove_blog_for_user( $user_id, $blog_id ) { BP_Blogs_Blog::delete_blog_for_user( $blog_id, $user_id ); - // Delete activity stream item - bp_blogs_delete_activity( array( - 'item_id' => $blog_id, - 'component' => buddypress()->blogs->id, - 'type' => 'new_blog' - ) ); + /** + * Delete activity stream item only if the Activity component is active + * + * @see https://buddypress.trac.wordpress.org/ticket/6937 + */ + if ( bp_is_active( 'activity' ) ) { + bp_blogs_delete_activity( array( + 'item_id' => $blog_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) + * @since 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. @@ -921,7 +894,8 @@ add_action( 'remove_user_from_blog', 'bp_blogs_remove_blog_for_user', 10, 2 ); * @param int $post_id ID of the post to be removed. * @param int $blog_id Optional. Defaults to current blog ID. * @param int $user_id Optional. Defaults to the logged-in user ID. This param - * is currently unused in the function (but is passed to hooks). + * is currently unused in the function (but is passed to hooks). + * @return bool */ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { global $wpdb; @@ -940,7 +914,7 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { /** * Fires before removal of a blog post activity item from the activity stream. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -948,18 +922,24 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { */ 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' => buddypress()->blogs->id, - 'type' => 'new_blog_post' - ) ); + /** + * Delete activity stream item only if the Activity component is active + * + * @see https://buddypress.trac.wordpress.org/ticket/6937 + */ + if ( bp_is_active( 'activity' ) ) { + 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) + * @since 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. @@ -970,37 +950,33 @@ function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { add_action( 'delete_post', 'bp_blogs_remove_post' ); /** - * Remove a blog comment activity item from the activity stream. + * Remove a synced activity comment from the activity stream. + * + * @since 2.5.0 * - * @param int $comment_id ID of the comment to be removed. + * @param bool $deleted True when a comment post type activity was successfully removed. + * @param int $comment_id ID of the comment to be removed. + * @param object $activity_post_object The post type tracking args object. + * @param string $activity_type The post type comment activity type. + * + * @return bool True on success. False on error. */ -function bp_blogs_remove_comment( $comment_id ) { - global $wpdb; - - // activity comments are disabled for blog posts - // which means that individual activity items exist for blog comments - if ( bp_disable_blogforum_comments() ) { - // Delete the individual activity stream item - bp_blogs_delete_activity( array( - 'item_id' => $wpdb->blogid, - 'secondary_item_id' => $comment_id, - 'type' => 'new_blog_comment' - ) ); - - // activity comments are enabled for blog posts - // remove the associated activity item - } else { - // get associated activity ID from comment meta +function bp_blogs_post_type_remove_comment( $deleted, $comment_id, $activity_post_object, $activity_type = '' ) { + // Remove synced activity comments, if needed. + if ( ! bp_disable_blogforum_comments() ) { + // Get associated activity ID from comment meta $activity_id = get_comment_meta( $comment_id, 'bp_activity_comment_id', true ); - // delete the associated activity comment - // - // also removes child post comments and associated activity comments - if ( ! empty( $activity_id ) && bp_is_active( 'activity' ) ) { + /** + * Delete the associated activity comment & also remove + * child post comments and associated activity comments. + */ + if ( ! empty( $activity_id ) ) { // fetch the activity comments for the activity item $activity = bp_activity_get( array( 'in' => $activity_id, 'display_comments' => 'stream', + 'spam' => 'all', ) ); // get all activity comment IDs for the pending deleted item @@ -1020,38 +996,46 @@ function bp_blogs_remove_comment( $comment_id ) { // rebuild activity comment tree BP_Activity_Activity::rebuild_activity_comment_tree( $activity['activities'][0]->item_id ); + + // Set the result + $deleted = true; } } } - /** - * 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() ); + // Backcompat for comments about the 'post' post type. + if ( 'new_blog_comment' === $activity_type ) { + /** + * Fires after a blog comment activity item was removed from activity stream. + * + * @since 1.0.0 + * + * @param int $value 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', get_current_blog_id(), $comment_id, bp_loggedin_user_id() ); + } + + return $deleted; } -add_action( 'delete_comment', 'bp_blogs_remove_comment' ); +add_action( 'bp_activity_post_type_remove_comment', 'bp_blogs_post_type_remove_comment', 10, 4 ); /** * Removes blog comments that are associated with activity comments. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @see bp_blogs_remove_comment() + * @see bp_blogs_remove_synced_comment() * @see bp_blogs_sync_delete_from_activity_comment() * * @param array $activity_ids The activity IDs to check association with blog - * comments. - * @param bool $force_delete Whether to force delete the comments. If false, - * comments are trashed instead. + * comments. + * @param bool $force_delete Whether to force delete the comments. If false, + * comments are trashed instead. */ function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $force_delete = true ) { - // query args + // Query args. $query_args = array( 'meta_query' => array( array( @@ -1062,104 +1046,22 @@ function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $for ) ); - // get comment + // Get comment. $comment_query = new WP_Comment_Query; $comments = $comment_query->query( $query_args ); - // found the corresponding comments + // Found the corresponding comments // let's delete them! foreach ( $comments as $comment ) { wp_delete_comment( $comment->comment_ID, $force_delete ); - // if we're trashing the comment, remove the meta key as well + // If we're trashing the comment, remove the meta key as well. if ( empty( $force_delete ) ) { delete_comment_meta( $comment->comment_ID, 'bp_activity_comment_id' ); } } } -/** - * When a blog comment status transition occurs, update the relevant activity's status. - * - * @since BuddyPress (1.6.0) - * - * @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 ) { - - // Check the Activity component is active - if ( ! bp_is_active( 'activity' ) ) - return; - - /** - * Activity currently doesn't have any concept of a trash, or an unapproved/approved state. - * - * If a blog comment transitions to a "delete" or "hold" status, delete the activity item. - * If a blog comment transitions to trashed, or spammed, mark the activity as spam. - * If a blog comment transitions to approved (and the activity exists), mark the activity as ham. - * If a blog comment transitions to unapproved (and the activity exists), mark the activity as spam. - * Otherwise, record the comment into the activity stream. - */ - - // This clause was moved in from bp_blogs_remove_comment() in BuddyPress 1.6. It handles delete/hold. - if ( in_array( $new_status, array( 'delete', 'hold' ) ) ) { - return bp_blogs_remove_comment( $comment->comment_ID ); - - // These clauses handle trash, spam, and un-spams. - } elseif ( in_array( $new_status, array( 'trash', 'spam', 'unapproved' ) ) ) { - $action = 'spam_activity'; - } elseif ( 'approved' == $new_status ) { - $action = 'ham_activity'; - } - - // Get the activity - if ( bp_disable_blogforum_comments() ) { - $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 ); - } - - // Check activity item exists - if ( empty( $activity_id ) ) { - // If no activity exists, but the comment has been approved, record it into the activity table. - if ( 'approved' == $new_status ) { - return bp_blogs_record_comment( $comment->comment_ID, true ); - } - - return; - } - - // Create an activity object - $activity = new BP_Activity_Activity( $activity_id ); - if ( empty( $activity->component ) ) - return; - - // Spam/ham the activity if it's not already in that state - if ( 'spam_activity' == $action && ! $activity->is_spam ) { - bp_activity_mark_as_spam( $activity ); - } elseif ( 'ham_activity' == $action) { - bp_activity_mark_as_ham( $activity ); - } - - // Add "new_blog_comment" to the whitelisted activity types, so that the activity's Akismet history is generated - $comment_akismet_history = create_function( '$t', '$t[] = "new_blog_comment"; return $t;' ); - add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); - - // Save the updated activity - $activity->save(); - - // Remove the "new_blog_comment" activity type whitelist so we don't break anything - remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); -} -add_action( 'transition_comment_status', 'bp_blogs_transition_activity_status', 10, 3 ); - /** * Get the total number of blogs being tracked by BuddyPress. * @@ -1179,10 +1081,10 @@ function bp_blogs_total_blogs() { /** * Get the total number of blogs being tracked by BP for a specific user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $user_id ID of the user being queried. Default: on a user page, - * the displayed user. Otherwise, the logged-in user. + * the displayed user. Otherwise, the logged-in user. * @return int $count Total blog count for the user. */ function bp_blogs_total_blogs_for_user( $user_id = 0 ) { @@ -1190,7 +1092,7 @@ function bp_blogs_total_blogs_for_user( $user_id = 0 ) { $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); } - // no user ID? do not attempt to look at cache + // No user ID? do not attempt to look at cache. if ( empty( $user_id ) ) { return 0; } @@ -1215,7 +1117,7 @@ function bp_blogs_remove_data_for_blog( $blog_id ) { * Fires before all data related to a given blog is removed from blogs tracker * and activity stream. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $blog_id ID of the blog whose data is being removed. */ @@ -1224,18 +1126,24 @@ function bp_blogs_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' => buddypress()->blogs->id, - 'type' => false - ) ); + /** + * Delete activity stream item only if the Activity component is active + * + * @see https://buddypress.trac.wordpress.org/ticket/6937 + */ + if ( bp_is_active( 'activity' ) ) { + 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) + * @since 1.0.0 * * @param int $blog_id ID of the blog whose data is being removed. */ @@ -1249,7 +1157,7 @@ add_action( 'delete_blog', 'bp_blogs_remove_data_for_blog', 1 ); * @see BP_Blogs_Blog::get_blogs_for_user() for a description of parameters * and return values. * - * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}. + * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}. * @param bool $show_hidden See {@BP_Blogs_Blog::get_blogs_for_user()}. * @return array See {@BP_Blogs_Blog::get_blogs_for_user()}. */ @@ -1262,8 +1170,8 @@ function bp_blogs_get_blogs_for_user( $user_id, $show_hidden = false ) { * * @see BP_Blogs_Blog::get_all() for a description of parameters and return values. * - * @param int $limit See {@BP_Blogs_Blog::get_all()}. - * @param int $page See {@BP_Blogs_Blog::get_all()}. + * @param int|null $limit See {@BP_Blogs_Blog::get_all()}. + * @param int|null $page See {@BP_Blogs_Blog::get_all()}. * @return array See {@BP_Blogs_Blog::get_all()}. */ function bp_blogs_get_all_blogs( $limit = null, $page = null ) { @@ -1275,8 +1183,8 @@ function bp_blogs_get_all_blogs( $limit = null, $page = null ) { * * @see BP_Blogs_Blog::get() for a description of parameters and return values. * - * @param int $limit See {@BP_Blogs_Blog::get()}. - * @param int $page See {@BP_Blogs_Blog::get()}. + * @param int|null $limit See {@BP_Blogs_Blog::get()}. + * @param int|null $page See {@BP_Blogs_Blog::get()}. * @return array See {@BP_Blogs_Blog::get()}. */ function bp_blogs_get_random_blogs( $limit = null, $page = null ) { @@ -1295,7 +1203,7 @@ function bp_blogs_is_blog_hidden( $blog_id ) { return BP_Blogs_Blog::is_hidden( $blog_id ); } -/******************************************************************************* +/* * Blog meta functions * * These functions are used to store specific blogmeta in one global table, @@ -1309,21 +1217,22 @@ function bp_blogs_is_blog_hidden( $blog_id ) { * * @global object $wpdb WordPress database access object. * - * @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 - * omitted, all BP metadata associated with the blog 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 blog_id. Otherwise, only - * delete matching metadata entries for the specified blog. - * Default: false. + * @param int $blog_id ID of the blog whose metadata is being deleted. + * @param string|bool $meta_key Optional. The key of the metadata being deleted. If + * omitted, all BP metadata associated with the blog will + * be deleted. + * @param string|bool $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 blog_id. Otherwise, only + * delete matching metadata entries for the specified blog. + * Default: false. * @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; - // Legacy - if no meta_key is passed, delete all for the blog_id + // Legacy - if no meta_key is passed, delete all for the blog_id. if ( empty( $meta_key ) ) { $keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->blogmeta} WHERE blog_id = %d", $blog_id ) ); $delete_all = false; @@ -1346,17 +1255,17 @@ function bp_blogs_delete_blogmeta( $blog_id, $meta_key = false, $meta_value = fa /** * Get metadata for a given blog. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $wpdb WordPress database access object. * - * @param int $blog_id ID of the blog whose metadata is being requested. + * @param int $blog_id ID of the blog 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 - * blog 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. + * that meta key will be returned. Otherwise, all + * metadata for the blog 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_blogs_get_blogmeta( $blog_id, $meta_key = '', $single = true ) { @@ -1372,15 +1281,15 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '', $single = true ) { * * @global object $wpdb WordPress database access object. * - * @param int $blog_id ID of the blog 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 $blog_id ID of the blog 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_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value, $prev_value = '' ) { add_filter( 'query', 'bp_filter_metaid_column_name' ); @@ -1393,14 +1302,14 @@ function bp_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value, $prev_value /** * Add a piece of blog metadata. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $blog_id ID of the blog. - * @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 $blog_id ID of the blog. + * @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_blogs_add_blogmeta( $blog_id, $meta_key, $meta_value, $unique = false ) { @@ -1414,7 +1323,7 @@ function bp_blogs_add_blogmeta( $blog_id, $meta_key, $meta_value, $unique = fals * Remove all blog associations for a given user. * * @param int $user_id ID whose blog data should be removed. - * @return bool|null Returns false on failure. + * @return bool Returns false on failure. */ function bp_blogs_remove_data( $user_id ) { if ( !is_multisite() ) @@ -1423,7 +1332,7 @@ function bp_blogs_remove_data( $user_id ) { /** * Fires before all blog associations are removed for a given user. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $user_id ID of the user whose blog associations are being removed. */ @@ -1435,7 +1344,7 @@ function bp_blogs_remove_data( $user_id ) { /** * Fires after all blog associations are removed for a given user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user whose blog associations were removed. */ @@ -1446,9 +1355,9 @@ 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 + * Restore all blog associations for a given user. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $user_id ID whose blog data should be restored. */ @@ -1457,7 +1366,7 @@ function bp_blogs_restore_data( $user_id = 0 ) { return; } - // Get the user's blogs + // Get the user's blogs. $user_blogs = get_blogs_of_user( $user_id ); if ( empty( $user_blogs ) ) { return; 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 2e36870e6a74396e2a10e4ddc9e4b1faf0a681bf..1764a4654be9ce6ac1e7e64f4865126bcf2dbe93 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Blogs Loader * @@ -8,328 +7,14 @@ * information from those blogs to make querying blogs in bulk more performant. * * @package BuddyPress - * @subpackage Blogs Core + * @subpackage BlogsCore + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Blogs_Component extends BP_Component { - - /** - * Start the blogs component creation process. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'blogs', - __( 'Site Directory', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 30 - ) - ); - } - - /** - * Set up global settings for the blogs component. - * - * The BP_BLOGS_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for description of parameters. - * - * @param array $args See {@link BP_Component::setup_globals()}. - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - if ( ! defined( 'BP_BLOGS_SLUG' ) ) { - define ( 'BP_BLOGS_SLUG', $this->id ); - } - - // Global tables for messaging component - $global_tables = array( - 'table_name' => $bp->table_prefix . 'bp_user_blogs', - 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta', - ); - - $meta_tables = array( - 'blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta', - ); - - // All globals for blogs component. - $args = array( - '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' ), - 'global_tables' => $global_tables, - 'meta_tables' => $meta_tables, - ); - - // 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 ); - } - - /** - * Include bp-blogs files. - * - * @see BP_Component::includes() for description of parameters. - * - * @param array $includes See {@link BP_Component::includes()}. - */ - public function includes( $includes = array() ) { - - // Files to include - $includes = array( - 'cache', - 'actions', - 'screens', - 'classes', - 'template', - 'filters', - 'activity', - 'functions', - ); - - if ( is_multisite() ) { - $includes[] = 'widgets'; - } - - // Include the files - parent::includes( $includes ); - } - - /** - * Set up component navigation for bp-blogs. - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - $bp = buddypress(); - - /** - * Blog/post/comment menus should not appear on single WordPress setups. - * Although comments and posts made by users will still show on their - * activity stream. - */ - if ( ! is_multisite() ) { - return false; - } - - // Add 'Sites' to the main navigation - $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', - 'default_subnav_slug' => 'my-sites', - 'item_css_id' => $this->id - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - $parent_url = trailingslashit( $user_domain . bp_get_blogs_slug() ); - - $sub_nav[] = array( - 'name' => __( 'My Sites', 'buddypress' ), - 'slug' => 'my-sites', - 'parent_url' => $parent_url, - 'parent_slug' => $bp->blogs->slug, - 'screen_function' => 'bp_blogs_screen_my_blogs', - 'position' => 10 - ); - - // Setup navigation - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up bp-blogs integration with the WordPress admin bar. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_admin_bar() for a description of arguments. - * - * @param array $wp_admin_nav See BP_Component::setup_admin_bar() - * for description. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - $bp = buddypress(); - - /** - * Site/post/comment menus should not appear on single WordPress setups. - * - * Comments and posts made by users will still show in their activity. - */ - if ( ! is_multisite() ) { - return false; - } - - // Menus for logged in user - if ( is_user_logged_in() ) { - - $blogs_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); - - // Add the "Sites" sub menu - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => __( 'Sites', 'buddypress' ), - 'href' => trailingslashit( $blogs_link ) - ); - - // My Sites - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-my-sites', - 'title' => __( 'My Sites', 'buddypress' ), - 'href' => trailingslashit( $blogs_link ) - ); - - // Create a Site - if ( bp_blog_signup_enabled() ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-create', - 'title' => __( 'Create a Site', 'buddypress' ), - 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) - ); - } - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title> - */ - public function setup_title() { - $bp = buddypress(); - - // Set up the component options navigation for Site - if ( bp_is_blogs_component() ) { - if ( bp_is_my_profile() ) { - if ( bp_is_active( 'xprofile' ) ) { - $bp->bp_options_title = __( 'My Sites', 'buddypress' ); - } - - // If we are not viewing the logged in user, set up the current - // users avatar and name - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - 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; - } -} +require dirname( __FILE__ ) . '/classes/class-bp-blogs-component.php'; /** * Set up the bp-blogs component. 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 4b47ef5a1a93a79063c392f4e8e01ee30520a73f..317aa16a99912fd2395b2c32fb30c1d7b7739376 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php @@ -1,15 +1,17 @@ <?php - /** - * BuddyPress Blogs Screens + * BuddyPress Blogs Screens. * * @package BuddyPress * @subpackage BlogsScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-blogs-theme-compat.php'; + /** * Load the "My Blogs" screen. */ @@ -20,7 +22,7 @@ function bp_blogs_screen_my_blogs() { /** * Fires right before the loading of the My Blogs screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_blogs_screen_my_blogs' ); @@ -41,7 +43,7 @@ function bp_blogs_screen_create_a_blog() { /** * Fires right before the loading of the Create A Blog screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_blogs_screen_create_a_blog' ); @@ -59,7 +61,7 @@ function bp_blogs_screen_index() { /** * Fires right before the loading of the top-level Blogs screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_blogs_screen_index' ); @@ -70,195 +72,4 @@ add_action( 'bp_screens', 'bp_blogs_screen_index', 2 ); /** Theme Compatibility *******************************************************/ -/** - * The main theme compat class for BuddyPress Blogs - * - * 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) - */ -class BP_Blogs_Theme_Compat { - - /** - * Set up theme compatibility for the Blogs component. - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - add_action( 'bp_setup_theme_compat', array( $this, 'is_blogs' ) ); - } - - /** - * Are we looking at something that needs Blogs theme compatibility? - * - * @since BuddyPress (1.7.0) - */ - public function is_blogs() { - - // Bail if not looking at a group - if ( ! bp_is_blogs_component() ) - return; - - // Bail if looking at a users sites - if ( bp_is_user() ) - return; - - // Blog Directory - 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' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); - - // Create blog - } elseif ( is_user_logged_in() && bp_blog_signup_enabled() ) { - add_filter( 'bp_get_buddypress_template', array( $this, 'create_template_hierarchy' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); - } - } - - /** Directory *************************************************************/ - - /** - * Add template hierarchy to theme compat for the blog directory page. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with directory data. - * - * @since BuddyPress (1.7.0) - */ - public function directory_dummy_post() { - - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => __( 'Sites', 'buddypress' ), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the groups index template part. - * - * @since BuddyPress (1.7.0) - */ - public function directory_content() { - return bp_buffer_template_part( 'blogs/index', null, false ); - } - - /** Create ****************************************************************/ - - /** - * Add custom template hierarchy to theme compat for the blog create page. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with create screen data. - * - * @since BuddyPress (1.7.0) - */ - public function create_dummy_post() { - - // Title based on ability to create blogs - if ( is_user_logged_in() && bp_blog_signup_enabled() ) { - $title = __( 'Create a Site', 'buddypress' ); - } else { - $title = __( 'Sites', 'buddypress' ); - } - - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => $title, - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the create screen template part. - * - * @since BuddyPress (1.7.0) - */ - public function create_content() { - return bp_buffer_template_part( 'blogs/create', null, false ); - } -} new BP_Blogs_Theme_Compat(); 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 d0851fd7cdc0d576bd088414a36d28cfb2e88033..c4719f44b360e20970c41eac7408cf1fc3c591bc 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php @@ -1,19 +1,21 @@ <?php - /** * BuddyPress Blogs Template Tags. * * @package BuddyPress * @subpackage BlogsTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-blogs-template.php'; + /** * Output the blogs component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_blogs_slug() */ @@ -23,7 +25,7 @@ function bp_blogs_slug() { /** * Return the blogs component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string The 'blogs' slug. */ @@ -32,7 +34,7 @@ function bp_blogs_slug() { /** * Filters the blogs component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Slug for the blogs component. */ @@ -42,7 +44,7 @@ function bp_blogs_slug() { /** * Output the blogs component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_blogs_root_slug() */ @@ -52,7 +54,7 @@ function bp_blogs_root_slug() { /** * Return the blogs component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string The 'blogs' root slug. */ @@ -61,7 +63,7 @@ function bp_blogs_root_slug() { /** * Filters the blogs component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Root slug for the blogs component. */ @@ -71,7 +73,7 @@ function bp_blogs_root_slug() { /** * Output blog directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_blogs_directory_permalink() */ @@ -81,12 +83,13 @@ function bp_blogs_directory_permalink() { /** * Return blog directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() * @uses trailingslashit() * @uses bp_get_root_domain() * @uses bp_get_blogs_root_slug() + * * @return string The URL of the Blogs directory. */ function bp_get_blogs_directory_permalink() { @@ -94,257 +97,13 @@ function bp_blogs_directory_permalink() { /** * Filters the blog directory permalink. * - * @since BuddyPress (1.5.0) + * @since 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() ) ); } -/** - * The main blog template loop class. - * - * Responsible for loading a group of blogs into a loop for display. - */ -class BP_Blogs_Template { - - /** - * The loop iterator. - * - * @access public - * @var int - */ - public $current_blog = -1; - - /** - * The number of blogs returned by the paged query. - * - * @access public - * @var int - */ - public $blog_count = 0; - - /** - * Array of blogs located by the query.. - * - * @access public - * @var array - */ - public $blogs = array(); - - /** - * The blog object currently being iterated on. - * - * @access public - * @var object - */ - public $blog; - - /** - * A flag for whether the loop is currently being iterated. - * - * @access public - * @var bool - */ - public $in_the_loop = false; - - /** - * The page number being requested. - * - * @access public - * @var public - */ - public $pag_page = 1; - - /** - * The number of items being requested per page. - * - * @access public - * @var public - */ - public $pag_num = 20; - - /** - * An HTML string containing pagination links. - * - * @access public - * @var string - */ - public $pag_links = ''; - - /** - * The total number of blogs matching the query parameters. - * - * @access public - * @var int - */ - public $total_blog_count = 0; - - /** - * Constructor method. - * - * @see BP_Blogs_Blog::get() for a description of parameters. - * - * @param string $type See {@link BP_Blogs_Blog::get()}. - * @param string $page See {@link BP_Blogs_Blog::get()}. - * @param string $per_page See {@link BP_Blogs_Blog::get()}. - * @param string $max See {@link BP_Blogs_Blog::get()}. - * @param string $user_id See {@link BP_Blogs_Blog::get()}. - * @param string $search_terms See {@link BP_Blogs_Blog::get()}. - * @param string $page_arg The string used as a query parameter in - * pagination links. Default: 'bpage'. - * @param bool $update_meta_cache Whether to pre-fetch metadata for - * queried blogs. - * @param array $include_blog_ids Array of blog IDs to include. - */ - 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_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'] ) ) { - $this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page ); - - // Typical blogs query - } else { - $this->blogs = bp_blogs_get_blogs( array( - 'type' => $type, - 'per_page' => $this->pag_num, - 'page' => $this->pag_page, - 'user_id' => $user_id, - 'search_terms' => $search_terms, - 'update_meta_cache' => $update_meta_cache, - 'include_blog_ids' => $include_blog_ids, - ) ); - } - - // Set the total blog count - if ( empty( $max ) || ( $max >= (int) $this->blogs['total'] ) ) { - $this->total_blog_count = (int) $this->blogs['total']; - } else { - $this->total_blog_count = (int) $max; - } - - // Set the blogs array (to loop through later - $this->blogs = $this->blogs['blogs']; - - // Get the current blog count to compare maximum against - $blog_count = count( $this->blogs ); - - // Set the current blog count - if ( empty( $max ) || ( $max >= (int) $blog_count ) ) { - $this->blog_count = (int) $blog_count; - } else { - $this->blog_count = (int) $max; - } - - // 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( $this->pag_arg, '%#%' ), - 'format' => '', - 'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ), - 'current' => (int) $this->pag_page, - 'prev_text' => _x( '←', 'Blog pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Blog pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => array(), - ) ); - } - } - - /** - * Whether there are blogs available in the loop. - * - * @see bp_has_blogs() - * - * @return bool True if there are items in the loop, otherwise false. - */ - public function has_blogs() { - return (bool) ! empty( $this->blog_count ); - } - - /** - * Set up the next blog and iterate index. - * - * @return object The next blog to iterate over. - */ - public function next_blog() { - $this->current_blog++; - $this->blog = $this->blogs[ $this->current_blog ]; - - return $this->blog; - } - - /** - * Rewind the blogs and reset blog index. - */ - public function rewind_blogs() { - $this->current_blog = -1; - if ( $this->blog_count > 0 ) { - $this->blog = $this->blogs[0]; - } - } - - /** - * Whether there are blogs left in the loop to iterate over. - * - * This method is used by {@link bp_blogs()} as part of the while loop - * that controls iteration inside the blogs loop, eg: - * while ( bp_blogs() ) { ... - * - * @see bp_blogs() - * - * @return bool True if there are more blogs to show, otherwise false. - */ - public function blogs() { - 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current blog inside the loop. - * - * Used by {@link bp_the_blog()} to set up the current blog data while - * looping, so that template tags used during that iteration make - * reference to the current blog. - * - * @see bp_the_blog() - */ - public function the_blog() { - - $this->in_the_loop = true; - $this->blog = $this->next_blog(); - - // 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' ); - } - } -} - /** * Rewind the blogs and reset blog index. */ @@ -363,7 +122,7 @@ function bp_rewind_blogs() { * * @global object $blogs_template {@link BP_Blogs_Template} * - * @param array $args { + * @param array|string $args { * Arguments for limiting the contents of the blogs loop. Most arguments * are in the same format as {@link BP_Blogs_Blog::get()}. However, because * the format of the arguments accepted here differs in a number of ways, @@ -373,58 +132,62 @@ function bp_rewind_blogs() { * Arguments can be passed as an associative array, or as a URL query * string (eg, 'user_id=4&per_page=3'). * - * @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: 'bpage'. - * @type int|bool $max Maximum number of results to return. - * Default: false (unlimited). - * @type string $type The order in which results should be fetched. - * 'active', 'alphabetical', 'newest', or 'random'. - * @type array $include_blog_ids Array of blog IDs to limit results to. - * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'. - * @type string $search_terms Limit results by a search term. Default: the - * value of $_REQUEST['s'], if present. - * @type int $user_id The ID of the user whose blogs should be retrieved. - * When viewing a user profile page, 'user_id' defaults to the ID of - * the displayed user. Otherwise the default is false. + * @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: 'bpage'. + * @type int|bool $max Maximum number of results to return. + * Default: false (unlimited). + * @type string $type The order in which results should be fetched. + * 'active', 'alphabetical', 'newest', or 'random'. + * @type array $include_blog_ids Array of blog IDs to limit results to. + * @type string $sort 'ASC' or 'DESC'. Default: 'DESC'. + * @type string $search_terms Limit results by a search term. Default: the value of `$_REQUEST['s']` or + * `$_REQUEST['sites_search']`, if present. + * @type int $user_id The ID of the user whose blogs should be retrieved. + * When viewing a user profile page, 'user_id' defaults to the + * ID of the displayed user. Otherwise the default is false. * } * @return bool Returns true when blogs are found, otherwise false. */ function bp_has_blogs( $args = '' ) { global $blogs_template; - // Check for and use search terms - $search_terms = ! empty( $_REQUEST['s'] ) - ? $_REQUEST['s'] - : false; + // Check for and use search terms. + $search_terms_default = false; + $search_query_arg = bp_core_get_component_search_query_arg( 'blogs' ); + if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) { + $search_terms_default = stripslashes( $_REQUEST[ $search_query_arg ] ); + } elseif ( ! empty( $_REQUEST['s'] ) ) { + $search_terms_default = stripslashes( $_REQUEST['s'] ); + } - // Parse arguments + // Parse arguments. $r = bp_parse_args( $args, array( 'type' => 'active', - 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679 + 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679. 'page' => 1, 'per_page' => 20, 'max' => false, - 'user_id' => bp_displayed_user_id(), // Pass a user_id to limit to only blogs this user is a member of + 'user_id' => bp_displayed_user_id(), // Pass a user_id to limit to only blogs this user is a member of. 'include_blog_ids' => false, - 'search_terms' => $search_terms, // Pass search terms to filter on the blog title or description. + 'search_terms' => $search_terms_default, 'update_meta_cache' => true ), 'has_blogs' ); - // Set per_page to maximum if max is enforced + // Set per_page to maximum if max is enforced. if ( ! empty( $r['max'] ) && ( (int) $r['per_page'] > (int) $r['max'] ) ) { $r['per_page'] = (int) $r['max']; } - // Get the blogs + // 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'] ); /** * Filters whether or not there are blogs to list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param bool $value Whether or not there are blogs to list. * @param BP_Blogs_Template $blogs_template Current blogs template object. @@ -500,7 +263,7 @@ function bp_blogs_pagination_links() { /** * Filters the blogs pagination links. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $pag_links HTML pagination links. */ @@ -512,7 +275,7 @@ function bp_blogs_pagination_links() { * * @see bp_get_blog_avatar() for description of arguments. * - * @param array $args See {@link bp_get_blog_avatar()}. + * @param array|string $args See {@link bp_get_blog_avatar()}. */ function bp_blog_avatar( $args = '' ) { echo bp_get_blog_avatar( $args ); @@ -523,21 +286,23 @@ function bp_blog_avatar( $args = '' ) { * At the moment, blog avatars are simply the user avatars of the blog * admin. Filter 'bp_get_blog_avatar_' . $blog_id to customize. * + * @since 2.4.0 Introduced `$title` argument. + * * @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 site author - * [user name]'. - * @type string $class Default: 'avatar'. - * @type string $type Default: 'full'. - * @type int|bool $width Default: false. - * @type int|bool $height Default: false. - * @type bool $id Currently unused. - * @type bool $no_grav Default: true. + * @type string $alt Default: 'Profile picture of site author [user name]'. + * @type string $class Default: 'avatar'. + * @type string $title Default: 'Profile picture of site author [user name]'. + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type bool $id Currently unused. + * @type bool $no_grav Default: true. * } * @return string User avatar string. */ @@ -550,23 +315,26 @@ function bp_blog_avatar( $args = '' ) { return false; } - // Parse the arguments + $author_displayname = bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ); + + // Parse the arguments. $r = bp_parse_args( $args, array( 'type' => 'full', 'width' => false, 'height' => false, 'class' => 'avatar', + 'title' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ), 'id' => false, - 'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ), + 'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), esc_attr( $author_displayname ) ), 'no_grav' => true, ) ); - // Fetch the avatar + // Fetch the avatar. $avatar = bp_core_fetch_avatar( array( 'item_id' => $blogs_template->blog->admin_user_id, - 'title' => $blogs_template->blog->admin_user_email, - //'avatar_dir' => 'blog-avatars', - //'object' => 'blog', + 'title' => $r['title'], + // 'avatar_dir' => 'blog-avatars', + // 'object' => 'blog', 'type' => $r['type'], 'alt' => $r['alt'], 'css_id' => $r['id'], @@ -575,7 +343,7 @@ function bp_blog_avatar( $args = '' ) { 'height' => $r['height'] ) ); - /*** + /** * In future BuddyPress versions you will be able to set the avatar for a blog. * Right now you can use a filter with the ID of the blog to change it if you wish. * By default it will return the avatar for the primary blog admin. @@ -588,7 +356,7 @@ function bp_blog_avatar( $args = '' ) { /** * Filters a blog's avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $avatar Formatted HTML <img> element, or raw avatar * URL based on $html arg. @@ -617,7 +385,7 @@ function bp_blog_permalink() { /** * Filters the blog permalink. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $permalink Permalink URL for the blog. */ @@ -641,7 +409,7 @@ function bp_blog_name() { /** * Filters the name of the current blog in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $name Name of the current blog in the loop. */ @@ -651,7 +419,7 @@ function bp_blog_name() { /** * Output the ID of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_blog_id() { echo bp_get_blog_id(); @@ -659,7 +427,7 @@ function bp_blog_id() { /** * Return the ID of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return int ID of the current blog in the loop. */ @@ -669,7 +437,7 @@ function bp_blog_id() { /** * Filters the ID of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param int $blog_id ID of the current blog in the loop. */ @@ -684,7 +452,7 @@ function bp_blog_description() { /** * Filters the description of the current blog in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Description of the current blog in the loop. */ @@ -701,7 +469,7 @@ function bp_blog_description() { /** * Filters the description of the current blog in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Description of the current blog in the loop. */ @@ -711,9 +479,9 @@ function bp_blog_description() { /** * Output the row class of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param array $classes Array of custom classes + * @param array $classes Array of custom classes. */ function bp_blog_class( $classes = array() ) { echo bp_get_blog_class( $classes ); @@ -721,22 +489,22 @@ function bp_blog_class( $classes = array() ) { /** * Return the row class of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Blogs_Template $blogs_template - * @param array $classes Array of custom classes * + * @param array $classes Array of custom classes. * @return string Row class of the site. */ function bp_get_blog_class( $classes = array() ) { global $blogs_template; - // Add even/odd classes, but only if there's more than 1 group + // Add even/odd classes, but only if there's more than 1 group. if ( $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 we've only one site in the loop, don't bother with odd and even. } else { $classes[] = 'bp-single-blog'; } @@ -744,7 +512,7 @@ function bp_blog_class( $classes = array() ) { /** * Filters the row class of the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $classes Array of classes to be applied to row. */ @@ -768,33 +536,34 @@ function bp_blog_last_active( $args = array() ) { * * @param array $args { * Array of optional arguments. - * @type bool $active_format If true, formatted "Active 5 minutes - * ago". If false, formatted "5 minutes ago". Default: true. + * @type bool $active_format If true, formatted "Active 5 minutes ago". + * If false, formatted "5 minutes ago". + * Default: true. * } * @return string Last active date. */ function bp_get_blog_last_active( $args = array() ) { global $blogs_template; - // Parse the activity format + // Parse the activity format. $r = bp_parse_args( $args, array( 'active_format' => true ) ); - // Backwards compatibility 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' ); } - // Blog has been posted to at least once + // Blog has been posted to at least once. if ( isset( $blogs_template->blog->last_activity ) ) { - // Backwards compatibility for pre 1.5 'ago' strings + // Backwards compatibility for pre 1.5 'ago' strings. $last_activity = ! empty( $r['active_format'] ) ? bp_core_get_last_activity( $blogs_template->blog->last_activity, $r['active_format'] ) : bp_core_time_since( $blogs_template->blog->last_activity ); - // Blog has never been posted to + // Blog has never been posted to. } else { $last_activity = __( 'Never active', 'buddypress' ); } @@ -823,9 +592,9 @@ function bp_blog_latest_post( $args = array() ) { * * @param array $args { * Array of optional arguments. - * @type bool $latest_format If true, formatted "Latest post: - * [link to post]". If false, formatted "[link to post]". - * Default: true. + * @type bool $latest_format If true, formatted "Latest post: [link to post]". + * If false, formatted "[link to post]". + * Default: true. * } * @return string $retval String of the form 'Latest Post: [link to post]'. */ @@ -844,7 +613,7 @@ function bp_blog_latest_post( $args = array() ) { /** * Filters the title text of the latest post for the current blog in loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $retval Title of the latest post. */ @@ -859,7 +628,7 @@ function bp_blog_latest_post( $args = array() ) { /** * Filters the HTML markup result for the latest blog post in loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $retval HTML markup for the latest post. */ @@ -869,7 +638,7 @@ function bp_blog_latest_post( $args = array() ) { /** * Output the title of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_get_blog_latest_post_title() */ @@ -879,7 +648,7 @@ function bp_blog_latest_post_title() { /** * Return the title of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Blogs_Template * @@ -896,7 +665,7 @@ function bp_blog_latest_post_title() { /** * Filters the title text of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $retval Title text for the latest post. */ @@ -906,7 +675,7 @@ function bp_blog_latest_post_title() { /** * Output the permalink of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_get_blog_latest_post_title() */ @@ -916,7 +685,7 @@ function bp_blog_latest_post_permalink() { /** * Return the permalink of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Blogs_Template * @@ -933,7 +702,7 @@ function bp_blog_latest_post_permalink() { /** * Filters the permalink of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $retval Permalink URL of the latest post. */ @@ -943,7 +712,7 @@ function bp_blog_latest_post_permalink() { /** * Output the content of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_get_blog_latest_post_content() */ @@ -953,7 +722,7 @@ function bp_blog_latest_post_content() { /** * Return the content of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Blogs_Template * @@ -970,7 +739,7 @@ function bp_blog_latest_post_content() { /** * Filters the content of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $retval Content of the latest post on the current blog in the loop. */ @@ -980,7 +749,7 @@ function bp_blog_latest_post_content() { /** * Output the featured image of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_get_blog_latest_post_content() For description of parameters. * @@ -992,12 +761,12 @@ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) { /** * Return the featured image of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Blogs_Template * * @param string $size Image version to return. 'thumbnail', 'medium', - * 'large', or 'post-thumbnail'. Default: 'thumbnail'. + * 'large', or 'post-thumbnail'. Default: 'thumbnail'. * @return string URL of the image. */ function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) { @@ -1011,7 +780,7 @@ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) { /** * Filters the featured image of the latest post on the current blog in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $retval The featured image of the latest post on the current blog in the loop. */ @@ -1021,12 +790,12 @@ function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) { /** * Does the latest blog post have a featured image? * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param string $size Image version to return. 'thumbnail', 'medium', 'large', - * or 'post-thumbnail'. Default: 'thumbnail'. + * @param string $thumbnail Image version to return. 'thumbnail', 'medium', 'large', + * or 'post-thumbnail'. Default: 'thumbnail'. * @return bool True if the latest blog post from the current blog has a - * featured image of the given size. + * featured image of the given size. */ function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) { $image = bp_get_blog_latest_post_featured_image( $thumbnail ); @@ -1034,7 +803,7 @@ function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) { /** * Filters whether or not the latest blog post has a featured image. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param bool $value Whether or not the latest blog post has a featured image. * @param string $thumbnail Image version to return. @@ -1077,7 +846,7 @@ function bp_total_blog_count() { /** * Filters the total number of blogs on the site. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Total number of blogs on the site. */ @@ -1104,7 +873,7 @@ function bp_total_blog_count_for_user( $user_id = 0 ) { /** * Filters the total number of blogs for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Total number of blogs for a given user. */ @@ -1133,11 +902,13 @@ function bp_blog_signup_enabled() { /** * Filters whether or not blog creation is enabled. * - * @since BuddyPress (1.0.0) + * Return "all", "none", "blog" or "user". + * + * @since 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" + $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); if ( 'none' == $active_signup || 'user' == $active_signup ) return false; @@ -1148,10 +919,10 @@ function bp_blog_signup_enabled() { /** * Output the wrapper markup for the blog signup form. * - * @param string $blogname Optional. The default blog name (path or domain). - * @param string $blog_title Optional. The default blog title. - * @param string|WP_Error Optional. The WP_Error object returned by a previous - * submission attempt. + * @param string $blogname Optional. The default blog name (path or domain). + * @param string $blog_title Optional. The default blog title. + * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous + * submission attempt. */ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') { global $current_user; @@ -1166,7 +937,7 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '' /** * Filters the default values for Blog name, title, and any current errors. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $value { * string $blogname Default blog name provided. @@ -1195,7 +966,7 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '' /** * Fires after the default hidden fields in blog signup form markup. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'signup_hidden_fields' ); ?> @@ -1213,15 +984,15 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '' /** * Output the input fields for the blog creation form. * - * @param string $blogname Optional. The default blog name (path or domain). - * @param string $blog_title Optional. The default blog title. - * @param string|WP_Error Optional. The WP_Error object returned by a previous - * submission attempt. + * @param string $blogname Optional. The default blog name (path or domain). + * @param string $blog_title Optional. The default blog title. + * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous + * submission attempt. */ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) { global $current_site; - // Blog name + // Blog name. if( !is_subdomain_install() ) echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>'; else @@ -1250,7 +1021,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>'; } - // Blog Title + // Blog Title. ?> <label for="blog_title"><?php _e('Site Title:', 'buddypress') ?></label> @@ -1282,7 +1053,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) /** * Fires at the end of all of the default input fields for blog creation form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param WP_Error $errors WP_Error object if any present. */ @@ -1318,16 +1089,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 + // Depreciated. + $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); /** * Filters the default values for Blog meta. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $meta { - * string $value Default blog language ID. - * string $public Default public status. + * string $value Default blog language ID. + * string $public Default public status. * } */ $meta = apply_filters( 'add_signup_meta', $meta ); @@ -1359,12 +1131,12 @@ function bp_blogs_validate_blog_form() { /** * Display a message after successful blog registration. * - * @param string $domain The new blog's domain. - * @param string $path The new blog's path. - * @param string $blog_title The new blog's title. - * @param string $user_name The user name of the user who created the blog. Unused. - * @param string $user_email The email of the user who created the blog. Unused. - * @param string|array $meta Meta values associated with the new blog. Unused. + * @param string $domain The new blog's domain. + * @param string $path The new blog's path. + * @param string $blog_title The new blog's title. + * @param string $user_name The user name of the user who created the blog. Unused. + * @param string $user_email The email of the user who created the blog. Unused. + * @param string|array $meta Meta values associated with the new blog. Unused. */ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = '' ) { $protocol = is_ssl() ? 'https://' : 'http://'; @@ -1380,7 +1152,7 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, /** * Fires after the default successful blog registration message markup. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action('signup_finished'); } @@ -1393,7 +1165,7 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, */ function bp_create_blog_link() { - // Don't show this link when not on your own profile + // Don't show this link when not on your own profile. if ( ! bp_is_my_profile() ) { return; } @@ -1401,7 +1173,7 @@ function bp_create_blog_link() { /** * Filters "Create a Site" links for users viewing their own profiles. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML link for creating a site. */ @@ -1415,7 +1187,7 @@ function bp_create_blog_link() { */ function bp_blogs_blog_tabs() { - // Don't show these tabs on a user's own profile + // Don't show these tabs on a user's own profile. if ( bp_is_my_profile() ) { return false; } ?> @@ -1431,7 +1203,7 @@ function bp_blogs_blog_tabs() { /** * Fires after the markup for the navigation tabs for a user Blogs page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_blogs_blog_tabs' ); } @@ -1440,18 +1212,24 @@ function bp_blogs_blog_tabs() { * Output the blog directory search form. */ function bp_directory_blogs_search_form() { - $default_search_value = bp_get_search_default_text(); - $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; + + $query_arg = bp_core_get_component_search_query_arg( 'blogs' ); + + if ( ! empty( $_REQUEST[ $query_arg ] ) ) { + $search_value = stripslashes( $_REQUEST[ $query_arg ] ); + } else { + $search_value = bp_get_search_default_text( 'blogs' ); + } $search_form_html = '<form action="" method="get" id="search-blogs-form"> - <label><input type="text" name="s" id="blogs_search" placeholder="'. esc_attr( $search_value ) .'" /></label> + <label for="blogs_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="blogs_search" placeholder="'. esc_attr( $search_value ) .'" /></label> <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) + * @since 1.9.0 * * @param string $search_form_html HTML markup for blog directory search form. */ @@ -1461,7 +1239,7 @@ function bp_directory_blogs_search_form() { /** * Output the Create a Site button. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_blog_create_button() { echo bp_get_blog_create_button(); @@ -1469,7 +1247,7 @@ function bp_blog_create_button() { /** * Get the Create a Site button. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -1496,7 +1274,7 @@ function bp_blog_create_button() { /** * Filters the Create a Site button. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $button_args Array of arguments to be used for the Create a Site button. */ @@ -1506,7 +1284,7 @@ function bp_blog_create_button() { /** * Output the Create a Site nav item. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_blog_create_nav_item() { echo bp_get_blog_create_nav_item(); @@ -1515,15 +1293,15 @@ function bp_blog_create_nav_item() { /** * Get the Create a Site nav item. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return string */ function bp_get_blog_create_nav_item() { - // Get the create a site button + // Get the create a site button. $create_blog_button = bp_get_blog_create_button(); - // Make sure the button is available + // Make sure the button is available. if ( empty( $create_blog_button ) ) { return; } @@ -1537,18 +1315,19 @@ function bp_blog_create_nav_item() { * 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) + * @since 2.2.0 + * + * @uses bp_blog_create_nav_item() to output the Create a Site nav item. * - * @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 + // 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 + // Bail if the theme is not filtering the Blogs directory title. if ( ! has_filter( 'bp_blogs_directory_header' ) ) { return; } @@ -1562,7 +1341,7 @@ add_action( 'bp_blogs_directory_blog_types', 'bp_blog_backcompat_create_nav_item * * @see bp_get_blogs_visit_blog_button() for description of arguments. * - * @param array $args See {@link bp_get_blogs_visit_blog_button()}. + * @param array|string $args See {@link bp_get_blogs_visit_blog_button()}. */ function bp_blogs_visit_blog_button( $args = '' ) { echo bp_get_blogs_visit_blog_button( $args ); @@ -1573,18 +1352,18 @@ function bp_blogs_visit_blog_button( $args = '' ) { * @see BP_Button for a complete description of arguments and return * value. * - * @param array $args { + * @param array|string $args { * Arguments are listed below, with their default values. For a * complete description of arguments, see {@link BP_Button}. - * @type string $id Default: 'visit_blog'. - * @type string $component Default: 'blogs'. - * @type bool $must_be_logged_in Default: false. - * @type bool $block_self Default: false. - * @type string $wrapper_class Default: 'blog-button visit'. - * @type string $link_href Permalink of the current blog in the loop. - * @type string $link_class Default: 'blog-button visit'. - * @type string $link_text Default: 'Visit Site'. - * @type string $link_title Default: 'Visit Site'. + * @type string $id Default: 'visit_blog'. + * @type string $component Default: 'blogs'. + * @type bool $must_be_logged_in Default: false. + * @type bool $block_self Default: false. + * @type string $wrapper_class Default: 'blog-button visit'. + * @type string $link_href Permalink of the current blog in the loop. + * @type string $link_class Default: 'blog-button visit'. + * @type string $link_text Default: 'Visit Site'. + * @type string $link_title Default: 'Visit Site'. * } * @return string The HTML for the Visit button. */ @@ -1606,7 +1385,7 @@ function bp_blogs_visit_blog_button( $args = '' ) { /** * Filters the button for visiting a blog in a loop. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param array $button Array of arguments to be used for the button to visit a blog. */ @@ -1618,10 +1397,11 @@ function bp_blogs_visit_blog_button( $args = '' ) { /** * Display the number of blogs in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @uses bp_blogs_admin_get_profile_stats() to get the stats. * - * @param array $args before|after|user_id - * @uses bp_blogs_admin_get_profile_stats() to get the stats + * @param array|string $args Before|after|user_id. */ function bp_blogs_profile_stats( $args = '' ) { echo bp_blogs_get_profile_stats( $args ); @@ -1631,14 +1411,14 @@ add_action( 'bp_members_admin_user_stats', 'bp_blogs_profile_stats', 9, 1 ); /** * Return the number of blogs in user's profile. * - * @since BuddyPress (2.0.0) + * @since 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_blogs_get_profile_stats( $args = '' ) { - // Parse the args + // Parse the args. $r = bp_parse_args( $args, array( 'before' => '<li class="bp-blogs-profile-stats">', 'after' => '</li>', @@ -1647,18 +1427,18 @@ function bp_blogs_get_profile_stats( $args = '' ) { 'output' => '' ), 'blogs_get_profile_stats' ); - // Allow completely overloaded output + // Allow completely overloaded output. if ( is_multisite() && empty( $r['output'] ) ) { - // Only proceed if a user ID was passed + // Only proceed if a user ID was passed. if ( ! empty( $r['user_id'] ) ) { - // Get the user's blogs + // Get the user's blogs. if ( empty( $r['blogs'] ) ) { $r['blogs'] = absint( bp_blogs_total_blogs_for_user( $r['user_id'] ) ); } - // If blogs exist, show some formatted output + // If blogs exist, show some formatted output. $r['output'] = $r['before'] . sprintf( _n( '%s site', '%s sites', $r['blogs'], 'buddypress' ), '<strong>' . $r['blogs'] . '</strong>' ) . $r['after']; } } @@ -1666,7 +1446,7 @@ function bp_blogs_get_profile_stats( $args = '' ) { /** * Filters the number of blogs in user's profile. * - * @since BuddyPress (2.0.0) + * @since 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. 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 5cb224f83774e4b7f1778d48c27d73cc1f37ebb7..151528ce35a96c48cf0ff1b9b97137fa966ee06e 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php @@ -1,15 +1,17 @@ <?php - /** - * BuddyPress Blogs Widgets + * BuddyPress Blogs Widgets. * * @package BuddyPress * @subpackage BlogsWidgets + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-blogs-recent-posts-widget.php'; + /** * Register the widgets for the Blogs component. */ @@ -21,143 +23,3 @@ function bp_blogs_register_widgets() { } } add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' ); - -/** - * The Recent Networkwide Posts widget - */ -class BP_Blogs_Recent_Posts_Widget extends WP_Widget { - - /** - * Constructor method. - */ - 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', - ); - parent::__construct( false, $name = _x( '(BuddyPress) Recent Networkwide Posts', 'widget name', 'buddypress' ), $widget_ops ); - } - - /** - * Display the networkwide posts 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 ) { - - $title = ! empty( $instance['title'] ) - ? esc_html( $instance['title'] ) - : __( 'Recent Networkwide Posts', 'buddypress' ); - - if ( ! empty( $instance['link_title'] ) ) { - $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'] ) || empty( $instance['max_posts'] ) ) { - $instance['max_posts'] = 10; - } - - // 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"> - - <?php while ( bp_activities() ) : bp_the_activity(); ?> - - <li> - <div class="activity-content" style="margin: 0"> - <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> - - <?php endif; ?> - - </div> - </li> - - <?php endwhile; ?> - - </ul> - - <?php else : ?> - - <div id="message" class="info"> - <p><?php _e( 'Sorry, there were no posts found. Why not write one?', 'buddypress' ); ?></p> - </div> - - <?php endif; ?> - - <?php echo $args['after_widget']; ?> - <?php - } - - /** - * Update the networkwide posts 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_posts'] = strip_tags( $new_instance['max_posts'] ); - $instance['link_title'] = (bool) $new_instance['link_title']; - - return $instance; - } - - /** - * Output the networkwide posts widget options form. - * - * @param $instance Settings for this widget. - */ - 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'] ); - $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> - <?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 index 5e88b89d147e50c52007f3bd1c0abd005ea6a1e5..6e36295923448949c41a893bd8e2e82b187d3fe6 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage BlogsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,17 +16,35 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 1.0.0 */ class BP_Blogs_Blog { + + /** + * Site ID. + * + * @var int|null + */ public $id; + + /** + * User ID. + * + * @var int + */ public $user_id; + + /** + * Blog ID. + * + * @var int + */ public $blog_id; /** * Constructor method. * - * @param int $id Optional. The ID of the blog. + * @param int|null $id Optional. The ID of the blog. */ public function __construct( $id = null ) { if ( !empty( $id ) ) { @@ -64,9 +83,9 @@ class BP_Blogs_Blog { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference. + * @param BP_Blogs_Blog $this Current instance of the blog item being saved. Passed by reference. */ do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) ); @@ -81,10 +100,10 @@ class BP_Blogs_Blog { $bp = buddypress(); if ( $this->id ) { - // Update + // 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 + // Save. $sql = $wpdb->prepare( "INSERT INTO {$bp->blogs->table_name} ( user_id, blog_id ) VALUES ( %d, %d )", $this->user_id, $this->blog_id ); } @@ -96,9 +115,9 @@ class BP_Blogs_Blog { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference. + * @param BP_Blogs_Blog $this Current instance of the blog item being saved. Passed by reference. */ do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) ); @@ -111,8 +130,8 @@ class BP_Blogs_Blog { /** * 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. + * @return int $value The number of associations between the user and blog + * saved in the blog component tables. */ public function exists() { global $wpdb; @@ -127,22 +146,22 @@ class BP_Blogs_Blog { /** * 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. + * @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|bool $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 + * '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; @@ -241,7 +260,7 @@ class BP_Blogs_Blog { 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 ) ); @@ -250,9 +269,9 @@ class BP_Blogs_Blog { /** * 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. + * @param int $blog_id The blog being removed. + * @param int|null $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 ) { @@ -269,9 +288,8 @@ class BP_Blogs_Blog { /** * 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. + * @param int|null $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 ) { @@ -293,14 +311,13 @@ class BP_Blogs_Blog { * 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. + * @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. + * '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; @@ -336,7 +353,7 @@ class BP_Blogs_Blog { * 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. + * 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 ) { @@ -355,7 +372,7 @@ class BP_Blogs_Blog { * * @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. + * on success, otherwise null. */ public static function is_recorded( $blog_id ) { global $wpdb; @@ -372,8 +389,8 @@ class BP_Blogs_Blog { * $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. + * @param int|null $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 ) { @@ -398,14 +415,14 @@ class BP_Blogs_Blog { * 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). + * @param string $filter The search term. + * @param int|null $limit Optional. The maximum number of items to return. + * Default: null (no limit). + * @param int|null $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. + * '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; @@ -436,13 +453,13 @@ class BP_Blogs_Blog { * 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). + * @param int|null $limit Optional. The maximum number of items to return. + * Default: null (no limit). + * @param int|null $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. + * 'blogs' - Array of located blog objects. + * 'total' - A count of the total blogs. */ public static function get_all( $limit = null, $page = null ) { global $wpdb; @@ -464,14 +481,14 @@ class BP_Blogs_Blog { * 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). + * @param string $letter The letter you're looking for. + * @param int|null $limit Optional. The maximum number of items to return. + * Default: null (no limit). + * @param int|null $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. + * '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; @@ -504,9 +521,9 @@ class BP_Blogs_Blog { * - 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. + * @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 ) { @@ -524,7 +541,7 @@ class BP_Blogs_Blog { $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 + // 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. @@ -532,22 +549,22 @@ class BP_Blogs_Blog { if ( ! empty( $image ) ) $images['thumbnail'] = $image[0]; - // Medium + // 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 + // 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 + // 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 + // Add the images to the latest_post object. $paged_blogs[$i]->latest_post->images = $images; } } diff --git a/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-component.php b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-component.php new file mode 100644 index 0000000000000000000000000000000000000000..336a8be878e99ec94885e6542fb3e69ced85ff41 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-component.php @@ -0,0 +1,305 @@ +<?php +/** + * BuddyPress Blogs Loader + * + * 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 querying blogs in bulk more performant. + * + * @package BuddyPress + * @subpackage BlogsCore + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Creates our Blogs component. + */ +class BP_Blogs_Component extends BP_Component { + + /** + * Start the blogs component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'blogs', + __( 'Site Directory', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 30, + 'search_query_arg' => 'sites_search', + ) + ); + } + + /** + * Set up global settings for the blogs component. + * + * The BP_BLOGS_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals( $args = array() ) { + $bp = buddypress(); + + if ( ! defined( 'BP_BLOGS_SLUG' ) ) { + define ( 'BP_BLOGS_SLUG', $this->id ); + } + + // Global tables for messaging component. + $global_tables = array( + 'table_name' => $bp->table_prefix . 'bp_user_blogs', + 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta', + ); + + $meta_tables = array( + 'blog' => $bp->table_prefix . 'bp_user_blogs_blogmeta', + ); + + // All globals for blogs component. + $args = array( + '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' ), + 'global_tables' => $global_tables, + 'meta_tables' => $meta_tables, + ); + + // Setup the globals. + parent::setup_globals( $args ); + + /** + * Filters if a blog is public. + * + * In case the config is not multisite, the blog_public option is ignored. + * + * @since 2.3.0 + * + * @param int $value Whether or not the blog is public. + */ + 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 1.5.0 + * @deprecated 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' ); + } + } + } + + /** + * Include bp-blogs files. + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes( $includes = array() ) { + + // Files to include. + $includes = array( + 'cache', + 'actions', + 'screens', + 'classes', + 'template', + 'filters', + 'functions', + ); + + if ( bp_is_active( 'activity' ) ) { + $includes[] = 'activity'; + } + + if ( is_multisite() ) { + $includes[] = 'widgets'; + } + + // Include the files. + parent::includes( $includes ); + } + + /** + * Set up component navigation for bp-blogs. + * + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + /** + * Blog/post/comment menus should not appear on single WordPress setups. + * Although comments and posts made by users will still show on their + * activity stream. + */ + if ( ! is_multisite() ) { + return false; + } + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $slug = bp_get_blogs_slug(); + $parent_url = trailingslashit( $user_domain . $slug ); + + // Add 'Sites' to the main navigation. + $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 ), bp_core_number_format( $count ) ); + $main_nav = array( + 'name' => $nav_text, + 'slug' => $slug, + 'position' => 30, + 'screen_function' => 'bp_blogs_screen_my_blogs', + 'default_subnav_slug' => 'my-sites', + 'item_css_id' => $this->id + ); + + $sub_nav[] = array( + 'name' => __( 'My Sites', 'buddypress' ), + 'slug' => 'my-sites', + 'parent_url' => $parent_url, + 'parent_slug' => $slug, + 'screen_function' => 'bp_blogs_screen_my_blogs', + 'position' => 10 + ); + + // Setup navigation. + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up bp-blogs integration with the WordPress admin bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_admin_bar() for a description of arguments. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() + * for description. + * @return bool + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + /** + * Site/post/comment menus should not appear on single WordPress setups. + * + * Comments and posts made by users will still show in their activity. + */ + if ( ! is_multisite() ) { + return false; + } + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $blogs_link = trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ); + + // Add the "Sites" sub menu. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => __( 'Sites', 'buddypress' ), + 'href' => $blogs_link + ); + + // My Sites. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-my-sites', + 'title' => __( 'My Sites', 'buddypress' ), + 'href' => $blogs_link, + 'position' => 10 + ); + + // Create a Site. + if ( bp_blog_signup_enabled() ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-create', + 'title' => __( 'Create a Site', 'buddypress' ), + 'href' => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ), + 'position' => 99 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + */ + public function setup_title() { + + // Set up the component options navigation for Site. + if ( bp_is_blogs_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + if ( bp_is_active( 'xprofile' ) ) { + $bp->bp_options_title = __( 'My Sites', 'buddypress' ); + } + + // If we are not viewing the logged in user, set up the current + // users avatar and name. + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() { + + // Global groups. + wp_cache_add_global_groups( array( + 'blog_meta' + ) ); + + parent::setup_cache_groups(); + } +} diff --git a/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..f7e68271e588e031304e8332ad3e265fbf8fe6ec --- /dev/null +++ b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-recent-posts-widget.php @@ -0,0 +1,163 @@ +<?php +/** + * BuddyPress Blogs Recent Posts Widget. + * + * @package BuddyPress + * @subpackage BlogsWidgets + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The Recent Networkwide Posts widget. + */ +class BP_Blogs_Recent_Posts_Widget extends WP_Widget { + + /** + * Constructor method. + */ + 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', + ); + parent::__construct( false, $name = _x( '(BuddyPress) Recent Networkwide Posts', 'widget name', 'buddypress' ), $widget_ops ); + } + + /** + * Display the networkwide posts 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 ) { + global $activities_template; + + $title = ! empty( $instance['title'] ) + ? esc_html( $instance['title'] ) + : __( 'Recent Networkwide Posts', 'buddypress' ); + + if ( ! empty( $instance['link_title'] ) ) { + $title = '<a href="' . bp_get_blogs_directory_permalink() . '">' . esc_html( $title ) . '</a>'; + } + + /** + * Filters the Blogs Recent Posts widget title. + * + * @since 2.2.0 + * @since 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'] ) || empty( $instance['max_posts'] ) ) { + $instance['max_posts'] = 10; + } + + $after_widget = $args['after_widget']; + + // 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 + ); + + // Back up global. + $old_activities_template = $activities_template; + + ?> + + <?php if ( bp_has_activities( $args ) ) : ?> + + <ul id="blog-post-list" class="activity-list item-list"> + + <?php while ( bp_activities() ) : bp_the_activity(); ?> + + <li> + <div class="activity-content" style="margin: 0"> + <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> + + <?php endif; ?> + + </div> + </li> + + <?php endwhile; ?> + + </ul> + + <?php else : ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, there were no posts found. Why not write one?', 'buddypress' ); ?></p> + </div> + + <?php endif; ?> + + <?php echo $after_widget; + + // Restore the global. + $activities_template = $old_activities_template; + } + + /** + * Update the networkwide posts 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_posts'] = strip_tags( $new_instance['max_posts'] ); + $instance['link_title'] = (bool) $new_instance['link_title']; + + return $instance; + } + + /** + * Output the networkwide posts widget options form. + * + * @param array $instance Settings for this widget. + * + * @return void + */ + 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'] ); + $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> + <?php + } +} diff --git a/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-template.php b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-template.php new file mode 100644 index 0000000000000000000000000000000000000000..b203c892c29ebca5215aa0317c2cc126328fe74e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-template.php @@ -0,0 +1,246 @@ +<?php +/** + * BuddyPress Blogs Template Class. + * + * @package BuddyPress + * @subpackage BlogsTemplate + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main blog template loop class. + * + * Responsible for loading a group of blogs into a loop for display. + */ +class BP_Blogs_Template { + + /** + * The loop iterator. + * + * @var int + */ + public $current_blog = -1; + + /** + * The number of blogs returned by the paged query. + * + * @var int + */ + public $blog_count = 0; + + /** + * Array of blogs located by the query.. + * + * @var array + */ + public $blogs = array(); + + /** + * The blog object currently being iterated on. + * + * @var object + */ + public $blog; + + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop = false; + + /** + * The page number being requested. + * + * @var int + */ + public $pag_page = 1; + + /** + * The number of items being requested per page. + * + * @var int + */ + public $pag_num = 20; + + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links = ''; + + /** + * The total number of blogs matching the query parameters. + * + * @var int + */ + public $total_blog_count = 0; + + /** + * Constructor method. + * + * @see BP_Blogs_Blog::get() for a description of parameters. + * + * @param string $type See {@link BP_Blogs_Blog::get()}. + * @param string $page See {@link BP_Blogs_Blog::get()}. + * @param string $per_page See {@link BP_Blogs_Blog::get()}. + * @param string $max See {@link BP_Blogs_Blog::get()}. + * @param string $user_id See {@link BP_Blogs_Blog::get()}. + * @param string $search_terms See {@link BP_Blogs_Blog::get()}. + * @param string $page_arg The string used as a query parameter in + * pagination links. Default: 'bpage'. + * @param bool $update_meta_cache Whether to pre-fetch metadata for + * queried blogs. + * @param array|bool $include_blog_ids Array of blog IDs to include. + */ + 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_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'] ) ) { + $this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page ); + + // Typical blogs query. + } else { + $this->blogs = bp_blogs_get_blogs( array( + 'type' => $type, + 'per_page' => $this->pag_num, + 'page' => $this->pag_page, + 'user_id' => $user_id, + 'search_terms' => $search_terms, + 'update_meta_cache' => $update_meta_cache, + 'include_blog_ids' => $include_blog_ids, + ) ); + } + + // Set the total blog count. + if ( empty( $max ) || ( $max >= (int) $this->blogs['total'] ) ) { + $this->total_blog_count = (int) $this->blogs['total']; + } else { + $this->total_blog_count = (int) $max; + } + + // Set the blogs array (to loop through later. + $this->blogs = $this->blogs['blogs']; + + // Get the current blog count to compare maximum against. + $blog_count = count( $this->blogs ); + + // Set the current blog count. + if ( empty( $max ) || ( $max >= (int) $blog_count ) ) { + $this->blog_count = (int) $blog_count; + } else { + $this->blog_count = (int) $max; + } + + // 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( $this->pag_arg, '%#%' ), + 'format' => '', + 'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ), + 'current' => (int) $this->pag_page, + 'prev_text' => _x( '←', 'Blog pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Blog pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => array(), + ) ); + } + } + + /** + * Whether there are blogs available in the loop. + * + * @see bp_has_blogs() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_blogs() { + return (bool) ! empty( $this->blog_count ); + } + + /** + * Set up the next blog and iterate index. + * + * @return object The next blog to iterate over. + */ + public function next_blog() { + $this->current_blog++; + $this->blog = $this->blogs[ $this->current_blog ]; + + return $this->blog; + } + + /** + * Rewind the blogs and reset blog index. + */ + public function rewind_blogs() { + $this->current_blog = -1; + if ( $this->blog_count > 0 ) { + $this->blog = $this->blogs[0]; + } + } + + /** + * Whether there are blogs left in the loop to iterate over. + * + * This method is used by {@link bp_blogs()} as part of the while loop + * that controls iteration inside the blogs loop, eg: + * while ( bp_blogs() ) { ... + * + * @see bp_blogs() + * + * @return bool True if there are more blogs to show, otherwise false. + */ + public function blogs() { + 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 1.5.0 + */ + do_action( 'blog_loop_end' ); + // Do some cleaning up after the loop. + $this->rewind_blogs(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current blog inside the loop. + * + * Used by {@link bp_the_blog()} to set up the current blog data while + * looping, so that template tags used during that iteration make + * reference to the current blog. + * + * @see bp_the_blog() + */ + public function the_blog() { + + $this->in_the_loop = true; + $this->blog = $this->next_blog(); + + // Loop has just started. + if ( 0 === $this->current_blog ) { + + /** + * Fires if on the first blog in the loop. + * + * @since 1.5.0 + */ + do_action( 'blog_loop_start' ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-theme-compat.php b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..04623e5fb6fb66edd3d5027452c9c2baef8f9a00 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-blogs/classes/class-bp-blogs-theme-compat.php @@ -0,0 +1,201 @@ +<?php +/** + * BuddyPress Blogs Theme Compatibility. + * + * @package BuddyPress + * @subpackage BlogsScreens + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main theme compat class for BuddyPress Blogs. + * + * 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 1.7.0 + */ +class BP_Blogs_Theme_Compat { + + /** + * Set up theme compatibility for the Blogs component. + * + * @since 1.7.0 + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_blogs' ) ); + } + + /** + * Are we looking at something that needs Blogs theme compatibility? + * + * @since 1.7.0 + */ + public function is_blogs() { + + // Bail if not looking at a group. + if ( ! bp_is_blogs_component() ) + return; + + // Bail if looking at a users sites. + if ( bp_is_user() ) + return; + + // Blog Directory. + 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 1.5.0 + */ + do_action( 'bp_blogs_screen_index' ); + + add_filter( 'bp_get_buddypress_template', array( $this, 'directory_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Create blog. + } elseif ( is_user_logged_in() && bp_blog_signup_enabled() ) { + add_filter( 'bp_get_buddypress_template', array( $this, 'create_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); + } + } + + /** Directory *************************************************************/ + + /** + * Add template hierarchy to theme compat for the blog directory page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the custom templates used for theme compat with the blog directory page. + * + * @since 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' + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() { + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => __( 'Sites', 'buddypress' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part. + * + * @since 1.7.0 + */ + public function directory_content() { + return bp_buffer_template_part( 'blogs/index', null, false ); + } + + /** Create ****************************************************************/ + + /** + * Add custom template hierarchy to theme compat for the blog create page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the custom templates used for theme compat with the blog create page. + * + * @since 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' + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with create screen data. + * + * @since 1.7.0 + */ + public function create_dummy_post() { + + // Title based on ability to create blogs. + if ( is_user_logged_in() && bp_blog_signup_enabled() ) { + $title = __( 'Create a Site', 'buddypress' ); + } else { + $title = __( 'Sites', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the create screen template part. + * + * @since 1.7.0 + */ + public function create_content() { + return bp_buffer_template_part( 'blogs/create', null, false ); + } +} 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 index 32c7204aa85719d0e0346f967984cd32cc83eb88..3662892d581fd6261ccb0ffbd212f1fe4c663ff2 100644 --- 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Admin Actions. * @@ -14,11 +13,12 @@ * * @package BuddyPress * @subpackage Admin + * @since 2.3.0 * @see bp-core-actions.php * @see bp-core-filters.php */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -35,19 +35,20 @@ defined( 'ABSPATH' ) || exit; * 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 + * 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( '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( 'customize_controls_enqueue_scripts', 'bp_admin_enqueue_scripts', 8 ); +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' ); @@ -55,35 +56,35 @@ 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 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) + * @since 1.7.0 * - * @param int $blog_id - * @param int $user_id - * @param string $domain - * @param string $path - * @param int $site_id - * @param array $meta + * @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. */ function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { - // Bail if plugin is not network activated + // Bail if plugin is not network activated. if ( ! is_plugin_active_for_network( buddypress()->basename ) ) return; - // Switch to the new blog + // 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) + * @since 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. @@ -94,7 +95,7 @@ function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { */ do_action( 'bp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta ); - // restore original blog + // Restore original blog. restore_current_blog(); } @@ -103,7 +104,8 @@ function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { /** * Piggy back admin_init action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_init'. */ function bp_admin_init() { @@ -111,7 +113,7 @@ function bp_admin_init() { /** * Fires inside the bp_admin_init function. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_admin_init' ); } @@ -119,7 +121,8 @@ function bp_admin_init() { /** * Piggy back admin_menu action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_menu'. */ function bp_admin_menu() { @@ -127,7 +130,7 @@ function bp_admin_menu() { /** * Fires inside the bp_admin_menu function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_admin_menu' ); } @@ -135,7 +138,8 @@ function bp_admin_menu() { /** * Piggy back admin_head action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_head'. */ function bp_admin_head() { @@ -143,7 +147,7 @@ function bp_admin_head() { /** * Fires inside the bp_admin_head function. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_admin_head' ); } @@ -151,7 +155,8 @@ function bp_admin_head() { /** * Piggy back admin_notices action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_notices'. */ function bp_admin_notices() { @@ -159,7 +164,7 @@ function bp_admin_notices() { /** * Fires inside the bp_admin_notices function. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_admin_notices' ); } @@ -167,9 +172,9 @@ function bp_admin_notices() { /** * Piggy back admin_enqueue_scripts action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @uses do_action() Calls 'bp_admin_enqueue_scripts''. + * @uses do_action() Calls 'bp_admin_enqueue_scripts'. * * @param string $hook_suffix The current admin page, passed to * 'admin_enqueue_scripts'. @@ -179,7 +184,7 @@ function bp_admin_enqueue_scripts( $hook_suffix = '' ) { /** * Fires inside the bp_admin_enqueue_scripts function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $hook_suffix The current admin page, passed to admin_enqueue_scripts. */ @@ -189,7 +194,8 @@ function bp_admin_enqueue_scripts( $hook_suffix = '' ) { /** * Dedicated action to register BuddyPress importers. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_notices'. */ function bp_register_importers() { @@ -199,7 +205,7 @@ function bp_register_importers() { * * Used to register a BuddyPress importer. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_register_importers' ); } @@ -207,7 +213,8 @@ function bp_register_importers() { /** * Dedicated action to register admin styles. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_admin_notices'. */ function bp_register_admin_style() { @@ -215,7 +222,7 @@ function bp_register_admin_style() { /** * Fires inside the bp_register_admin_style function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_register_admin_style' ); } @@ -223,7 +230,8 @@ function bp_register_admin_style() { /** * Dedicated action to register admin settings. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * * @uses do_action() Calls 'bp_register_admin_settings'. */ function bp_register_admin_settings() { @@ -231,7 +239,7 @@ function bp_register_admin_settings() { /** * Fires inside the bp_register_admin_settings function. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_register_admin_settings' ); } diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-classes.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-classes.php new file mode 100644 index 0000000000000000000000000000000000000000..9fb599f93ac46660c6960592e985a8611948880c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-admin-classes.php @@ -0,0 +1,13 @@ +<?php +/** + * Core component classes for wp-admin screens. + * + * @package BuddyPress + * @subpackage Core + * @since 2.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-walker-category-checklist.php'; 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 index c4e07da8cd9da452ca17a6f4c8e93a705bd3d880..8e71dc01fdf2b8509cb8b3909707a28768d68b47 100644 --- 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 @@ -1,27 +1,28 @@ <?php - /** - * BuddyPress Admin Component Functions + * BuddyPress Admin Component Functions. * * @package BuddyPress * @subpackage CoreAdministration + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Renders the Component Setup admin panel. * - * @package BuddyPress - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * * @uses bp_core_admin_component_options() */ function bp_core_admin_components_settings() { ?> <div class="wrap"> - <?php screen_icon( 'buddypress'); ?> + + <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1> <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2> <form action="" method="post" id="bp-admin-component-form"> @@ -43,25 +44,25 @@ function bp_core_admin_components_settings() { /** * Creates reusable markup for component setup on the Components and Pages dashboard panel. * - * @package BuddyPress - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * * @todo Use settings API */ function bp_core_admin_components_options() { - // Declare local variables + // Declare local variables. $deactivated_components = array(); /** * Filters the array of available components. * - * @since BuddyPress (1.5.0) + * @since 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) + // The default components (if none are previously selected). $default_components = array( 'xprofile' => array( 'title' => __( 'Extended Profiles', 'buddypress' ), @@ -81,12 +82,12 @@ function bp_core_admin_components_options() { $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 + // 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 + // 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 @@ -95,13 +96,13 @@ function bp_core_admin_components_options() { $deactivated_components = bp_get_option( 'bp-deactivated-components' ); if ( !empty( $deactivated_components ) ) { - // Trim off namespace and filename + // 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 + // 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; @@ -110,18 +111,19 @@ function bp_core_admin_components_options() { } } - // On new install, set active components to default + // On new install, set active components to default. if ( empty( $active_components ) ) { $active_components = $default_components; } - // Core component is always active + // Core component is always active. $active_components['core'] = $all_components['core']; $inactive_components = array_diff( array_keys( $all_components ) , array_keys( $active_components ) ); - /** Display ***************************************************************/ + /** Display ************************************************************** + */ - // Get the total count of all plugins + // 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'; @@ -148,6 +150,8 @@ function bp_core_admin_components_options() { break; } ?> + <h3 class="screen-reader-text"><?php _e( 'Filter components list', 'buddypress' ); ?></h3> + <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> @@ -156,23 +160,17 @@ function bp_core_admin_components_options() { <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"> + <h3 class="screen-reader-text"><?php _e( 'Components list', 'buddypress' ); ?></h3> + + <table class="wp-list-table widefat plugins"> <thead> <tr> - <th scope="col" id="cb" class="manage-column column-cb check-column"> </th> - <th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th> + <td id="cb" class="manage-column column-cb check-column"><input id="cb-select-all-1" type="checkbox" disabled><label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Bulk selection is disabled', 'buddypress' ); ?></label></td> + <th scope="col" id="name" class="manage-column column-title column-primary"><?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"> </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 ) ) : ?> @@ -186,33 +184,29 @@ function bp_core_admin_components_options() { endif; ?> <tr id="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $name ) . ' ' . esc_attr( $class ); ?>"> - <th scope="row"> + <th scope="row" class="check-column"> <?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 )] ) ); ?> /> + <input type="checkbox" id="<?php echo esc_attr( "bp_components[$name]" ); ?>" name="<?php echo esc_attr( "bp_components[$name]" ); ?>" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> /><label for="<?php echo esc_attr( "bp_components[$name]" ); ?>" class="screen-reader-text"><?php printf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label> + + <?php else : ?> + + <input type="checkbox" id="<?php echo esc_attr( "bp_components[$name]" ); ?>" name="<?php echo esc_attr( "bp_components[$name]" ); ?>" value="1" checked="checked" disabled><label for="<?php echo esc_attr( "bp_components[$name]" ); ?>" class="screen-reader-text"><?php printf( __( '%s is a required component', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label> <?php endif; ?> </th> - <td class="plugin-title" style="width: 190px;"> + <td class="plugin-title column-primary"> <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> + <strong><?php echo esc_html( $labels['title'] ); ?></strong> </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> @@ -227,6 +221,15 @@ function bp_core_admin_components_options() { <?php endif; ?> </tbody> + + <tfoot> + <tr> + <td class="manage-column column-cb check-column"><input id="cb-select-all-2" type="checkbox" disabled><label class="screen-reader-text" for="cb-select-all-2"><?php _e( 'Bulk selection is disabled', 'buddypress' ); ?></label></td> + <th class="manage-column column-title column-primary"><?php _e( 'Component', 'buddypress' ); ?></th> + <th class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th> + </tr> + </tfoot> + </table> <input type="hidden" name="bp_components[members]" value="1" /> @@ -235,28 +238,29 @@ function bp_core_admin_components_options() { } /** - * Handle saving the Component settings + * Handle saving the Component settings. + * + * @since 1.6.0 * - * @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 + // Bail if not saving settings. if ( ! isset( $_POST['bp-admin-component-submit'] ) ) return; - // Bail if nonce fails + // Bail if nonce fails. if ( ! check_admin_referer( 'bp-admin-component-setup' ) ) return; - // Settings form submitted, now save the settings. First, set active components + // Settings form submitted, now save the settings. First, set active components. if ( isset( $_POST['bp_components'] ) ) { - // Load up BuddyPress + // Load up BuddyPress. $bp = buddypress(); - // Save settings and upgrade schema + // Save settings and upgrade schema. require_once( $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); $submitted = stripslashes_deep( $_POST['bp_components'] ); @@ -270,14 +274,14 @@ function bp_core_admin_components_settings_handler() { // Where are we redirecting to? $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) ); - // Redirect + // 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 + * 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 @@ -296,10 +300,10 @@ add_action( 'bp_admin_init', 'bp_core_admin_components_settings_handler' ); * is not present, before merging the submitted components with the active * ones. * - * @since BuddyPress (1.7.0) + * @since 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 + * @param array $submitted 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 ) { @@ -318,8 +322,8 @@ function bp_core_admin_get_active_components_from_submitted_settings( $submitted if ( ! isset( $submitted[ $retired_component ] ) ) { unset( $current_components[ $retired_component ] ); } - } - // fall through + } // Fall through. + case 'inactive' : $components = array_merge( $submitted, $current_components ); @@ -336,19 +340,19 @@ function bp_core_admin_get_active_components_from_submitted_settings( $submitted } /** - * Return a list of component information, optionally filtered by type + * 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) + * @since 1.7.0 * - * @param string $type 'all', 'optional', 'retired', 'required' - * @return array An array of requested component data + * @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. $required_components = array( 'core' => array( 'title' => __( 'BuddyPress Core', 'buddypress' ), @@ -360,7 +364,7 @@ function bp_core_admin_get_components( $type = 'all' ) { ), ); - // Retired components + // Retired components. $retired_components = array( 'forums' => array( 'title' => __( 'Group Forums', 'buddypress' ), @@ -368,7 +372,7 @@ function bp_core_admin_get_components( $type = 'all' ) { ), ); - // Optional core components + // Optional core components. $optional_components = array( 'xprofile' => array( 'title' => __( 'Extended Profiles', 'buddypress' ), @@ -409,7 +413,7 @@ function bp_core_admin_get_components( $type = 'all' ) { ); - // Add blogs tracking if multisite + // Add blogs tracking if multisite. if ( is_multisite() ) { $optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' ); } @@ -434,12 +438,12 @@ function bp_core_admin_get_components( $type = 'all' ) { /** * Filters the list of component information. * - * @since BuddyPress (2.0.0) + * @since 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'. + * '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 index eaacaf382b501c14ec8af7ae94e1d37a03f67be3..fbc5d4cde24668b5efb836bddc0a2703420e11aa 100644 --- 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 @@ -1,13 +1,13 @@ <?php - /** - * BuddyPress Common Admin Functions + * BuddyPress Common Admin Functions. * * @package BuddyPress * @subpackage CoreAdministration + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Menu **********************************************************************/ @@ -15,8 +15,7 @@ defined( 'ABSPATH' ) || exit; /** * 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 + * @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 ); @@ -32,13 +31,14 @@ function bp_core_admin_menu_init() { * @global array $_parent_pages * @global array $_registered_pages * @global array $submenu - * @since BuddyPress (1.6.0) + * + * @since 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 + // user is not an Administrator), there's nothing to do here. if ( ! isset( $submenu['bp-general-settings'] ) ) { return; } @@ -52,11 +52,11 @@ function bp_core_admin_backpat_menu() { return; } - // This removes the top-level menu + // 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 + // These stop people accessing the URL directly. unset( $_parent_pages['bp-general-settings'] ); unset( $_registered_pages['toplevel_page_bp-general-settings'] ); } @@ -71,17 +71,18 @@ add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 ); * * @global string $plugin_page * @global array $submenu - * @since BuddyPress (1.6.0) + * + * @since 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 + // 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 + // Network Admin > Tools. if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) { $submenu_file = $plugin_page; } @@ -93,7 +94,9 @@ function bp_core_modify_admin_menu_highlight() { * will never appear. * * @see bp_core_admin_backpat_menu() - * @since BuddyPress (1.6.0) + * + * @since 1.6.0 + * * @todo Add convenience links into the markup once new positions are finalised. */ function bp_core_admin_backpat_page() { @@ -101,7 +104,6 @@ function bp_core_admin_backpat_page() { $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> @@ -114,19 +116,19 @@ function bp_core_admin_backpat_page() { /** Notices *******************************************************************/ /** - * Print admin messages to admin_notices or network_admin_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) + * @since 1.5.0 * - * @uses bp_current_user_can() to check current user permissions before showing the notices + * @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 + // Only the super admin should see messages. if ( ! bp_current_user_can( 'bp_moderate' ) ) { return; } @@ -158,30 +160,30 @@ 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 + * 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) + * @since 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". + * @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 + // Do not add if the notice is empty. if ( empty( $notice ) ) { return; } - // Double check the object before referencing it + // Double check the object before referencing it. if ( ! isset( buddypress()->admin->notices ) ) { buddypress()->admin->notices = array(); } - // Add the notice + // Add the notice. buddypress()->admin->notices[] = array( 'message' => $notice, 'type' => $type, @@ -189,37 +191,38 @@ function bp_core_add_admin_notice( $notice = '', $type = 'updated' ) { } /** - * Verify that some BP prerequisites are set up properly, and notify the admin if not + * 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 + * - 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) + * + * @since 1.2.0 */ function bp_core_activation_notice() { global $wp_rewrite, $wpdb; - // Only the super admin gets warnings + // Only the super admin gets warnings. if ( ! bp_current_user_can( 'bp_moderate' ) ) { return; } - // Bail in user admin + // 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 + // 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 + // Bail if in network admin, and BuddyPress is not network activated. if ( is_network_admin() && ! bp_is_network_activated() ) { return; } @@ -238,21 +241,21 @@ function bp_core_activation_notice() { } } - // Add notice if no rewrite rules are enabled + // 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 + // Get BuddyPress instance. $bp = buddypress(); /** - * Check for orphaned BP components (BP component is enabled, no WP page exists) + * 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 + // 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( @@ -276,7 +279,8 @@ function bp_core_activation_notice() { ); } - // On the first admin screen after a new installation, this isn't set, so grab it to suppress a misleading error message. + // 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(); } @@ -289,7 +293,7 @@ function bp_core_activation_notice() { // 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 + // 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] ); @@ -313,11 +317,11 @@ function bp_core_activation_notice() { $dupe_names[] = $bp->pages->{$dupe_component}->title; } - // Make sure that there are no duplicate duplicates :) + // Make sure that there are no duplicate duplicates :). $dupe_names = array_unique( $dupe_names ); } - // If there are duplicates, post a message about them + // 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>' ); @@ -327,30 +331,30 @@ function bp_core_activation_notice() { } /** - * Redirect user to BuddyPress's What's New page on activation + * Redirect user to BuddyPress's What's New page on activation. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @internal Used internally to redirect BuddyPress to the about page on activation + * @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 + * @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 + // Bail if no activation redirect. if ( ! get_transient( '_bp_activation_redirect' ) ) { return; } - // Delete the redirect transient + // Delete the redirect transient. delete_transient( '_bp_activation_redirect' ); - // Bail if activating from network, or bulk + // Bail if activating from network, or bulk. if ( isset( $_GET['activate-multi'] ) ) { return; } @@ -361,16 +365,17 @@ function bp_do_activation_redirect() { delete_transient( '_bp_is_new_install' ); } - // Redirect to BuddyPress about page + // 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 + * Output the tabs in the admin area. + * + * @since 1.5.0 * - * @since BuddyPress (1.5.0) * @param string $active_tab Name of the tab that is active. Optional. */ function bp_core_admin_tabs( $active_tab = '' ) { @@ -381,13 +386,13 @@ function bp_core_admin_tabs( $active_tab = '' ) { /** * Filters the admin tabs to be displayed. * - * @since BuddyPress (1.9.0) + * @since 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 + // 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; @@ -399,7 +404,7 @@ function bp_core_admin_tabs( $active_tab = '' ) { /** * Fires after the output of tabs for the admin area. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_admin_tabs' ); } @@ -407,8 +412,10 @@ function bp_core_admin_tabs( $active_tab = '' ) { /** * Get the data for the tabs in the admin area. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 + * * @param string $active_tab Name of the tab that is active. Optional. + * @return string */ function bp_core_get_admin_tabs( $active_tab = '' ) { $tabs = array( @@ -422,14 +429,14 @@ function bp_core_get_admin_tabs( $active_tab = '' ) { ), '2' => array( 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), - 'name' => __( 'Settings', 'buddypress' ) + 'name' => __( 'Options', 'buddypress' ) ), ); - // If forums component is active, add additional tab + // If forums component is active, add additional tab. if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) { - // enqueue thickbox + // Enqueue thickbox. wp_enqueue_script( 'thickbox' ); wp_enqueue_style( 'thickbox' ); @@ -442,7 +449,7 @@ function bp_core_get_admin_tabs( $active_tab = '' ) { /** * Filters the tab data used in our wp-admin screens. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $tabs Tab data. */ @@ -452,10 +459,12 @@ function bp_core_get_admin_tabs( $active_tab = '' ) { /** Help **********************************************************************/ /** - * adds contextual help to BuddyPress admin pages + * Adds contextual help to BuddyPress admin pages. + * + * @since 1.7.0 + * @todo Make this part of the BP_Component class and split into each component. * - * @since BuddyPress (1.7.0) - * @todo Make this part of the BP_Component class and split into each component + * @param string $screen Current screen. */ function bp_core_add_contextual_help( $screen = '' ) { @@ -463,17 +472,17 @@ function bp_core_add_contextual_help( $screen = '' ) { switch ( $screen->id ) { - // Component page + // Component page. case 'settings_page_bp-components' : - // help tabs + // 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 + // 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>' . @@ -481,17 +490,17 @@ function bp_core_add_contextual_help( $screen = '' ) { ); break; - // Pages page + // Pages page. case 'settings_page_bp-page-settings' : - // Help tabs + // 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 + // 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>' . @@ -500,17 +509,17 @@ function bp_core_add_contextual_help( $screen = '' ) { break; - // Settings page + // Settings page. case 'settings_page_bp-settings' : - // Help tabs + // 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 + // 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>' . @@ -519,17 +528,17 @@ function bp_core_add_contextual_help( $screen = '' ) { break; - // Profile fields page + // Profile fields page. case 'users_page_bp-profile-setup' : - // Help tabs + // 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 + // 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>' . @@ -542,9 +551,12 @@ function bp_core_add_contextual_help( $screen = '' ) { add_action( 'contextual_help', 'bp_core_add_contextual_help' ); /** - * renders contextual help content to contextual help tabs + * Renders contextual help content to contextual help tabs. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $tab Current help content tab. + * @return string */ function bp_core_add_contextual_help_content( $tab = '' ) { @@ -562,7 +574,7 @@ function bp_core_add_contextual_help_content( $tab = '' ) { 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' ); + $retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.', 'buddypress' ) . '<br /><br />' . __( 'Note: Any fields in the first group will appear on the signup page.', 'buddypress' ); break; default: @@ -570,7 +582,7 @@ function bp_core_add_contextual_help_content( $tab = '' ) { break; } - // Wrap text in a paragraph tag + // Wrap text in a paragraph tag. if ( !empty( $retval ) ) { $retval = '<p>' . $retval . '</p>'; } @@ -581,25 +593,25 @@ function bp_core_add_contextual_help_content( $tab = '' ) { /** Separator *****************************************************************/ /** - * Add a separator to the WordPress admin menus + * Add a separator to the WordPress admin menus. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @uses bp_current_user_can() To check users capability on root blog + * @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 + // 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 + // 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 + // Prevent duplicate separators when no core menu items exist. if ( ! bp_current_user_can( 'bp_moderate' ) ) { return; } @@ -616,17 +628,18 @@ function bp_admin_separator() { } /** - * Tell WordPress we have a custom menu order + * Tell WordPress we have a custom menu order. + * + * @since 1.7.0 * - * @since BuddyPress (1.7.0) + * @uses bp_current_user_can() To check users capability on root blog. * - * @param bool $menu_order Menu order - * @uses bp_current_user_can() To check users capability on root blog - * @return bool Always true + * @param bool $menu_order Menu order. + * @return bool Always true. */ function bp_admin_custom_menu_order( $menu_order = false ) { - // Bail if user cannot see admin pages + // Bail if user cannot see admin pages. if ( ! bp_current_user_can( 'bp_moderate' ) ) { return $menu_order; } @@ -635,87 +648,89 @@ function bp_admin_custom_menu_order( $menu_order = false ) { } /** - * Move our custom separator above our custom post types + * Move our custom separator above our custom post types. * - * @since BuddyPress (1.7.0) + * @since 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 + * @uses bp_current_user_can() To check users capability on root blog. + * + * @param array $menu_order Menu Order. + * @return array Modified menu order. */ function bp_admin_menu_order( $menu_order = array() ) { - // Bail if user cannot see admin pages + // 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 + // Initialize our custom order array. $bp_menu_order = array(); - // Menu values + // Menu values. $last_sep = is_network_admin() ? 'separator1' : 'separator2'; /** * Filters the custom admin menus. * - * @since BuddyPress (1.7.0) + * @since 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 + // Bail if no components have top level admin pages. if ( empty( $custom_menus ) ) { return $menu_order; } - // Add our separator to beginning of array + // Add our separator to beginning of array. array_unshift( $custom_menus, 'separator-buddypress' ); - // Loop through menu order and do some rearranging + // Loop through menu order and do some rearranging. foreach ( (array) $menu_order as $item ) { - // Position BuddyPress menus above appearance + // Position BuddyPress menus above appearance. if ( $last_sep == $item ) { - // Add our custom menus + // 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 + // Add the appearance separator. $bp_menu_order[] = $last_sep; - // Skip our menu items + // Skip our menu items. } elseif ( ! in_array( $item, $custom_menus ) ) { $bp_menu_order[] = $item; } } - // Return our custom order + // Return our custom order. return $bp_menu_order; } /** Utility *****************************************************************/ /** - * When using a WP_List_Table, get the currently selected bulk action + * 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) + * @since 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 the bottom is set, let it override the action. if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != "-1" ) { $action = $_REQUEST['action2']; } @@ -726,9 +741,9 @@ function bp_admin_list_table_current_bulk_action() { /** Menus *********************************************************************/ /** - * Register meta box and associated JS for BuddyPress WP Nav Menu . + * Register meta box and associated JS for BuddyPress WP Nav Menu. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_admin_wp_nav_menu_meta_box() { if ( ! bp_is_root_blog() ) { @@ -743,7 +758,7 @@ function bp_admin_wp_nav_menu_meta_box() { /** * Build and populate the BuddyPress accordion on Appearance > Menus. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @global $nav_menu_selected_id */ @@ -795,6 +810,131 @@ function bp_admin_do_wp_nav_menu_meta_box() { <?php } +/** + * In admin emails list, for non-en_US locales, add notice explaining how to reinstall emails. + * + * If BuddyPress installs before its translations are in place, tell people how to reinstall + * the emails so they have their contents in their site's language. + * + * @since 2.5.0 + */ +function bp_admin_email_maybe_add_translation_notice() { + if ( get_current_screen()->post_type !== bp_get_email_post_type() || get_locale() === 'en_US' ) { + return; + } + + // If user can't access BP Tools, there's no point showing the message. + if ( ! current_user_can( buddypress()->admin->capability ) ) { + return; + } + + if ( bp_core_do_network_admin() ) { + $admin_page = 'admin.php'; + } else { + $admin_page = 'tools.php'; + } + + bp_core_add_admin_notice( + sprintf( + __( 'Are your emails in the wrong language? Go to <a href="%s">BuddyPress Tools and run the "reinstall emails"</a> tool.', 'buddypress' ), + esc_url( add_query_arg( 'page', 'bp-tools', bp_get_admin_url( $admin_page ) ) ) + ), + 'updated' + ); +} +add_action( 'admin_head-edit.php', 'bp_admin_email_maybe_add_translation_notice' ); + +/** + * In emails editor, add notice linking to token documentation on Codex. + * + * @since 2.5.0 + */ +function bp_admin_email_add_codex_notice() { + if ( get_current_screen()->post_type !== bp_get_email_post_type() ) { + return; + } + + bp_core_add_admin_notice( + sprintf( + __( 'Phrases wrapped in braces <code>{{ }}</code> are email tokens. <a href="%s">Learn about tokens on the BuddyPress Codex</a>.', 'buddypress' ), + esc_url( 'https://codex.buddypress.org/emails/email-tokens/' ) + ), + 'error' + ); +} +add_action( 'admin_head-post.php', 'bp_admin_email_add_codex_notice' ); + +/** + * Display metabox for email taxonomy type. + * + * Shows the term description in a list, rather than the term name itself. + * + * @since 2.5.0 + * + * @param WP_Post $post Post object. + * @param array $box { + * Tags meta box arguments. + * + * @type string $id Meta box ID. + * @type string $title Meta box title. + * @type callable $callback Meta box display callback. + * } + */ +function bp_email_tax_type_metabox( $post, $box ) { + $r = array( + 'taxonomy' => bp_get_email_tax_type() + ); + + $tax_name = esc_attr( $r['taxonomy'] ); + $taxonomy = get_taxonomy( $r['taxonomy'] ); + ?> + <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv"> + <div id="<?php echo $tax_name; ?>-all" class="tabs-panel"> + <?php + $name = ( $tax_name == 'category' ) ? 'post_category' : 'tax_input[' . $tax_name . ']'; + echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. + ?> + <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear"> + <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'walker' => new BP_Walker_Category_Checklist ) ); ?> + </ul> + </div> + + <p><?php esc_html_e( 'Choose when this email will be sent.', 'buddypress' ); ?></p> + </div> + <?php +} + +/** + * Custom metaboxes used by our 'bp-email' post type. + * + * @since 2.5.0 + */ +function bp_email_custom_metaboxes() { + // Remove default 'Excerpt' metabox and replace with our own. + remove_meta_box( 'postexcerpt', null, 'normal' ); + add_meta_box( 'postexcerpt', __( 'Plain text email content', 'buddypress' ), 'bp_email_plaintext_metabox', null, 'normal', 'high' ); +} +add_action( 'add_meta_boxes_' . bp_get_email_post_type(), 'bp_email_custom_metaboxes' ); + +/** + * Customized version of the 'Excerpt' metabox for our 'bp-email' post type. + * + * We are using the 'Excerpt' metabox as our plain-text email content editor. + * + * @since 2.5.0 + * + * @param WP_Post $post + */ +function bp_email_plaintext_metabox( $post ) { +?> + + <label class="screen-reader-text" for="excerpt"><?php _e( 'Plain text email content', 'buddypress' ); ?></label><textarea rows="5" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea> + + <p><?php _e( 'Most email clients support HTML email. However, some people prefer to receive plain text email. Enter a plain text alternative version of your email here.', 'buddypress' ); ?></p> + +<?php +} + /** * Restrict various items from view if editing a BuddyPress menu. * @@ -809,7 +949,7 @@ function bp_admin_do_wp_nav_menu_meta_box() { * * Note: These restrictions are only enforced if JavaScript is enabled. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_admin_wp_nav_menu_restrict_items() { ?> @@ -830,33 +970,33 @@ function bp_admin_wp_nav_menu_restrict_items() { /** * Add "Mark as Spam/Ham" button to user row actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param array $actions User row action links. + * @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 + // 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 + // 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 + // Admin URL could be single site or network. $url = bp_get_admin_url( 'users.php' ); - // If spammed, create unspam link + // 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 + // 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' ); @@ -864,34 +1004,34 @@ function bp_core_admin_user_row_actions( $actions, $user_object ) { } } - // Create a "View" link + // 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 new actions. return $actions; } /** * Catch requests to mark individual users as spam/ham from users.php. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_core_admin_user_manage_spammers() { - // Print our inline scripts on non-Multisite + // 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 this is a multisite, bulk request, stop now! if ( 'list' == $mode ) { return; } - // Process a spam/ham request + // Process a spam/ham request. if ( ! empty( $action ) && in_array( $action, array( 'spam', 'ham' ) ) ) { check_admin_referer( 'bp-spam-user' ); @@ -906,7 +1046,7 @@ function bp_core_admin_user_manage_spammers() { $status = ( $action == 'spam' ) ? 'spam' : 'ham'; - // Process the user + // Process the user. bp_core_process_spammer_status( $user_id, $status ); $redirect = add_query_arg( array( 'updated' => 'marked-' . $status ), $redirect ); @@ -914,7 +1054,7 @@ function bp_core_admin_user_manage_spammers() { wp_redirect( $redirect ); } - // Display feedback + // Display feedback. if ( ! empty( $updated ) && in_array( $updated, array( 'marked-spam', 'marked-ham' ) ) ) { if ( 'marked-spam' === $updated ) { @@ -930,7 +1070,7 @@ function bp_core_admin_user_manage_spammers() { /** * Inline script that adds the 'site-spammed' class to spammed users. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_core_admin_user_spammed_js() { ?> 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 index 9aa6b60ec6b3cb2cb1981a3456882ed3080edd1c..a603e6c1db51b87dd6cbe74249dd53ee27dc8aa1 100644 --- 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 @@ -1,22 +1,23 @@ <?php - /** - * BuddyPress DB schema + * BuddyPress DB schema. * * @package BuddyPress * @subpackage CoreAdministration + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Get the DB schema to use for BuddyPress components + * Get the DB schema to use for BuddyPress components. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global $wpdb $wpdb - * @return string The default database character-set, if set + * + * @return string The default database character-set, if set. */ function bp_core_set_charset() { global $wpdb; @@ -27,67 +28,67 @@ function bp_core_set_charset() { } /** - * Main installer + * 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) + * @since 1.0.0 * - * @param array $active_components Components to install + * @param array|bool $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 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) + // Install Activity Streams even when inactive (to store last_activity data). bp_core_install_activity_streams(); - // Install the signups table + // Install the signups table. bp_core_maybe_install_signups(); - // Notifications + // Notifications. if ( !empty( $active_components['notifications'] ) ) { bp_core_install_notifications(); } - // Friend Connections + // Friend Connections. if ( !empty( $active_components['friends'] ) ) { bp_core_install_friends(); } - // Extensible Groups + // Extensible Groups. if ( !empty( $active_components['groups'] ) ) { bp_core_install_groups(); } - // Private Messaging + // Private Messaging. if ( !empty( $active_components['messages'] ) ) { bp_core_install_private_messaging(); } - // Extended Profiles + // Extended Profiles. if ( !empty( $active_components['xprofile'] ) ) { bp_core_install_extended_profiles(); } - // Blog tracking + // Blog tracking. if ( !empty( $active_components['blogs'] ) ) { bp_core_install_blog_tracking(); } } /** - * Install database tables for the Notifications component + * Install database tables for the Notifications component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -129,9 +130,9 @@ function bp_core_install_notifications() { } /** - * Install database tables for the Activity component + * Install database tables for the Activity component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -182,9 +183,9 @@ function bp_core_install_activity_streams() { } /** - * Install database tables for the Notifications component + * Install database tables for the Notifications component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -210,9 +211,9 @@ function bp_core_install_friends() { } /** - * Install database tables for the Groups component + * Install database tables for the Groups component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -270,9 +271,9 @@ function bp_core_install_groups() { } /** - * Install database tables for the Messages component + * Install database tables for the Messages component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -330,9 +331,9 @@ function bp_core_install_private_messaging() { } /** - * Install database tables for the Profiles component + * Install database tables for the Profiles component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -345,7 +346,7 @@ function bp_core_install_extended_profiles() { $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 + // 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' ) ); } @@ -405,7 +406,7 @@ function bp_core_install_extended_profiles() { dbDelta( $sql ); - // Insert the default group and fields + // Insert the default group and fields. $insert_sql = array(); if ( ! $wpdb->get_var( "SELECT id FROM {$bp_prefix}bp_xprofile_groups WHERE id = 1" ) ) { @@ -420,9 +421,9 @@ function bp_core_install_extended_profiles() { } /** - * Install database tables for the Sites component + * Install database tables for the Sites component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @uses bp_core_set_charset() * @uses bp_core_get_table_prefix() @@ -458,7 +459,7 @@ function bp_core_install_blog_tracking() { /** * Install the signups table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global $wpdb * @uses wp_get_db_schema() to get WordPress ms_global schema @@ -466,21 +467,21 @@ function bp_core_install_blog_tracking() { function bp_core_install_signups() { global $wpdb; - // Signups is not there and we need it so let's create it + // 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 + // 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 + // 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 + // 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 ) { @@ -489,7 +490,7 @@ function bp_core_install_signups() { } } - // Run WordPress's database upgrader + // Run WordPress's database upgrader. if ( ! empty( $create_queries ) ) { dbDelta( $create_queries ); } @@ -500,9 +501,9 @@ function bp_core_install_signups() { * * 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 + * own sign-ups table; Eg: Gravity Forms User Registration Add On. * - * @since BuddyPress (2.0.1) + * @since 2.0.1 * * @see pre_schema_upgrade() * @link https://core.trac.wordpress.org/ticket/27855 WordPress Trac Ticket @@ -513,15 +514,53 @@ function bp_core_install_signups() { function bp_core_upgrade_signups() { global $wpdb; - // Bail if global tables should not be upgraded + // 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 + // Never use bp_core_get_table_prefix() for any global users tables. $wpdb->signups = $wpdb->base_prefix . 'signups'; - // Attempt to alter the signups table + // 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" ); } + +/** + * Add default emails. + * + * @since 2.5.0 + */ +function bp_core_install_emails() { + $defaults = array( + 'post_status' => 'publish', + 'post_type' => bp_get_email_post_type(), + ); + + $emails = bp_email_get_schema(); + $descriptions = bp_email_get_type_schema(); + + // Add these emails to the database. + foreach ( $emails as $id => $email ) { + $post_id = wp_insert_post( bp_parse_args( $email, $defaults, 'install_email_' . $id ) ); + if ( ! $post_id ) { + continue; + } + + $tt_ids = wp_set_object_terms( $post_id, $id, bp_get_email_tax_type() ); + foreach ( $tt_ids as $tt_id ) { + $term = get_term_by( 'term_taxonomy_id', (int) $tt_id, bp_get_email_tax_type() ); + wp_update_term( (int) $term->term_id, bp_get_email_tax_type(), array( + 'description' => $descriptions[ $id ], + ) ); + } + } + + /** + * Fires after BuddyPress adds the posts for its emails. + * + * @since 2.5.0 + */ + do_action( 'bp_core_install_emails' ); +} 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 index 8b02f4f9fa83f910d55cf62382853117cce80bc6..4bfcc69b75c24042d0b8c1d2d639a9dde38c3f6f 100644 --- 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 @@ -1,28 +1,28 @@ <?php - /** - * BuddyPress Admin Settings + * BuddyPress Admin Settings. * * @package BuddyPress * @subpackage CoreAdministration + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Main settings section description for the settings page + * Main settings section description for the settings page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_main_section() { } /** - * Admin bar for logged out users setting field + * Admin bar for logged out users setting field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses bp_form_option() To output the option value + * @uses bp_form_option() To output the option value. */ function bp_admin_setting_callback_admin_bar() { ?> @@ -34,11 +34,11 @@ function bp_admin_setting_callback_admin_bar() { } /** - * Allow members to delete their accounts setting field + * Allow members to delete their accounts setting field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses checked() To display the checked attribute + * @uses checked() To display the checked attribute. */ function bp_admin_setting_callback_account_deletion() { ?> @@ -52,18 +52,18 @@ function bp_admin_setting_callback_account_deletion() { /** Activity *******************************************************************/ /** - * Groups settings section description for the settings page + * Groups settings section description for the settings page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_activity_section() { } /** - * Allow Akismet setting field + * Allow Akismet setting field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses checked() To display the checked attribute + * @uses checked() To display the checked attribute. */ function bp_admin_setting_callback_activity_akismet() { ?> @@ -75,9 +75,9 @@ function bp_admin_setting_callback_activity_akismet() { } /** - * Allow activity comments on blog posts and forum posts + * Allow activity comments on blog posts and forum posts. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_blogforum_comments() { ?> @@ -91,7 +91,7 @@ function bp_admin_setting_callback_blogforum_comments() { /** * Allow Heartbeat to refresh activity stream. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_admin_setting_callback_heartbeat() { ?> @@ -103,13 +103,16 @@ function bp_admin_setting_callback_heartbeat() { } /** - * Sanitization for bp-disable-blogforum-comments setting + * 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) + * @since 1.6.0 + * + * @param bool $value Whether or not to sanitize. + * @return bool */ function bp_admin_sanitize_callback_blogforum_comments( $value = false ) { return $value ? 0 : 1; @@ -118,18 +121,18 @@ function bp_admin_sanitize_callback_blogforum_comments( $value = false ) { /** XProfile ******************************************************************/ /** - * Profile settings section description for the settings page + * Profile settings section description for the settings page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_xprofile_section() { } /** - * Enable BP->WP profile syncing field + * Enable BP->WP profile syncing field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses bp_form_option() To output the option value + * @uses bp_form_option() To output the option value. */ function bp_admin_setting_callback_profile_sync() { ?> @@ -141,11 +144,11 @@ function bp_admin_setting_callback_profile_sync() { } /** - * Allow members to upload avatars field + * Allow members to upload avatars field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses checked() To display the checked attribute + * @uses checked() To display the checked attribute. */ function bp_admin_setting_callback_avatar_uploads() { ?> @@ -156,21 +159,33 @@ function bp_admin_setting_callback_avatar_uploads() { <?php } +/** + * Allow members to upload cover images field. + * + * @since 2.4.0 + */ +function bp_admin_setting_callback_cover_image_uploads() { +?> + <input id="bp-disable-cover-image-uploads" name="bp-disable-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_cover_image_uploads() ); ?> /> + <label for="bp-disable-cover-image-uploads"><?php _e( 'Allow registered members to upload cover images', 'buddypress' ); ?></label> +<?php +} + /** Groups Section ************************************************************/ /** - * Groups settings section description for the settings page + * Groups settings section description for the settings page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_groups_section() { } /** - * Allow all users to create groups field + * Allow all users to create groups field. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @uses checked() To display the checked attribute + * @uses checked() To display the checked attribute. */ function bp_admin_setting_callback_group_creation() { ?> @@ -185,7 +200,7 @@ function bp_admin_setting_callback_group_creation() { /** * 'Enable group avatars' field markup. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_admin_setting_callback_group_avatar_uploads() { ?> @@ -194,22 +209,35 @@ function bp_admin_setting_callback_group_avatar_uploads() { <?php } +/** + * 'Enable group cover images' field markup. + * + * @since 2.4.0 + */ +function bp_admin_setting_callback_group_cover_image_uploads() { +?> + <input id="bp-disable-group-cover-image-uploads" name="bp-disable-group-cover-image-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_cover_image_uploads() ); ?> /> + <label for="bp-disable-group-cover-image-uploads"><?php _e( 'Allow customizable cover images for groups', 'buddypress' ); ?></label> +<?php +} + /** Forums Section ************************************************************/ /** - * Forums settings section description for the settings page + * Forums settings section description for the settings page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_admin_setting_callback_bbpress_section() { } /** - * bb-config.php location field + * The bb-config.php location field. + * + * @since 1.6.0 * - * @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 + * @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() { @@ -235,24 +263,23 @@ function bp_admin_setting_callback_bbpress_configuration() { /** * The main settings page * - * @since BuddyPress (1.6.0) + * @since 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 + * @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 + // 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' ); ?> + <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1> - <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Settings', 'buddypress' ) ); ?></h2> + <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Options', 'buddypress' ) ); ?></h2> <form action="<?php echo esc_url( $form_action ) ?>" method="post"> @@ -270,9 +297,9 @@ function bp_core_admin_settings() { } /** - * Save our settings + * Save our settings. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_core_admin_settings_save() { global $wp_settings_fields; @@ -281,7 +308,7 @@ function bp_core_admin_settings_save() { 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 + // 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 ) { @@ -296,7 +323,9 @@ function bp_core_admin_settings_save() { $legacy_options = array( 'bp-disable-account-deletion', 'bp-disable-avatar-uploads', + 'bp-disable-cover-image-uploads', 'bp-disable-group-avatar-uploads', + 'bp-disable-group-cover-image-uploads', 'bp_disable_blogforum_comments', 'bp-disable-profile-sync', 'bp_restrict_group_creation', @@ -306,7 +335,7 @@ function bp_core_admin_settings_save() { 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 + // the corresponding option should be unset. $value = isset( $_POST[$legacy_option] ) ? '' : 1; bp_update_option( $legacy_option, $value ); } @@ -317,15 +346,15 @@ function bp_core_admin_settings_save() { add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 ); /** - * Output settings API option + * Output settings API option. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_bp_form_option() * - * @param string $option - * @param string $default - * @param bool $slug + * @param string $option Form option to echo. + * @param string $default Form option default. + * @param bool $slug Form option slug. */ function bp_form_option( $option, $default = '' , $slug = false ) { echo bp_get_form_option( $option, $default, $slug ); @@ -333,19 +362,20 @@ function bp_form_option( $option, $default = '' , $slug = false ) { /** * Return settings API option * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() * @uses esc_attr() * @uses apply_filters() * - * @param string $option - * @param string $default - * @param bool $slug + * @param string $option Form option to return. + * @param string $default Form option default. + * @param bool $slug Form option slug. + * @return string */ function bp_get_form_option( $option, $default = '', $slug = false ) { - // Get the option and sanitize it + // Get the option and sanitize it. $value = bp_get_option( $option, $default ); // Slug? @@ -354,23 +384,23 @@ function bp_form_option( $option, $default = '' , $slug = false ) { /** * Filters the slug value in the form field. * - * @since BuddyPress (1.6.0) + * @since 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 + } else { // Not a slug. $value = esc_attr( $value ); } - // Fallback to default + // Fallback to default. if ( empty( $value ) ) $value = $default; /** * Filters the settings API option. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Value being returned for the requested option. * @param string $option Option whose value is being requested. 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 index e1da411e546c436d3525e2a2aa7cc92bec49099c..035a9954a381ee07313c4fe82075e67567c19ad7 100644 --- 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 @@ -1,19 +1,19 @@ <?php - /** - * BuddyPress Admin Slug Functions + * BuddyPress Admin Slug Functions. * * @package BuddyPress * @subpackage CoreAdministration + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Renders the page mapping admin panel. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @todo Use settings API * @uses bp_core_admin_component_options() */ @@ -21,7 +21,8 @@ function bp_core_admin_slugs_settings() { ?> <div class="wrap"> - <?php screen_icon( 'buddypress'); ?> + + <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1> <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2> <form action="" method="post" id="bp-admin-page-form"> @@ -41,30 +42,24 @@ function bp_core_admin_slugs_settings() { } /** - * Creates reusable markup for page setup on the Components and Pages dashboard panel. + * Generate a list of directory pages, for use when building Components panel markup. * - * @package BuddyPress - * @since BuddyPress (1.6.0) - * @todo Use settings API + * @since 2.4.1 + * + * @return array */ -function bp_core_admin_slugs_options() { +function bp_core_admin_get_directory_pages() { $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 + // 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 + // 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 + // The component->name property 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 ); } } @@ -75,11 +70,53 @@ function bp_core_admin_slugs_options() { /** * Filters the loaded components needing directory page association to a WordPress page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $directory_pages Array of available components to set associations for. */ - $directory_pages = apply_filters( 'bp_directory_pages', $directory_pages ); + return apply_filters( 'bp_directory_pages', $directory_pages ); +} + +/** + * Generate a list of static pages, for use when building Components panel markup. + * + * By default, this list contains 'register' and 'activate'. + * + * @since 2.4.1 + * + * @return array + */ +function bp_core_admin_get_static_pages() { + $static_pages = array( + 'register' => __( 'Register', 'buddypress' ), + 'activate' => __( 'Activate', 'buddypress' ), + ); + + /** + * Filters the default static pages for BuddyPress setup. + * + * @since 1.6.0 + * + * @param array $static_pages Array of static default static pages. + */ + return apply_filters( 'bp_static_pages', $static_pages ); +} + +/** + * Creates reusable markup for page setup on the Components and Pages dashboard panel. + * + * @package BuddyPress + * @since 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 = bp_core_admin_get_directory_pages(); if ( !empty( $directory_pages ) ) : ?> @@ -129,7 +166,7 @@ function bp_core_admin_slugs_options() { * * Allows plugins to add their own directory associations. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_active_external_directories' ); ?> @@ -142,20 +179,7 @@ function bp_core_admin_slugs_options() { /** 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 ); + $static_pages = bp_core_admin_get_static_pages(); if ( !empty( $static_pages ) ) : ?> @@ -202,7 +226,7 @@ function bp_core_admin_slugs_options() { /** * Fires after the display of default static pages for BuddyPress setup. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_active_external_pages' ); ?> @@ -214,9 +238,9 @@ function bp_core_admin_slugs_options() { } /** - * Handle saving of the BuddyPress slugs + * Handle saving of the BuddyPress slugs. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @todo Use settings API */ function bp_core_admin_slugs_setup_handler() { @@ -225,17 +249,17 @@ function bp_core_admin_slugs_setup_handler() { if ( !check_admin_referer( 'bp-admin-pages-setup' ) ) return false; - // Then, update the directory pages + // Then, update the directory pages. if ( isset( $_POST['bp_pages'] ) ) { + $valid_pages = array_merge( bp_core_admin_get_directory_pages(), bp_core_admin_get_static_pages() ); - $directory_pages = array(); - + $new_directory_pages = array(); foreach ( (array) $_POST['bp_pages'] as $key => $value ) { - if ( !empty( $value ) ) { - $directory_pages[$key] = (int) $value; + if ( isset( $valid_pages[ $key ] ) ) { + $new_directory_pages[ $key ] = (int) $value; } } - bp_core_update_directory_page_ids( $directory_pages ); + bp_core_update_directory_page_ids( $new_directory_pages ); } $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings', 'updated' => 'true' ), 'admin.php' ) ); 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 index e0f5149a9e55cb5ecc7249152018e6fabf4e9ab5..98e818369d4a0042a92df28cf86ce0cedcbbb121 100644 --- 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 @@ -1,25 +1,28 @@ <?php - /** - * BuddyPress Tools panel + * BuddyPress Tools panel. * - * @since BuddyPress (2.0.0) + * @package BuddyPress + * @subpackage Core + * @since 2.0.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** * Render the BuddyPress Tools page. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_core_admin_tools() { ?> <div class="wrap"> - <?php screen_icon( 'buddypress'); ?> - <h2><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h2> + <h1><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1> <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( 'BuddyPress keeps track of various relationships between members, 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> @@ -28,14 +31,14 @@ function bp_core_admin_tools() { <table class="form-table"> <tbody> <tr valign="top"> - <th scope="row"><?php esc_html_e( 'Data to Repair:', 'buddypress' ) ?></th> + <th scope="row"><?php esc_html_e( 'Repair tools', '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 /> + <label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>"><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; ?> @@ -57,23 +60,23 @@ function bp_core_admin_tools() { /** * Handle the processing and feedback of the admin tools page. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_admin_repair_handler() { - if ( ! bp_is_post_request() ) { - return; - } - - if ( empty( $_POST['bp-tools-submit'] ) ) { + if ( ! bp_is_post_request() || empty( $_POST['bp-tools-submit'] ) ) { return; } check_admin_referer( 'bp-do-counts' ); - // Stores messages - $messages = array(); + // Bail if user cannot moderate. + $capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; + if ( ! bp_current_user_can( $capability ) ) { + return; + } wp_cache_flush(); + $messages = array(); 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] ) ) { @@ -99,55 +102,63 @@ function bp_admin_repair_list() { // Members: // - member count - // - last_activity migration (2.0) + // - last_activity migration (2.0). $repair_list[20] = array( 'bp-total-member-count', - __( 'Count total members', 'buddypress' ), + __( 'Repair total members count.', 'buddypress' ), 'bp_admin_repair_count_members', ); $repair_list[25] = array( 'bp-last-activity', - __( 'Repair user "last activity" data', 'buddypress' ), + __( 'Repair member "last activity" data.', 'buddypress' ), 'bp_admin_repair_last_activity', ); // Friends: - // - user friend count + // - user friend count. if ( bp_is_active( 'friends' ) ) { $repair_list[0] = array( 'bp-user-friends', - __( 'Count friends for each user', 'buddypress' ), + __( 'Repair total friends count for each member.', 'buddypress' ), 'bp_admin_repair_friend_count', ); } // Groups: - // - user group count + // - user group count. if ( bp_is_active( 'groups' ) ) { $repair_list[10] = array( 'bp-group-count', - __( 'Count groups for each user', 'buddypress' ), + __( 'Repair total groups count for each member.', 'buddypress' ), 'bp_admin_repair_group_count', ); } // Blogs: - // - user blog count + // - user blog count. if ( bp_is_active( 'blogs' ) ) { $repair_list[90] = array( 'bp-blog-records', - __( 'Repopulate blogs records', 'buddypress' ), + __( 'Repopulate site tracking records.', 'buddypress' ), 'bp_admin_repair_blog_records', ); } + // Emails: + // - reinstall emails. + $repair_list[100] = array( + 'bp-reinstall-emails', + __( 'Reinstall emails (delete and restore from defaults).', 'buddypress' ), + 'bp_admin_reinstall_emails', + ); + ksort( $repair_list ); /** * Filters the array of the repair list. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $repair_list Array of values for the Repair list options. */ @@ -157,7 +168,7 @@ function bp_admin_repair_list() { /** * Recalculate friend counts for each user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return array */ @@ -178,7 +189,7 @@ function bp_admin_repair_friend_count() { $bp = buddypress(); - // Walk through all users on the site + // Walk through all users on the site. $total_users = $wpdb->get_row( "SELECT count(ID) as c FROM {$wpdb->users}" )->c; $updated = array(); @@ -186,11 +197,11 @@ function bp_admin_repair_friend_count() { $per_query = 500; $offset = 0; while ( $offset < $total_users ) { - // Only bother updating counts for users who actually have friendships + // 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 + // filter them here. foreach ( $friendships as $friendship ) { if ( ! isset( $updated[ $friendship->initiator_user_id ] ) ) { BP_Friends_Friendship::total_friend_count( $friendship->initiator_user_id ); @@ -215,7 +226,7 @@ function bp_admin_repair_friend_count() { /** * Recalculate group counts for each user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return array */ @@ -236,14 +247,14 @@ function bp_admin_repair_group_count() { $bp = buddypress(); - // Walk through all users on the site + // 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 + // 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 ) { @@ -260,29 +271,29 @@ function bp_admin_repair_group_count() { } /** - * Recalculate user-to-blog relationships and useful blog meta data + * Recalculate user-to-blog relationships and useful blog meta data. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return array */ function bp_admin_repair_blog_records() { - // Description of this tool, displayed to the user + // Description of this tool, displayed to the user. $statement = __( 'Repopulating Blogs records… %s', 'buddypress' ); - // Default to failure text + // Default to failure text. $result = __( 'Failed!', 'buddypress' ); - // Default to unrepaired + // Default to unrepaired. $repair = false; - // Run function if blogs component is active + // Run function if blogs component is active. if ( bp_is_active( 'blogs' ) ) { $repair = bp_blogs_record_existing_blogs(); } - // Setup success/fail messaging + // Setup success/fail messaging. if ( true === $repair ) { $result = __( 'Complete!', 'buddypress' ); } @@ -294,7 +305,7 @@ function bp_admin_repair_blog_records() { /** * Recalculate the total number of active site members. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_admin_repair_count_members() { $statement = __( 'Counting the number of active members on the site… %s', 'buddypress' ); @@ -308,7 +319,7 @@ function bp_admin_repair_count_members() { * * Re-runs the migration from usermeta introduced in BP 2.0. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_admin_repair_last_activity() { $statement = __( 'Determining last activity dates for each user… %s', 'buddypress' ); @@ -319,10 +330,11 @@ function bp_admin_repair_last_activity() { /** * Assemble admin notices relating success/failure of repair processes. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $message Feedback message. - * @param unknown $class Unused. + * @param string $message Feedback message. + * @param string|bool $class Unused. + * @return bool */ function bp_admin_tools_feedback( $message, $class = false ) { if ( is_string( $message ) ) { @@ -364,19 +376,19 @@ function bp_admin_tools_feedback( $message, $class = false ) { * 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) + * @since 2.0.0 */ function bp_core_admin_available_tools_page() { ?> <div class="wrap"> - <h2><?php esc_attr_e( 'Tools', 'buddypress' ) ?></h2> + <h1><?php esc_attr_e( 'Tools', 'buddypress' ) ?></h1> <?php /** * Fires inside the markup used to display the Available Tools page. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_network_tool_box' ); ?> @@ -387,7 +399,7 @@ function bp_core_admin_available_tools_page() { /** * Render an introduction of BuddyPress tools on Available Tools page. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_core_admin_available_tools_intro() { $query_arg = array( @@ -398,7 +410,7 @@ function bp_core_admin_available_tools_intro() { $url = add_query_arg( $query_arg, bp_get_admin_url( $page ) ); ?> <div class="card tool-box"> - <h3><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h3> + <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 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>' ); ?> @@ -406,3 +418,58 @@ function bp_core_admin_available_tools_intro() { </div> <?php } + +/** + * Delete emails and restore from defaults. + * + * @since 2.5.0 + * + * @return array + */ +function bp_admin_reinstall_emails() { + $switched = false; + + // Switch to the root blog, where the email posts live. + if ( ! bp_is_root_blog() ) { + switch_to_blog( bp_get_root_blog_id() ); + bp_register_taxonomies(); + + $switched = true; + } + + $emails = get_posts( array( + 'fields' => 'ids', + 'post_status' => 'publish', + 'post_type' => bp_get_email_post_type(), + 'posts_per_page' => 200, + 'suppress_filters' => false, + ) ); + + if ( $emails ) { + foreach ( $emails as $email_id ) { + wp_trash_post( $email_id ); + } + } + + // Make sure we have no orphaned email type terms. + $email_types = get_terms( bp_get_email_tax_type(), array( + 'fields' => 'ids', + 'hide_empty' => false, + 'update_term_meta_cache' => false, + ) ); + + if ( $email_types ) { + foreach ( $email_types as $term_id ) { + wp_delete_term( (int) $term_id, bp_get_email_tax_type() ); + } + } + + require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); + bp_core_install_emails(); + + if ( $switched ) { + restore_current_blog(); + } + + return array( 0, __( 'Emails have been successfully reinstalled.', 'buddypress' ) ); +} 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 dfd0b68096099c998fcd087d3da7c1351bd5f2af..1c2791bf5b811141ac563e8b6312bf7df23b9d18 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 @@ -1,198 +1,208 @@ -/** - * CSS that is always loaded when in wp-admin - * - * @since BuddyPress (1.6) - */ - -/* Welcome Screen +/*------------------------------------------------------------------------------ + +This stylesheet is always loaded in wp-admin. + +@since 1.6.0 +@since 2.5.0 + +-------------------------------------------------------------------------------- +TABLE OF CONTENTS: +-------------------------------------------------------------------------------- +1.0 Welcome Screen + 1.1 Version Badge + 1.2 About Panel + 1.2.1 Headline Feature + 1.2.2 Columns + 1.2.3 Features Section + 1.2.4 Changelog Section +2.0 Dashicons + 2.1 Top level menus + 2.2 Settings - Components + 2.3 Tools +3.0 User's Lists +4.0 Emails - Edit page ------------------------------------------------------------------------------*/ -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; +/*------------------------------------------------------------------------------ + * 1.0 Welcome Screen + *----------------------------------------------------------------------------*/ + +/* + * 1.1 Version Badge + */ +.bp-badge { + color: #d84800; + display: inline-block; + font: normal 150px/1 'dashicons' !important; } -/* About Page - since 2.3.3 (WP 4.3) */ +.bp-badge:before { + content: "\f448"; +} -.about-wrap .two-col > div { - position: relative; - width: 47.6%; - margin-left: 4.799999999%; - float: right; +.about-wrap .bp-badge { + position: absolute; + top: 0; + left: 0; } -.about-wrap [class$=col] .last-feature { - margin-left: 0; +@media only screen and (max-width: 500px) { + .about-wrap .bp-badge { + position: relative; + margin: 10px auto; + top: auto; + left: auto; + } } -.about-wrap .feature-list.finer-points h4, -.about-wrap .feature-list.finer-points p { - margin-right: 115px; +/* + * 1.2 About Panel + */ + +/* + * 1.2.1 Headline Feature + */ +.index_page_bp-about .about-wrap .headline-feature, +.dashboard_page_bp-about .about-wrap .headline-feature { + margin-bottom: 2em; + text-align: center; } -@media screen and ( max-width: 782px ) { - .about-wrap .two-col > div { - width: 100%; - margin: 30px 0 0; - padding: 0 0 30px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - } - body.dashboard_page_bp-about span.dashicons, - body.index_page_bp-about span.dashicons { - font-size: 55px; - line-height: 70px; - height: 70px; - width: 70px; - } - .about-wrap .feature-list h2 { - margin: 30px 0 0; - text-align: center; - } - .about-wrap .feature-list.finer-points h4, - .about-wrap .feature-list.finer-points p { - margin-right: 90px; - } +.index_page_bp-about .about-wrap .headline-feature h3, +.index_page_bp-about .headline-feature .headline-title, +.dashboard_page_bp-about .about-wrap .headline-feature h3, +.dashboard_page_bp-about .headline-feature .headline-title { + font-size: 2.2em; + font-weight: normal; + line-height: 1.3; + margin: 1.25em 0 0.6em; + text-align: center; } -/* User's Lists -------------------------------------------------------------------------------*/ +.index_page_bp-about .about-wrap .headline-feature p, +.dashboard_page_bp-about .about-wrap .headline-feature p { + font-size: 1.15em; + margin: 1.15em auto 0.6em; +} -body.site-users-php th#role, -body.users-php th#role, -body.users_page_bp-signups th#count_sent { - width: 10%; +.index_page_bp-about .about-wrap .headline-feature .introduction, +.dashboard_page_bp-about .about-wrap .headline-feature .introduction { + font-weight: 600; } -body.site-users-php th#name, -body.site-users-php th#email, -body.users-php th#name, -body.users-php th#registered, -body.users-php th#email, -body.users_page_bp-signups th#name, -body.users_page_bp-signups th#registered, -body.users_page_bp-signups th#email, -body.users_page_bp-signups th#date_sent { - width: 15%; +/* + * 1.2.2 Columns + */ +.index_page_bp-about .about-wrap .two-col > div, +.dashboard_page_bp-about .about-wrap .two-col > div { + float: right; + margin-left: 4.799999999%; + position: relative; + width: 47.6%; } -body.users-php th#blogs, -body.users_page_bp-signups th#blogs { - width: 20%; +.index_page_bp-about .about-wrap .two-col .last-feature, +.dashboard_page_bp-about .about-wrap .two-col .last-feature { + margin-left: 0; } -body.users_page_bp-signups th.column-count_sent, -body.users_page_bp-signups td.count_sent { - text-align: center; +/* + * 1.2.3 Features Section + */ +.index_page_bp-about .bp-features-section, +.dashboard_page_bp-about .bp-features-section { + margin-bottom: 2em; } -/* Icon 32's -------------------------------------------------------------------------------*/ +.index_page_bp-about .about-wrap .feature-section, +.dashboard_page_bp-about .about-wrap .feature-section { + clear: both; + margin-top: 2em; + overflow: hidden; + padding-bottom: 0; +} -body.branch-3-6 div#icon-buddypress, -body.branch-3-7 div#icon-buddypress { - background: url('../images/icons32.png') no-repeat -370px -6px; +.index_page_bp-about .about-wrap .changelog .feature-section, +.dashboard_page_bp-about .about-wrap .changelog .feature-section { + margin-top: 0; } -body.branch-3-6 div#icon-buddypress-activity, -body.branch-3-7 div#icon-buddypress-activity { - background: url('../images/icons32.png') no-repeat -10px -6px; +.index_page_bp-about .about-wrap .feature-section h3, +.dashboard_page_bp-about .about-wrap .feature-section h3 { + font-size: 1.25em; + line-height: 1.5em; + margin: 0 0 0.6em; } -body.branch-3-6 div#icon-buddypress-groups, -body.branch-3-7 div#icon-buddypress-groups { - background: url('../images/icons32.png') no-repeat -250px -6px; +.index_page_bp-about .about-wrap .changelog h4, +.dashboard_page_bp-about .about-wrap .changelog h4 { + color: #23282d; + font-size: 1em; + margin: 1.4em 0 0.6em; } -/* Menu Icons -------------------------------------------------------------------------------*/ +/* + * 1.2.4 Changelog Section + */ +.index_page_bp-about .about-wrap .changelog, +.dashboard_page_bp-about .about-wrap .changelog { + border-top: 1px solid #eee; + margin-bottom: 3em; +} -/* Backpat */ -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:hover .wp-menu-image, -body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image, -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-general-settings.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: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-general-settings.wp-has-current-submenu .wp-menu-image { - background-position: -178px -2px; -} - -/* Activity */ -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:hover .wp-menu-image, -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_network: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-7 ul#adminmenu li.toplevel_page_bp-activity: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_network: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 { - background-position: 0 -2px; -} - -/* Groups */ -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:hover .wp-menu-image, -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_network: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-7 ul#adminmenu li.toplevel_page_bp-groups: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_network: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 { - background-position: -61px -2px; -} - -/* Tools */ -#adminmenu .toplevel_page_network-tools div.wp-menu-image:before { - content: ""; +.index_page_bp-about .about-wrap .changelog .changelog-title, +.dashboard_page_bp-about .about-wrap .changelog .changelog-title { + font-size: 1.25em; + line-height: 1.5em; + margin: 1.25em 0 .6em; + text-align: center; } -/* Components -------------------------------------------------------------------------------*/ +@media screen and ( max-width: 782px ) { + .index_page_bp-about .about-wrap .headline-feature, + .dashboard_page_bp-about .about-wrap .headline-feature { + max-width: 100%; + } + .index_page_bp-about .about-wrap .headline-feature h3, + .dahsboard_page_bp-about .about-wrap .headline-feature h3, + .index_page_bp-about .about-wrap .headline-feature .headline-title, + .dashboard_page_bp-about .about-wrap .headline-feature .headline-title { + font-size: 2em; + } + .index_page_bp-about .bp-features-section, + .dashboard_page_bp-about .bp-features-section { + margin-bottom: 0; + } + .index_page_bp-about .about-wrap .feature-section, + .dashboard_page_bp-about .about-wrap .feature-section { + margin-top: 0; + } + .index_page_bp-about .about-wrap .two-col > div, + .dashboard_page_bp-about .about-wrap .two-col > div { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + margin-top: 1.25em; + padding-bottom: 1em; + width: 100%; + } + .index_page_bp-about .changelog .two-col > div, + .dashboard_page_bp-about .changelog .two-col > div { + margin-top: 0; + padding-bottom: 0; + } + .index_page_bp-about .about-wrap .changelog .changelog-title, + .dashboard_page_bp-about .about-wrap .changelog .changelog-title { + text-align: right; + } +} + + +/*------------------------------------------------------------------------------ + * 2.0 Dashicons + *----------------------------------------------------------------------------*/ -/* Dashicons */ +/* + * 2.1 Top level menus + */ #adminmenu #toplevel_page_bp-activity .wp-menu-image:before, #adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before, #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before { @@ -234,23 +244,9 @@ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-s content: "\f448"; } -/* Dashicons overrides for backward compatibility */ -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 - Dashicons (WP 3.8+) */ +/* + * 2.2 Settings - Components + */ .settings_page_bp-components td.plugin-title span { float: right; width: 18px; @@ -299,207 +295,75 @@ body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image { content: "\f454"; } -/* Settings - Legacy (< WP 3.8) */ -body.branch-3-6.settings_page_bp-components tr.activity 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.xprofile 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.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.forums 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.friends 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.notifications td.plugin-title span:before, -body.branch-3-7.settings_page_bp-components tr.xprofile 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.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.forums 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.friends 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; +.settings_page_bp-components tr.core td.plugin-title span:before { + content: "\f448"; } -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; +.settings_page_bp-components tr.members td.plugin-title span:before { + content: "\f307"; } -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; +#bp-admin-component-form .wp-list-table.plugins .plugin-title { + width: 25%; } -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; +@media screen and ( max-width: 782px ) { + .settings_page_bp-components td.plugin-title span { + margin-top: 5px; + } + #bp-admin-component-form .wp-list-table.plugins .plugin-title { + display: block; + width: auto; + } + #bp-admin-component-form .subsubsub { + margin-bottom: 0; + padding-bottom: 35px; + } } -#bp-admin-component-form .widefat th { - display: table-cell; - vertical-align: top; +/* + * 2.3 Tools + */ +#adminmenu .toplevel_page_network-tools div.wp-menu-image:before { + content: ""; } -/* Version Badge */ -.bp-badge { - font: normal 150px/1 'dashicons' !important; - color: #D84800; - display: inline-block; +/*------------------------------------------------------------------------------ + * 3.0 User's Lists + *----------------------------------------------------------------------------*/ +body.site-users-php th#role, +body.users-php th#role, +body.users_page_bp-signups th#count_sent { + width: 10%; } -.bp-badge:before { - content: "\f448"; +body.site-users-php th#name, +body.site-users-php th#email, +body.users-php th#name, +body.users-php th#registered, +body.users-php th#email, +body.users_page_bp-signups th#name, +body.users_page_bp-signups th#registered, +body.users_page_bp-signups th#email, +body.users_page_bp-signups th#date_sent { + width: 15%; } -.about-wrap .bp-badge { - position: absolute; - top: 0; - left: 0; +body.users-php th#blogs, +body.users_page_bp-signups th#blogs { + width: 20%; } -/* About Page - since 2.3.3 (WP 4.3) */ - -@media only screen and (max-width: 500px) { - .about-wrap .bp-badge { - position: relative; - margin: 10px auto; - top: auto; - left: auto; - } +body.users_page_bp-signups th.column-count_sent, +body.users_page_bp-signups td.count_sent { + text-align: center; } -/* HiDPI -------------------------------------------------------------------------------*/ -@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { - - /* Icon 32 */ - 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; - } - - /* Backpat */ - 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-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-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-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-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-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; - } +/*------------------------------------------------------------------------------ + * 4.0 Emails - Edit Page + *----------------------------------------------------------------------------*/ +body.post-type-bp-email #excerpt { + height: auto; } 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 ca7bc72ee865f1180b09693ba70dcbfbbaf613d9..f5779009cbbd62fd4e1182626f1a0b499b71f736 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 +1 @@ -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}.about-wrap .two-col>div{position:relative;width:47.6%;margin-left:4.799999999%;float:right}.about-wrap [class$=col] .last-feature{margin-left:0}.about-wrap .feature-list.finer-points h4,.about-wrap .feature-list.finer-points p{margin-right:115px}@media screen and (max-width:782px){.about-wrap .two-col>div{width:100%;margin:30px 0 0;padding:0 0 30px;border-bottom:1px solid rgba(0,0,0,.1)}body.dashboard_page_bp-about span.dashicons,body.index_page_bp-about span.dashicons{font-size:55px;line-height:70px;height:70px;width:70px}.about-wrap .feature-list h2{margin:30px 0 0;text-align:center}.about-wrap .feature-list.finer-points h4,.about-wrap .feature-list.finer-points p{margin-right:90px}}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 (max-width:500px){.about-wrap .bp-badge{position:relative;margin:10px auto;top:auto;left:auto}}@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 +.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;left:0}@media only screen and (max-width:500px){.about-wrap .bp-badge{position:relative;margin:10px auto;top:auto;left:auto}}.dashboard_page_bp-about .about-wrap .headline-feature,.index_page_bp-about .about-wrap .headline-feature{margin-bottom:2em;text-align:center}.dashboard_page_bp-about .about-wrap .headline-feature h3,.dashboard_page_bp-about .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature h3,.index_page_bp-about .headline-feature .headline-title{font-size:2.2em;font-weight:400;line-height:1.3;margin:1.25em 0 .6em;text-align:center}.dashboard_page_bp-about .about-wrap .headline-feature p,.index_page_bp-about .about-wrap .headline-feature p{font-size:1.15em;margin:1.15em auto .6em}.dashboard_page_bp-about .about-wrap .headline-feature .introduction,.index_page_bp-about .about-wrap .headline-feature .introduction{font-weight:600}.dashboard_page_bp-about .about-wrap .two-col>div,.index_page_bp-about .about-wrap .two-col>div{float:right;margin-left:4.799999999%;position:relative;width:47.6%}.dashboard_page_bp-about .about-wrap .two-col .last-feature,.index_page_bp-about .about-wrap .two-col .last-feature{margin-left:0}.dashboard_page_bp-about .bp-features-section,.index_page_bp-about .bp-features-section{margin-bottom:2em}.dashboard_page_bp-about .about-wrap .feature-section,.index_page_bp-about .about-wrap .feature-section{clear:both;margin-top:2em;overflow:hidden;padding-bottom:0}.dashboard_page_bp-about .about-wrap .changelog .feature-section,.index_page_bp-about .about-wrap .changelog .feature-section{margin-top:0}.dashboard_page_bp-about .about-wrap .feature-section h3,.index_page_bp-about .about-wrap .feature-section h3{font-size:1.25em;line-height:1.5em;margin:0 0 .6em}.dashboard_page_bp-about .about-wrap .changelog h4,.index_page_bp-about .about-wrap .changelog h4{color:#23282d;font-size:1em;margin:1.4em 0 .6em}.dashboard_page_bp-about .about-wrap .changelog,.index_page_bp-about .about-wrap .changelog{border-top:1px solid #eee;margin-bottom:3em}.dashboard_page_bp-about .about-wrap .changelog .changelog-title,.index_page_bp-about .about-wrap .changelog .changelog-title{font-size:1.25em;line-height:1.5em;margin:1.25em 0 .6em;text-align:center}@media screen and (max-width:782px){.dashboard_page_bp-about .about-wrap .headline-feature,.index_page_bp-about .about-wrap .headline-feature{max-width:100%}.dahsboard_page_bp-about .about-wrap .headline-feature h3,.dashboard_page_bp-about .about-wrap .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature h3{font-size:2em}.dashboard_page_bp-about .bp-features-section,.index_page_bp-about .bp-features-section{margin-bottom:0}.dashboard_page_bp-about .about-wrap .feature-section,.index_page_bp-about .about-wrap .feature-section{margin-top:0}.dashboard_page_bp-about .about-wrap .two-col>div,.index_page_bp-about .about-wrap .two-col>div{border-bottom:1px solid rgba(0,0,0,.1);margin-top:1.25em;padding-bottom:1em;width:100%}.dashboard_page_bp-about .changelog .two-col>div,.index_page_bp-about .changelog .two-col>div{margin-top:0;padding-bottom:0}.dashboard_page_bp-about .about-wrap .changelog .changelog-title,.index_page_bp-about .about-wrap .changelog .changelog-title{text-align:right}}#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"}.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"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}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.post-type-bp-email #excerpt{height:auto} \ 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 d287ccf2ba8df3d04a323041e12199509022893f..e1cb99b5d3181638e8582765e39115f89cad2c53 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/css/common.css +++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.css @@ -1,198 +1,208 @@ -/** - * CSS that is always loaded when in wp-admin - * - * @since BuddyPress (1.6) - */ - -/* Welcome Screen +/*------------------------------------------------------------------------------ + +This stylesheet is always loaded in wp-admin. + +@since 1.6.0 +@since 2.5.0 + +-------------------------------------------------------------------------------- +TABLE OF CONTENTS: +-------------------------------------------------------------------------------- +1.0 Welcome Screen + 1.1 Version Badge + 1.2 About Panel + 1.2.1 Headline Feature + 1.2.2 Columns + 1.2.3 Features Section + 1.2.4 Changelog Section +2.0 Dashicons + 2.1 Top level menus + 2.2 Settings - Components + 2.3 Tools +3.0 User's Lists +4.0 Emails - Edit page ------------------------------------------------------------------------------*/ -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; +/*------------------------------------------------------------------------------ + * 1.0 Welcome Screen + *----------------------------------------------------------------------------*/ + +/* + * 1.1 Version Badge + */ +.bp-badge { + color: #d84800; + display: inline-block; + font: normal 150px/1 'dashicons' !important; } -/* About Page - since 2.3.3 (WP 4.3) */ +.bp-badge:before { + content: "\f448"; +} -.about-wrap .two-col > div { - position: relative; - width: 47.6%; - margin-right: 4.799999999%; - float: left; +.about-wrap .bp-badge { + position: absolute; + top: 0; + right: 0; } -.about-wrap [class$=col] .last-feature { - margin-right: 0; +@media only screen and (max-width: 500px) { + .about-wrap .bp-badge { + position: relative; + margin: 10px auto; + top: auto; + right: auto; + } } -.about-wrap .feature-list.finer-points h4, -.about-wrap .feature-list.finer-points p { - margin-left: 115px; +/* + * 1.2 About Panel + */ + +/* + * 1.2.1 Headline Feature + */ +.index_page_bp-about .about-wrap .headline-feature, +.dashboard_page_bp-about .about-wrap .headline-feature { + margin-bottom: 2em; + text-align: center; } -@media screen and ( max-width: 782px ) { - .about-wrap .two-col > div { - width: 100%; - margin: 30px 0 0; - padding: 0 0 30px; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - } - body.dashboard_page_bp-about span.dashicons, - body.index_page_bp-about span.dashicons { - font-size: 55px; - line-height: 70px; - height: 70px; - width: 70px; - } - .about-wrap .feature-list h2 { - margin: 30px 0 0; - text-align: center; - } - .about-wrap .feature-list.finer-points h4, - .about-wrap .feature-list.finer-points p { - margin-left: 90px; - } +.index_page_bp-about .about-wrap .headline-feature h3, +.index_page_bp-about .headline-feature .headline-title, +.dashboard_page_bp-about .about-wrap .headline-feature h3, +.dashboard_page_bp-about .headline-feature .headline-title { + font-size: 2.2em; + font-weight: normal; + line-height: 1.3; + margin: 1.25em 0 0.6em; + text-align: center; } -/* User's Lists -------------------------------------------------------------------------------*/ +.index_page_bp-about .about-wrap .headline-feature p, +.dashboard_page_bp-about .about-wrap .headline-feature p { + font-size: 1.15em; + margin: 1.15em auto 0.6em; +} -body.site-users-php th#role, -body.users-php th#role, -body.users_page_bp-signups th#count_sent { - width: 10%; +.index_page_bp-about .about-wrap .headline-feature .introduction, +.dashboard_page_bp-about .about-wrap .headline-feature .introduction { + font-weight: 600; } -body.site-users-php th#name, -body.site-users-php th#email, -body.users-php th#name, -body.users-php th#registered, -body.users-php th#email, -body.users_page_bp-signups th#name, -body.users_page_bp-signups th#registered, -body.users_page_bp-signups th#email, -body.users_page_bp-signups th#date_sent { - width: 15%; +/* + * 1.2.2 Columns + */ +.index_page_bp-about .about-wrap .two-col > div, +.dashboard_page_bp-about .about-wrap .two-col > div { + float: left; + margin-right: 4.799999999%; + position: relative; + width: 47.6%; } -body.users-php th#blogs, -body.users_page_bp-signups th#blogs { - width: 20%; +.index_page_bp-about .about-wrap .two-col .last-feature, +.dashboard_page_bp-about .about-wrap .two-col .last-feature { + margin-right: 0; } -body.users_page_bp-signups th.column-count_sent, -body.users_page_bp-signups td.count_sent { - text-align: center; +/* + * 1.2.3 Features Section + */ +.index_page_bp-about .bp-features-section, +.dashboard_page_bp-about .bp-features-section { + margin-bottom: 2em; } -/* Icon 32's -------------------------------------------------------------------------------*/ +.index_page_bp-about .about-wrap .feature-section, +.dashboard_page_bp-about .about-wrap .feature-section { + clear: both; + margin-top: 2em; + overflow: hidden; + padding-bottom: 0; +} -body.branch-3-6 div#icon-buddypress, -body.branch-3-7 div#icon-buddypress { - background: url('../images/icons32.png') no-repeat -370px -6px; +.index_page_bp-about .about-wrap .changelog .feature-section, +.dashboard_page_bp-about .about-wrap .changelog .feature-section { + margin-top: 0; } -body.branch-3-6 div#icon-buddypress-activity, -body.branch-3-7 div#icon-buddypress-activity { - background: url('../images/icons32.png') no-repeat -10px -6px; +.index_page_bp-about .about-wrap .feature-section h3, +.dashboard_page_bp-about .about-wrap .feature-section h3 { + font-size: 1.25em; + line-height: 1.5em; + margin: 0 0 0.6em; } -body.branch-3-6 div#icon-buddypress-groups, -body.branch-3-7 div#icon-buddypress-groups { - background: url('../images/icons32.png') no-repeat -250px -6px; +.index_page_bp-about .about-wrap .changelog h4, +.dashboard_page_bp-about .about-wrap .changelog h4 { + color: #23282d; + font-size: 1em; + margin: 1.4em 0 0.6em; } -/* Menu Icons -------------------------------------------------------------------------------*/ +/* + * 1.2.4 Changelog Section + */ +.index_page_bp-about .about-wrap .changelog, +.dashboard_page_bp-about .about-wrap .changelog { + border-top: 1px solid #eee; + margin-bottom: 3em; +} -/* Backpat */ -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:hover .wp-menu-image, -body.branch-3-6 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image, -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-general-settings.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: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-general-settings.wp-has-current-submenu .wp-menu-image { - background-position: -178px -2px; -} - -/* Activity */ -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:hover .wp-menu-image, -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_network: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-7 ul#adminmenu li.toplevel_page_bp-activity: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_network: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 { - background-position: 0 -2px; -} - -/* Groups */ -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:hover .wp-menu-image, -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_network: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-7 ul#adminmenu li.toplevel_page_bp-groups: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_network: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 { - background-position: -61px -2px; -} - -/* Tools */ -#adminmenu .toplevel_page_network-tools div.wp-menu-image:before { - content: ""; +.index_page_bp-about .about-wrap .changelog .changelog-title, +.dashboard_page_bp-about .about-wrap .changelog .changelog-title { + font-size: 1.25em; + line-height: 1.5em; + margin: 1.25em 0 .6em; + text-align: center; } -/* Components -------------------------------------------------------------------------------*/ +@media screen and ( max-width: 782px ) { + .index_page_bp-about .about-wrap .headline-feature, + .dashboard_page_bp-about .about-wrap .headline-feature { + max-width: 100%; + } + .index_page_bp-about .about-wrap .headline-feature h3, + .dahsboard_page_bp-about .about-wrap .headline-feature h3, + .index_page_bp-about .about-wrap .headline-feature .headline-title, + .dashboard_page_bp-about .about-wrap .headline-feature .headline-title { + font-size: 2em; + } + .index_page_bp-about .bp-features-section, + .dashboard_page_bp-about .bp-features-section { + margin-bottom: 0; + } + .index_page_bp-about .about-wrap .feature-section, + .dashboard_page_bp-about .about-wrap .feature-section { + margin-top: 0; + } + .index_page_bp-about .about-wrap .two-col > div, + .dashboard_page_bp-about .about-wrap .two-col > div { + border-bottom: 1px solid rgba(0, 0, 0, 0.1); + margin-top: 1.25em; + padding-bottom: 1em; + width: 100%; + } + .index_page_bp-about .changelog .two-col > div, + .dashboard_page_bp-about .changelog .two-col > div { + margin-top: 0; + padding-bottom: 0; + } + .index_page_bp-about .about-wrap .changelog .changelog-title, + .dashboard_page_bp-about .about-wrap .changelog .changelog-title { + text-align: left; + } +} + + +/*------------------------------------------------------------------------------ + * 2.0 Dashicons + *----------------------------------------------------------------------------*/ -/* Dashicons */ +/* + * 2.1 Top level menus + */ #adminmenu #toplevel_page_bp-activity .wp-menu-image:before, #adminmenu #toplevel_page_bp-activity_user .wp-menu-image:before, #adminmenu #toplevel_page_bp-activity_network .wp-menu-image:before { @@ -234,23 +244,9 @@ body.branch-3-7 ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-s content: "\f448"; } -/* Dashicons overrides for backward compatibility */ -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 - Dashicons (WP 3.8+) */ +/* + * 2.2 Settings - Components + */ .settings_page_bp-components td.plugin-title span { float: left; width: 18px; @@ -299,207 +295,75 @@ body.branch-3-7 #adminmenu li.toplevel_page_bp-general-settings .wp-menu-image { content: "\f454"; } -/* Settings - Legacy (< WP 3.8) */ -body.branch-3-6.settings_page_bp-components tr.activity 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.xprofile 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.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.forums 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.friends 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.notifications td.plugin-title span:before, -body.branch-3-7.settings_page_bp-components tr.xprofile 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.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.forums 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.friends 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; +.settings_page_bp-components tr.core td.plugin-title span:before { + content: "\f448"; } -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; +.settings_page_bp-components tr.members td.plugin-title span:before { + content: "\f307"; } -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; +#bp-admin-component-form .wp-list-table.plugins .plugin-title { + width: 25%; } -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; +@media screen and ( max-width: 782px ) { + .settings_page_bp-components td.plugin-title span { + margin-top: 5px; + } + #bp-admin-component-form .wp-list-table.plugins .plugin-title { + display: block; + width: auto; + } + #bp-admin-component-form .subsubsub { + margin-bottom: 0; + padding-bottom: 35px; + } } -#bp-admin-component-form .widefat th { - display: table-cell; - vertical-align: top; +/* + * 2.3 Tools + */ +#adminmenu .toplevel_page_network-tools div.wp-menu-image:before { + content: ""; } -/* Version Badge */ -.bp-badge { - font: normal 150px/1 'dashicons' !important; - color: #D84800; - display: inline-block; +/*------------------------------------------------------------------------------ + * 3.0 User's Lists + *----------------------------------------------------------------------------*/ +body.site-users-php th#role, +body.users-php th#role, +body.users_page_bp-signups th#count_sent { + width: 10%; } -.bp-badge:before { - content: "\f448"; +body.site-users-php th#name, +body.site-users-php th#email, +body.users-php th#name, +body.users-php th#registered, +body.users-php th#email, +body.users_page_bp-signups th#name, +body.users_page_bp-signups th#registered, +body.users_page_bp-signups th#email, +body.users_page_bp-signups th#date_sent { + width: 15%; } -.about-wrap .bp-badge { - position: absolute; - top: 0; - right: 0; +body.users-php th#blogs, +body.users_page_bp-signups th#blogs { + width: 20%; } -/* About Page - since 2.3.3 (WP 4.3) */ - -@media only screen and (max-width: 500px) { - .about-wrap .bp-badge { - position: relative; - margin: 10px auto; - top: auto; - right: auto; - } +body.users_page_bp-signups th.column-count_sent, +body.users_page_bp-signups td.count_sent { + text-align: center; } -/* HiDPI -------------------------------------------------------------------------------*/ -@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { - - /* Icon 32 */ - 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; - } - - /* Backpat */ - 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-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-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-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-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-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; - } +/*------------------------------------------------------------------------------ + * 4.0 Emails - Edit Page + *----------------------------------------------------------------------------*/ +body.post-type-bp-email #excerpt { + height: auto; } 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 98b705e4614a8986d37e05e65f0a953b84235b90..f7a4f1eefaf7748ca3a294556a79cc24b9c258e5 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 +1 @@ -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}.about-wrap .two-col>div{position:relative;width:47.6%;margin-right:4.799999999%;float:left}.about-wrap [class$=col] .last-feature{margin-right:0}.about-wrap .feature-list.finer-points h4,.about-wrap .feature-list.finer-points p{margin-left:115px}@media screen and (max-width:782px){.about-wrap .two-col>div{width:100%;margin:30px 0 0;padding:0 0 30px;border-bottom:1px solid rgba(0,0,0,.1)}body.dashboard_page_bp-about span.dashicons,body.index_page_bp-about span.dashicons{font-size:55px;line-height:70px;height:70px;width:70px}.about-wrap .feature-list h2{margin:30px 0 0;text-align:center}.about-wrap .feature-list.finer-points h4,.about-wrap .feature-list.finer-points p{margin-left:90px}}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 (max-width:500px){.about-wrap .bp-badge{position:relative;margin:10px auto;top:auto;right:auto}}@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 +.bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.about-wrap .bp-badge{position:absolute;top:0;right:0}@media only screen and (max-width:500px){.about-wrap .bp-badge{position:relative;margin:10px auto;top:auto;right:auto}}.dashboard_page_bp-about .about-wrap .headline-feature,.index_page_bp-about .about-wrap .headline-feature{margin-bottom:2em;text-align:center}.dashboard_page_bp-about .about-wrap .headline-feature h3,.dashboard_page_bp-about .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature h3,.index_page_bp-about .headline-feature .headline-title{font-size:2.2em;font-weight:400;line-height:1.3;margin:1.25em 0 .6em;text-align:center}.dashboard_page_bp-about .about-wrap .headline-feature p,.index_page_bp-about .about-wrap .headline-feature p{font-size:1.15em;margin:1.15em auto .6em}.dashboard_page_bp-about .about-wrap .headline-feature .introduction,.index_page_bp-about .about-wrap .headline-feature .introduction{font-weight:600}.dashboard_page_bp-about .about-wrap .two-col>div,.index_page_bp-about .about-wrap .two-col>div{float:left;margin-right:4.799999999%;position:relative;width:47.6%}.dashboard_page_bp-about .about-wrap .two-col .last-feature,.index_page_bp-about .about-wrap .two-col .last-feature{margin-right:0}.dashboard_page_bp-about .bp-features-section,.index_page_bp-about .bp-features-section{margin-bottom:2em}.dashboard_page_bp-about .about-wrap .feature-section,.index_page_bp-about .about-wrap .feature-section{clear:both;margin-top:2em;overflow:hidden;padding-bottom:0}.dashboard_page_bp-about .about-wrap .changelog .feature-section,.index_page_bp-about .about-wrap .changelog .feature-section{margin-top:0}.dashboard_page_bp-about .about-wrap .feature-section h3,.index_page_bp-about .about-wrap .feature-section h3{font-size:1.25em;line-height:1.5em;margin:0 0 .6em}.dashboard_page_bp-about .about-wrap .changelog h4,.index_page_bp-about .about-wrap .changelog h4{color:#23282d;font-size:1em;margin:1.4em 0 .6em}.dashboard_page_bp-about .about-wrap .changelog,.index_page_bp-about .about-wrap .changelog{border-top:1px solid #eee;margin-bottom:3em}.dashboard_page_bp-about .about-wrap .changelog .changelog-title,.index_page_bp-about .about-wrap .changelog .changelog-title{font-size:1.25em;line-height:1.5em;margin:1.25em 0 .6em;text-align:center}@media screen and (max-width:782px){.dashboard_page_bp-about .about-wrap .headline-feature,.index_page_bp-about .about-wrap .headline-feature{max-width:100%}.dahsboard_page_bp-about .about-wrap .headline-feature h3,.dashboard_page_bp-about .about-wrap .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature .headline-title,.index_page_bp-about .about-wrap .headline-feature h3{font-size:2em}.dashboard_page_bp-about .bp-features-section,.index_page_bp-about .bp-features-section{margin-bottom:0}.dashboard_page_bp-about .about-wrap .feature-section,.index_page_bp-about .about-wrap .feature-section{margin-top:0}.dashboard_page_bp-about .about-wrap .two-col>div,.index_page_bp-about .about-wrap .two-col>div{border-bottom:1px solid rgba(0,0,0,.1);margin-top:1.25em;padding-bottom:1em;width:100%}.dashboard_page_bp-about .changelog .two-col>div,.index_page_bp-about .changelog .two-col>div{margin-top:0;padding-bottom:0}.dashboard_page_bp-about .about-wrap .changelog .changelog-title,.index_page_bp-about .about-wrap .changelog .changelog-title{text-align:left}}#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"}.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"}.settings_page_bp-components tr.core td.plugin-title span:before{content:"\f448"}.settings_page_bp-components tr.members td.plugin-title span:before{content:"\f307"}#bp-admin-component-form .wp-list-table.plugins .plugin-title{width:25%}@media screen and (max-width:782px){.settings_page_bp-components td.plugin-title span{margin-top:5px}#bp-admin-component-form .wp-list-table.plugins .plugin-title{display:block;width:auto}#bp-admin-component-form .subsubsub{margin-bottom:0;padding-bottom:35px}}#adminmenu .toplevel_page_network-tools div.wp-menu-image:before{content:""}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.post-type-bp-email #excerpt{height:auto} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.css b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..f56c366c4d7b21e85c63c10da853891f15fbc1ca --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.css @@ -0,0 +1,10 @@ +.customize-control-range output { + background-color: #FFF; + border: 1px solid #DDD; + box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 ); + float: right; + margin-left: 10px; + margin-top: -4px; + min-width: 16px; + padding: 5px; +} diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.min.css b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..404a768645928ae573aa59c71ddb3e2653e66a62 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls-rtl.min.css @@ -0,0 +1 @@ +.customize-control-range output{background-color:#FFF;border:1px solid #DDD;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);float:right;margin-left:10px;margin-top:-4px;min-width:16px;padding:5px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.css b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.css new file mode 100644 index 0000000000000000000000000000000000000000..c5673f83b223a64d019eee09013d2dfaa1f63cc6 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.css @@ -0,0 +1,10 @@ +.customize-control-range output { + background-color: #FFF; + border: 1px solid #DDD; + box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 ); + float: left; + margin-right: 10px; + margin-top: -4px; + min-width: 16px; + padding: 5px; +} diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.min.css b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.min.css new file mode 100644 index 0000000000000000000000000000000000000000..51c8b4a86a322a570a18db5449f3fa1b4e3a63e9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/css/customizer-controls.min.css @@ -0,0 +1 @@ +.customize-control-range output{background-color:#FFF;border:1px solid #DDD;box-shadow:inset 0 1px 2px rgba(0,0,0,.07);float:left;margin-right:10px;margin-top:-4px;min-width:16px;padding:5px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/autolink-feature.png b/wp-content/plugins/buddypress/bp-core/admin/images/autolink-feature.png new file mode 100644 index 0000000000000000000000000000000000000000..e23f659e92dbd27bc95b40266f869cd7126ae09b Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/autolink-feature.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/bp-emails-feature.png b/wp-content/plugins/buddypress/bp-core/admin/images/bp-emails-feature.png new file mode 100644 index 0000000000000000000000000000000000000000..b658495f105fd898f9552058e739156f686cfbc9 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/bp-emails-feature.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/emoji-feature.png b/wp-content/plugins/buddypress/bp-core/admin/images/emoji-feature.png new file mode 100644 index 0000000000000000000000000000000000000000..a68cefaf0180e95fff6be2d987a113ed43750a08 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/emoji-feature.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/post-type.png b/wp-content/plugins/buddypress/bp-core/admin/images/post-type.png new file mode 100644 index 0000000000000000000000000000000000000000..c8f2e92e067a38f286ed3d4cc3b1c4a6f8fb9a77 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/post-type.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/twentytwelve.png b/wp-content/plugins/buddypress/bp-core/admin/images/twentytwelve.png new file mode 100644 index 0000000000000000000000000000000000000000..2fae456c31a5c51794b55f7a285cbdf4263a8cb1 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/twentytwelve.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.js b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.js new file mode 100644 index 0000000000000000000000000000000000000000..508d09c4175cc3a8ca4ebd13369d61178ef41a18 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.js @@ -0,0 +1,22 @@ +/** + * Customizer controls implementation. + * + * If you're looking to add JS for a specific panel or control, don't add it here. + * The file only implements generic Customizer control implementations. + * + * @since 2.5.0 + */ + +(function( $ ) { + $( window ).on( 'load', function() { + /** + * <range> element: update label when value changes. + * + * @since 2.5.0 + */ + $( '.customize-control-range input' ).on( 'input', function() { + var $this = $( this ); + $this.siblings( 'output' ).text( $this.val() ); + }); + }); +})( jQuery ); diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.min.js b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.min.js new file mode 100644 index 0000000000000000000000000000000000000000..010900818f691941e1db20bc4e5e9158bf366d36 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-controls.min.js @@ -0,0 +1,2 @@ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */ +!function(a){a(window).on("load",function(){a(".customize-control-range input").on("input",function(){var b=a(this);b.siblings("output").text(b.val())})})}(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.js b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.js new file mode 100644 index 0000000000000000000000000000000000000000..61d13e85877da73aa379c24685934b8182ba9f1b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.js @@ -0,0 +1,115 @@ +/** + * Customizer implementation for Email. + * + * If you're looking to add JS for every instance of a control, don't add it here. + * The file only implements the Customizer controls for Emails. + * + * @since 2.5.0 + */ + +(function( $ ) { + wp.customize( 'bp_email_options[email_bg]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.email_bg' ).attr( 'bgcolor', newval ); + $( 'hr' ).attr( 'color', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[header_bg]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.header_bg' ).attr( 'bgcolor', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[header_text_size]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.header_text_size' ).css( 'font-size', newval + 'px' ); + } + }); + }); + + wp.customize( 'bp_email_options[header_text_color]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.header_text_color' ).css( 'color', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[highlight_color]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.header_bg' ).css( 'border-top-color', newval ); + $( 'a' ).css( 'color', newval ); + $( 'hr' ).attr( 'color', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[body_bg]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.body_bg' ).attr( 'bgcolor', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[body_text_size]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + // 1.618 = golden mean. + $( '.body_text_size' ) + .css( 'font-size', newval + 'px' ) + .css( 'line-height', Math.floor( newval * 1.618 ) + 'px' ); + + // 1.35 = default body_text_size multipler. Gives default heading of 20px. + $( '.welcome' ).css( 'font-size', Math.floor( newval * 1.35 ) + 'px' ); + } + }); + }); + + wp.customize( 'bp_email_options[body_text_color]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.body_text_color' ).css( 'color', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[footer_bg]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.footer_bg' ).attr( 'bgcolor', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[footer_text_size]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.footer_text_size' ) + .css( 'font-size', newval + 'px' ) + .css( 'line-height', Math.floor( newval * 1.618 ) + 'px' ); + } + }); + }); + + wp.customize( 'bp_email_options[footer_text_color]', function( value ) { + value.bind(function( newval ) { + if ( newval.length ) { + $( '.footer_text_color' ).css( 'color', newval ); + } + }); + }); + + wp.customize( 'bp_email_options[footer_text]', function( value ) { + value.bind(function( newval ) { + $( '.footer_text' ).text( newval ); + }); + }); +})( jQuery ); diff --git a/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.min.js b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f553d005d0d5e97775995bf9c1e24e207b7980ce --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/js/customizer-receiver-emails.min.js @@ -0,0 +1,2 @@ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */ +!function(a){wp.customize("bp_email_options[email_bg]",function(b){b.bind(function(b){b.length&&(a(".email_bg").attr("bgcolor",b),a("hr").attr("color",b))})}),wp.customize("bp_email_options[header_bg]",function(b){b.bind(function(b){b.length&&a(".header_bg").attr("bgcolor",b)})}),wp.customize("bp_email_options[header_text_size]",function(b){b.bind(function(b){b.length&&a(".header_text_size").css("font-size",b+"px")})}),wp.customize("bp_email_options[header_text_color]",function(b){b.bind(function(b){b.length&&a(".header_text_color").css("color",b)})}),wp.customize("bp_email_options[highlight_color]",function(b){b.bind(function(b){b.length&&(a(".header_bg").css("border-top-color",b),a("a").css("color",b),a("hr").attr("color",b))})}),wp.customize("bp_email_options[body_bg]",function(b){b.bind(function(b){b.length&&a(".body_bg").attr("bgcolor",b)})}),wp.customize("bp_email_options[body_text_size]",function(b){b.bind(function(b){b.length&&(a(".body_text_size").css("font-size",b+"px").css("line-height",Math.floor(1.618*b)+"px"),a(".welcome").css("font-size",Math.floor(1.35*b)+"px"))})}),wp.customize("bp_email_options[body_text_color]",function(b){b.bind(function(b){b.length&&a(".body_text_color").css("color",b)})}),wp.customize("bp_email_options[footer_bg]",function(b){b.bind(function(b){b.length&&a(".footer_bg").attr("bgcolor",b)})}),wp.customize("bp_email_options[footer_text_size]",function(b){b.bind(function(b){b.length&&a(".footer_text_size").css("font-size",b+"px").css("line-height",Math.floor(1.618*b)+"px")})}),wp.customize("bp_email_options[footer_text_color]",function(b){b.bind(function(b){b.length&&a(".footer_text_color").css("color",b)})}),wp.customize("bp_email_options[footer_text]",function(b){b.bind(function(b){a(".footer_text").text(b)})})}(jQuery); \ No newline at end of file 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 3d5cf148a5adfa95674b09406eeebfaf32e75a00..2f4506a04a092c27c52cde52b014eb7986887ffe 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php @@ -1,18 +1,17 @@ <?php - /** * BuddyPress Filters & Actions. * - * @package BuddyPress - * @subpackage Hooks - * * This file contains the actions and filters that are used through-out BuddyPress. * They are consolidated here to make searching for them easier, and to help * developers understand at a glance the order in which things occur. * + * @package BuddyPress + * @subpackage Hooks + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -33,19 +32,20 @@ defined( 'ABSPATH' ) || exit; */ add_action( 'plugins_loaded', 'bp_loaded', 10 ); add_action( 'init', 'bp_init', 10 ); -add_action( 'parse_query', 'bp_parse_query', 2 ); // Early for overrides +add_action( 'customize_register', 'bp_customize_register', 20 ); // After WP core. +add_action( 'parse_query', 'bp_parse_query', 2 ); // Early for overrides. add_action( 'wp', 'bp_ready', 10 ); add_action( 'set_current_user', 'bp_setup_current_user', 10 ); add_action( 'setup_theme', 'bp_setup_theme', 10 ); -add_action( 'after_setup_theme', 'bp_after_setup_theme', 100 ); // After WP themes +add_action( 'after_setup_theme', 'bp_after_setup_theme', 100 ); // After WP themes. add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 ); -add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core +add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core. add_action( 'template_redirect', 'bp_template_redirect', 10 ); add_action( 'widgets_init', 'bp_widgets_init', 10 ); add_action( 'generate_rewrite_rules', 'bp_generate_rewrite_rules', 10 ); /** - * bp_loaded - Attached to 'plugins_loaded' above + * The bp_loaded hook - Attached to 'plugins_loaded' above. * * Attach various loader actions to the bp_loaded action. * The load order helps to execute code at the correct time. @@ -60,13 +60,14 @@ add_action( 'bp_loaded', 'bp_register_theme_packages', 12 ); add_action( 'bp_loaded', 'bp_register_theme_directory', 14 ); /** - * bp_init - Attached to 'init' above + * The bp_init hook - Attached to 'init' above. * * Attach various initialization actions to the bp_init action. * The load order helps to execute code at the correct time. * v---Load order */ add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); +add_action( 'bp_init', 'bp_register_post_types', 3 ); 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 ); @@ -78,7 +79,7 @@ add_action( 'bp_init', 'bp_add_rewrite_rules', 30 ); add_action( 'bp_init', 'bp_add_permastructs', 40 ); /** - * bp_template_redirect - Attached to 'template_redirect' above + * The bp_template_redirect hook - Attached to 'template_redirect' above. * * Attach various template actions to the bp_template_redirect action. * The load order helps to execute code at the correct time. @@ -95,14 +96,15 @@ add_action( 'bp_template_redirect', 'bp_post_request', 10 ); add_action( 'bp_template_redirect', 'bp_get_request', 10 ); /** - * Add the BuddyPress functions file + * Add the BuddyPress functions file and the Theme Compat Default features. */ -add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); +add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); +add_action( 'bp_after_setup_theme', 'bp_register_theme_compat_default_features', 10 ); -// Load the admin +// Load the admin. if ( is_admin() ) { add_action( 'bp_loaded', 'bp_admin' ); } -// Activation redirect +// Activation redirect. add_action( 'bp_activation', 'bp_add_activation_redirect' ); 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 94b7a13a325eddefe633937da3fc517e45493c0e..1dcd44210dc96302cb62bf69d46cd92b60526729 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php @@ -1,872 +1,21 @@ <?php - /** * Main BuddyPress Admin Class. * * @package BuddyPress * @subpackage CoreAdministration + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -if ( !class_exists( 'BP_Admin' ) ) : -/** - * Load BuddyPress plugin admin area. - * - * @package BuddyPress - * @subpackage CoreAdministration - * @todo Break this apart into each applicable Component - * - * @since BuddyPress (1.6.0) - */ -class BP_Admin { - - /** Directory *************************************************************/ - - /** - * Path to the BuddyPress admin directory. - * - * @var string $admin_dir - */ - public $admin_dir = ''; - - /** URLs ******************************************************************/ - - /** - * URL to the BuddyPress admin directory. - * - * @var string $admin_url - */ - public $admin_url = ''; - - /** - * URL to the BuddyPress images directory. - * - * @var string $images_url - */ - public $images_url = ''; - - /** - * URL to the BuddyPress admin CSS directory. - * - * @var string $css_url - */ - public $css_url = ''; - - /** - * URL to the BuddyPress admin JS directory. - * - * @var string - */ - public $js_url = ''; - - /** Other *****************************************************************/ - - /** - * Notices used for user feedback, like saving settings. - * - * @var array() - */ - public $notices = array(); - - /** Methods ***************************************************************/ - - /** - * The main BuddyPress admin loader. - * - * @since BuddyPress (1.6.0) - * - * @uses BP_Admin::setup_globals() Setup the globals needed. - * @uses BP_Admin::includes() Include the required files. - * @uses BP_Admin::setup_actions() Setup the hooks and actions. - */ - public function __construct() { - $this->setup_globals(); - $this->includes(); - $this->setup_actions(); - } - - /** - * Set admin-related globals. - * - * @access private - * @since BuddyPress (1.6.0) - */ - private function setup_globals() { - $bp = buddypress(); - - // Paths and URLs - $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path - $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url - $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL - $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL - $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL - - // Main settings page - $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; - - // Main capability - $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; - } - - /** - * Include required files. - * - * @since BuddyPress (1.6.0) - * @access private - */ - private function includes() { - 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' ); - } - - /** - * Set up the admin hooks, actions, and filters. - * - * @access private - * @since BuddyPress (1.6.0) - * - * @uses add_action() To add various actions. - * @uses add_filter() To add various filters. - */ - private function setup_actions() { - - /** General Actions ***************************************************/ - - // Add some page specific output to the <head> - add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); - - // Add menu item to settings menu - add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); - - // Enqueue all admin JS and CSS - add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - - /** BuddyPress Actions ************************************************/ - - // Load the BuddyPress metabox in the WP Nav Menu Admin UI - add_action( 'load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box' ); - - // Add settings - add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) ); - - // Add a link to BuddyPress About page to the admin bar - 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( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' ); - - // On non-multisite, catch - add_action( 'load-users.php', 'bp_core_admin_user_manage_spammers' ); - - /** Filters ***********************************************************/ - - // Add link to settings page - add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); - add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); - - // Add "Mark as Spam" row actions on users.php - add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); - add_filter( 'user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); - } - - /** - * Add the navigational menu elements. - * - * @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 - * section. - */ - public function admin_menus() { - - // Bail if user cannot moderate - if ( ! bp_current_user_can( 'manage_options' ) ) { - return; - } - - // About - add_dashboard_page( - __( 'Welcome to BuddyPress', 'buddypress' ), - __( 'Welcome to BuddyPress', 'buddypress' ), - 'manage_options', - 'bp-about', - array( $this, 'about_screen' ) - ); - - // Credits - add_dashboard_page( - __( 'Welcome to BuddyPress', 'buddypress' ), - __( 'Welcome to BuddyPress', 'buddypress' ), - 'manage_options', - 'bp-credits', - array( $this, 'credits_screen' ) - ); - - $hooks = array(); - - // Changed in BP 1.6 . See bp_core_admin_backpat_menu() - $hooks[] = add_menu_page( - __( 'BuddyPress', 'buddypress' ), - __( 'BuddyPress', 'buddypress' ), - $this->capability, - 'bp-general-settings', - 'bp_core_admin_backpat_menu', - 'div' - ); - - $hooks[] = add_submenu_page( - 'bp-general-settings', - __( 'BuddyPress Help', 'buddypress' ), - __( 'Help', 'buddypress' ), - $this->capability, - 'bp-general-settings', - 'bp_core_admin_backpat_page' - ); - - // Add the option pages - $hooks[] = add_submenu_page( - $this->settings_page, - __( 'BuddyPress Components', 'buddypress' ), - __( 'BuddyPress', 'buddypress' ), - $this->capability, - 'bp-components', - 'bp_core_admin_components_settings' - ); - - $hooks[] = add_submenu_page( - $this->settings_page, - __( 'BuddyPress Pages', 'buddypress' ), - __( 'BuddyPress Pages', 'buddypress' ), - $this->capability, - 'bp-page-settings', - 'bp_core_admin_slugs_settings' - ); - - $hooks[] = add_submenu_page( - $this->settings_page, - __( 'BuddyPress Settings', 'buddypress' ), - __( 'BuddyPress Settings', 'buddypress' ), - $this->capability, - 'bp-settings', - 'bp_core_admin_settings' - ); - - // For consistency with non-Multisite, we add a Tools menu in - // the Network Admin as a home for our Tools panel - if ( is_multisite() && bp_core_do_network_admin() ) { - $tools_parent = 'network-tools'; - - $hooks[] = add_menu_page( - __( 'Tools', 'buddypress' ), - __( 'Tools', 'buddypress' ), - $this->capability, - $tools_parent, - 'bp_core_tools_top_level_item', - '', - 24 // just above Settings - ); - - $hooks[] = add_submenu_page( - $tools_parent, - __( 'Available Tools', 'buddypress' ), - __( 'Available Tools', 'buddypress' ), - $this->capability, - 'available-tools', - 'bp_core_admin_available_tools_page' - ); - } else { - $tools_parent = 'tools.php'; - } - - $hooks[] = add_submenu_page( - $tools_parent, - __( 'BuddyPress Tools', 'buddypress' ), - __( 'BuddyPress', 'buddypress' ), - $this->capability, - 'bp-tools', - 'bp_core_admin_tools' - ); - - // Fudge the highlighted subnav item when on a BuddyPress admin page - foreach( $hooks as $hook ) { - add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); - } - } - - /** - * Register the settings. - * - * @since BuddyPress (1.6.0) - * - * @uses add_settings_section() To add our own settings section. - * @uses add_settings_field() To add various settings fields. - * @uses register_setting() To register various settings. - */ - public function register_admin_settings() { - - /** Main Section ******************************************************/ - - // Add the main section - 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' ); - - // 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 ) ) { - add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' ); - register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' ); - } - - // 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' ); - - /** XProfile Section **************************************************/ - - if ( bp_is_active( 'xprofile' ) ) { - - // Add the main section - add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); - - 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' ); - } - - /** Groups Section ****************************************************/ - - if ( bp_is_active( 'groups' ) ) { - - // Add the main section - 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' ); - - // 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 ************************************************************/ - - 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' ); - - // 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', '' ); - } - - /** Activity Section **************************************************/ - - if ( bp_is_active( 'activity' ) ) { - - // Add the main section - 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 & Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' ); - register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' ); - - // Activity Heartbeat refresh - add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' ); - register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' ); - - // 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 a link to BuddyPress About page to the admin bar. - * - * @since BuddyPress (1.9.0) - * - * @param WP_Admin_Bar $wp_admin_bar As passed to 'admin_bar_menu'. - */ - public function admin_bar_about_link( $wp_admin_bar ) { - if ( is_user_logged_in() ) { - $wp_admin_bar->add_menu( array( - 'parent' => 'wp-logo', - 'id' => 'bp-about', - 'title' => esc_html__( 'About BuddyPress', 'buddypress' ), - 'href' => add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ), - ) ); - } - } - - /** - * Add Settings link to plugins area. - * - * @since BuddyPress (1.6.0) - * - * @param array $links Links array in which we would prepend our link. - * @param string $file Current plugin basename. - * @return array Processed links. - */ - public function modify_plugin_action_links( $links, $file ) { - - // Return normal links if not BuddyPress - 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="' . 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>' - ) ); - } - - /** - * Add some general styling to the admin area. - * - * @since BuddyPress (1.6.0) - */ - public function admin_head() { - - // Settings pages - remove_submenu_page( $this->settings_page, 'bp-page-settings' ); - remove_submenu_page( $this->settings_page, 'bp-settings' ); - - // Network Admin Tools - remove_submenu_page( 'network-tools', 'network-tools' ); - - // About and Credits pages - remove_submenu_page( 'index.php', 'bp-about' ); - remove_submenu_page( 'index.php', 'bp-credits' ); - } - - /** - * Add some general styling to the admin area. - * - * @since BuddyPress (1.6.0) - */ - public function enqueue_scripts() { - $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() ); - - wp_style_add_data( 'bp-admin-common-css', 'rtl', true ); - if ( $min ) { - wp_style_add_data( 'bp-admin-common-css', 'suffix', $min ); - } - } - - /** About *****************************************************************/ - - /** - * Output the about screen. - * - * @since BuddyPress (1.7.0) - */ - public function about_screen() { - ?> - - <div class="wrap about-wrap"> - - <?php self::welcome_text(); ?> - - <?php self::tab_navigation( __METHOD__ ); ?> - - <?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> - <ul> - <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>', 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>', 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> - </div> - <div class="welcome-panel-column"> - <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>', 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>', 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>', 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>', 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>', 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="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’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> - </div> - - <?php endif; ?> - - <div class="headline-feature"> - <h3><?php esc_html_e( 'Upload Profile Pictures with Drag and Drop', 'buddypress' ); ?></h3> - - <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> - - <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 →', 'buddypress' ); ?></a></p> - </div> - - <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="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="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="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> - - <div class="feature-list"> - <h2><?php esc_html_e( 'Under the Hood', 'buddypress' ); ?></h2> - - <div class="feature-section col two-col"> - <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 & 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> - - <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> • <a href="https://buddypress.org/suppport/"><?php _ex( 'Support', 'About screen, link to support site', 'buddypress' ); ?></a> • <a href="https://codex.buddypress.org/"><?php _ex( 'Documentation', 'About screen, link to documentation', 'buddypress' ); ?></a> • <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> • <a href="https://twitter.com/bptrac/"><?php _ex( 'Trac', '@bptrac twitter account name', 'buddypress' ); ?></a> • <a href="https://twitter.com/buddypressdev/"><?php _ex( 'Development', '@buddypressdev twitter account name', 'buddypress' ); ?></a></p> - - <?php - } - - /** - * Output the credits screen. - * - * Hardcoding this in here is pretty janky. It's fine for now, but we'll - * want to leverage api.wordpress.org eventually. - * - * @since BuddyPress (1.7.0) - */ - public function credits_screen() { - ?> - - <div class="wrap about-wrap"> - - <?php self::welcome_text(); ?> - - <?php self::tab_navigation( __METHOD__ ); ?> - - <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="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="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="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> - - <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="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="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="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-henry-wright"> - <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="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="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="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( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h4> - <p class="wp-credits-list"> - <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/sbrajesh/">Brajesh Singh (sbrajesh)</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/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/jaimieolmstead/">jaimieolmstead</a>, - <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</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/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/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/netweb/">Stephen Edgar (netweb)</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> - <p class="wp-credits-list"> - <a href="https://github.com/ichord/At.js">At.js</a>, - <a href="https://github.com/ichord/Caret.js">Caret.js</a>, - <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>. - </p> - - </div> - - <?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’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’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 +require dirname( __FILE__ ) . '/classes/class-bp-admin.php'; /** * Setup BuddyPress Admin. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses BP_Admin */ @@ -876,7 +25,6 @@ function bp_admin() { // These are strings we may use to describe maintenance/security releases, where we aim for no new strings. - _n_noop( 'Maintenance Release', 'Maintenance Releases', 'buddypress' ); _n_noop( 'Security Release', 'Security Releases', 'buddypress' ); _n_noop( 'Maintenance and Security Release', 'Maintenance and Security Releases', 'buddypress' ); 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 7949e0bf09a01d64502a02aa4e9e4cf07cca1d19..fa77395eea1cb2d28a04427fcbbc29e8651d3ebd 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Core Toolbar. * @@ -7,29 +6,30 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Add the secondary BuddyPress area to the my-account menu. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @global WP_Admin_Bar $wp_admin_bar + * @global WP_Admin_Bar $wp_admin_bar. */ function bp_admin_bar_my_account_root() { global $wp_admin_bar; - // Bail if this is an ajax request + // Bail if this is an ajax request. if ( !bp_use_wp_admin_bar() || defined( 'DOING_AJAX' ) ) return; - // Only add menu for logged in user + // Only add menu for logged in user. if ( is_user_logged_in() ) { - // Add secondary parent item for all BuddyPress components + // Add secondary parent item for all BuddyPress components. $wp_admin_bar->add_menu( array( 'parent' => 'my-account', 'id' => 'my-account-buddypress', @@ -40,8 +40,8 @@ function bp_admin_bar_my_account_root() { ) ) ); - // Remove 'Edit' post link as it's not applicable to BP - // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed + // Remove 'Edit' post link as it's not applicable to BP. + // Remove when https://core.trac.wordpress.org/ticket/29538 is addressed. if ( is_buddypress() ) { $wp_admin_bar->remove_node( 'edit' ); } @@ -52,7 +52,7 @@ add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); /** * Handle the Toolbar/BuddyBar business. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global string $wp_version * @uses bp_get_option() @@ -69,26 +69,26 @@ add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); */ function bp_core_load_admin_bar() { - // Show the Toolbar for logged out users + // Show the Toolbar for logged out users. if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) { show_admin_bar( true ); } - // Hide the WordPress Toolbar and show the BuddyBar + // Hide the WordPress Toolbar and show the BuddyBar. if ( ! bp_use_wp_admin_bar() ) { _doing_it_wrong( __FUNCTION__, __( 'The BuddyBar is no longer supported. Please migrate to the WordPress toolbar as soon as possible.', 'buddypress' ), '2.1.0' ); - // Keep the WP Toolbar from loading + // Keep the WP Toolbar from loading. show_admin_bar( false ); - // Actions used to build the BP Toolbar + // Actions used to build the BP Toolbar. add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' ); add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 ); add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 ); add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); - // Actions used to append BP Toolbar to footer + // Actions used to append BP Toolbar to footer. add_action( 'wp_footer', 'bp_core_admin_bar', 8 ); add_action( 'admin_footer', 'bp_core_admin_bar' ); } @@ -102,7 +102,7 @@ add_action( 'init', 'bp_core_load_admin_bar', 9 ); * previously unhooking this function can continue to do so. It's hooked to * the `bp_init` action in `bp-core-actions.php`. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_core_load_admin_bar_css() { add_action( 'bp_enqueue_scripts', 'bp_core_enqueue_admin_bar_css', 1 ); @@ -110,9 +110,9 @@ function bp_core_load_admin_bar_css() { } /** - * Enqueue supplemental WordPress Toolbar styling + * Enqueue supplemental WordPress Toolbar styling. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @see bp_core_register_common_styles() * @see bp_core_load_admin_bar_css() @@ -125,6 +125,6 @@ function bp_core_enqueue_admin_bar_css() { return; } - // Enqueue the additional adminbar css + // Enqueue the additional adminbar css. wp_enqueue_style( 'bp-admin-bar' ); -} \ No newline at end of file +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php b/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php index 3156e8be02b84212c06fbbcdd8699a6fddff262d..bde083ae64800c9b945338a88b98da90ddace446 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-attachments.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Attachments + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -16,20 +17,516 @@ defined( 'ABSPATH' ) || exit; * script requires it. So we need to make sure the current WordPress * match with our needs. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return bool True if WordPress is 3.9+, false otherwise + * @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 + * Get the Attachments Uploads dir data. * - * @since BuddyPress (2.3.0) + * @since 2.4.0 * - * @return array list of BuddyPress Plupload settings + * @param string $data The data to get. Possible values are: 'dir', 'basedir' & 'baseurl'. + * Leave empty to get all datas. + * @return string|array The needed Upload dir data. + */ +function bp_attachments_uploads_dir_get( $data = '' ) { + $attachments_dir = 'buddypress'; + $retval = ''; + + if ( 'dir' === $data ) { + $retval = $attachments_dir; + } else { + $upload_data = bp_upload_dir(); + + // Return empty string, if Uploads data are not available. + if ( ! $upload_data ) { + return $retval; + } + + // Build the Upload data array for BuddyPress attachments. + foreach ( $upload_data as $key => $value ) { + if ( 'basedir' === $key || 'baseurl' === $key ) { + $upload_data[ $key ] = trailingslashit( $value ) . $attachments_dir; + } else { + unset( $upload_data[ $key ] ); + } + } + + // Add the dir to the array. + $upload_data['dir'] = $attachments_dir; + + if ( empty( $data ) ) { + $retval = $upload_data; + } elseif ( isset( $upload_data[ $data ] ) ) { + $retval = $upload_data[ $data ]; + } + } + + /** + * Filter here to edit the Attachments upload dir data. + * + * @since 2.4.0 + * + * @param string|array $retval The needed Upload dir data or the full array of data + * @param string $data The data requested + */ + return apply_filters( 'bp_attachments_uploads_dir_get', $retval, $data ); +} + +/** + * Get the max upload file size for any attachment. + * + * @since 2.4.0 + * + * @param string $type A string to inform about the type of attachment + * we wish to get the max upload file size for. + * @return int Max upload file size for any attachment. + */ +function bp_attachments_get_max_upload_file_size( $type = '' ) { + $fileupload_maxk = bp_core_get_root_option( 'fileupload_maxk' ); + + if ( '' === $fileupload_maxk ) { + $fileupload_maxk = 5120000; // 5mb; + } else { + $fileupload_maxk = $fileupload_maxk * 1024; + } + + /** + * Filter here to edit the max upload file size. + * + * @since 2.4.0 + * + * @param int $fileupload_maxk Max upload file size for any attachment. + * @param string $type The attachment type (eg: 'avatar' or 'cover_image'). + */ + return apply_filters( 'bp_attachments_get_max_upload_file_size', $fileupload_maxk, $type ); +} + +/** + * Get allowed types for any attachment. + * + * @since 2.4.0 + * + * @param string $type The extension types to get. + * Default: 'avatar'. + * @return array The list of allowed extensions for attachments. + */ +function bp_attachments_get_allowed_types( $type = 'avatar' ) { + // Defaults to BuddyPress supported image extensions. + $exts = array( 'jpeg', 'gif', 'png' ); + + /** + * It's not a BuddyPress feature, get the allowed extensions + * matching the $type requested. + */ + if ( 'avatar' !== $type && 'cover_image' !== $type ) { + // Reset the default exts. + $exts = array(); + + switch ( $type ) { + case 'video' : + $exts = wp_get_video_extensions(); + break; + + case 'audio' : + $exts = wp_get_video_extensions(); + break; + + default: + $allowed_mimes = get_allowed_mime_types(); + + /** + * Search for allowed mimes matching the type. + * + * Eg: using 'application/vnd.oasis' as the $type + * parameter will get all OpenOffice extensions supported + * by WordPress and allowed for the current user. + */ + if ( '' !== $type ) { + $allowed_mimes = preg_grep( '/' . addcslashes( $type, '/.+-' ) . '/', $allowed_mimes ); + } + + $allowed_types = array_keys( $allowed_mimes ); + + // Loop to explode keys using '|'. + foreach ( $allowed_types as $allowed_type ) { + $t = explode( '|', $allowed_type ); + $exts = array_merge( $exts, (array) $t ); + } + break; + } + } + + /** + * Filter here to edit the allowed extensions by attachment type. + * + * @since 2.4.0 + * + * @param array $exts List of allowed extensions. + * @param string $type The requested file type. + */ + return apply_filters( 'bp_attachments_get_allowed_types', $exts, $type ); +} + +/** + * Get allowed attachment mime types. + * + * @since 2.4.0 + * + * @param string $type The extension types to get (Optional). + * @param array $allowed_types List of allowed extensions. + * @return array List of allowed mime types. + */ +function bp_attachments_get_allowed_mimes( $type = '', $allowed_types = array() ) { + if ( empty( $allowed_types ) ) { + $allowed_types = bp_attachments_get_allowed_types( $type ); + } + + $validate_mimes = wp_match_mime_types( join( ',', $allowed_types ), wp_get_mime_types() ); + $allowed_mimes = array_map( 'implode', $validate_mimes ); + + /** + * Include jpg type if jpeg is set + */ + if ( isset( $allowed_mimes['jpeg'] ) && ! isset( $allowed_mimes['jpg'] ) ) { + $allowed_mimes['jpg'] = $allowed_mimes['jpeg']; + } + + return $allowed_mimes; +} + +/** + * Check the uploaded attachment type is allowed. + * + * @since 2.4.0 + * + * @param string $file Full path to the file. + * @param string $filename The name of the file (may differ from $file due to $file being + * in a tmp directory). + * @param array $allowed_mimes The attachment allowed mimes (Required). + * @return bool True if the attachment type is allowed. False otherwise + */ +function bp_attachments_check_filetype( $file, $filename, $allowed_mimes ) { + $filetype = wp_check_filetype_and_ext( $file, $filename, $allowed_mimes ); + + if ( ! empty( $filetype['ext'] ) && ! empty( $filetype['type'] ) ) { + return true; + } + + return false; +} + +/** + * Use the absolute path to an image to set an attachment type for a given item. + * + * @since 2.4.0 + * + * @param string $type The attachment type to create (avatar or cover_image). Default: avatar. + * @param array $args { + * @type int $item_id The ID of the object (Required). Default: 0. + * @type string $object The object type (eg: group, user, blog) (Required). Default: 'user'. + * @type string $component The component for the object (eg: groups, xprofile, blogs). Default: ''. + * @type string $image The absolute path to the image (Required). Default: ''. + * @type int $crop_w Crop width. Default: 0. + * @type int $crop_h Crop height. Default: 0. + * @type int $crop_x The horizontal starting point of the crop. Default: 0. + * @type int $crop_y The vertical starting point of the crop. Default: 0. + * } + * @return bool True on success, false otherwise. + */ +function bp_attachments_create_item_type( $type = 'avatar', $args = array() ) { + if ( empty( $type ) || ( $type !== 'avatar' && $type !== 'cover_image' ) ) { + return false; + } + + $r = bp_parse_args( $args, array( + 'item_id' => 0, + 'object' => 'user', + 'component' => '', + 'image' => '', + 'crop_w' => 0, + 'crop_h' => 0, + 'crop_x' => 0, + 'crop_y' => 0 + ), 'create_item_' . $type ); + + if ( empty( $r['item_id'] ) || empty( $r['object'] ) || ! file_exists( $r['image'] ) || ! @getimagesize( $r['image'] ) ) { + return false; + } + + // Make sure the file path is safe. + if ( 0 !== validate_file( $r['image'] ) ) { + return false; + } + + // Set the component if not already done. + if ( empty( $r['component'] ) ) { + if ( 'user' === $r['object'] ) { + $r['component'] = 'xprofile'; + } else { + $r['component'] = $r['object'] . 's'; + } + } + + // Get allowed mimes for the Attachment type and check the image one is. + $allowed_mimes = bp_attachments_get_allowed_mimes( $type ); + $is_allowed = wp_check_filetype( $r['image'], $allowed_mimes ); + + // It's not an image. + if ( ! $is_allowed['ext'] ) { + return false; + } + + // Init the Attachment data. + $attachment_data = array(); + + if ( 'avatar' === $type ) { + // Set crop width for the avatar if not given. + if ( empty( $r['crop_w'] ) ) { + $r['crop_w'] = bp_core_avatar_full_width(); + } + + // Set crop height for the avatar if not given. + if ( empty( $r['crop_h'] ) ) { + $r['crop_h'] = bp_core_avatar_full_height(); + } + + if ( is_callable( $r['component'] . '_avatar_upload_dir' ) ) { + $dir_args = array( $r['item_id'] ); + + // In case of xprofile, we need an extra argument. + if ( 'xprofile' === $r['component'] ) { + $dir_args = array( false, $r['item_id'] ); + } + + $attachment_data = call_user_func_array( $r['component'] . '_avatar_upload_dir', $dir_args ); + } + } elseif ( 'cover_image' === $type ) { + $attachment_data = bp_attachments_uploads_dir_get(); + + // The BP Attachments Uploads Dir is not set, stop. + if ( ! $attachment_data ) { + return false; + } + + // Default to members for xProfile. + $object_subdir = 'members'; + + if ( 'xprofile' !== $r['component'] ) { + $object_subdir = sanitize_key( $r['component'] ); + } + + // Set Subdir. + $attachment_data['subdir'] = $object_subdir . '/' . $r['item_id'] . '/cover-image'; + + // Set Path. + $attachment_data['path'] = trailingslashit( $attachment_data['basedir'] ) . $attachment_data['subdir']; + } + + if ( ! isset( $attachment_data['path'] ) || ! isset( $attachment_data['subdir'] ) ) { + return false; + } + + // It's not a regular upload, we may need to create some folders. + if ( ! is_dir( $attachment_data['path'] ) ) { + if ( ! wp_mkdir_p( $attachment_data['path'] ) ) { + return false; + } + } + + // Set the image name and path. + $image_file_name = wp_unique_filename( $attachment_data['path'], basename( $r['image'] ) ); + $image_file_path = $attachment_data['path'] . '/' . $image_file_name; + + // Copy the image file into the avatar dir. + if ( ! copy( $r['image'], $image_file_path ) ) { + return false; + } + + // Init the response. + $created = false; + + // It's an avatar, we need to crop it. + if ( 'avatar' === $type ) { + $created = bp_core_avatar_handle_crop( array( + 'object' => $r['object'], + 'avatar_dir' => trim( dirname( $attachment_data['subdir'] ), '/' ), + 'item_id' => (int) $r['item_id'], + 'original_file' => trailingslashit( $attachment_data['subdir'] ) . $image_file_name, + 'crop_w' => $r['crop_w'], + 'crop_h' => $r['crop_h'], + 'crop_x' => $r['crop_x'], + 'crop_y' => $r['crop_y'] + ) ); + + // It's a cover image we need to fit it to feature's dimensions. + } elseif ( 'cover_image' === $type ) { + $cover_image = bp_attachments_cover_image_generate_file( array( + 'file' => $image_file_path, + 'component' => $r['component'], + 'cover_image_dir' => $attachment_data['path'] + ) ); + + $created = ! empty( $cover_image['cover_file'] ); + } + + // Remove copied file if it fails. + if ( ! $created ) { + @unlink( $image_file_path ); + } + + // Return the response. + return $created; +} + +/** + * Get the url or the path for a type of attachment. + * + * @since 2.4.0 + * + * @param string $data whether to get the url or the path. + * @param array $args { + * @type string $object_dir The object dir (eg: members/groups). Defaults to members. + * @type int $item_id The object id (eg: a user or a group id). Defaults to current user. + * @type string $type The type of the attachment which is also the subdir where files are saved. + * Defaults to 'cover-image' + * @type string $file The name of the file. + * } + * @return string|bool The url or the path to the attachment, false otherwise + */ +function bp_attachments_get_attachment( $data = 'url', $args = array() ) { + // Default value. + $attachment_data = false; + + $r = bp_parse_args( $args, array( + 'object_dir' => 'members', + 'item_id' => bp_loggedin_user_id(), + 'type' => 'cover-image', + 'file' => '', + ), 'attachments_get_attachment_src' ); + + /** + * Filters whether or not to handle fetching a BuddyPress image attachment. + * + * If you want to override this function, make sure you return false. + * + * @since 2.5.1 + * + * @param null|string $value If null is returned, proceed with default behaviour. Otherwise, value returned verbatim. + * @param array $r { + * @type string $object_dir The object dir (eg: members/groups). Defaults to members. + * @type int $item_id The object id (eg: a user or a group id). Defaults to current user. + * @type string $type The type of the attachment which is also the subdir where files are saved. + * Defaults to 'cover-image' + * @type string $file The name of the file. + * } + */ + $pre_filter = apply_filters( 'bp_attachments_pre_get_attachment', null, $r ); + if ( $pre_filter !== null ) { + return $pre_filter; + } + + // Get BuddyPress Attachments Uploads Dir datas. + $bp_attachments_uploads_dir = bp_attachments_uploads_dir_get(); + + // The BP Attachments Uploads Dir is not set, stop. + if ( ! $bp_attachments_uploads_dir ) { + return $attachment_data; + } + + $type_subdir = $r['object_dir'] . '/' . $r['item_id'] . '/' . $r['type']; + $type_dir = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $type_subdir; + + if ( ! is_dir( $type_dir ) ) { + return $attachment_data; + } + + if ( ! empty( $r['file'] ) ) { + if ( ! file_exists( trailingslashit( $type_dir ) . $r['file'] ) ) { + return $attachment_data; + } + + if ( 'url' === $data ) { + $attachment_data = trailingslashit( $bp_attachments_uploads_dir['baseurl'] ) . $type_subdir . '/' . $r['file']; + } else { + $attachment_data = trailingslashit( $type_dir ) . $r['file']; + } + + } else { + $file = false; + + // Open the directory and get the first file. + if ( $att_dir = opendir( $type_dir ) ) { + + while ( false !== ( $attachment_file = readdir( $att_dir ) ) ) { + // Look for the first file having the type in its name. + if ( false !== strpos( $attachment_file, $r['type'] ) && empty( $file ) ) { + $file = $attachment_file; + break; + } + } + } + + if ( empty( $file ) ) { + return $attachment_data; + } + + if ( 'url' === $data ) { + $attachment_data = trailingslashit( $bp_attachments_uploads_dir['baseurl'] ) . $type_subdir . '/' . $file; + } else { + $attachment_data = trailingslashit( $type_dir ) . $file; + } + } + + return $attachment_data; +} + +/** + * Delete an attachment for the given arguments + * + * @since 2.4.0 + * + * @see bp_attachments_get_attachment() For more information on accepted arguments. + * + * @param array $args Array of arguments for the attachment deletion. + * @return bool True if the attachment was deleted, false otherwise. + */ +function bp_attachments_delete_file( $args = array() ) { + $attachment_path = bp_attachments_get_attachment( 'path', $args ); + + /** + * Filters whether or not to handle deleting an existing BuddyPress attachment. + * + * If you want to override this function, make sure you return false. + * + * @since 2.5.1 + * + * @param bool $value Whether or not to delete the BuddyPress attachment. + * @param array Array of arguments for the attachment deletion. + */ + if ( ! apply_filters( 'bp_attachments_pre_delete_file', true, $args ) ) { + return true; + } + + if ( empty( $attachment_path ) ) { + return false; + } + + @unlink( $attachment_path ); + return true; +} + +/** + * Get the BuddyPress Plupload settings. + * + * @since 2.3.0 + * + * @return array List of BuddyPress Plupload settings. */ function bp_attachments_get_plupload_default_settings() { @@ -77,20 +574,20 @@ function bp_attachments_get_plupload_default_settings() { * * @since 2.3.0 * - * @param array $params Default Plupload parameters array. + * @param array $settings Default Plupload parameters array. */ return apply_filters( 'bp_attachments_get_plupload_default_settings', $settings ); } /** - * Builds localization strings for the BuddyPress Uploader scripts + * Builds localization strings for the BuddyPress Uploader scripts. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return array Plupload default localization strings + * @return array Plupload default localization strings. */ function bp_attachments_get_plupload_l10n() { - // Localization strings + // 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' ), @@ -119,14 +616,15 @@ function bp_attachments_get_plupload_l10n() { } /** - * Enqueues the script needed for the Uploader UI + * 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 2.3.0 * - * @since BuddyPress (2.3.0) + * @see BP_Attachment::script_data() && BP_Attachment_Avatar::script_data() for examples showing how + * to set specific script data. * - * @param string $class name of the class extending BP_Attachment (eg: BP_Attachment_Avatar) + * @param string $class Name of the class extending BP_Attachment (eg: BP_Attachment_Avatar). + * @return null|WP_Error */ function bp_attachments_enqueue_scripts( $class = '' ) { // Enqueue me just once per page, please. @@ -138,7 +636,7 @@ function bp_attachments_enqueue_scripts( $class = '' ) { return new WP_Error( 'missing_parameter' ); } - // Get an instance of the class and get the script data + // Get an instance of the class and get the script data. $attachment = new $class; $script_data = $attachment->script_data(); @@ -159,29 +657,29 @@ function bp_attachments_enqueue_scripts( $class = '' ) { return new WP_Error( 'missing_parameter' ); } - // Get the BuddyPress uploader strings + // Get the BuddyPress uploader strings. $strings = bp_attachments_get_plupload_l10n(); - // Get the BuddyPress uploader settings + // Get the BuddyPress uploader settings. $settings = bp_attachments_get_plupload_default_settings(); - // Set feedback messages + // Set feedback messages. if ( ! empty( $args['feedback_messages'] ) ) { $strings['feedback_messages'] = $args['feedback_messages']; } - // Use a temporary var to ease manipulation + // Use a temporary var to ease manipulation. $defaults = $settings['defaults']; - // Set the upload action + // Set the upload action. $defaults['multipart_params']['action'] = $args['action']; - // Set BuddyPress upload parameters if provided + // Set BuddyPress upload parameters if provided. if ( ! empty( $args['bp_params'] ) ) { $defaults['multipart_params']['bp_params'] = $args['bp_params']; } - // Merge other arguments + // Merge other arguments. $ui_args = array_intersect_key( $args, array( 'file_data_name' => true, 'browse_button' => true, @@ -195,10 +693,10 @@ function bp_attachments_enqueue_scripts( $class = '' ) { $defaults['filters']['max_file_size'] = $args['max_file_size'] . 'b'; } - // Specific to BuddyPress Avatars + // Specific to BuddyPress Avatars. if ( 'bp_avatar_upload' === $defaults['multipart_params']['action'] ) { - // Include the cropping informations for avatars + // Include the cropping informations for avatars. $settings['crop'] = array( 'full_h' => bp_core_avatar_full_height(), 'full_w' => bp_core_avatar_full_width(), @@ -207,25 +705,25 @@ function bp_attachments_enqueue_scripts( $class = '' ) { // Avatar only need 1 file and 1 only! $defaults['multi_selection'] = false; - // Does the object already has an avatar set + // 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 + // What is the object the avatar belongs to. $object = $defaults['multipart_params']['bp_params']['object']; - // Init the Avatar nav + // 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 + // 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 + // 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 + // 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' ), @@ -239,25 +737,56 @@ function bp_attachments_enqueue_scripts( $class = '' ) { } /** - * Use this filter to add a navigation to a custom tool to set the object's avatar + * Use this filter to add a navigation to a custom tool to set the object's avatar. * - * @since BuddyPress (2.3.0) + * @since 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 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) + * @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' ); + + // Specific to BuddyPress cover images. + } elseif ( 'bp_cover_image_upload' === $defaults['multipart_params']['action'] ) { + + // Cover images only need 1 file and 1 only! + $defaults['multi_selection'] = false; + + // Default cover component is xprofile. + $cover_component = 'xprofile'; + + // Get the object we're editing the cover image of. + $object = $defaults['multipart_params']['bp_params']['object']; + + // Set the cover component according to the object. + if ( 'group' === $object ) { + $cover_component = 'groups'; + } elseif ( 'user' !== $object ) { + $cover_component = apply_filters( 'bp_attachments_cover_image_ui_component', $cover_component ); + } + // Get cover image advised dimensions. + $cover_dimensions = bp_attachments_get_cover_image_dimensions( $cover_component ); + + // Set warning messages. + $strings['cover_image_warnings'] = apply_filters( 'bp_attachments_cover_image_ui_warnings', array( + 'dimensions' => sprintf( + __( 'For better results, make sure to upload an image that is larger than %1$spx wide, and %2$spx tall.', 'buddypress' ), + (int) $cover_dimensions['width'], + (int) $cover_dimensions['height'] + ), + ) ); } - // Set Plupload settings + // Set Plupload settings. $settings['defaults'] = $defaults; /** @@ -297,35 +826,36 @@ function bp_attachments_enqueue_scripts( $class = '' ) { * Fires at the conclusion of bp_attachments_enqueue_scripts() * to avoid the scripts to be loaded more than once. * - * @since BuddyPress 2.3.0 + * @since 2.3.0 */ do_action( 'bp_attachments_enqueue_scripts' ); } /** - * Check the current user's capability to edit an avatar for a given object + * Check the current user's capability to edit an avatar for a given object. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param string $capability the capability to check - * @param array $args an array containing the item_id and the object to check + * @param string $capability The capability to check. + * @param array $args An array containing the item_id and the object to check. + * @return bool */ function bp_attachments_current_user_can( $capability, $args = array() ) { $can = false; - if ( 'edit_avatar' === $capability ) { + if ( 'edit_avatar' === $capability || 'edit_cover_image' === $capability ) { /** * Needed avatar arguments are set. */ if ( isset( $args['item_id'] ) && isset( $args['object'] ) ) { - // Group profile photo + // 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 + // 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' ); } @@ -348,11 +878,11 @@ function bp_attachments_current_user_can( $capability, $args = array() ) { /** * Send a JSON response back to an Ajax upload request. * - * @since BuddyPress (2.3.0) + * @since 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. + * @param bool $success True for a success, false otherwise. + * @param bool $is_html4 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 ); @@ -361,7 +891,7 @@ function bp_attachments_json_response( $success, $is_html4 = false, $data = null $response['data'] = $data; } - // Send regular json response + // Send regular json response. if ( ! $is_html4 ) { wp_send_json( $response ); @@ -380,23 +910,24 @@ function bp_attachments_json_response( $success, $is_html4 = false, $data = null /** * Get an Attachment template part. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param string Template part slug. eg 'uploader' for 'uploader.php'. + * @param string $slug Template part slug. eg 'uploader' for 'uploader.php'. + * @return bool */ function bp_attachments_get_template_part( $slug ) { $attachment_template_part = 'assets/_attachments/' . $slug; - // Load the attachment template in WP Administratin screens + // Load the attachment template in WP Administration 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 + // Check whether the template part exists. if ( ! file_exists( $attachment_admin_template_part ) ) { return false; } - // load the template part + // Load the template part. require( $attachment_admin_template_part ); // Load the attachment template in WP_USE_THEMES env. @@ -404,3 +935,514 @@ function bp_attachments_get_template_part( $slug ) { bp_get_template_part( $attachment_template_part ); } } + +/** Cover Image ***************************************************************/ + +/** + * Get the cover image settings + * + * @since 2.4.0 + * + * @param string $component The component to get the settings for ("xprofile" for user or "groups"). + * @return array The cover image settings. + */ +function bp_attachments_get_cover_image_settings( $component = 'xprofile' ) { + // Default parameters. + $args = array(); + + // First look in BP Theme Compat. + $cover_image = bp_get_theme_compat_feature( 'cover_image' ); + + if ( ! empty( $cover_image ) ) { + $args = (array) $cover_image; + } + + /** + * Then let people override/set the feature using this dynamic filter + * + * Eg: for the user's profile cover image use: + * add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'your_filter', 10, 1 ); + * + * @since 2.4.0 + * + * @param array $settings The cover image settings + */ + $settings = bp_parse_args( $args, array( + 'components' => array(), + 'width' => 1300, + 'height' => 225, + 'callback' => '', + 'theme_handle' => '', + 'default_cover' => '', + ), $component . '_cover_image_settings' ); + + if ( empty( $settings['components'] ) || empty( $settings['callback'] ) || empty( $settings['theme_handle'] ) ) { + return false; + } + + // Current component is not supported. + if ( ! in_array( $component, $settings['components'] ) ) { + return false; + } + + // Finally return the settings. + return $settings; +} + +/** + * Get cover image Width and Height + * + * @since 2.4.0 + * + * @param string $component The BuddyPress component concerned ("xprofile" for user or "groups"). + * @return array An associative array containing the advised width and height for the cover image. + */ +function bp_attachments_get_cover_image_dimensions( $component = 'xprofile' ) { + // Let's prevent notices when setting the warning strings. + $default = array( 'width' => 0, 'height' => 0 ); + + $settings = bp_attachments_get_cover_image_settings( $component ); + + if ( empty( $settings ) ) { + return false; + } + + // Get width and height. + $wh = array_intersect_key( $settings, $default ); + + /** + * Filter here to edit the cover image dimensions if needed. + * + * @since 2.4.0 + * + * @param array $wh An associative array containing the width and height values. + * @param array $settings An associative array containing all the feature settings. + * @param string $compnent The requested component. + */ + return apply_filters( 'bp_attachments_get_cover_image_dimensions', $wh, $settings, $component ); +} + +/** + * Are we on a page to edit a cover image? + * + * @since 2.4.0 + * + * @return bool True if on a page to edit a cover image, false otherwise. + */ +function bp_attachments_cover_image_is_edit() { + $retval = false; + + $current_component = bp_current_component(); + if ( 'profile' === $current_component ) { + $current_component = 'xprofile'; + } + + if ( ! bp_is_active( $current_component, 'cover_image' ) ) { + return $retval; + } + + if ( bp_is_user_change_cover_image() ) { + $retval = ! bp_disable_cover_image_uploads(); + } + + if ( ( bp_is_group_admin_page() && 'group-cover-image' == bp_get_group_current_admin_tab() ) + || ( bp_is_group_create() && bp_is_group_creation_step( 'group-cover-image' ) ) ) { + $retval = ! bp_disable_group_cover_image_uploads(); + } + + return apply_filters( 'bp_attachments_cover_image_is_edit', $retval, $current_component ); +} + +/** + * Does the user has a cover image? + * + * @since 2.4.0 + * + * @param int $user_id User ID to retrieve cover image for. + * @return bool True if the user has a cover image, false otherwise. + */ +function bp_attachments_get_user_has_cover_image( $user_id = 0 ) { + if ( empty( $user_id ) ) { + $user_id = bp_displayed_user_id(); + } + + $cover_src = bp_attachments_get_attachment( 'url', array( + 'item_id' => $user_id, + ) ); + + return (bool) apply_filters( 'bp_attachments_get_user_has_cover_image', $cover_src, $user_id ); +} + +/** + * Does the group has a cover image? + * + * @since 2.4.0 + * + * @param int $group_id Group ID to check cover image existence for. + * @return bool True if the group has a cover image, false otherwise. + */ +function bp_attachments_get_group_has_cover_image( $group_id = 0 ) { + if ( empty( $group_id ) ) { + $group_id = bp_get_current_group_id(); + } + + $cover_src = bp_attachments_get_attachment( 'url', array( + 'object_dir' => 'groups', + 'item_id' => $group_id, + ) ); + + return (bool) apply_filters( 'bp_attachments_get_user_has_cover_image', $cover_src, $group_id ); +} + +/** + * Generate the cover image file. + * + * @since 2.4.0 + * + * @param array $args { + * @type string $file The absolute path to the image. Required. + * @type string $component The component for the object (eg: groups, xprofile). Required. + * @type string $cover_image_dir The Cover image dir to write the image into. Required. + * } + * @param BP_Attachment_Cover_Image|null $cover_image_class The class to use to fit the cover image. + * @return bool|array An array containing cover image data on success, false otherwise. + */ +function bp_attachments_cover_image_generate_file( $args = array(), $cover_image_class = null ) { + // Bail if an argument is missing. + if ( empty( $args['file'] ) || empty( $args['component'] ) || empty( $args['cover_image_dir'] ) ) { + return false; + } + + // Get advised dimensions for the cover image. + $dimensions = bp_attachments_get_cover_image_dimensions( $args['component'] ); + + // No dimensions or the file does not match with the cover image dir, stop! + if ( false === $dimensions || $args['file'] !== $args['cover_image_dir'] . '/' . wp_basename( $args['file'] ) ) { + return false; + } + + if ( ! is_a( $cover_image_class, 'BP_Attachment_Cover_Image' ) ) { + $cover_image_class = new BP_Attachment_Cover_Image(); + } + + // Make sure the file is inside the Cover Image Upload path. + if ( false === strpos( $args['file'], $cover_image_class->upload_path ) ) { + return false; + } + + // Resize the image so that it fit with the cover image dimensions. + $cover_image = $cover_image_class->fit( $args['file'], $dimensions ); + $is_too_small = false; + + // Image is too small in width and height. + if ( empty( $cover_image ) ) { + $cover_file = $cover_image_class->generate_filename( $args['file'] ); + @rename( $args['file'], $cover_file ); + + // It's too small! + $is_too_small = true; + } elseif ( ! empty( $cover_image['path'] ) ) { + $cover_file = $cover_image['path']; + + // Image is too small in width or height. + if ( $cover_image['width'] < $dimensions['width'] || $cover_image['height'] < $dimensions['height'] ) { + $is_too_small = true; + } + } + + // We were not able to generate the cover image file. + if ( empty( $cover_file ) ) { + return false; + } + + // Do some clean up with old cover image, now a new one is set. + $cover_basename = wp_basename( $cover_file ); + + if ( $att_dir = opendir( $args['cover_image_dir'] ) ) { + while ( false !== ( $attachment_file = readdir( $att_dir ) ) ) { + // Skip directories and the new cover image. + if ( 2 < strlen( $attachment_file ) && 0 !== strpos( $attachment_file, '.' ) && $cover_basename !== $attachment_file ) { + @unlink( $args['cover_image_dir'] . '/' . $attachment_file ); + } + } + } + + // Finally return needed data. + return array( + 'cover_file' => $cover_file, + 'cover_basename' => $cover_basename, + 'is_too_small' => $is_too_small + ); +} + +/** + * Ajax Upload and set a cover image + * + * @since 2.4.0 + * + * @return string|null A json object containing success data if the upload succeeded + * error message otherwise. + */ +function bp_attachments_cover_image_ajax_upload() { + // Bail if not a POST action. + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { + wp_die(); + } + + /** + * Sending the json response will be different if + * the current Plupload runtime is html4 + */ + $is_html4 = false; + if ( ! empty( $_POST['html4' ] ) ) { + $is_html4 = true; + } + + // Check the nonce. + check_admin_referer( 'bp-uploader' ); + + // Init the BuddyPress parameters. + $bp_params = array(); + + // We need it to carry on. + if ( ! empty( $_POST['bp_params'] ) ) { + $bp_params = bp_parse_args( $_POST['bp_params'], array( + 'object' => 'user', + 'item_id' => bp_loggedin_user_id(), + ), 'attachments_cover_image_ajax_upload' ); + } else { + bp_attachments_json_response( false, $is_html4 ); + } + + // We need the object to set the uploads dir filter. + if ( empty( $bp_params['object'] ) ) { + bp_attachments_json_response( false, $is_html4 ); + } + + // Capability check. + if ( ! bp_attachments_current_user_can( 'edit_cover_image', $bp_params ) ) { + bp_attachments_json_response( false, $is_html4 ); + } + + $bp = buddypress(); + $needs_reset = array(); + + // Member's cover image. + if ( 'user' === $bp_params['object'] ) { + $object_data = array( 'dir' => 'members', 'component' => 'xprofile' ); + + 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']; + } + + // Group's cover image. + } elseif ( 'group' === $bp_params['object'] ) { + $object_data = array( 'dir' => 'groups', 'component' => 'groups' ); + + 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, + ) ); + } + + // Other object's cover image. + } else { + $object_data = apply_filters( 'bp_attachments_cover_image_object_dir', array(), $bp_params['object'] ); + } + + // Stop here in case of a missing parameter for the object. + if ( empty( $object_data['dir'] ) || empty( $object_data['component'] ) ) { + bp_attachments_json_response( false, $is_html4 ); + } + + /** + * Filters whether or not to handle cover image uploading. + * + * If you want to override this function, make sure you return an array with the 'result' key set. + * + * @since 2.5.1 + * + * @param array $value + * @param array $bp_params + * @param array $needs_reset Stores original value of certain globals we need to revert to later. + * @param array $object_data + */ + $pre_filter = apply_filters( 'bp_attachments_pre_cover_image_ajax_upload', array(), $bp_params, $needs_reset, $object_data ); + if ( isset( $pre_filter['result'] ) ) { + bp_attachments_json_response( $pre_filter['result'], $is_html4, $pre_filter ); + } + + $cover_image_attachment = new BP_Attachment_Cover_Image(); + $uploaded = $cover_image_attachment->upload( $_FILES ); + + // Reset objects. + if ( ! empty( $needs_reset ) ) { + if ( ! empty( $needs_reset['component'] ) ) { + $bp->{$needs_reset['component']}->{$needs_reset['key']} = $needs_reset['value']; + } else { + $bp->{$needs_reset['key']} = $needs_reset['value']; + } + } + + if ( ! empty( $uploaded['error'] ) ) { + // Upload error response. + bp_attachments_json_response( false, $is_html4, array( + 'type' => 'upload_error', + 'message' => sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $uploaded['error'] ), + ) ); + } + + // Default error message. + $error_message = __( 'There was a problem uploading the cover image.', 'buddypress' ); + + // Get BuddyPress Attachments Uploads Dir datas. + $bp_attachments_uploads_dir = bp_attachments_uploads_dir_get(); + + // The BP Attachments Uploads Dir is not set, stop. + if ( ! $bp_attachments_uploads_dir ) { + bp_attachments_json_response( false, $is_html4, array( + 'type' => 'upload_error', + 'message' => $error_message, + ) ); + } + + $cover_subdir = $object_data['dir'] . '/' . $bp_params['item_id'] . '/cover-image'; + $cover_dir = trailingslashit( $bp_attachments_uploads_dir['basedir'] ) . $cover_subdir; + + if ( ! is_dir( $cover_dir ) ) { + // Upload error response. + bp_attachments_json_response( false, $is_html4, array( + 'type' => 'upload_error', + 'message' => $error_message, + ) ); + } + + /** + * Generate the cover image so that it fit to feature's dimensions + * + * Unlike the Avatar, Uploading and generating the cover image is happening during + * the same Ajax request, as we already instantiated the BP_Attachment_Cover_Image + * class, let's use it. + */ + $cover = bp_attachments_cover_image_generate_file( array( + 'file' => $uploaded['file'], + 'component' => $object_data['component'], + 'cover_image_dir' => $cover_dir + ), $cover_image_attachment ); + + if ( ! $cover ) { + // Upload error response. + bp_attachments_json_response( false, $is_html4, array( + 'type' => 'upload_error', + 'message' => $error_message, + ) ); + } + + // Build the url to the file. + $cover_url = trailingslashit( $bp_attachments_uploads_dir['baseurl'] ) . $cover_subdir . '/' . $cover['cover_basename']; + + // Init Feedback code, 1 is success. + $feedback_code = 1; + + // 0 is the size warning. + if ( $cover['is_too_small'] ) { + $feedback_code = 0; + } + + // Set the name of the file. + $name = $_FILES['file']['name']; + $name_parts = pathinfo( $name ); + $name = trim( substr( $name, 0, - ( 1 + strlen( $name_parts['extension'] ) ) ) ); + + /** + * Fires if the new cover image was successfully uploaded. + * + * The dynamic portion of the hook will be xprofile in case of a user's + * cover image, groups in case of a group's cover image. For instance: + * Use add_action( 'xprofile_cover_image_uploaded' ) to run your specific + * code once the user has set his cover image. + * + * @since 2.4.0 + * + * @param int $item_id Inform about the item id the cover image was set for. + */ + do_action( $object_data['component'] . '_cover_image_uploaded', (int) $bp_params['item_id'] ); + + // Finally return the cover image url to the UI. + bp_attachments_json_response( true, $is_html4, array( + 'name' => $name, + 'url' => $cover_url, + 'feedback_code' => $feedback_code, + ) ); +} +add_action( 'wp_ajax_bp_cover_image_upload', 'bp_attachments_cover_image_ajax_upload' ); + +/** + * Ajax delete a cover image for a given object and item id. + * + * @since 2.4.0 + * + * @return string|null A json object containing success data if the cover image was deleted + * error message otherwise. + */ +function bp_attachments_cover_image_ajax_delete() { + // Bail if not a POST action. + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { + wp_send_json_error(); + } + + $cover_image_data = $_POST; + + if ( empty( $cover_image_data['object'] ) || empty( $cover_image_data['item_id'] ) ) { + wp_send_json_error(); + } + + // Check the nonce. + check_admin_referer( 'bp_delete_cover_image', 'nonce' ); + + // Capability check. + if ( ! bp_attachments_current_user_can( 'edit_cover_image', $cover_image_data ) ) { + wp_send_json_error(); + } + + // Set object for the user's case. + if ( 'user' === $cover_image_data['object'] ) { + $component = 'xprofile'; + $dir = 'members'; + + // Set it for any other cases. + } else { + $component = $cover_image_data['object'] . 's'; + $dir = $component; + } + + // Handle delete. + if ( bp_attachments_delete_file( array( 'item_id' => $cover_image_data['item_id'], 'object_dir' => $dir, 'type' => 'cover-image' ) ) ) { + + // Defaults no cover image. + $response = array( + 'reset_url' => '', + 'feedback_code' => 3 , + ); + + // Get cover image settings in case there's a default header. + $cover_params = bp_attachments_get_cover_image_settings( $component ); + + // Check if there's a default cover. + if ( ! empty( $cover_params['default_cover'] ) ) { + $response['reset_url'] = $cover_params['default_cover']; + } + + // Finally send the reset url. + wp_send_json_success( $response ); + + } else { + wp_send_json_error( array( + 'feedback_code' => 2, + ) ); + } +} +add_action( 'wp_ajax_bp_cover_image_delete', 'bp_attachments_cover_image_ajax_delete' ); 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 11727b4d172b0f06960b9f0d6e074819d0d5976d..64a9e43331e5c4a1a1bb82f55e22ea004f9c1a88 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php @@ -1,14 +1,19 @@ <?php - /** * BuddyPress Avatars. + * + * @package BuddyPress + * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/*** +/** * Set up the constants we need for avatar support. + * + * @since 1.2.0 */ function bp_core_set_avatar_constants() { @@ -30,13 +35,7 @@ function bp_core_set_avatar_constants() { define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 ); if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) { - - $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', $fileupload_maxk * 1024 ); - } + define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', bp_attachments_get_max_upload_file_size( 'avatar' ) ); } if ( ! defined( 'BP_SHOW_AVATARS' ) ) { @@ -48,7 +47,7 @@ add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 ); /** * Set up global variables related to avatars. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_core_set_avatar_globals() { $bp = buddypress(); @@ -57,40 +56,40 @@ function bp_core_set_avatar_globals() { $bp->avatar->thumb = new stdClass; $bp->avatar->full = new stdClass; - // Dimensions + // Dimensions. $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH; $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT; $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH; $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT; - // Upload maximums + // Upload maximums. $bp->avatar->original_max_width = BP_AVATAR_ORIGINAL_MAX_WIDTH; $bp->avatar->original_max_filesize = BP_AVATAR_ORIGINAL_MAX_FILESIZE; - // Defaults + // Defaults. $bp->avatar->thumb->default = bp_core_avatar_default_thumb(); $bp->avatar->full->default = bp_core_avatar_default(); - // These have to be set on page load in order to avoid infinite filter loops at runtime + // These have to be set on page load in order to avoid infinite filter loops at runtime. $bp->avatar->upload_path = bp_core_avatar_upload_path(); $bp->avatar->url = bp_core_avatar_url(); // Cache the root blog's show_avatars setting, to avoid unnecessary - // calls to switch_to_blog() + // calls to switch_to_blog(). $bp->avatar->show_avatars = (bool) BP_SHOW_AVATARS; - // Backpat for pre-1.5 + // Backpat for pre-1.5. if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) ) define( 'BP_AVATAR_UPLOAD_PATH', $bp->avatar->upload_path ); - // Backpat for pre-1.5 + // Backpat for pre-1.5. 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) + * @since 1.5.0 */ do_action( 'bp_core_set_avatar_globals' ); } @@ -107,82 +106,93 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' ); * locally: * add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' ); * - * @param array $args { + * @since 1.1.0 + * @since 2.4.0 Added 'extra_attr', 'scheme', 'rating' and 'force_default' for $args. + * These are inherited from WordPress 4.2.0. See {@link get_avatar()}. + * + * @param array|string $args { * An array of arguments. All arguments are technically optional; some * will, if not provided, be auto-detected by bp_core_fetch_avatar(). This * auto-detection is described more below, when discussing specific * arguments. * - * @type int|bool $item_id The numeric ID of the item for which you're - * requesting an avatar (eg, a user ID). If no 'item_id' is present, - * the function attempts to infer an ID from the 'object' + the - * current context: if 'object' is 'user' and the current page is a - * user page, 'item_id' will default to the displayed user ID; if - * 'group' and on a group page, to the current group ID; if 'blog', - * to the current blog's ID. If no 'item_id' can be determined in - * this way, the function returns false. Default: false. - * @type string $object The kind of object for which you're getting an - * avatar. BuddyPress natively supports three options: 'user', - * 'group', 'blog'; a plugin may register more. Default: 'user'. - * @type string $type When a new avatar is uploaded to BP, 'thumb' and - * 'full' versions are saved. This parameter specifies whether you'd - * like the 'full' or smaller 'thumb' avatar. Default: 'thumb'. + * @type int|bool $item_id The numeric ID of the item for which you're requesting + * an avatar (eg, a user ID). If no 'item_id' is present, + * the function attempts to infer an ID from the 'object' + the + * current context: if 'object' is 'user' and the current page is a + * user page, 'item_id' will default to the displayed user ID; if + * 'group' and on a group page, to the current group ID; if 'blog', + * to the current blog's ID. If no 'item_id' can be determined in + * this way, the function returns false. Default: false. + * @type string $object The kind of object for which you're getting an + * avatar. BuddyPress natively supports three options: 'user', + * 'group', 'blog'; a plugin may register more. Default: 'user'. + * @type string $type When a new avatar is uploaded to BP, 'thumb' and + * 'full' versions are saved. This parameter specifies whether you'd + * like the 'full' or smaller 'thumb' avatar. Default: 'thumb'. * @type string|bool $avatar_dir The name of the subdirectory where the - * requested avatar should be found. If no value is passed, - * 'avatar_dir' is inferred from 'object': 'user' becomes 'avatars', - * 'group' becomes 'group-avatars', 'blog' becomes 'blog-avatars'. - * Remember that this string denotes a subdirectory of BP's main - * avatar directory (usually based on {@link wp_upload_dir()}); it's a - * string like 'group-avatars' rather than the full directory path. - * Generally, it'll only be necessary to override the default value if - * storing avatars in a non-default location. Defaults to false - * (auto-detected). - * @type int|bool $width Requested avatar width. The unit is px. This value - * is used to build the 'width' attribute for the <img> element. If - * no value is passed, BP uses the global avatar width for this - * avatar type. Default: false (auto-detected). - * @type int|bool $height Requested avatar height. The unit is px. This - * value is used to build the 'height' attribute for the <img> - * element. If no value is passed, BP uses the global avatar height - * for this avatar type. Default: false (auto-detected). - * @type string $class The CSS class for the <img> element. Note that BP - * uses the 'avatar' class fairly extensively in its default styling, - * so if you plan to pass a custom value, consider appending it to - * 'avatar' (eg 'avatar foo') rather than replacing it altogether. - * Default: 'avatar'. - * @type string|bool $css_id The CSS id for the <img> element. - * Default: false. - * @type string $title The title attribute for the <img> element. - * Default: false. - * @type string $alt The alt attribute for the <img> element. In BP, this - * value is generally passed by the wrapper functions, where the data - * necessary for concatenating the string is at hand; see - * {@link bp_get_activity_avatar()} for an example. Default: ''. - * @type string|bool $email An email to use in Gravatar queries. Unless - * otherwise configured, BP uses Gravatar as a fallback for avatars - * that are not provided locally. Gravatar's API requires using a hash - * of the user's email address; this argument provides it. If not - * provided, the function will infer it: for users, by getting the - * user's email from the database, for groups/blogs, by concatenating - * "{$item_id}-{$object}@{bp_get_root_domain()}". The user query adds - * overhead, so it's recommended that wrapper functions provide a - * value for 'email' when querying user IDs. Default: false. - * @type bool $no_grav Whether to disable the default Gravatar fallback. - * By default, BP will fall back on Gravatar when it cannot find a - * local avatar. In some cases, this may be undesirable, in which - * case 'no_grav' should be set to true. To disable Gravatar - * fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter. - * Default: false. - * @type bool $html Whether to return an <img> HTML element, vs a raw URL - * to an avatar. If false, <img>-specific arguments (like 'css_id') - * will be ignored. Default: true. + * requested avatar should be found. If no value is passed, + * 'avatar_dir' is inferred from 'object': 'user' becomes 'avatars', + * 'group' becomes 'group-avatars', 'blog' becomes 'blog-avatars'. + * Remember that this string denotes a subdirectory of BP's main + * avatar directory (usually based on {@link wp_upload_dir()}); it's a + * string like 'group-avatars' rather than the full directory path. + * Generally, it'll only be necessary to override the default value if + * storing avatars in a non-default location. Defaults to false + * (auto-detected). + * @type int|bool $width Requested avatar width. The unit is px. This value + * is used to build the 'width' attribute for the <img> element. If + * no value is passed, BP uses the global avatar width for this + * avatar type. Default: false (auto-detected). + * @type int|bool $height Requested avatar height. The unit is px. This + * value is used to build the 'height' attribute for the <img> + * element. If no value is passed, BP uses the global avatar height + * for this avatar type. Default: false (auto-detected). + * @type string $class The CSS class for the <img> element. Note that BP + * uses the 'avatar' class fairly extensively in its default styling, + * so if you plan to pass a custom value, consider appending it to + * 'avatar' (eg 'avatar foo') rather than replacing it altogether. + * Default: 'avatar'. + * @type string|bool $css_id The CSS id for the <img> element. + * Default: false. + * @type string $title The title attribute for the <img> element. + * Default: false. + * @type string $alt The alt attribute for the <img> element. In BP, this + * value is generally passed by the wrapper functions, where the data + * necessary for concatenating the string is at hand; see + * {@link bp_get_activity_avatar()} for an example. Default: ''. + * @type string|bool $email An email to use in Gravatar queries. Unless + * otherwise configured, BP uses Gravatar as a fallback for avatars + * that are not provided locally. Gravatar's API requires using a hash + * of the user's email address; this argument provides it. If not + * provided, the function will infer it: for users, by getting the + * user's email from the database, for groups/blogs, by concatenating + * "{$item_id}-{$object}@{bp_get_root_domain()}". The user query adds + * overhead, so it's recommended that wrapper functions provide a + * value for 'email' when querying user IDs. Default: false. + * @type bool $no_grav Whether to disable the default Gravatar fallback. + * By default, BP will fall back on Gravatar when it cannot find a + * local avatar. In some cases, this may be undesirable, in which + * case 'no_grav' should be set to true. To disable Gravatar + * fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter. + * Default: false. + * @type bool $html Whether to return an <img> HTML element, vs a raw URL + * to an avatar. If false, <img>-specific arguments (like 'css_id') + * will be ignored. Default: true. + * @type string $extra_attr HTML attributes to insert in the IMG element. Not sanitized. Default: ''. + * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. + * Default null. + * @type string $rating What rating to display Gravatars for. Accepts 'G', 'PG', 'R', 'X'. + * Default is the value of the 'avatar_rating' option. + * @type bool $force_default Used when creating the Gravatar URL. Whether to force the default + * image regardless if the Gravatar exists. Default: false. * } * @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 avatars are disabled for the root site, obey that request and bail. if ( ! $bp->avatar->show_avatars ) { return; } @@ -191,22 +201,26 @@ function bp_core_fetch_avatar( $args = '' ) { // Set the default variables array and parse it against incoming $args array. $params = wp_parse_args( $args, array( - 'item_id' => false, - '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' => '', + 'item_id' => false, + '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' => '', + 'extra_attr' => '', + 'scheme' => null, + 'rating' => get_option( 'avatar_rating' ), + 'force_default' => false, ) ); - /** Set item_id ***********************************************************/ + /* Set item_id ***********************************************************/ if ( empty( $params['item_id'] ) ) { @@ -234,7 +248,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the ID of the item being requested. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value ID of avatar item being requested. * @param string $value Avatar type being requested. @@ -247,7 +261,7 @@ function bp_core_fetch_avatar( $args = '' ) { } } - /** Set avatar_dir ********************************************************/ + /* Set avatar_dir ********************************************************/ if ( empty( $params['avatar_dir'] ) ) { @@ -275,7 +289,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the avatar directory to use. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Name of the subdirectory where the requested avatar should be found. * @param string $value Avatar type being requested. @@ -288,7 +302,7 @@ function bp_core_fetch_avatar( $args = '' ) { } } - /** <img> alt *************************************************************/ + /* <img> alt *************************************************************/ if ( false !== strpos( $params['alt'], '%s' ) || false !== strpos( $params['alt'], '%1$s' ) ) { @@ -311,7 +325,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the alt attribute value to be applied to avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value alt to be applied to avatar. * @param string $value ID of avatar item being requested. @@ -322,21 +336,21 @@ function bp_core_fetch_avatar( $args = '' ) { $params['alt'] = sprintf( $params['alt'], $item_name ); } - /** Sanity Checks *********************************************************/ + /* Sanity Checks *********************************************************/ - // Get a fallback for the 'alt' parameter, create html output + // 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'] ) . '"'; - // Filter image title and create html string + // Filter image title and create html string. $html_title = ''; /** * Filters the title attribute value to be applied to avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Title to be applied to avatar. * @param string $value ID of avatar item being requested. @@ -349,13 +363,16 @@ function bp_core_fetch_avatar( $args = '' ) { $html_title = ' title="' . esc_attr( $params['title'] ) . '"'; } - // Set CSS ID and create html string + // Extra attributes. + $extra_attr = ! empty( $args['extra_attr'] ) ? ' ' . $args['extra_attr'] : ''; + + // Set CSS ID and create html string. $html_css_id = ''; /** * Filters the ID attribute to be applied to avatar. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $value ID to be applied to avatar. * @param string $value ID of avatar item being requested. @@ -368,7 +385,7 @@ function bp_core_fetch_avatar( $args = '' ) { $html_css_id = ' id="' . esc_attr( $params['css_id'] ) . '"'; } - // Set image width + // Set image width. if ( false !== $params['width'] ) { // Width has been specified. No modification necessary. } elseif ( 'thumb' == $params['type'] ) { @@ -378,7 +395,7 @@ function bp_core_fetch_avatar( $args = '' ) { } $html_width = ' width="' . $params['width'] . '"'; - // Set image height + // Set image height. if ( false !== $params['height'] ) { // Height has been specified. No modification necessary. } elseif ( 'thumb' == $params['type'] ) { @@ -391,7 +408,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the classes to be applied to the avatar. * - * @since BuddyPress (1.6.0) + * @since 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. @@ -400,25 +417,25 @@ function bp_core_fetch_avatar( $args = '' ) { */ $params['class'] = apply_filters( 'bp_core_avatar_class', $params['class'], $params['item_id'], $params['object'], $params ); - // Use an alias to leave the param unchanged + // Use an alias to leave the param unchanged. $avatar_classes = $params['class']; if ( ! is_array( $avatar_classes ) ) { $avatar_classes = explode( ' ', $avatar_classes ); } - // merge classes + // Merge classes. $avatar_classes = array_merge( $avatar_classes, array( $params['object'] . '-' . $params['item_id'] . '-avatar', 'avatar-' . $params['width'], ) ); - // Sanitize each class + // Sanitize each class. $avatar_classes = array_map( 'sanitize_html_class', $avatar_classes ); - // populate the class attribute + // Populate the class attribute. $html_class = ' class="' . join( ' ', $avatar_classes ) . ' photo"'; - // Set img URL and DIR based on prepopulated constants + // 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() ); @@ -428,7 +445,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the avatar folder directory URL. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Path to the avatar folder URL. * @param int $value ID of the avatar item being requested. @@ -440,7 +457,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters the avatar folder directory path. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Path to the avatar folder directory. * @param int $value ID of the avatar item being requested. @@ -458,32 +475,32 @@ function bp_core_fetch_avatar( $args = '' ) { $legacy_user_avatar_name = ( 'full' == $params['type'] ) ? '-avatar2' : '-avatar1'; $legacy_group_avatar_name = ( 'full' == $params['type'] ) ? '-groupavatar-full' : '-groupavatar-thumb'; - // Check for directory + // Check for directory. if ( file_exists( $avatar_folder_dir ) ) { - // Open directory + // Open directory. if ( $av_dir = opendir( $avatar_folder_dir ) ) { - // Stash files in an array once to check for one that matches + // Stash files in an array once to check for one that matches. $avatar_files = array(); while ( false !== ( $avatar_file = readdir( $av_dir ) ) ) { - // Only add files to the array (skip directories) + // Only add files to the array (skip directories). if ( 2 < strlen( $avatar_file ) ) { $avatar_files[] = $avatar_file; } } - // Check for array + // Check for array. if ( 0 < count( $avatar_files ) ) { - // Check for current avatar + // Check for current avatar. foreach( $avatar_files as $key => $value ) { if ( strpos ( $value, $avatar_size )!== false ) { $avatar_url = $avatar_folder_url . '/' . $avatar_files[$key]; } } - // Legacy avatar check + // Legacy avatar check. if ( !isset( $avatar_url ) ) { foreach( $avatar_files as $key => $value ) { if ( strpos ( $value, $legacy_user_avatar_name )!== false ) { @@ -491,7 +508,7 @@ function bp_core_fetch_avatar( $args = '' ) { } } - // Legacy group avatar check + // Legacy group avatar check. if ( !isset( $avatar_url ) ) { foreach( $avatar_files as $key => $value ) { if ( strpos ( $value, $legacy_group_avatar_name )!== false ) { @@ -503,19 +520,21 @@ function bp_core_fetch_avatar( $args = '' ) { } } - // Close the avatar directory + // Close the avatar directory. closedir( $av_dir ); - // If we found a locally uploaded avatar + // If we found a locally uploaded avatar. if ( isset( $avatar_url ) ) { + // Support custom scheme. + $avatar_url = set_url_scheme( $avatar_url, $params['scheme'] ); - // Return it wrapped in an <img> element + // Return it wrapped in an <img> element. if ( true === $params['html'] ) { /** * Filters an avatar URL wrapped in an <img> element. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Full <img> element for an avatar. * @param array $params Array of parameters for the request. @@ -527,7 +546,7 @@ function bp_core_fetch_avatar( $args = '' ) { * @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 ); + return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '"' . $html_class . $html_css_id . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $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 { @@ -535,7 +554,7 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters a locally uploaded avatar URL. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param string $avatar_url URL for a locally uploaded avatar. * @param array $params Array of parameters for the request. @@ -548,22 +567,22 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Filters whether or not to skip Gravatar check. * - * @since BuddyPress (1.5.0) + * @since 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 + // Set gravatar type. if ( empty( $bp->grav_default->{$params['object']} ) ) { $default_grav = 'wavatar'; } elseif ( 'mystery' == $bp->grav_default->{$params['object']} ) { /** - * Filters the Mysteryman avatar src value. + * Filters the Mystery person avatar src value. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Avatar value. * @param string $value Width to display avatar at. @@ -573,7 +592,7 @@ function bp_core_fetch_avatar( $args = '' ) { $default_grav = $bp->grav_default->{$params['object']}; } - // Set gravatar object + // Set gravatar object. if ( empty( $params['email'] ) ) { if ( 'user' == $params['object'] ) { $params['email'] = bp_core_get_user_email( $params['item_id'] ); @@ -582,12 +601,10 @@ function bp_core_fetch_avatar( $args = '' ) { } } - $host = '//www.gravatar.com/avatar/'; - /** * Filters the Gravatar email to use. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Email to use in Gravatar request. * @param string $value ID of the item being requested. @@ -596,20 +613,40 @@ function bp_core_fetch_avatar( $args = '' ) { $params['email'] = apply_filters( 'bp_core_gravatar_email', $params['email'], $params['item_id'], $params['object'] ); /** - * Filters the Gravatar URL path. + * Filters the Gravatar URL host. * - * @since BuddyPress (1.0.2) + * @since 1.0.2 * - * @param string $value Gravatar URL path. + * @param string $value Gravatar URL host. */ - $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $params['email'] ) ) . '?d=' . $default_grav . '&s=' . $params['width']; + $gravatar = apply_filters( 'bp_gravatar_url', '//www.gravatar.com/avatar/' ); + + // Append email hash to Gravatar. + $gravatar .= md5( strtolower( $params['email'] ) ); + + // Main Gravatar URL args. + $url_args = array( + 's' => $params['width'] + ); - // Gravatar rating; http://bit.ly/89QxZA - $rating = get_option( 'avatar_rating' ); - if ( ! empty( $rating ) ) { - $gravatar .= "&r={$rating}"; + // Custom Gravatar URL args. + if ( ! empty( $params['force_default'] ) ) { + $url_args['f'] = 'y'; + } + if ( ! empty( $params['rating'] ) ) { + $url_args['r'] = strtolower( $params['rating'] ); + } + // Only set default image if 'Gravatar Logo' is not requested. + if ( 'gravatar_default' !== $default_grav ) { + $url_args['d'] = $default_grav; } + // Set up the Gravatar URL. + $gravatar = esc_url( add_query_arg( + rawurlencode_deep( array_filter( $url_args ) ), + $gravatar + ) ); + // No avatar was found, and we've been told not to use a gravatar. } else { @@ -618,7 +655,7 @@ function bp_core_fetch_avatar( $args = '' ) { * * This is a variable filter dependent on the avatar type being requested. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Default avatar for non-gravatar requests. * @param array $params Array of parameters for the avatar request. @@ -629,7 +666,7 @@ function bp_core_fetch_avatar( $args = '' ) { 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 ); + return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '"' . $html_css_id . $html_class . $html_width . $html_height . $html_alt . $html_title . $extra_attr . ' />', $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 */ @@ -640,15 +677,18 @@ function bp_core_fetch_avatar( $args = '' ) { /** * Delete an existing avatar. * - * @param array $args { + * @since 1.1.0 + * + * @param array|string $args { * Array of function parameters. - * @type bool|int $item_id ID of the item whose avatar you're deleting. - * Defaults to the current item of type $object. - * @type string $object Object type of the item whose avatar you're - * deleting. 'user', 'group', 'blog', or custom. Default: 'user'. + * @type bool|int $item_id ID of the item whose avatar you're deleting. + * Defaults to the current item of type $object. + * @type string $object Object type of the item whose avatar you're + * deleting. 'user', 'group', 'blog', or custom. + * Default: 'user'. * @type bool|string $avatar_dir Subdirectory where avatar is located. - * Default: false, which falls back on the default location - * corresponding to the $object. + * Default: false, which falls back on the default location + * corresponding to the $object. * } * @return bool True on success, false on failure. */ @@ -656,13 +696,38 @@ function bp_core_delete_existing_avatar( $args = '' ) { $defaults = array( 'item_id' => false, - 'object' => 'user', // user OR group OR blog OR custom type (if you use filters) + 'object' => 'user', // User OR group OR blog OR custom type (if you use filters). 'avatar_dir' => false ); $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); + /** + * Filters whether or not to handle deleting an existing avatar. + * + * If you want to override this function, make sure you return false. + * + * @since 2.5.1 + * + * @param bool $value Whether or not to delete the avatar. + * @param array $args { + * Array of function parameters. + * + * @type bool|int $item_id ID of the item whose avatar you're deleting. + * Defaults to the current item of type $object. + * @type string $object Object type of the item whose avatar you're + * deleting. 'user', 'group', 'blog', or custom. + * Default: 'user'. + * @type bool|string $avatar_dir Subdirectory where avatar is located. + * Default: false, which falls back on the default location + * corresponding to the $object. + * } + */ + if ( ! apply_filters( 'bp_core_pre_delete_existing_avatar', true, $args ) ) { + return true; + } + if ( empty( $item_id ) ) { if ( 'user' == $object ) $item_id = bp_displayed_user_id(); @@ -710,7 +775,7 @@ function bp_core_delete_existing_avatar( $args = '' ) { /** * Fires after deleting an existing avatar. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $args Array of arguments used for avatar deletion. */ @@ -720,15 +785,15 @@ function bp_core_delete_existing_avatar( $args = '' ) { } /** - * Ajax delete an avatar for a given object and item id + * Ajax delete an avatar for a given object and item id. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return string a json object containing success data if the avatar was deleted - * error message otherwise + * @return string|null 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 + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { wp_send_json_error(); } @@ -744,15 +809,15 @@ function bp_avatar_ajax_delete() { $nonce = 'bp_group_avatar_delete'; } - // Check the nonce + // Check the nonce. check_admin_referer( $nonce, 'nonce' ); - // Capability check + // Capability check. if ( ! bp_attachments_current_user_can( 'edit_avatar', $avatar_data ) ) { wp_send_json_error(); } - // Handle delete + // 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( @@ -783,12 +848,13 @@ add_action( 'wp_ajax_bp_avatar_delete', 'bp_avatar_ajax_delete' ); * png). If everything checks out, crop the image and move it to its real * location. * + * @since 1.1.0 + * * @see bp_core_check_avatar_upload() * @see bp_core_check_avatar_type() * * @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 ) { @@ -798,7 +864,7 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { * * If you want to override this function, make sure you return false. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param bool $value Whether or not to crop. * @param array $file Appropriate entry from $_FILES superglobal. @@ -808,22 +874,30 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { return true; } - // Setup some variables + // Setup some variables. $bp = buddypress(); $upload_path = bp_core_avatar_upload_path(); - // Upload the file + // Upload the file. $avatar_attachment = new BP_Attachment_Avatar(); $bp->avatar_admin->original = $avatar_attachment->upload( $file, $upload_dir_filter ); - // In case of an error, stop the process and display a feedback to the user + // 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; } - // Maybe resize - $bp->avatar_admin->resized = $avatar_attachment->shrink( $bp->avatar_admin->original['file'] ); + // The Avatar UI available width. + $ui_available_width = 0; + + // Try to set the ui_available_width using the avatar_admin global. + if ( isset( $bp->avatar_admin->ui_available_width ) ) { + $ui_available_width = $bp->avatar_admin->ui_available_width; + } + + // Maybe resize. + $bp->avatar_admin->resized = $avatar_attachment->shrink( $bp->avatar_admin->original['file'], $ui_available_width ); $bp->avatar_admin->image = new stdClass(); // We only want to handle one image after resize. @@ -836,33 +910,33 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { @unlink( $bp->avatar_admin->original['file'] ); } - // Check for WP_Error on what should be an image + // 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; } - // If the uploaded image is smaller than the "full" dimensions, throw a warning + // 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' ); } - // Set the url value for the image + // Set the url value for the image. $bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir; return true; } /** - * Ajax upload an avatar + * Ajax upload an avatar. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return string a json object containing success data if the upload succeeded - * error message otherwise + * @return string|null A json object containing success data if the upload succeeded + * error message otherwise. */ function bp_avatar_ajax_upload() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { wp_die(); } @@ -876,25 +950,25 @@ function bp_avatar_ajax_upload() { $is_html4 = true; } - // Check the nonce + // Check the nonce. check_admin_referer( 'bp-uploader' ); - // Init the BuddyPress parameters + // Init the BuddyPress parameters. $bp_params = array(); - // We need it to carry on + // We need it to carry on. if ( ! empty( $_POST['bp_params' ] ) ) { $bp_params = $_POST['bp_params' ]; } else { bp_attachments_json_response( false, $is_html4 ); } - // We need the object to set the uploads dir filter + // We need the object to set the uploads dir filter. if ( empty( $bp_params['object'] ) ) { bp_attachments_json_response( false, $is_html4 ); } - // Capability check + // Capability check. if ( ! bp_attachments_current_user_can( 'edit_avatar', $bp_params ) ) { bp_attachments_json_response( false, $is_html4 ); } @@ -922,11 +996,11 @@ function bp_avatar_ajax_upload() { } } else { /** - * Filter here to deal with other components + * Filter here to deal with other components. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @var array $bp_params the BuddyPress Ajax parameters + * @var array $bp_params the BuddyPress Ajax parameters. */ $bp_params = apply_filters( 'bp_core_avatar_ajax_upload_params', $bp_params ); } @@ -935,10 +1009,18 @@ function bp_avatar_ajax_upload() { $bp->avatar_admin = new stdClass(); } - // Upload the avatar + /** + * The BuddyPress upload parameters is including the Avatar UI Available width, + * add it to the avatar_admin global for a later use. + */ + if ( isset( $bp_params['ui_available_width'] ) ) { + $bp->avatar_admin->ui_available_width = (int) $bp_params['ui_available_width']; + } + + // Upload the avatar. $avatar = bp_core_avatar_handle_upload( $_FILES, $bp_params['upload_dir_filter'] ); - // Reset objects + // Reset objects. if ( ! empty( $needs_reset ) ) { if ( ! empty( $needs_reset['component'] ) ) { $bp->{$needs_reset['component']}->{$needs_reset['key']} = $needs_reset['value']; @@ -947,7 +1029,7 @@ function bp_avatar_ajax_upload() { } } - // Init the feedback message + // Init the feedback message. $feedback_message = false; if ( ! empty( $bp->template_message ) ) { @@ -961,15 +1043,15 @@ function bp_avatar_ajax_upload() { } if ( empty( $avatar ) ) { - // Default upload error + // Default upload error. $message = __( 'Upload failed.', 'buddypress' ); - // Use the template message if set + // Use the template message if set. if ( ! empty( $feedback_message ) ) { $message = $feedback_message; } - // Upload error reply + // Upload error reply. bp_attachments_json_response( false, $is_html4, array( 'type' => 'upload_error', 'message' => $message, @@ -982,12 +1064,12 @@ function bp_avatar_ajax_upload() { $uploaded_image = @getimagesize( $bp->avatar_admin->image->file ); - // Set the name of the 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'] ) ) ) ); - // Finally return the avatar to the editor + // Finally return the avatar to the editor. bp_attachments_json_response( true, $is_html4, array( 'name' => $name, 'url' => $bp->avatar_admin->image->url, @@ -999,31 +1081,56 @@ function bp_avatar_ajax_upload() { 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. - */ + * Handle avatar webcam capture. + * + * @since 2.3.0 + * + * @param string $data Base64 encoded image. + * @param int $item_id Item to associate. + * @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; } + /** + * Filters whether or not to handle avatar webcam capture. + * + * If you want to override this function, make sure you return false. + * + * @since 2.5.1 + * + * @param bool $value Whether or not to crop. + * @param string $data Base64 encoded image. + * @param int $item_id Item to associate. + */ + if ( ! apply_filters( 'bp_avatar_pre_handle_capture', true, $data, $item_id ) ) { + return true; + } + $avatar_dir = bp_core_avatar_upload_path() . '/avatars'; - // It's not a regular upload, we may need to create this folder + // 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; } } + /** + * Filters the Avatar folder directory. + * + * @since 2.3.0 + * + * @param string $avatar_dir Directory for storing avatars. + * @param int $item_id ID of the item being acted on. + * @param string $value Avatar type. + * @param string $value Avatars word. + */ $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', $avatar_dir . '/' . $item_id, $item_id, 'user', 'avatars' ); - // It's not a regular upload, we may need to create this folder + // 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; @@ -1035,7 +1142,7 @@ function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { if ( file_put_contents( $original_file, $data ) ) { $avatar_to_crop = str_replace( bp_core_avatar_upload_path(), '', $original_file ); - // Crop to default values + // Crop to default values. $crop_args = array( 'item_id' => $item_id, 'original_file' => $avatar_to_crop, 'crop_x' => 0, 'crop_y' => 0 ); return bp_core_avatar_handle_crop( $crop_args ); @@ -1057,21 +1164,24 @@ function bp_avatar_handle_capture( $data = '', $item_id = 0 ) { * crop_x - The horizontal starting point of the crop * crop_y - The vertical starting point of the crop * - * @param array $args { + * @since 1.1.0 + * + * @param array|string $args { * Array of function parameters. - * @type string $object Object type of the item whose avatar you're - * handling. 'user', 'group', 'blog', or custom. Default: 'user'. - * @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 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(). - * @type int $crop_h Crop height. Default: the global 'full' avatar height, - * as retrieved by bp_core_avatar_full_height(). - * @type int $crop_x The horizontal starting point of the crop. Default: 0. - * @type int $crop_y The vertical starting point of the crop. Default: 0. + * + * @type string $object Object type of the item whose avatar you're + * handling. 'user', 'group', 'blog', or custom. + * Default: 'user'. + * @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 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(). + * @type int $crop_h Crop height. Default: the global 'full' avatar height, + * as retrieved by bp_core_avatar_full_height(). + * @type int $crop_x The horizontal starting point of the crop. Default: 0. + * @type int $crop_y The vertical starting point of the crop. Default: 0. * } * @return bool True on success, false on failure. */ @@ -1093,20 +1203,20 @@ function bp_core_avatar_handle_crop( $args = '' ) { * * If you want to override this function, make sure you return false. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param bool $value Whether or not to crop. - * @param array $r Array of parsed arguments for function + * @param array $r Array of parsed arguments for function. */ if ( ! apply_filters( 'bp_core_pre_avatar_handle_crop', true, $r ) ) { return true; } - // Crop the file + // Crop the file. $avatar_attachment = new BP_Attachment_Avatar(); $cropped = $avatar_attachment->crop( $r ); - // Check for errors + // Check for errors. if ( empty( $cropped['full'] ) || empty( $cropped['thumb'] ) || is_wp_error( $cropped['full'] ) || is_wp_error( $cropped['thumb'] ) ) { return false; } @@ -1115,20 +1225,20 @@ function bp_core_avatar_handle_crop( $args = '' ) { } /** - * Ajax set an avatar for a given object and item id + * Ajax set an avatar for a given object and item id. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return string a json object containing success data if the crop/capture succeeded - * error message otherwise + * @return string|null 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 + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { wp_send_json_error(); } - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_avatar_cropstore', 'nonce' ); $avatar_data = wp_parse_args( $_POST, array( @@ -1142,7 +1252,7 @@ function bp_avatar_ajax_set() { wp_send_json_error(); } - // Capability check + // Capability check. if ( ! bp_attachments_current_user_can( 'edit_avatar', $avatar_data ) ) { wp_send_json_error(); } @@ -1193,16 +1303,16 @@ function bp_avatar_ajax_set() { $original_file = str_replace( bp_core_avatar_url(), '', $avatar_data['original_file'] ); - // Set avatars dir & feedback part + // Set avatars dir & feedback part. if ( 'user' === $avatar_data['object'] ) { $avatar_dir = 'avatars'; - // Defaults to object-avatars dir + // Defaults to object-avatars dir. } else { $avatar_dir = sanitize_key( $avatar_data['object'] ) . '-avatars'; } - // Crop args + // Crop args. $r = array( 'item_id' => $avatar_data['item_id'], 'object' => $avatar_data['object'], @@ -1214,7 +1324,7 @@ function bp_avatar_ajax_set() { 'crop_y' => $avatar_data['crop_y'] ); - // Handle crop + // Handle crop. if ( bp_core_avatar_handle_crop( $r ) ) { $return = array( 'avatar' => html_entity_decode( bp_core_fetch_avatar( array( @@ -1254,23 +1364,27 @@ add_action( 'wp_ajax_bp_avatar_set', 'bp_avatar_ajax_set' ); /** * Replace default WordPress avatars with BP avatars, if available. * - * Filters 'get_avatar'. + * See 'get_avatar' filter description in wp-includes/pluggable.php. + * + * @since 1.1.0 + * @since 2.4.0 Added $args parameter to coincide with WordPress 4.2.0. * - * @param string $avatar The avatar path passed to 'get_avatar'. - * @param int|string|object $user A user ID, email address, or comment object. - * @param int $size Size of the avatar image ('thumb' or 'full'). - * @param string $default URL to a default image to use if no avatar is available. - * @param string $alt Alternate text to use in image tag. Default: ''. + * @param string $avatar The avatar path passed to 'get_avatar'. + * @param int|string|object $user A user ID, email address, or comment object. + * @param int $size Size of the avatar image ('thumb' or 'full'). + * @param string $default URL to a default image to use if no avatar is available. + * @param string $alt Alternate text to use in image tag. Default: ''. + * @param array $args Arguments passed to get_avatar_data(), after processing. * @return string BP avatar path, if found; else the original avatar path. */ -function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' ) { +function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '', $args = array() ) { global $pagenow; - // Do not filter if inside WordPress options page + // Do not filter if inside WordPress options page. if ( 'options-discussion.php' == $pagenow ) return $avatar; - // If passed an object, assume $user->user_id + // If passed an object, assume $user->user_id. if ( is_object( $user ) ) { if ( isset( $user->user_id ) ) { $id = $user->user_id; @@ -1278,21 +1392,21 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' $id = $user->ID; } - // If passed a number, assume it was a $user_id + // If passed a number, assume it was a $user_id. } elseif ( is_numeric( $user ) ) { $id = $user; - // If passed a string and that string returns a user, get the $id + // If passed a string and that string returns a user, get the $id. } elseif ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) ) { $id = $user_by_email->ID; } - // If somehow $id hasn't been assigned, return the result of get_avatar + // If somehow $id hasn't been assigned, return the result of get_avatar. if ( empty( $id ) ) { return !empty( $avatar ) ? $avatar : $default; } - // Image alt tag + // Image alt tag. if ( empty( $alt ) ) { $alt = sprintf( __( 'Profile photo of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) ); } @@ -1304,23 +1418,53 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' $type = 'full'; } - // Let BuddyPress handle the fetching of the avatar - $bp_avatar = bp_core_fetch_avatar( array( + $avatar_args = array( 'item_id' => $id, 'type' => $type, 'width' => $size, 'height' => $size, 'alt' => $alt, - ) ); + ); + + // Support new arguments as of WordPress 4.2.0. + if ( ! empty( $args['width'] ) ) { + $avatar_args['width'] = $args['width']; + } + if ( ! empty( $args['height'] ) ) { + $avatar_args['height'] = $args['height']; + } + if ( ! empty( $args['class'] ) ) { + $avatar_args['class'] = $args['class']; + } + if ( ! empty( $args['class'] ) ) { + $avatar_args['class'] = $args['class']; + } + if ( ! empty( $args['extra_attr'] ) ) { + $avatar_args['extra_attr'] = $args['extra_attr']; + } + if ( ! empty( $args['scheme'] ) ) { + $avatar_args['scheme'] = $args['scheme']; + } + if ( ! empty( $args['force_default'] ) ) { + $avatar_args['force_default'] = $args['force_default']; + } + if ( ! empty( $args['rating'] ) ) { + $avatar_args['rating'] = $args['rating']; + } + + // Let BuddyPress handle the fetching of the avatar. + $bp_avatar = bp_core_fetch_avatar( $avatar_args ); - // If BuddyPress found an avatar, use it. If not, use the result of get_avatar + // If BuddyPress found an avatar, use it. If not, use the result of get_avatar. return ( !$bp_avatar ) ? $avatar : $bp_avatar; } -add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 5 ); +add_filter( 'get_avatar', 'bp_core_fetch_avatar_filter', 10, 6 ); /** * Is the current avatar upload error-free? * + * @since 1.0.0 + * * @param array $file The $_FILES array. * @return bool True if no errors are found. False if there are errors. */ @@ -1334,6 +1478,8 @@ function bp_core_check_avatar_upload( $file ) { /** * Is the file size of the current avatar upload permitted? * + * @since 1.0.0 + * * @param array $file The $_FILES array. * @return bool True if the avatar is under the size limit, otherwise false. */ @@ -1345,50 +1491,40 @@ function bp_core_check_avatar_size( $file ) { } /** - * Get allowed avatar types + * Get allowed avatar types. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_core_get_allowed_avatar_types() { - $allowed_types = array( 'jpeg', 'gif', 'png' ); + $allowed_types = bp_attachments_get_allowed_types( 'avatar' ); /** - * 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 ); + * Filters the list of allowed image types. + * + * @since 2.3.0 + * + * @param array $allowed_types 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 + * Get allowed avatar mime types. * - * @since BuddyPress (2.3.0) + * @since 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; + return bp_attachments_get_allowed_mimes( 'avatar', $allowed_types ); } /** @@ -1396,26 +1532,22 @@ function bp_core_get_allowed_avatar_mimes() { * * Permitted file types are JPG, GIF and PNG. * + * @since 1.0.0 + * * @param array $file The $_FILES array. * @return bool True if the file extension is permitted, otherwise 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() ); - - if ( ! empty( $avatar_filetype['ext'] ) && ! empty( $avatar_filetype['type'] ) ) { - return true; - } - - return false; + return bp_attachments_check_filetype( $file['file']['tmp_name'], $file['file']['name'], bp_core_get_allowed_avatar_mimes() ); } /** * Fetch data from the BP root blog's upload directory. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * - * @param string $type The variable we want to return from the $bp->avatars - * object. Only 'upload_path' and 'url' are supported. Default: 'upload_path'. + * @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. */ function bp_core_get_upload_dir( $type = 'upload_path' ) { @@ -1440,30 +1572,30 @@ function bp_core_get_upload_dir( $type = 'upload_path' ) { break; } - // See if the value has already been calculated and stashed in the $bp global + // See if the value has already been calculated and stashed in the $bp global. if ( isset( $bp->avatar->$type ) ) { $retval = $bp->avatar->$type; } else { - // If this value has been set in a constant, just use that + // If this value has been set in a constant, just use that. if ( defined( $constant ) ) { $retval = constant( $constant ); } else { - // Use cached upload dir data if available + // Use cached upload dir data if available. if ( ! empty( $bp->avatar->upload_dir ) ) { $upload_dir = $bp->avatar->upload_dir; - // No cache, so query for it + // No cache, so query for it. } else { - // Get upload directory information from current site + // Get upload directory information from current site. $upload_dir = bp_upload_dir(); - // Stash upload directory data for later use + // Stash upload directory data for later use. $bp->avatar->upload_dir = $upload_dir; } - // Directory does not exist and cannot be created + // Directory does not exist and cannot be created. if ( ! empty( $upload_dir['error'] ) ) { $retval = ''; @@ -1479,7 +1611,7 @@ function bp_core_get_upload_dir( $type = 'upload_path' ) { } - // Stash in $bp for later use + // Stash in $bp for later use. $bp->avatar->$type = $retval; } @@ -1489,7 +1621,9 @@ function bp_core_get_upload_dir( $type = 'upload_path' ) { /** * Get the absolute upload path for the WP installation. * - * @uses bp_core_get_upload_dir() To get upload directory info + * @since 1.2.0 + * + * @uses bp_core_get_upload_dir() To get upload directory info. * * @return string Absolute path to WP upload directory. */ @@ -1498,7 +1632,7 @@ function bp_core_avatar_upload_path() { /** * Filters the absolute upload path for the WP installation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Absolute upload path for the WP installation. */ @@ -1508,6 +1642,8 @@ function bp_core_avatar_upload_path() { /** * Get the raw base URL for root site upload location. * + * @since 1.2.0 + * * @uses bp_core_get_upload_dir() To get upload directory info. * * @return string Full URL to current upload location. @@ -1517,7 +1653,7 @@ function bp_core_avatar_url() { /** * Filters the raw base URL for root site upload location. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Raw base URL for the root site upload location. */ @@ -1527,7 +1663,7 @@ function bp_core_avatar_url() { /** * Check if a given user ID has an uploaded avatar. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user whose avatar is being checked. * @return bool True if the user has uploaded a local avatar. Otherwise false. @@ -1544,7 +1680,7 @@ function bp_get_user_has_avatar( $user_id = 0 ) { /** * Filters whether or not a user has an uploaded avatar. * - * @since BuddyPress (1.6.0) + * @since 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. @@ -1555,13 +1691,13 @@ function bp_get_user_has_avatar( $user_id = 0 ) { /** * Utility function for fetching an avatar dimension setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $type Dimension type you're fetching dimensions for. 'thumb' - * or 'full'. Default: 'thumb'. + * @param string $type Dimension type you're fetching dimensions for. 'thumb' + * or 'full'. Default: 'thumb'. * @param string $h_or_w Which dimension is being fetched. 'height' or 'width'. - * Default: 'height'. - * @return int $dim The dimension. + * Default: 'height'. + * @return int|bool $dim The dimension. */ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { $bp = buddypress(); @@ -1570,11 +1706,11 @@ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { /** * Filters the avatar dimension setting. * - * @since BuddyPress (1.5.0) + * @since 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'. + * @param int|bool $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 ); } @@ -1582,7 +1718,7 @@ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { /** * Get the 'thumb' avatar width setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The 'thumb' width. */ @@ -1591,7 +1727,7 @@ function bp_core_avatar_thumb_width() { /** * Filters the 'thumb' avatar width setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the 'thumb' avatar width setting. */ @@ -1601,7 +1737,7 @@ function bp_core_avatar_thumb_width() { /** * Get the 'thumb' avatar height setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The 'thumb' height. */ @@ -1610,7 +1746,7 @@ function bp_core_avatar_thumb_height() { /** * Filters the 'thumb' avatar height setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the 'thumb' avatar height setting. */ @@ -1618,9 +1754,9 @@ function bp_core_avatar_thumb_height() { } /** - * Get the 'full' avatar width setting + * Get the 'full' avatar width setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The 'full' width. */ @@ -1629,7 +1765,7 @@ function bp_core_avatar_full_width() { /** * Filters the 'full' avatar width setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the 'full' avatar width setting. */ @@ -1639,7 +1775,7 @@ function bp_core_avatar_full_width() { /** * Get the 'full' avatar height setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The 'full' height. */ @@ -1648,7 +1784,7 @@ function bp_core_avatar_full_height() { /** * Filters the 'full' avatar height setting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the 'full' avatar height setting. */ @@ -1658,7 +1794,7 @@ function bp_core_avatar_full_height() { /** * Get the max width for original avatar uploads. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The max width for original avatar uploads. */ @@ -1667,7 +1803,7 @@ function bp_core_avatar_original_max_width() { /** * Filters the max width for original avatar uploads. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the max width. */ @@ -1677,7 +1813,7 @@ function bp_core_avatar_original_max_width() { /** * Get the max filesize for original avatar uploads. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The max filesize for original avatar uploads. */ @@ -1686,7 +1822,7 @@ function bp_core_avatar_original_max_filesize() { /** * Filters the max filesize for original avatar uploads. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value for the max filesize. */ @@ -1696,23 +1832,23 @@ function bp_core_avatar_original_max_filesize() { /** * Get the URL of the 'full' default avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $type 'local' if the fallback should be the locally-hosted - * version of the mystery-man, 'gravatar' if the fallback should be - * Gravatar's version. Default: 'gravatar'. + * @param string $type 'local' if the fallback should be the locally-hosted version + * of the mystery-person, 'gravatar' if the fallback should be + * Gravatar's version. Default: 'gravatar'. * @return string The URL of the default avatar. */ function bp_core_avatar_default( $type = 'gravatar' ) { - // Local override + // Local override. if ( defined( 'BP_AVATAR_DEFAULT' ) ) { $avatar = BP_AVATAR_DEFAULT; - // Use the local default image + // Use the local default image. } elseif ( 'local' === $type ) { $avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man.jpg'; - // Use Gravatar's mystery man as fallback + // Use Gravatar's mystery person as fallback. } else { $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' . bp_core_avatar_full_width(); } @@ -1720,7 +1856,7 @@ function bp_core_avatar_default( $type = 'gravatar' ) { /** * Filters the URL of the 'full' default avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $avatar URL of the default avatar. */ @@ -1730,26 +1866,26 @@ function bp_core_avatar_default( $type = 'gravatar' ) { /** * Get the URL of the 'thumb' default avatar. * - * Uses Gravatar's mystery-man avatar, unless BP_AVATAR_DEFAULT_THUMB has been + * Uses Gravatar's mystery-person avatar, unless BP_AVATAR_DEFAULT_THUMB has been * defined. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $type 'local' if the fallback should be the locally-hosted - * version of the mystery-man, 'gravatar' if the fallback should be - * Gravatar's version. Default: 'gravatar'. + * @param string $type 'local' if the fallback should be the locally-hosted version + * of the mystery-person, 'gravatar' if the fallback should be + * Gravatar's version. Default: 'gravatar'. * @return string The URL of the default avatar thumb. */ function bp_core_avatar_default_thumb( $type = 'gravatar' ) { - // Local override + // Local override. if ( defined( 'BP_AVATAR_DEFAULT_THUMB' ) ) { $avatar = BP_AVATAR_DEFAULT_THUMB; - // Use the local default image + // Use the local default image. } elseif ( 'local' === $type ) { $avatar = buddypress()->plugin_url . 'bp-core/images/mystery-man-50.jpg'; - // Use Gravatar's mystery man as fallback + // Use Gravatar's mystery person as fallback. } else { $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' . bp_core_avatar_thumb_width(); } @@ -1757,7 +1893,7 @@ function bp_core_avatar_default_thumb( $type = 'gravatar' ) { /** * Filters the URL of the 'thumb' default avatar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $avatar URL of the default avatar. */ @@ -1765,42 +1901,43 @@ function bp_core_avatar_default_thumb( $type = 'gravatar' ) { } /** - * Reset the week parameter of the WordPress main query if needed + * 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 + * notices, we need to make sure this 'week' query var is reset to 0. * - * @since BuddyPress (2.2.0) + * @since 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 + * + * @param WP_Query|null $posts_query The main query object. */ function bp_core_avatar_reset_query( $posts_query = null ) { $reset_w = false; - // Group's avatar edit screen + // 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 + // Group's avatar create screen. } elseif ( bp_is_group_create() ) { /** - * we can't use bp_get_groups_current_create_step() + * 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 + // User's change avatar screen. } else { $reset_w = bp_is_user_change_avatar(); } - // A user or a group is cropping an avatar + // A user or a group is cropping an avatar. if ( true === $reset_w && isset( $_POST['avatar-crop-submit'] ) ) { $posts_query->set( 'w', 0 ); } @@ -1808,11 +1945,11 @@ function bp_core_avatar_reset_query( $posts_query = null ) { add_action( 'bp_parse_query', 'bp_core_avatar_reset_query', 10, 1 ); /** - * Checks whether Avatar UI should be loaded + * Checks whether Avatar UI should be loaded. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return bool True if Avatar UI should load, false otherwise + * @return bool True if Avatar UI should load, false otherwise. */ function bp_avatar_is_front_edit() { $retval = false; @@ -1827,11 +1964,11 @@ function bp_avatar_is_front_edit() { } if ( bp_is_active( 'groups' ) ) { - // Group creation + // 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 + // 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(); } @@ -1842,24 +1979,25 @@ function bp_avatar_is_front_edit() { * - 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) + * @since 2.3.0 * - * @var bool whether to load the Avatar UI + * @param bool $retval Whether or not to load the Avatar UI. */ return apply_filters( 'bp_avatar_is_front_edit', $retval ); } /** - * Checks whether the Webcam Avatar UI part should be loaded + * Checks whether the Webcam Avatar UI part should be loaded. * - * @since BuddyPress (2.3.0) + * @since 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; + global $is_safari, $is_IE, $is_chrome; /** * Do not use the webcam feature for mobile devices @@ -1874,7 +2012,7 @@ function bp_avatar_use_webcam() { * * @see http://caniuse.com/#feat=stream */ - if ( $is_safari || $is_IE ) { + if ( $is_safari || $is_IE || ( $is_chrome && ! is_ssl() ) ) { return false; } @@ -1882,17 +2020,17 @@ function bp_avatar_use_webcam() { * Use this filter if you need to disable the webcam capture feature * by returning false. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @var bool whether to load Webcam Avatar UI part + * @param bool $value Whether or not to load Webcam Avatar UI part. */ return apply_filters( 'bp_avatar_use_webcam', true ); } /** - * Template function to load the Avatar UI javascript templates + * Template function to load the Avatar UI javascript templates. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_avatar_get_templates() { if ( ! bp_avatar_is_front_edit() ) { @@ -1903,12 +2041,12 @@ function bp_avatar_get_templates() { } /** - * Trick to check if the theme's BuddyPress templates are up to date + * 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) + * @since 2.3.0 */ function bp_avatar_template_check() { if ( ! bp_avatar_is_front_edit() ) { 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 ca87d9a123cbec5114b380be29e53bcd8f9ef639..9f1ffb08b1ba130fcf4894619eda5c70d51d00c5 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php @@ -1,201 +1,335 @@ <?php - /** * Core BuddyPress Navigational Functions. * * @package BuddyPress * @subpackage Core + * @since 1.5.0 + * * @todo Deprecate BuddyBar functions. */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Add an item to the main BuddyPress navigation array. * - * @param array $args { + * @since 1.1.0 + * + * @param array|string $args { * Array describing the new nav item. - * @type string $name Display name for the nav item. - * @type string $slug Unique URL slug for the nav item. - * @type bool|string $item_css_id Optional. 'id' attribute for the nav - * item. Default: the value of $slug. - * @type bool $show_for_displayed_user Optional. Whether the nav item - * should be visible when viewing a member profile other than your - * own. Default: true. - * @type bool $site_admin_only Optional. Whether the nav item should be - * visible only to site admins (those with the 'bp_moderate' cap). - * Default: false. - * @type int $position Optional. Numerical index specifying where the item - * should appear in the nav array. Default: 99. - * @type callable $screen_function The callback function that will run - * when the nav item is clicked. - * @type bool|string $default_subnav_slug Optional. The slug of the default - * subnav item to select when the nav item is clicked. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. * } * @return bool|null Returns false on failure. */ function bp_core_new_nav_item( $args = '' ) { + + $defaults = array( + 'name' => false, // Display name for the nav item. + 'slug' => false, // URL slug for the nav item. + 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item. + 'show_for_displayed_user' => true, // When viewing another user does this nav item show up? + 'site_admin_only' => false, // Can only site admins see this nav item? + 'position' => 99, // Index of where this nav item should be positioned. + 'screen_function' => false, // The name of the function to run when clicked. + 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. + ); + + $r = wp_parse_args( $args, $defaults ); + + // First, add the nav item link to the bp_nav array. + $created = bp_core_create_nav_link( $r ); + + // To mimic the existing behavior, if bp_core_create_nav_link() + // returns false, we make an early exit and don't attempt to register + // the screen function. + if ( false === $created ) { + return false; + } + + // Then, hook the screen function for the added nav item. + $hooked = bp_core_register_nav_screen_function( $r ); + if ( false === $hooked ){ + return false; + } + + /** + * Fires after adding an item to the main BuddyPress navigation array. + * Note that, when possible, the more specific action hooks + * `bp_core_create_nav_link` or `bp_core_register_nav_screen_function` + * should be used. + * + * @since 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 ); +} + +/** + * Add a link to the main BuddyPress navigation array. + * + * @since 2.4.0 + * + * @param array|string $args { + * Array describing the new nav item. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. + * } + * @return bool|null Returns false on failure. + */ +function bp_core_create_nav_link( $args = '' ) { $bp = buddypress(); $defaults = array( - 'name' => false, // Display name for the nav item - 'slug' => false, // URL slug for the nav item - 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item + 'name' => false, // Display name for the nav item. + 'slug' => false, // URL slug for the nav item. + 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item. 'show_for_displayed_user' => true, // When viewing another user does this nav item show up? 'site_admin_only' => false, // Can only site admins see this nav item? - 'position' => 99, // Index of where this nav item should be positioned - 'screen_function' => false, // The name of the function to run when clicked - 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked + 'position' => 99, // Index of where this nav item should be positioned. + 'screen_function' => false, // The name of the function to run when clicked. + 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. ); $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); - // If we don't have the required info we need, don't create this subnav item - if ( empty( $name ) || empty( $slug ) ) + // If we don't have the required info we need, don't create this nav item. + if ( empty( $r['name'] ) || empty( $r['slug'] ) ) { return false; + } - // If this is for site admins only and the user is not one, don't create the subnav item - if ( !empty( $site_admin_only ) && !bp_current_user_can( 'bp_moderate' ) ) + // If this is for site admins only and the user is not one, don't create the nav item. + if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) { return false; + } + + if ( empty( $r['item_css_id'] ) ) { + $r['item_css_id'] = $r['slug']; + } + + $bp->bp_nav[$r['slug']] = array( + 'name' => $r['name'], + 'slug' => $r['slug'], + 'link' => trailingslashit( bp_loggedin_user_domain() . $r['slug'] ), + 'css_id' => $r['item_css_id'], + 'show_for_displayed_user' => $r['show_for_displayed_user'], + 'position' => $r['position'], + 'screen_function' => &$r['screen_function'], + 'default_subnav_slug' => $r['default_subnav_slug'] + ); - if ( empty( $item_css_id ) ) - $item_css_id = $slug; - - $bp->bp_nav[$slug] = array( - 'name' => $name, - 'slug' => $slug, - 'link' => trailingslashit( bp_loggedin_user_domain() . $slug ), - 'css_id' => $item_css_id, - 'show_for_displayed_user' => $show_for_displayed_user, - 'position' => $position, - 'screen_function' => &$screen_function, - 'default_subnav_slug' => $default_subnav_slug + /** + * Fires after a link is added to the main BuddyPress navigation array. + * + * @since 2.4.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_create_nav_link', $r, $args, $defaults ); +} + +/** + * Register a screen function for an item in the main nav array. + * + * @since 2.4.0 + * + * @param array|string $args { + * Array describing the new nav item. + * @type string $name Display name for the nav item. + * @type string $slug Unique URL slug for the nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $show_for_displayed_user Optional. Whether the nav item should be visible when viewing a + * member profile other than your own. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in + * the nav array. Default: 99. + * @type callable $screen_function The callback function that will run when the nav item is clicked. + * @type bool|string $default_subnav_slug Optional. The slug of the default subnav item to select when the nav + * item is clicked. + * } + * @return bool|null Returns false on failure. + */ +function bp_core_register_nav_screen_function( $args = '' ) { + $bp = buddypress(); + + $defaults = array( + 'name' => false, // Display name for the nav item. + 'slug' => false, // URL slug for the nav item. + 'item_css_id' => false, // The CSS ID to apply to the HTML of the nav item. + 'show_for_displayed_user' => true, // When viewing another user does this nav item show up? + 'site_admin_only' => false, // Can only site admins see this nav item? + 'position' => 99, // Index of where this nav item should be positioned. + 'screen_function' => false, // The name of the function to run when clicked. + 'default_subnav_slug' => false // The slug of the default subnav item to select when clicked. ); - /** + $r = wp_parse_args( $args, $defaults ); + + // If we don't have the required info we need, don't register this screen function. + if ( empty( $r['slug'] ) ) { + return false; + } + + /** + * If this is for site admins only and the user is not one, + * don't register this screen function. + */ + if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) { + return false; + } + + /** * If this nav item is hidden for the displayed user, and * the logged in user is not the displayed user - * looking at their own profile, don't create the nav item. + * looking at their own profile, don't don't register this screen function. */ - if ( empty( $show_for_displayed_user ) && !bp_user_has_access() ) + if ( empty( $r['show_for_displayed_user'] ) && ! bp_user_has_access() ) { return false; + } /** - * If the nav item is visible, we are not viewing a user, and this is a root + * If the nav item is visible, we are not viewing a user, and this is a root * component, don't attach the default subnav function so we can display a * directory or something else. - */ - if ( ( -1 != $position ) && bp_is_root_component( $slug ) && !bp_displayed_user_id() ) + */ + if ( ( -1 != $r['position'] ) && bp_is_root_component( $r['slug'] ) && ! bp_displayed_user_id() ) { return; + } - // Look for current component - if ( bp_is_current_component( $slug ) || bp_is_current_item( $slug ) ) { + // Look for current component. + if ( bp_is_current_component( $r['slug'] ) || bp_is_current_item( $r['slug'] ) ) { // The requested URL has explicitly included the default subnav // (eg: http://example.com/members/membername/activity/just-me/) // The canonical version will not contain this subnav slug. - if ( !empty( $default_subnav_slug ) && bp_is_current_action( $default_subnav_slug ) && !bp_action_variable( 0 ) ) { + if ( ! empty( $r['default_subnav_slug'] ) && bp_is_current_action( $r['default_subnav_slug'] ) && ! bp_action_variable( 0 ) ) { unset( $bp->canonical_stack['action'] ); } elseif ( ! bp_current_action() ) { - // Add our screen hook if screen function is callable - if ( is_callable( $screen_function ) ) { - add_action( 'bp_screens', $screen_function, 3 ); + // Add our screen hook if screen function is callable. + if ( is_callable( $r['screen_function'] ) ) { + add_action( 'bp_screens', $r['screen_function'], 3 ); } - if ( !empty( $default_subnav_slug ) ) { + if ( ! empty( $r['default_subnav_slug'] ) ) { /** * Filters the default component subnav item. * - * @since BuddyPress (1.5.0) + * @since 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. + * @param string $value 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 ); + $bp->current_action = apply_filters( 'bp_default_component_subnav', $r['default_subnav_slug'], $r ); } } } /** - * Fires after adding an item to the main BuddyPress navigation array. + * Fires after the screen function for an item in the BuddyPress main + * navigation is registered. * - * @since BuddyPress (1.5.0) + * @since 2.4.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 ); + do_action( 'bp_core_register_nav_screen_function', $r, $args, $defaults ); } /** * Modify the default subnav item that loads when a top level nav item is clicked. * - * @param array $args { - * @type string $parent_slug The slug of the nav item whose default is - * being changed. - * @type callable $screen_function The new default callback function that - * will run when the nav item is clicked. - * @type string $subnav_slug The slug of the new default subnav item. + * @since 1.1.0 + * + * @param array|string $args { + * @type string $parent_slug The slug of the nav item whose default is being changed. + * @type callable $screen_function The new default callback function that will run when the nav item is clicked. + * @type string $subnav_slug The slug of the new default subnav item. * } */ function bp_core_new_nav_default( $args = '' ) { $bp = buddypress(); $defaults = array( - 'parent_slug' => false, // Slug of the parent - 'screen_function' => false, // The name of the function to run when clicked - 'subnav_slug' => false // The slug of the subnav item to select when clicked + 'parent_slug' => false, // Slug of the parent. + 'screen_function' => false, // The name of the function to run when clicked. + 'subnav_slug' => false // The slug of the subnav item to select when clicked. ); $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); - if ( $function = $bp->bp_nav[$parent_slug]['screen_function'] ) { - // Remove our screen hook if screen function is callable + if ( $function = $bp->bp_nav[$r['parent_slug']]['screen_function'] ) { + // Remove our screen hook if screen function is callable. if ( is_callable( $function ) ) { remove_action( 'bp_screens', $function, 3 ); } } - $bp->bp_nav[$parent_slug]['screen_function'] = &$screen_function; + $bp->bp_nav[$r['parent_slug']]['screen_function'] = &$r['screen_function']; - if ( bp_is_current_component( $parent_slug ) ) { + if ( bp_is_current_component( $r['parent_slug'] ) ) { // The only way to tell whether to set the subnav is to peek at the unfiltered_uri - // Find the component - $component_uri_key = array_search( $parent_slug, $bp->unfiltered_uri ); + // Find the component. + $component_uri_key = array_search( $r['parent_slug'], $bp->unfiltered_uri ); if ( false !== $component_uri_key ) { - if ( !empty( $bp->unfiltered_uri[$component_uri_key + 1] ) ) { + if ( ! empty( $bp->unfiltered_uri[$component_uri_key + 1] ) ) { $unfiltered_action = $bp->unfiltered_uri[$component_uri_key + 1]; } } - // No subnav item has been requested in the URL, so set a new nav default + // No subnav item has been requested in the URL, so set a new nav default. if ( empty( $unfiltered_action ) ) { - if ( !bp_is_current_action( $subnav_slug ) ) { - if ( is_callable( $screen_function ) ) { - add_action( 'bp_screens', $screen_function, 3 ); + if ( ! bp_is_current_action( $r['subnav_slug'] ) ) { + if ( is_callable( $r['screen_function'] ) ) { + add_action( 'bp_screens', $r['screen_function'], 3 ); } - $bp->current_action = $subnav_slug; + $bp->current_action = $r['subnav_slug']; unset( $bp->canonical_stack['action'] ); } // The URL is explicitly requesting the new subnav item, but should be - // directed to the canonical URL - } elseif ( $unfiltered_action == $subnav_slug ) { + // directed to the canonical URL. + } elseif ( $unfiltered_action == $r['subnav_slug'] ) { unset( $bp->canonical_stack['action'] ); // In all other cases (including the case where the original subnav item // is explicitly called in the URL), the canonical URL will contain the - // subnav slug + // subnav slug. } else { $bp->canonical_stack['action'] = bp_current_action(); } @@ -210,24 +344,27 @@ 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. * + * @since 1.0.0 + * * @return bool|null Returns false on failure. */ function bp_core_sort_nav_items() { $bp = buddypress(); - if ( empty( $bp->bp_nav ) || !is_array( $bp->bp_nav ) ) + if ( empty( $bp->bp_nav ) || ! is_array( $bp->bp_nav ) ) { return false; + } $temp = array(); foreach ( (array) $bp->bp_nav as $slug => $nav_item ) { - if ( empty( $temp[$nav_item['position']]) ) { + if ( empty( $temp[$nav_item['position']] ) ) { $temp[$nav_item['position']] = $nav_item; } else { - // increase numbers here to fit new items in. + // Increase numbers here to fit new items in. do { $nav_item['position']++; - } while ( !empty( $temp[$nav_item['position']] ) ); + } while ( ! empty( $temp[$nav_item['position']] ) ); $temp[$nav_item['position']] = $nav_item; } @@ -242,116 +379,215 @@ add_action( 'admin_head', 'bp_core_sort_nav_items' ); /** * Add a subnav item to the BuddyPress navigation. * - * @param array $args { + * @since 1.1.0 + * + * @param array|string $args { * Array describing the new subnav item. - * @type string $name Display name for the subnav item. - * @type string $slug Unique URL slug for the subnav item. - * @type string $parent_slug Slug of the top-level nav item under which the - * new subnav item should be added. - * @type string $parent_url URL of the parent nav item. - * @type bool|string $item_css_id Optional. 'id' attribute for the nav - * item. Default: the value of $slug. - * @type bool $user_has_access Optional. True if the logged-in user has - * access to the subnav item, otherwise false. Can be set dynamically - * when registering the subnav; eg, use bp_is_my_profile() to restrict - * access to profile owners only. Default: true. - * @type bool $site_admin_only Optional. Whether the nav item should be - * visible only to site admins (those with the 'bp_moderate' cap). - * Default: false. - * @type int $position Optional. Numerical index specifying where the item - * should appear in the subnav array. Default: 90. - * @type callable $screen_function The callback function that will run - * 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. + * @type string $name Display name for the subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the new subnav item should + * be added. + * @type string $parent_url URL of the parent nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav item. Default: the value of `$slug`. + * @type bool $user_has_access Optional. True if the logged-in user has access to the subnav item, + * otherwise false. Can be set dynamically when registering the subnav; + * eg, use `bp_is_my_profile()` to restrict access to profile owners only. + * Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only to site admins + * (those with the 'bp_moderate' cap). Default: false. + * @type int $position Optional. Numerical index specifying where the item should appear in the + * subnav array. Default: 90. + * @type callable $screen_function The callback function that will run 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 = '' ) { + + // First, add the subnav item link to the bp_options_nav array. + $created = bp_core_create_subnav_link( $args ); + + // To mimic the existing behavior, if bp_core_create_subnav_link() + // returns false, we make an early exit and don't attempt to register + // the screen function. + if ( false === $created ) { + return false; + } + + // Then, hook the screen function for the added subnav item. + $hooked = bp_core_register_subnav_screen_function( $args ); + if ( false === $hooked ) { + return false; + } +} + +/** + * Add a subnav link to the BuddyPress navigation. + * + * @since 2.4.0 + * + * @param array|string $args { + * Array describing the new subnav item. + * @type string $name Display name for the subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the + * new subnav item should be added. + * @type string $parent_url URL of the parent nav item. + * @type bool|string $item_css_id Optional. 'id' attribute for the nav + * item. Default: the value of $slug. + * @type bool $user_has_access Optional. True if the logged-in user has access to the + * subnav item, otherwise false. Can be set dynamically + * when registering the subnav; eg, use bp_is_my_profile() + * to restrict access to profile owners only. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible only + * to site admins (those with the 'bp_moderate' cap). + * Default: false. + * @type int $position Optional. Numerical index specifying where the item + * should appear in the subnav array. Default: 90. + * @type callable $screen_function The callback function that will run + * 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_create_subnav_link( $args = '' ) { $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 + '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 + '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 + 'show_in_admin_bar' => false, // Show the Manage link in the current group's "Edit" Admin Bar menu. ) ); - extract( $r, EXTR_SKIP ); - - // If we don't have the required info we need, don't create this subnav item - if ( empty( $name ) || empty( $slug ) || empty( $parent_slug ) || empty( $parent_url ) || empty( $screen_function ) ) + // If we don't have the required info we need, don't create this subnav item. + if ( empty( $r['name'] ) || empty( $r['slug'] ) || empty( $r['parent_slug'] ) || empty( $r['parent_url'] ) || empty( $r['screen_function'] ) ) return false; - // Link was not forced, so create one - if ( empty( $link ) ) { - $link = trailingslashit( $parent_url . $slug ); + // Link was not forced, so create one. + if ( empty( $r['link'] ) ) { + $r['link'] = trailingslashit( $r['parent_url'] . $r['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 = trailingslashit( $parent_url ); + // If this sub item is the default for its parent, skip the slug. + if ( ! empty( $bp->bp_nav[$r['parent_slug']]['default_subnav_slug'] ) && $r['slug'] == $bp->bp_nav[$r['parent_slug']]['default_subnav_slug'] ) { + $r['link'] = trailingslashit( $r['parent_url'] ); } } - // If this is for site admins only and the user is not one, don't create the subnav item - if ( !empty( $site_admin_only ) && !bp_current_user_can( 'bp_moderate' ) ) + // If this is for site admins only and the user is not one, don't create the subnav item. + if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) { return false; + } - if ( empty( $item_css_id ) ) - $item_css_id = $slug; + if ( empty( $r['item_css_id'] ) ) { + $r['item_css_id'] = $r['slug']; + } $subnav_item = array( - '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, + 'name' => $r['name'], + 'link' => $r['link'], + 'slug' => $r['slug'], + 'css_id' => $r['item_css_id'], + 'position' => $r['position'], + 'user_has_access' => $r['user_has_access'], + 'no_access_url' => $r['no_access_url'], + 'screen_function' => &$r['screen_function'], 'show_in_admin_bar' => (bool) $r['show_in_admin_bar'], ); - $bp->bp_options_nav[$parent_slug][$slug] = $subnav_item; + $bp->bp_options_nav[$r['parent_slug']][$r['slug']] = $subnav_item; +} + +/** + * Register a screen function, whether or not a related subnav link exists. + * + * @since 2.4.0 + * + * @param array|string $args { + * Array describing the new subnav item. + * @type string $slug Unique URL slug for the subnav item. + * @type string $parent_slug Slug of the top-level nav item under which the + * new subnav item should be added. + * @type string $parent_url URL of the parent nav item. + * @type bool $user_has_access Optional. True if the logged-in user has access to the + * subnav item, otherwise false. Can be set dynamically + * when registering the subnav; eg, use bp_is_my_profile() + * to restrict access to profile owners only. Default: true. + * @type bool $site_admin_only Optional. Whether the nav item should be visible + * only to site admins (those with the 'bp_moderate' cap). + * Default: false. + * @type int $position Optional. Numerical index specifying where the item + * should appear in the subnav array. Default: 90. + * @type callable $screen_function The callback function that will run + * 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_register_subnav_screen_function( $args = '' ) { + $bp = buddypress(); + + $r = wp_parse_args( $args, array( + 'slug' => false, // URL slug for the screen. + 'parent_slug' => false, // URL slug of the parent screen. + 'user_has_access' => true, // Can the user visit this screen? + 'no_access_url' => '', + 'site_admin_only' => false, // Can only site admins visit this screen? + 'screen_function' => false, // The name of the function to run when clicked. + ) ); /** - * The last step is to hook the screen function for the added subnav item. But this only - * needs to be done if this subnav item is the current view, and the user has access to the - * subnav item. We figure out whether we're currently viewing this subnav by checking the - * following two conditions: + * Hook the screen function for the added subnav item. But this only needs to + * be done if this subnav item is the current view, and the user has access to the + * subnav item. We figure out whether we're currently viewing this subnav by + * checking the following two conditions: * (1) Either: - * (a) the parent slug matches the current_component, or - * (b) the parent slug matches the current_item + * (a) the parent slug matches the current_component, or + * (b) the parent slug matches the current_item * (2) And either: - * (a) the current_action matches $slug, or + * (a) the current_action matches $slug, or * (b) there is no current_action (ie, this is the default subnav for the parent nav) - * and this subnav item is the default for the parent item (which we check by - * comparing this subnav item's screen function with the screen function of the - * parent nav item in $bp->bp_nav). This condition only arises when viewing a - * user, since groups should always have an action set. + * and this subnav item is the default for the parent item (which we check by + * comparing this subnav item's screen function with the screen function of the + * parent nav item in $bp->bp_nav). This condition only arises when viewing a + * user, since groups should always have an action set. */ - // If we *don't* meet condition (1), return - if ( ! bp_is_current_component( $parent_slug ) && ! bp_is_current_item( $parent_slug ) ) + // If we *don't* meet condition (1), return. + if ( ! bp_is_current_component( $r['parent_slug'] ) && ! bp_is_current_item( $r['parent_slug'] ) ) { return; + } - // If we *do* meet condition (2), then the added subnav item is currently being requested - if ( ( bp_current_action() && bp_is_current_action( $slug ) ) || ( bp_is_user() && ! bp_current_action() && ( $screen_function == $bp->bp_nav[$parent_slug]['screen_function'] ) ) ) { + // If we *do* meet condition (2), then the added subnav item is currently being requested. + if ( ( bp_current_action() && bp_is_current_action( $r['slug'] ) ) || ( bp_is_user() && ! bp_current_action() && ( $r['screen_function'] == $bp->bp_nav[$r['parent_slug']]['screen_function'] ) ) ) { - $hooked = bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ); + // If this is for site admins only and the user is not one, don't create the subnav item. + if ( ! empty( $r['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) { + return false; + } - // If redirect args have been returned, perform the redirect now + $hooked = bp_core_maybe_hook_new_subnav_screen_function( $r ); + + // If redirect args have been returned, perform the redirect now. if ( ! empty( $hooked['status'] ) && 'failure' === $hooked['status'] && isset( $hooked['redirect_args'] ) ) { bp_core_no_access( $hooked['redirect_args'] ); } @@ -361,10 +597,9 @@ function bp_core_new_subnav_item( $args = '' ) { /** * For a given subnav item, either hook the screen function or generate redirect arguments, as necessary. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param array $subnav_item The subnav array added to bp_options_nav in - * bp_core_new_subnav_item(). + * @param array $subnav_item The subnav array added to bp_options_nav in `bp_core_new_subnav_item()`. * @return array */ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { @@ -372,21 +607,27 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { 'status' => '', ); - // User has access, so let's try to hook the display callback - if ( ! empty( $subnav_item['user_has_access'] ) ) { + // Is this accessible by site admins only? + $site_admin_restricted = false; + if ( ! empty( $subnav_item['site_admin_only'] ) && ! bp_current_user_can( 'bp_moderate' ) ) { + $site_admin_restricted = true; + } + + // User has access, so let's try to hook the display callback. + if ( ! empty( $subnav_item['user_has_access'] ) && ! $site_admin_restricted ) { - // Screen function is invalid + // Screen function is invalid. if ( ! is_callable( $subnav_item['screen_function'] ) ) { $retval['status'] = 'failure'; - // Success - hook to bp_screens + // Success - hook to bp_screens. } else { add_action( 'bp_screens', $subnav_item['screen_function'], 3 ); $retval['status'] = 'success'; } // User doesn't have access. Determine redirect arguments based on - // user status + // user status. } else { $retval['status'] = 'failure'; @@ -395,13 +636,13 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { $bp = buddypress(); // If a redirect URL has been passed to the subnav - // item, respect it + // item, respect it. if ( ! empty( $subnav_item['no_access_url'] ) ) { $message = __( 'You do not have access to this page.', 'buddypress' ); $redirect_to = trailingslashit( $subnav_item['no_access_url'] ); // In the case of a user page, we try to assume a - // redirect URL + // redirect URL. } elseif ( bp_is_user() ) { // Redirect to the displayed user's default @@ -415,10 +656,10 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { // the logged-in user. So we fall back on a tab that we // know will be accessible. } else { - // Try 'activity' first + // Try 'activity' first. if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ); - // Then try 'profile' + // Then try 'profile'. } else { $redirect_to = trailingslashit( bp_displayed_user_domain() . ( 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id ) ); } @@ -426,7 +667,7 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { $message = ''; } - // Fall back to the home page + // Fall back to the home page. } else { $message = __( 'You do not have access to this page.', 'buddypress' ); $redirect_to = bp_get_root_domain(); @@ -441,7 +682,7 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { } else { // When the user is logged out, pass an empty array // This indicates that the default arguments should be - // used in bp_core_no_access() + // used in bp_core_no_access(). $retval['redirect_args'] = array(); } } @@ -452,6 +693,8 @@ function bp_core_maybe_hook_new_subnav_screen_function( $subnav_item ) { /** * Sort all subnavigation arrays. * + * @since 1.1.0 + * * @return bool|null Returns false on failure. */ function bp_core_sort_subnav_items() { @@ -468,7 +711,7 @@ function bp_core_sort_subnav_items() { if ( empty( $temp[$subnav_item['position']]) ) $temp[$subnav_item['position']] = $subnav_item; else { - // increase numbers here to fit new items in. + // Increase numbers here to fit new items in. do { $subnav_item['position']++; } while ( !empty( $temp[$subnav_item['position']] ) ); @@ -487,12 +730,11 @@ add_action( 'admin_head', 'bp_core_sort_subnav_items' ); /** * Check whether a given nav item has subnav items. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $nav_item The slug of the top-level nav item whose subnav - * items you're checking. Default: the current component slug. - * @return bool $has_subnav True if the nav item is found and has subnav - * items; false otherwise. + * @param string $nav_item The slug of the top-level nav item whose subnav items you're checking. + * Default: the current component slug. + * @return bool $has_subnav True if the nav item is found and has subnav items; false otherwise. */ function bp_nav_item_has_subnav( $nav_item = '' ) { $bp = buddypress(); @@ -505,11 +747,10 @@ function bp_nav_item_has_subnav( $nav_item = '' ) { /** * Filters whether or not a given nav item has subnav items. * - * @since BuddyPress (1.5.0) + * @since 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. + * @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 ); } @@ -517,13 +758,15 @@ function bp_nav_item_has_subnav( $nav_item = '' ) { /** * Remove a nav item from the navigation array. * + * @since 1.0.0 + * * @param int $parent_id The slug of the parent navigation item. - * @param bool Returns false on failure, ie if the nav item can't be found. + * @return bool Returns false on failure, ie if the nav item can't be found. */ function bp_core_remove_nav_item( $parent_id ) { $bp = buddypress(); - // Unset subnav items for this nav item + // Unset subnav items for this nav item. if ( isset( $bp->bp_options_nav[$parent_id] ) && is_array( $bp->bp_options_nav[$parent_id] ) ) { foreach( (array) $bp->bp_options_nav[$parent_id] as $subnav_item ) { bp_core_remove_subnav_item( $parent_id, $subnav_item['slug'] ); @@ -534,7 +777,7 @@ function bp_core_remove_nav_item( $parent_id ) { return false; if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) { - // Remove our screen hook if screen function is callable + // Remove our screen hook if screen function is callable. if ( is_callable( $function ) ) { remove_action( 'bp_screens', $function, 3 ); } @@ -546,8 +789,10 @@ function bp_core_remove_nav_item( $parent_id ) { /** * Remove a subnav item from the navigation array. * + * @since 1.0.0 + * * @param string $parent_id The slug of the parent navigation item. - * @param string $slug The slug of the subnav item to be removed. + * @param string $slug The slug of the subnav item to be removed. */ function bp_core_remove_subnav_item( $parent_id, $slug ) { $bp = buddypress(); @@ -557,7 +802,7 @@ function bp_core_remove_subnav_item( $parent_id, $slug ) { : false; if ( ! empty( $screen_function ) ) { - // Remove our screen hook if screen function is callable + // Remove our screen hook if screen function is callable. if ( is_callable( $screen_function ) ) { remove_action( 'bp_screens', $screen_function, 3 ); } @@ -572,6 +817,8 @@ function bp_core_remove_subnav_item( $parent_id, $slug ) { /** * Clear all subnav items from a specific nav item. * + * @since 1.0.0 + * * @param string $parent_slug The slug of the parent navigation item. */ function bp_core_reset_subnav_items( $parent_slug ) { @@ -586,13 +833,12 @@ function bp_core_reset_subnav_items( $parent_slug ) { * * This is a direct copy of WP's private _get_admin_bar_pref() * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses get_user_option() * * @param string $context Context of this preference check. 'admin' or 'front'. - * @param int $user Optional. ID of the user to check. Default: 0 (which falls - * back to the logged-in user's ID). + * @param int $user Optional. ID of the user to check. Default: 0 (which falls back to the logged-in user's ID). * @return bool True if the toolbar should be showing for this user. */ function bp_get_admin_bar_pref( $context, $user = 0 ) { 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 05e3625498bdda581524ed67eee34a25238b9859..2cddf4677082473d64b60cb1a0758f49f045b829 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php @@ -4,18 +4,26 @@ * * Caching functions handle the clearing of cached objects and pages on specific * actions throughout BuddyPress. + * + * @package BuddyPress + * @supackage Cache + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Prune the WP Super Cache. * + * When WP Super Cache is installed, this function will clear cached pages + * so that success/error messages or time-sensitive content are not cached. + * + * @since 1.0.0 + * * @see prune_super_cache() * - * When wp-super-cache is installed this function will clear cached pages - * so that success/error messages are not cached, or time sensitive content. + * @return int */ function bp_core_clear_cache() { global $cache_path; @@ -25,7 +33,7 @@ function bp_core_clear_cache() { /** * Fires before the pruning of WP Super Cache. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_core_clear_cache' ); return prune_super_cache( $cache_path, true ); @@ -34,6 +42,10 @@ function bp_core_clear_cache() { /** * Clear all cached objects for a user, or those that a user is part of. + * + * @since 1.0.0 + * + * @param string $user_id User ID to delete cache for. */ function bp_core_clear_user_object_cache( $user_id ) { wp_cache_delete( 'bp_user_' . $user_id, 'bp' ); @@ -41,6 +53,8 @@ function bp_core_clear_user_object_cache( $user_id ) { /** * Clear member count caches and transients. + * + * @since 1.6.0 */ function bp_core_clear_member_count_caches() { wp_cache_delete( 'bp_total_member_count', 'bp' ); @@ -55,16 +69,16 @@ add_action( 'deleted_user', 'bp_core_clear_member_count_caches /** * Clear the directory_pages cache when one of the pages is updated. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $post_id + * @param int $post_id ID of the page that was saved. */ function bp_core_clear_directory_pages_cache_page_edit( $post_id ) { if ( ! bp_is_root_blog() ) { return; } - // Bail if BP is not defined here + // Bail if BP is not defined here. if ( ! buddypress() ) { return; } @@ -75,20 +89,20 @@ function bp_core_clear_directory_pages_cache_page_edit( $post_id ) { return; } - wp_cache_delete( 'directory_pages', 'bp' ); + wp_cache_delete( 'directory_pages', 'bp_pages' ); } add_action( 'save_post', 'bp_core_clear_directory_pages_cache_page_edit' ); /** * Clear the directory_pages cache when the bp-pages option is updated. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $option Option name. */ function bp_core_clear_directory_pages_cache_settings_edit( $option ) { if ( 'bp-pages' === $option ) { - wp_cache_delete( 'directory_pages', 'bp' ); + wp_cache_delete( 'directory_pages', 'bp_pages' ); } } add_action( 'update_option', 'bp_core_clear_directory_pages_cache_settings_edit' ); @@ -96,7 +110,7 @@ add_action( 'update_option', 'bp_core_clear_directory_pages_cache_settings_edit' /** * Clear the root_blog_options cache when any of its options are updated. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $option Option name. */ @@ -123,9 +137,9 @@ add_action( 'add_site_option', 'bp_core_clear_root_options_cache' ); /** * Determine which items from a list do not have cached values. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param array $item_ids ID list. + * @param array $item_ids ID list. * @param string $cache_group The cache group to check against. * @return array */ @@ -151,21 +165,21 @@ function bp_get_non_cached_ids( $item_ids, $cache_group ) { * object can lead to dramatic performance improvements when using metadata * in the context of template loops. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @global $wpdb WordPress database object for queries.. + * @global object $wpdb WordPress database object for queries.. * * @param array $args { * Array of arguments. - * @type array|string $object_ids List of object IDs to fetch metadata for. - * Accepts an array or a comma-separated list of numeric IDs. - * @type string $object_type The type of object, eg 'groups' or 'activity'. - * @type string $meta_table The name of the metadata table being queried. - * @type string $object_column Optional. The name of the database column - * where IDs (those provided by $object_ids) are found. Eg, 'group_id' - * for the groups metadata tables. Default: $object_type . '_id'. - * @type string $cache_key_prefix Optional. The prefix to use when creating - * cache key names. Default: the value of $meta_table. + * @type array|string $object_ids List of object IDs to fetch metadata for. + * Accepts an array or a comma-separated list of numeric IDs. + * @type string $object_type The type of object, eg 'groups' or 'activity'. + * @type string $meta_table The name of the metadata table being queried. + * @type string $object_column Optional. The name of the database column where IDs + * (those provided by $object_ids) are found. Eg, 'group_id' + * for the groups metadata tables. Default: $object_type . '_id'. + * @type string $cache_key_prefix Optional. The prefix to use when creating + * cache key names. Default: the value of $meta_table. * } * @return array|bool Metadata cache for the specified objects, or false on failure. */ @@ -173,13 +187,12 @@ function bp_update_meta_cache( $args = array() ) { global $wpdb; $defaults = array( - 'object_ids' => array(), // Comma-separated list or array of item ids - 'object_type' => '', // Canonical component id: groups, members, etc - 'cache_group' => '', // Cache group - 'meta_table' => '', // Name of the table containing the metadata - 'object_column' => '', // DB column for the object ids (group_id, etc) - 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg - // 'bp_groups_groupmeta' + 'object_ids' => array(), // Comma-separated list or array of item ids. + 'object_type' => '', // Canonical component id: groups, members, etc. + 'cache_group' => '', // Cache group. + 'meta_table' => '', // Name of the table containing the metadata. + 'object_column' => '', // DB column for the object ids (group_id, etc). + 'cache_key_prefix' => '' // Prefix to use when creating cache key names. Eg 'bp_groups_groupmeta'. ); $r = wp_parse_args( $args, $defaults ); extract( $r ); @@ -205,7 +218,7 @@ function bp_update_meta_cache( $args = array() ) { $cache = array(); - // Get meta info + // Get meta info. if ( ! empty( $uncached_ids ) ) { $id_list = join( ',', wp_parse_id_list( $uncached_ids ) ); $meta_list = $wpdb->get_results( esc_sql( "SELECT {$object_column}, meta_key, meta_value FROM {$meta_table} WHERE {$object_column} IN ({$id_list})" ), ARRAY_A ); @@ -216,19 +229,19 @@ function bp_update_meta_cache( $args = array() ) { $mkey = $metarow['meta_key']; $mval = $metarow['meta_value']; - // Force subkeys to be array type: + // Force subkeys to be array type. if ( !isset( $cache[$mpid] ) || !is_array( $cache[$mpid] ) ) $cache[$mpid] = array(); if ( !isset( $cache[$mpid][$mkey] ) || !is_array( $cache[$mpid][$mkey] ) ) $cache[$mpid][$mkey] = array(); - // Add a value to the current pid/key: + // Add a value to the current pid/key. $cache[$mpid][$mkey][] = $mval; } } foreach ( $uncached_ids as $uncached_id ) { - // Cache empty values as well + // Cache empty values as well. if ( ! isset( $cache[ $uncached_id ] ) ) { $cache[ $uncached_id ] = array(); } 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 f6e30bb0dd46c3e6d7ec8f4b2fa802dce41a2452..325889b5b477123f5f103b6f4b0114e1534c9202 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php @@ -1,31 +1,31 @@ <?php - /** * BuddyPress Capabilities. * * @package BuddyPress * @subpackage Capabilities + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Return an array of roles from the currently loaded blog + * Return an array of roles from the currently loaded blog. * * 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 * WordPress's RBAC, so should our capability functions here. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return array */ function bp_get_current_blog_roles() { global $wp_roles; - // Sanity check on roles global variable + // Sanity check on roles global variable. $roles = isset( $wp_roles->roles ) ? $wp_roles->roles : array(); @@ -33,7 +33,7 @@ function bp_get_current_blog_roles() { /** * Filters the list of editable roles. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $roles List of roles. */ @@ -42,7 +42,7 @@ function bp_get_current_blog_roles() { /** * Filters the array of roles from the currently loaded blog. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $roles Available roles. * @param WP_Roles $wp_roles Object of WordPress roles. @@ -55,7 +55,7 @@ function bp_get_current_blog_roles() { * * This is called on plugin activation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses get_role() To get the administrator, default and moderator roles. * @uses WP_Role::add_cap() To add various capabilities. @@ -64,11 +64,12 @@ function bp_get_current_blog_roles() { function bp_add_caps() { global $wp_roles; - // Load roles if not set - if ( ! isset( $wp_roles ) ) + // Load roles if not set. + if ( ! isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); + } - // Loop through available roles and add them + // Loop through available roles and add them. foreach( $wp_roles->role_objects as $role ) { foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { $role->add_cap( $cap ); @@ -80,7 +81,7 @@ function bp_add_caps() { * * This is called on plugin activation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_add_caps' ); } @@ -90,7 +91,7 @@ function bp_add_caps() { * * This is called on plugin deactivation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses get_role() To get the administrator and default roles. * @uses WP_Role::remove_cap() To remove various capabilities. @@ -99,11 +100,12 @@ function bp_add_caps() { function bp_remove_caps() { global $wp_roles; - // Load roles if not set - if ( ! isset( $wp_roles ) ) + // Load roles if not set. + if ( ! isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); + } - // Loop through available roles and remove them + // Loop through available roles and remove them. foreach( $wp_roles->role_objects as $role ) { foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { $role->remove_cap( $cap ); @@ -115,7 +117,7 @@ function bp_remove_caps() { * * This is called on plugin deactivation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_remove_caps' ); } @@ -123,17 +125,17 @@ function bp_remove_caps() { /** * Map community caps to built in WordPress caps. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @see WP_User::has_cap() for description of the arguments passed to the * 'map_meta_cap' filter. * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user ID and * args. * - * @param array $caps See {@link WP_User::has_cap()}. - * @param string $cap See {@link WP_User::has_cap()}. - * @param int $user_id See {@link WP_User::has_cap()}. - * @param mixed $args See {@link WP_User::has_cap()}. + * @param array $caps See {@link WP_User::has_cap()}. + * @param string $cap See {@link WP_User::has_cap()}. + * @param int $user_id See {@link WP_User::has_cap()}. + * @param mixed $args See {@link WP_User::has_cap()}. * @return array Actual capabilities for meta capability. See {@link WP_User::has_cap()}. */ function bp_map_meta_caps( $caps, $cap, $user_id, $args ) { @@ -141,7 +143,7 @@ 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) + * @since 1.6.0 * * @param array $caps Returns the user's actual capabilities. * @param string $cap Capability name. @@ -154,7 +156,7 @@ function bp_map_meta_caps( $caps, $cap, $user_id, $args ) { /** * Return community capabilities. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Calls 'bp_get_community_caps' with the capabilities. * @@ -162,13 +164,13 @@ function bp_map_meta_caps( $caps, $cap, $user_id, $args ) { */ function bp_get_community_caps() { - // Forum meta caps + // Forum meta caps. $caps = array(); /** * Filters community capabilities. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $caps Array of capabilities to add. Empty by default. */ @@ -178,7 +180,7 @@ function bp_get_community_caps() { /** * Return an array of capabilities based on the role that is being requested. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Allow return value to be filtered. * @@ -190,20 +192,21 @@ function bp_get_caps_for_role( $role = '' ) { // Which role are we looking for? switch ( $role ) { - // Administrator + // Administrator. case 'administrator' : $caps = array( - // Misc + // Misc. 'bp_moderate', ); break; - case 'editor' : - case 'author' : - case 'contributor' : - case 'subscriber' : - default : + // All other default WordPress blog roles. + case 'editor' : + case 'author' : + case 'contributor' : + case 'subscriber' : + default : $caps = array(); break; } @@ -211,7 +214,7 @@ function bp_get_caps_for_role( $role = '' ) { /** * Filters the array of capabilities based on the role that is being requested. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $caps Array of capabilities to return. * @param string $role The role currently being loaded. @@ -225,7 +228,7 @@ function bp_get_caps_for_role( $role = '' ) { * Give a user the default role when creating content on a site they do not * already have a role or capability on. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global BuddyPress $bp Global BuddyPress settings object. * @@ -238,51 +241,79 @@ function bp_get_caps_for_role( $role = '' ) { */ function bp_set_current_user_default_role() { - // Bail if not multisite or not root blog - if ( ! is_multisite() || ! bp_is_root_blog() ) + // Bail if not multisite or not root blog. + if ( ! is_multisite() || ! bp_is_root_blog() ) { return; + } - // Bail if user is not logged in or already a member - if ( ! is_user_logged_in() || is_user_member_of_blog() ) + // Bail if user is not logged in or already a member. + if ( ! is_user_logged_in() || is_user_member_of_blog() ) { return; + } - // Bail if user is not active - if ( bp_is_user_inactive() ) + // Bail if user is not active. + if ( bp_is_user_inactive() ) { return; + } - // Set the current users default role + // Set the current users default role. buddypress()->current_user->set_role( bp_get_option( 'default_role', 'subscriber' ) ); } /** * Check whether the current user has a given capability. * - * Can be passed blog ID, or will use the root blog by default. + * @since 1.6.0 + * @since 2.4.0 Second argument modified to accept an array, rather than `$blog_id`. * - * @since BuddyPress (1.6.0) - * - * @param string $capability Capability or role name. - * @param int $blog_id Optional. Blog ID. Defaults to the BP root blog. - * @return bool True if the user has the cap for the given blog. + * @param string $capability Capability or role name. + * @param array|int $args { + * Array of extra arguments applicable to the capability check. + * @type int $blog_id Optional. Blog ID. Defaults to the BP root blog. + * @type mixed $a,... Optional. Extra arguments applicable to the capability check. + * } + * @return bool True if the user has the cap for the given parameters. */ -function bp_current_user_can( $capability, $blog_id = 0 ) { +function bp_current_user_can( $capability, $args = array() ) { + $blog_id = 0; + + // Backward compatibility for older $blog_id parameter. + if ( is_int( $args ) ) { + $blog_id = $args; + $args = array(); + + // New format for second parameter. + } elseif ( is_array( $args ) && isset( $args['blog_id'] ) ) { + // Get the blog ID if set, but don't pass along to `current_user_can_for_blog()`. + $blog_id = (int) $args['blog_id']; + unset( $args['blog_id'] ); + } - // Use root blog if no ID passed - if ( empty( $blog_id ) ) + // Backward compatibility for older bp_current_user_can() checks + if ( empty( $args ) ) { + $args = null; + } + + // Use root blog if no ID passed. + if ( empty( $blog_id ) ) { $blog_id = bp_get_root_blog_id(); + } - $retval = current_user_can_for_blog( $blog_id, $capability ); + $args = array( $blog_id, $capability, $args ); + $retval = call_user_func_array( 'current_user_can_for_blog', $args ); /** * Filters whether or not the current user has a given capability. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * @since 2.4.0 Pass `$args` variable. * * @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. + * @param array $args Array of extra arguments passed. */ - return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id ); + return (bool) apply_filters( 'bp_current_user_can', $retval, $capability, $blog_id, $args ); } /** @@ -299,34 +330,40 @@ function bp_current_user_can( $capability, $blog_id = 0 ) { * installation. See {@link WP_User::has_cap()}. * * This implementation of 'bp_moderate' is temporary, until BuddyPress properly - * matches caps to roles and stores them in the database. Plugin authors: Do - * not use this function. + * matches caps to roles and stores them in the database. + * + * Plugin authors: Please do not use this function; thank you. :) + * + * @since 1.6.0 * * @access private - * @since BuddyPress (1.6.0) * * @see WP_User::has_cap() * - * @param array $allcaps The caps that WP associates with the given role. - * @param array $caps The caps being tested for in WP_User::has_cap(). - * @param array $args Miscellaneous arguments passed to the user_has_cap filter. + * @param array $caps The caps that WP associates with the given role. + * @param string $cap The caps being tested for in WP_User::has_cap(). + * @param int $user_id ID of the user being checked against. + * @param array $args Miscellaneous arguments passed to the user_has_cap filter. * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant. */ function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { - // Bail if not checking the 'bp_moderate' cap - if ( 'bp_moderate' !== $cap ) + // Bail if not checking the 'bp_moderate' cap. + if ( 'bp_moderate' !== $cap ) { return $caps; + } - // Bail if BuddyPress is not network activated - if ( bp_is_network_activated() ) + // Bail if BuddyPress is not network activated. + if ( bp_is_network_activated() ) { return $caps; + } - // Never trust inactive users - if ( bp_is_user_inactive( $user_id ) ) + // Never trust inactive users. + if ( bp_is_user_inactive( $user_id ) ) { return $caps; + } - // Only users that can 'manage_options' on this site can 'bp_moderate' + // Only users that can 'manage_options' on this site can 'bp_moderate'. return array( 'manage_options' ); } add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 ); @@ -338,7 +375,7 @@ add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 ); * * This is called on plugin activation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @deprecated 1.7.0 */ function bp_add_roles() { @@ -350,7 +387,7 @@ function bp_add_roles() { * * This is called on plugin deactivation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @deprecated 1.7.0 */ function bp_remove_roles() { @@ -364,7 +401,7 @@ function bp_remove_roles() { * This is primarily for multisite compatibility when users without roles on * sites that have global communities enabled. * - * @since BuddyPress (1.6) + * @since 1.6.0 * @deprecated 1.7.0 */ function bp_get_participant_role() { @@ -374,7 +411,7 @@ function bp_get_participant_role() { /** * The moderator role for BuddyPress users. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @deprecated 1.7.0 */ function bp_get_moderator_role() { 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 3c6bc5b3e372dc227d77360e479ff03b63e296c8..ada5bf91e72f432e740e811b35cf51d2df4f58ed 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress URI catcher. * @@ -8,9 +7,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -24,28 +24,28 @@ defined( 'ABSPATH' ) || exit; * - 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: + * Example: * - 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] * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ function bp_core_set_uri_globals() { global $current_blog, $wp_rewrite; - // Don't catch URIs on non-root blogs unless multiblog mode is on + // 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 + // Define local variables. $root_profile = $match = false; $key_slugs = $matches = $uri_chunks = array(); - // Fetch all the WP page names for each component + // Fetch all the WP page names for each component. if ( empty( $bp->pages ) ) $bp->pages = bp_core_get_directory_pages(); @@ -58,34 +58,36 @@ function bp_core_set_uri_globals() { /** * Filters the BuddyPress global URI path. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $path Path to set. */ $path = apply_filters( 'bp_uri', $path ); - // Take GET variables off the URL to avoid problems + // Take GET variables off the URL to avoid problems. $path = strtok( $path, '?' ); - // Fetch current URI and explode each part separated by '/' into an array + // Fetch current URI and explode each part separated by '/' into an array. $bp_uri = explode( '/', $path ); - // Loop and remove empties + // Loop and remove empties. foreach ( (array) $bp_uri as $key => $uri_chunk ) { if ( empty( $bp_uri[$key] ) ) { unset( $bp_uri[$key] ); } } - // If running off blog other than root, any subdirectory names must be - // removed from $bp_uri. This includes two cases: - // - // 1. when WP is installed in a subdirectory, - // 2. when BP is running on secondary blog of a subdirectory - // multisite installation. Phew! + /* + * If running off blog other than root, any subdirectory names must be + * removed from $bp_uri. This includes two cases: + * + * 1. when WP is installed in a subdirectory, + * 2. when BP is running on secondary blog of a subdirectory + * multisite installation. Phew! + */ if ( is_multisite() && !is_subdomain_install() && ( bp_is_multiblog_mode() || 1 != bp_get_root_blog_id() ) ) { - // Blow chunks + // Blow chunks. $chunks = explode( '/', $current_blog->path ); // If chunks exist... @@ -105,34 +107,36 @@ function bp_core_set_uri_globals() { } } - // Get site path items + // Get site path items. $paths = explode( '/', bp_core_get_site_path() ); - // Take empties off the end of path + // Take empties off the end of path. if ( empty( $paths[count( $paths ) - 1] ) ) array_pop( $paths ); - // Take empties off the start of path + // Take empties off the start of path. if ( empty( $paths[0] ) ) array_shift( $paths ); - // Reset indexes + // Reset indexes. $bp_uri = array_values( $bp_uri ); $paths = array_values( $paths ); - // Unset URI indices if they intersect with the paths + // Unset URI indices if they intersect with the paths. foreach ( (array) $bp_uri as $key => $uri_chunk ) { if ( isset( $paths[$key] ) && $uri_chunk == $paths[$key] ) { unset( $bp_uri[$key] ); } } - // Reset the keys by merging with an empty array + // Reset the keys by merging with an empty array. $bp_uri = array_merge( array(), $bp_uri ); - // If a component is set to the front page, force its name into $bp_uri - // so that $current_component is populated (unless a specific WP post is being requested - // via a URL parameter, usually signifying Preview mode) + /* + * If a component is set to the front page, force its name into $bp_uri + * so that $current_component is populated (unless a specific WP post is being requested + * via a URL parameter, usually signifying Preview mode). + */ if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && empty( $bp_uri ) && empty( $_GET['p'] ) && empty( $_GET['page_id'] ) ) { $post = get_post( get_option( 'page_on_front' ) ); if ( !empty( $post ) ) { @@ -140,21 +144,21 @@ function bp_core_set_uri_globals() { } } - // Keep the unfiltered URI safe + // Keep the unfiltered URI safe. $bp->unfiltered_uri = $bp_uri; // Don't use $bp_unfiltered_uri, this is only for backpat with old plugins. Use $bp->unfiltered_uri. $GLOBALS['bp_unfiltered_uri'] = &$bp->unfiltered_uri; - // Get slugs of pages into array + // Get slugs of pages into array. foreach ( (array) $bp->pages as $page_key => $bp_page ) $key_slugs[$page_key] = trailingslashit( '/' . $bp_page->slug ); - // Bail if keyslugs are empty, as BP is not setup correct + // Bail if keyslugs are empty, as BP is not setup correct. if ( empty( $key_slugs ) ) return; - // Loop through page slugs and look for exact match to path + // Loop through page slugs and look for exact match to path. foreach ( $key_slugs as $key => $slug ) { if ( $slug == $path ) { $match = $bp->pages->{$key}; @@ -164,64 +168,64 @@ function bp_core_set_uri_globals() { } } - // No exact match, so look for partials + // No exact match, so look for partials. if ( empty( $match ) ) { - // Loop through each page in the $bp->pages global + // Loop through each page in the $bp->pages global. foreach ( (array) $bp->pages as $page_key => $bp_page ) { - // Look for a match (check members first) + // Look for a match (check members first). if ( in_array( $bp_page->name, (array) $bp_uri ) ) { // Match found, now match the slug to make sure. $uri_chunks = explode( '/', $bp_page->slug ); - // Loop through uri_chunks + // Loop through uri_chunks. foreach ( (array) $uri_chunks as $key => $uri_chunk ) { - // Make sure chunk is in the correct position + // Make sure chunk is in the correct position. if ( !empty( $bp_uri[$key] ) && ( $bp_uri[$key] == $uri_chunk ) ) { $matches[] = 1; - // No match + // No match. } else { $matches[] = 0; } } - // Have a match + // Have a match. if ( !in_array( 0, (array) $matches ) ) { $match = $bp_page; $match->key = $page_key; break; }; - // Unset matches + // Unset matches. unset( $matches ); } - // Unset uri chunks + // Unset uri chunks. unset( $uri_chunks ); } } - // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above + // URLs with BP_ENABLE_ROOT_PROFILES enabled won't be caught above. if ( empty( $matches ) && bp_core_enable_root_profiles() ) { - // Switch field based on compat + // Switch field based on compat. $field = bp_is_username_compatibility_mode() ? 'login' : 'slug'; - // Make sure there's a user corresponding to $bp_uri[0] + // Make sure there's a user corresponding to $bp_uri[0]. if ( !empty( $bp->pages->members ) && !empty( $bp_uri[0] ) && $root_profile = get_user_by( $field, $bp_uri[0] ) ) { - // Force BP to recognize that this is a members page + // Force BP to recognize that this is a members page. $matches[] = 1; $match = $bp->pages->members; $match->key = 'members'; } } - // Search doesn't have an associated page, so we check for it separately + // Search doesn't have an associated page, so we check for it separately. if ( !empty( $bp_uri[0] ) && ( bp_get_search_slug() == $bp_uri[0] ) ) { $matches[] = 1; $match = new stdClass; @@ -235,27 +239,30 @@ function bp_core_set_uri_globals() { $wp_rewrite->use_verbose_page_rules = false; - // Find the offset. With $root_profile set, we fudge the offset down so later parsing works + // Find the offset. With $root_profile set, we fudge the offset down so later parsing works. $slug = !empty ( $match ) ? explode( '/', $match->slug ) : ''; $uri_offset = empty( $root_profile ) ? 0 : -1; - // Rejig the offset + // Rejig the offset. if ( !empty( $slug ) && ( 1 < count( $slug ) ) ) { - array_pop( $slug ); - $uri_offset = count( $slug ); + // Only offset if not on a root profile. Fixes issue when Members page is nested. + if ( false === $root_profile ) { + array_pop( $slug ); + $uri_offset = count( $slug ); + } } // Global the unfiltered offset to use in bp_core_load_template(). - // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0 + // To avoid PHP warnings in bp_core_load_template(), it must always be >= 0. $bp->unfiltered_uri_offset = $uri_offset >= 0 ? $uri_offset : 0; - // We have an exact match + // We have an exact match. if ( isset( $match->key ) ) { - // Set current component to matched key + // Set current component to matched key. $bp->current_component = $match->key; - // If members component, do more work to find the actual component + // If members component, do more work to find the actual component. if ( 'members' == $match->key ) { $after_member_slug = false; @@ -265,16 +272,21 @@ function bp_core_set_uri_globals() { // Are we viewing a specific user? if ( $after_member_slug ) { - // Switch the displayed_user based on compatibility mode - if ( bp_is_username_compatibility_mode() ) { + // If root profile, we've already queried for the user. + if ( $root_profile instanceof WP_User ) { + $bp->displayed_user->id = $root_profile->ID; + + // Switch the displayed_user based on compatibility mode. + } elseif ( bp_is_username_compatibility_mode() ) { $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( $after_member_slug ); } } // 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 ] ) ) { + if ( ! bp_displayed_user_id() && $after_member_slug === bp_get_members_member_type_base() && ! empty( $bp_uri[ $uri_offset + 2 ] ) ) { $matched_types = bp_get_member_types( array( 'has_directory' => true, 'directory_slug' => $bp_uri[ $uri_offset + 2 ], @@ -294,7 +306,7 @@ function bp_core_set_uri_globals() { return; } - // If the displayed user is marked as a spammer, 404 (unless logged-in user is a super admin) + // 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' ); @@ -310,36 +322,50 @@ function bp_core_set_uri_globals() { $bp_uri = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) ); $bp->current_component = $bp_uri[0]; - // No component, so default will be picked later + // No component, so default will be picked later. } else { $bp_uri = array_merge( array(), array_slice( $bp_uri, $uri_offset + 2 ) ); $bp->current_component = ''; } - // Reset the offset + // Reset the offset. $uri_offset = 0; } } } - // Set the current action - $bp->current_action = isset( $bp_uri[$uri_offset + 1] ) ? $bp_uri[$uri_offset + 1] : ''; + // Determine the current action. + $current_action = isset( $bp_uri[ $uri_offset + 1 ] ) ? $bp_uri[ $uri_offset + 1 ] : ''; + + /* + * If a BuddyPress directory is set to the WP front page, URLs like example.com/members/?s=foo + * shouldn't interfere with blog searches. + */ + if ( empty( $current_action) && ! empty( $_GET['s'] ) && 'page' == get_option( 'show_on_front' ) && ! empty( $match->id ) ) { + $page_on_front = (int) get_option( 'page_on_front' ); + if ( (int) $match->id === $page_on_front ) { + $bp->current_component = ''; + return false; + } + } + + $bp->current_action = $current_action; - // Slice the rest of the $bp_uri array and reset offset + // Slice the rest of the $bp_uri array and reset offset. $bp_uri = array_slice( $bp_uri, $uri_offset + 2 ); $uri_offset = 0; - // Set the entire URI as the action variables, we will unset the current_component and action in a second + // Set the entire URI as the action variables, we will unset the current_component and action in a second. $bp->action_variables = $bp_uri; - // Reset the keys by merging with an empty array + // Reset the keys by merging with an empty array. $bp->action_variables = array_merge( array(), $bp->action_variables ); } /** * Are root profiles enabled and allowed? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return bool True if yes, false if no. */ @@ -353,7 +379,7 @@ function bp_core_enable_root_profiles() { /** * Filters whether or not root profiles are enabled and allowed. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $retval Whether or not root profiles are available. */ @@ -368,13 +394,14 @@ function bp_core_enable_root_profiles() { * Loads: * wp-content/themes/[activated_theme]/members/index.php * + * @since 1.0.0 + * * @param array $templates Array of templates to attempt to load. - * @return bool|null Returns false on failure. */ function bp_core_load_template( $templates ) { global $wp_query; - // Reset the post + // Reset the post. bp_theme_compat_reset_post( array( 'ID' => 0, 'is_404' => true, @@ -382,20 +409,20 @@ function bp_core_load_template( $templates ) { ) ); // Set theme compat to false since the reset post function automatically sets - // theme compat to true + // theme compat to true. bp_set_theme_compat_active( false ); - // Fetch each template and add the php suffix + // Fetch each template and add the php suffix. $filtered_templates = array(); foreach ( (array) $templates as $template ) { $filtered_templates[] = $template . '.php'; } - // Only perform template lookup for bp-default themes + // Only perform template lookup for bp-default themes. if ( ! bp_use_theme_compat_with_current_theme() ) { $template = locate_template( (array) $filtered_templates, false ); - // Theme compat doesn't require a template lookup + // Theme compat doesn't require a template lookup. } else { $template = ''; } @@ -405,7 +432,7 @@ function bp_core_load_template( $templates ) { * * Allows plugins to alter where the template files are located. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $template Located template path. * @param array $filtered_templates Array of templates to attempt to load. @@ -421,7 +448,7 @@ function bp_core_load_template( $templates ) { /** * Fires before the loading of a located template file. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $located_template Template found to be loaded. */ @@ -430,7 +457,7 @@ function bp_core_load_template( $templates ) { /** * Filters the selected template right before loading. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $located_template Template found to be loaded. */ @@ -439,7 +466,7 @@ function bp_core_load_template( $templates ) { /** * Fires after the loading of a located template file. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $located_template Template found that was loaded. */ @@ -448,8 +475,8 @@ function bp_core_load_template( $templates ) { // Kill any other output after this. exit(); - // No template found, so setup theme compatibility - // @todo Some other 404 handling if theme compat doesn't kick in + // No template found, so setup theme compatibility. + // @todo Some other 404 handling if theme compat doesn't kick in. } else { // We know where we are, so reset important $wp_query bits here early. @@ -464,7 +491,7 @@ function bp_core_load_template( $templates ) { /** * Fires if there are no found templates to load and theme compat is needed. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_setup_theme_compat' ); } @@ -472,6 +499,8 @@ function bp_core_load_template( $templates ) { /** * Redirect away from /profile URIs if XProfile is not enabled. + * + * @since 1.0.0 */ function bp_core_catch_profile_uri() { if ( !bp_is_active( 'xprofile' ) ) { @@ -479,7 +508,7 @@ function bp_core_catch_profile_uri() { /** * Filters the path to redirect users to if XProfile is not enabled. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to redirect users to. */ @@ -490,7 +519,7 @@ function bp_core_catch_profile_uri() { /** * Catch unauthorized access to certain BuddyPress pages and redirect accordingly. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_core_catch_no_access() { global $wp_query; @@ -515,27 +544,26 @@ add_action( 'bp_template_redirect', 'bp_core_catch_no_access', 1 ); * * If authenticated, redirects user back to requested content by default. * - * @since BuddyPress (1.5.0) - * - * @param array $args { - * @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 - * successfully logging in. Default: the URL originally requested. - * @type string $root The root URL of the site, used in case of error or - * mode 1 redirects. Default: the value of {@link bp_get_root_domain()}. - * @type string $message An error message to display to the user on the - * log-in page. Default: "You must log in to access the page you - * requested." + * @since 1.5.0 + * + * @param array|string $args { + * @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 successfully + * logging in. Default: the URL originally requested. + * @type string $root The root URL of the site, used in case of error or mode 1 redirects. + * Default: the value of {@link bp_get_root_domain()}. + * @type string $message An error message to display to the user on the log-in page. + * Default: "You must log in to access the page you requested." * } */ function bp_core_no_access( $args = '' ) { - // Build the redirect URL - $redirect_url = is_ssl() ? 'https://' : 'http://'; - $redirect_url .= $_SERVER['HTTP_HOST']; - $redirect_url .= $_SERVER['REQUEST_URI']; + // Build the redirect URL. + $redirect_url = is_ssl() ? 'https://' : 'http://'; + $redirect_url .= $_SERVER['HTTP_HOST']; + $redirect_url .= $_SERVER['REQUEST_URI']; $defaults = array( 'mode' => 2, // 1 = $root, 2 = wp-login.php @@ -549,14 +577,14 @@ function bp_core_no_access( $args = '' ) { /** * Filters the arguments used for user redirecting when visiting access controlled areas. * - * @since BuddyPress (1.6.0) + * @since 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 ); - /** + /* * @ignore Ignore these filters and use 'bp_core_no_access' above */ $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message ); @@ -568,7 +596,7 @@ function bp_core_no_access( $args = '' ) { switch ( $mode ) { // Option to redirect to wp-login.php - // Error message is displayed with bp_core_no_access_wp_login_error() + // Error message is displayed with bp_core_no_access_wp_login_error(). case 2 : if ( !empty( $redirect ) ) { bp_core_redirect( add_query_arg( array( 'action' => 'bpnoaccess' ), wp_login_url( $redirect ) ) ); @@ -579,7 +607,7 @@ function bp_core_no_access( $args = '' ) { break; // Redirect to root with "redirect_to" parameter - // Error message is displayed with bp_core_add_message() + // Error message is displayed with bp_core_add_message(). case 1 : default : @@ -603,9 +631,9 @@ function bp_core_no_access( $args = '' ) { * * Hooks into the "bpnoaccess" action defined in bp_core_no_access(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @global $error Error message to pass to wp-login.php + * @global string $error Error message to pass to wp-login.php. */ function bp_core_no_access_wp_login_error() { global $error; @@ -613,14 +641,14 @@ function bp_core_no_access_wp_login_error() { /** * Filters the error message for wp-login.php when needing to log in before accessing. * - * @since BuddyPress (1.5.0) + * @since 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! + // Shake shake shake!. add_action( 'login_head', 'wp_shake_js', 12 ); } add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' ); @@ -634,7 +662,7 @@ add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' ); * URL - eg, example.com/groups/mygroup/ instead of * example.com/groups/mygroup/home/. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @see BP_Members_Component::setup_globals() where * $bp->canonical_stack['base_url'] and ['component'] may be set. @@ -647,7 +675,7 @@ function bp_redirect_canonical() { /** * Filters whether or not to do canonical redirects on BuddyPress URLs. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Whether or not to do canonical redirects. Default true. */ @@ -660,23 +688,23 @@ function bp_redirect_canonical() { return; } - // build the URL in the address bar + // Build the URL in the address bar. $requested_url = bp_get_requested_url(); - // Stash query args + // Stash query args. $url_stack = explode( '?', $requested_url ); $req_url_clean = $url_stack[0]; $query_args = isset( $url_stack[1] ) ? $url_stack[1] : ''; $canonical_url = bp_get_canonical_url(); - // Only redirect if we've assembled a URL different from the request + // 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 + // they must be readded before redirecting. if ( isset( $bp->template_message ) ) { $message = stripslashes( $bp->template_message ); $message_type = isset( $bp->template_message_type ) ? $bp->template_message_type : 'success'; @@ -696,32 +724,32 @@ function bp_redirect_canonical() { /** * Output rel=canonical header tag for BuddyPress content. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_rel_canonical() { $canonical_url = bp_get_canonical_url(); - // Output rel=canonical tag + // Output rel=canonical tag. echo "<link rel='canonical' href='" . esc_attr( $canonical_url ) . "' />\n"; } /** * Get the canonical URL of the current page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Filter bp_get_canonical_url to modify return value. * * @param array $args { * Optional array of arguments. * @type bool $include_query_args Whether to include current URL arguments - * in the canonical URL returned from the function. + * in the canonical URL returned from the function. * } * @return string Canonical URL for the current page. */ function bp_get_canonical_url( $args = array() ) { - // For non-BP content, return the requested url, and let WP do the work + // For non-BP content, return the requested url, and let WP do the work. if ( bp_is_blog_page() ) { return bp_get_requested_url(); } @@ -729,7 +757,7 @@ function bp_get_canonical_url( $args = array() ) { $bp = buddypress(); $defaults = array( - 'include_query_args' => false // Include URL arguments, eg ?foo=bar&foo2=bar2 + 'include_query_args' => false // Include URL arguments, eg ?foo=bar&foo2=bar2. ); $r = wp_parse_args( $args, $defaults ); extract( $r ); @@ -743,19 +771,19 @@ function bp_get_canonical_url( $args = array() ) { // If requesting the front page component directory, canonical // URL is the front page. We detect whether we're detecting a // component *directory* by checking that bp_current_action() - // is empty - ie, this not a single item or a feed + // is empty - ie, this not a single item or a feed. if ( false !== $front_page_component && bp_is_current_component( $front_page_component ) && ! bp_current_action() ) { $bp->canonical_stack['canonical_url'] = trailingslashit( bp_get_root_domain() ); // 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 + // the members directory to avoid redirect loops. } 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) + * @since 1.5.1 * * @param string $value URL to redirect logged in members to. */ @@ -764,13 +792,13 @@ function bp_get_canonical_url( $args = array() ) { } if ( empty( $bp->canonical_stack['canonical_url'] ) ) { - // Build the URL in the address bar + // Build the URL in the address bar. $requested_url = bp_get_requested_url(); - // Stash query args + // Stash query args. $url_stack = explode( '?', $requested_url ); - // Build the canonical URL out of the redirect stack + // Build the canonical URL out of the redirect stack. if ( isset( $bp->canonical_stack['base_url'] ) ) $url_stack[0] = $bp->canonical_stack['base_url']; @@ -786,10 +814,10 @@ function bp_get_canonical_url( $args = array() ) { } } - // Add trailing slash + // Add trailing slash. $url_stack[0] = trailingslashit( $url_stack[0] ); - // Stash in the $bp global + // Stash in the $bp global. $bp->canonical_stack['canonical_url'] = implode( '?', $url_stack ); } @@ -803,7 +831,7 @@ function bp_get_canonical_url( $args = array() ) { /** * Filters the canonical url of the current page. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $canonical_url Canonical URL of the current page. * @param array $args Array of arguments to help determine canonical URL. @@ -814,7 +842,7 @@ function bp_get_canonical_url( $args = array() ) { /** * Return the URL as requested on the current page load by the user agent. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return string Requested URL string. */ @@ -829,7 +857,7 @@ function bp_get_requested_url() { /** * Filters the URL as requested on the current page load by the user agent. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $value Requested URL string. */ @@ -845,7 +873,7 @@ function bp_get_requested_url() { * This function should be considered temporary, and may be removed without * notice in future versions of BuddyPress. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_is_blog_page() */ @@ -877,7 +905,7 @@ add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' ); * This function will be removed in a later version of BuddyPress. Plugins * (and plugin authors!) should ignore it. * - * @since BuddyPress (1.6.1) + * @since 1.6.1 * * @link https://buddypress.trac.wordpress.org/ticket/4329 * @link https://buddypress.trac.wordpress.org/ticket/4415 @@ -896,7 +924,7 @@ add_action( 'template_redirect', '_bp_rehook_maybe_redirect_404', 1 ); * This function should be considered temporary, and may be removed without * notice in future versions of BuddyPress. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function _bp_maybe_remove_rel_canonical() { if ( ! bp_is_blog_page() && ! is_404() ) { 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 41be0654d5003d08960c0fb1e6a0f5ed121010de..bebf4ed0822d924afa843b166c1ad8af424dbbae 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; require dirname( __FILE__ ) . '/classes/class-bp-user-query.php'; @@ -20,6 +21,12 @@ 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-core-sort-by-key-callback.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'; +require dirname( __FILE__ ) . '/classes/class-bp-attachment-cover-image.php'; +require dirname( __FILE__ ) . '/classes/class-bp-email-recipient.php'; +require dirname( __FILE__ ) . '/classes/class-bp-email.php'; +require dirname( __FILE__ ) . '/classes/class-bp-email-delivery.php'; +require dirname( __FILE__ ) . '/classes/class-bp-phpmailer.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 a24de99b4a83856c46891ab5a874e4d36b6fa534..a6ec86cf76f6d941f891748756132566639973af 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-component.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-component.php @@ -4,805 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -if ( !class_exists( 'BP_Component' ) ) : -/** - * BuddyPress Component Class. - * - * The BuddyPress component class is responsible for simplifying the creation - * of components that share similar behaviors and routines. It is used - * internally by BuddyPress to create the bundled components, but can be - * extended to create other really neat things. - * - * @package BuddyPress - * @subpackage Component - * - * @since BuddyPress (1.5.0) - */ -class BP_Component { - - /** Variables *************************************************************/ - - /** - * Translatable name for the component. - * - * @internal - * @var string $name - */ - public $name = ''; - - /** - * Unique ID for the component. - * - * @var string $id - */ - public $id = ''; - - /** - * Unique slug for the component, for use in query strings and URLs. - * - * @var string $slug - */ - public $slug = ''; - - /** - * Does the component need a top-level directory? - * - * @var bool $has_directory - */ - public $has_directory = false; - - /** - * The path to the component's files. - * - * @var string $path - */ - public $path = ''; - - /** - * The WP_Query loop for this component. - * - * @var WP_Query $query - */ - public $query = false; - - /** - * The current ID of the queried object. - * - * @var string $current_id - */ - public $current_id = ''; - - /** - * Callback for formatting notifications. - * - * @var callable $notification_callback - */ - public $notification_callback = ''; - - /** - * WordPress Toolbar links. - * - * @var array $admin_menu - */ - public $admin_menu = ''; - - /** - * Placeholder text for component directory search box. - * - * @since BuddyPress (1.5.0) - * @var string $search_string - */ - public $search_string = ''; - - /** - * Root slug for the component. - * - * @since BuddyPress (1.5.0) - * @var string $root_slug - */ - public $root_slug = ''; - - /** - * Metadata tables for the component (if applicable) - * - * @since BuddyPress (2.0.0) - * - * @var array - */ - public $meta_tables = array(); - - /** - * Global tables for the component (if applicable) - * - * @since BuddyPress (2.0.0) - * - * @var array - */ - public $global_tables = array(); - - /** Methods ***************************************************************/ - - /** - * Component loader. - * - * @since BuddyPress (1.5.0) - * @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() ) { - - // Internal identifier of component - $this->id = $id; - - // Internal component name - $this->name = $name; - - // Path for includes - $this->path = $path; - - // Miscellaneous component parameters that need to be set early on - if ( ! empty( $params ) ) { - // Sets the position for our menu under the WP Toolbar's "My Account" menu - if ( ! empty( $params['adminbar_myaccount_order'] ) ) { - $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 - $this->adminbar_myaccount_order = 90; - } - - // Move on to the next step - $this->setup_actions(); - } - - /** - * Set up component global variables. - * - * @since BuddyPress (1.5) - * - * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'. - * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug'. - * - * @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. - * } - */ - public function setup_globals( $args = array() ) { - - /** Slugs *************************************************************/ - - // If a WP directory page exists for the component, it should - // be the default value of 'root_slug'. - $default_root_slug = isset( buddypress()->pages->{$this->id}->slug ) ? buddypress()->pages->{$this->id}->slug : ''; - - $r = wp_parse_args( $args, array( - 'slug' => $this->id, - 'root_slug' => $default_root_slug, - 'has_directory' => false, - 'directory_title' => '', - 'notification_callback' => '', - 'search_string' => '', - 'global_tables' => '', - 'meta_tables' => '', - ) ); - - /** - * 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'] ); - - /** - * 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'] ); - - /** - * 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'] ); - - /** - * 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'] ); - - /** - * 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'] ); - - /** - * 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 - if ( ! empty( $r['global_tables'] ) ) { - $this->register_global_tables( $r['global_tables'] ); - } - - // Set the metadata table, if applicable - if ( ! empty( $r['meta_tables'] ) ) { - $this->register_meta_tables( $r['meta_tables'] ); - } - - /** BuddyPress ********************************************************/ - - // Register this component in the loaded components array - buddypress()->loaded_components[$this->slug] = $this->id; - - /** - * 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' ); - } - - /** - * Include required files. - * - * Please note that, by default, this method is fired on the bp_include - * hook, with priority 8. This is necessary so that core components are - * loaded in time to be available to third-party plugins. However, this - * load order means that third-party plugins whose main files are - * loaded at bp_include with priority 10 (as recommended), will not be - * loaded in time for their includes() method to fire automatically. - * - * For this reason, it is recommended that your plugin has its own - * method or function for requiring necessary files. If you must use - * this method, you will have to call it manually in your constructor - * class, ie - * $this->includes(); - * - * Note that when you pass an array value like 'actions' to includes, - * it looks for the following three files (assuming your component is - * called 'my_component'): - * - ./actions - * - ./bp-my_component/actions - * - ./bp-my_component/bp-my_component-actions.php - * - * @since BuddyPress (1.5.0) - * - * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'. - * - * @param array $includes An array of file names, or file name chunks, - * to be parsed and then included. - */ - public function includes( $includes = array() ) { - - // Bail if no files to include - if ( ! empty( $includes ) ) { - $slashed_path = trailingslashit( $this->path ); - - // Loop through files to be included - foreach ( (array) $includes as $file ) { - - $paths = array( - - // Passed with no extension - 'bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php', - 'bp-' . $this->id . '-' . $file . '.php', - 'bp-' . $this->id . '/' . $file . '.php', - - // Passed with extension - $file, - 'bp-' . $this->id . '-' . $file, - 'bp-' . $this->id . '/' . $file, - ); - - foreach ( $paths as $path ) { - if ( @is_file( $slashed_path . $path ) ) { - require( $slashed_path . $path ); - break; - } - } - } - } - - /** - * 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' ); - } - - /** - * Set up the actions. - * - * @since BuddyPress (1.5.0) - * - * @uses add_action() To add various actions. - * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions'. - */ - public function setup_actions() { - - // Setup globals - add_action( 'bp_setup_globals', array( $this, 'setup_globals' ), 10 ); - - // Set up canonical stack - add_action( 'bp_setup_canonical_stack', array( $this, 'setup_canonical_stack' ), 10 ); - - // Include required files. Called early to ensure that BP core - // components are loaded before plugins that hook their loader functions - // to bp_include with the default priority of 10. This is for backwards - // compatibility; henceforth, plugins should register themselves by - // extending this base class. - add_action( 'bp_include', array( $this, 'includes' ), 8 ); - - // Setup navigation - add_action( 'bp_setup_nav', array( $this, 'setup_nav' ), 10 ); - - // Setup WP Toolbar menus - add_action( 'bp_setup_admin_bar', array( $this, 'setup_admin_bar' ), $this->adminbar_myaccount_order ); - - // 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 ); - - // Register taxonomies - add_action( 'bp_register_taxonomies', array( $this, 'register_taxonomies' ), 10 ); - - // Add the rewrite tags - add_action( 'bp_add_rewrite_tags', array( $this, 'add_rewrite_tags' ), 10 ); - - // Add the rewrite rules - add_action( 'bp_add_rewrite_rules', array( $this, 'add_rewrite_rules' ), 10 ); - - // Add the permalink structure - add_action( 'bp_add_permastructs', array( $this, 'add_permastructs' ), 10 ); - - // Allow components to parse the main query - add_action( 'bp_parse_query', array( $this, 'parse_query' ), 10 ); - - // Generate rewrite rules - add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 ); - - /** - * 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' ); - } - - /** - * Set up the canonical URL stack for this component. - * - * @since BuddyPress (2.1.0) - */ - public function setup_canonical_stack() {} - - /** - * Set up component navigation. - * - * @see bp_core_new_nav_item() For a description of the $main_nav - * parameter formatting. - * @see bp_core_new_subnav_item() For a description of how each item - * in the $sub_nav parameter array should be formatted. - * - * @param array $main_nav Optional. Passed directly to - * bp_core_new_nav_item(). See that function for a description. - * @param array $sub_nav Optional. Multidimensional array, each item in - * which is passed to bp_core_new_subnav_item(). See that - * function for a description. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // No sub nav items without a main nav item - if ( !empty( $main_nav ) ) { - bp_core_new_nav_item( $main_nav ); - - // Sub nav items are not required - if ( !empty( $sub_nav ) ) { - foreach( (array) $sub_nav as $nav ) { - bp_core_new_subnav_item( $nav ); - } - } - } - - /** - * 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' ); - } - - /** - * Set up the component entries in the WordPress Admin Bar. - * - * @see WP_Admin_Bar::add_menu() for a description of the syntax - * required by each item in the $wp_admin_nav parameter array. - * @global obj $wp_admin_bar - * - * @param array $wp_admin_nav An array of nav item arguments. Each item - * in this parameter array is passed to {@link WP_Admin_Bar::add_menu()}. - * See that method for a description of the required syntax for - * each item. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - - // Bail if this is an ajax request - if ( defined( 'DOING_AJAX' ) ) { - return; - } - - // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false - if ( ! bp_use_wp_admin_bar() ) { - return; - } - - /** - * 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? - if ( !empty( $wp_admin_nav ) ) { - - // Set this objects menus - $this->admin_menu = $wp_admin_nav; - - // Define the WordPress global - global $wp_admin_bar; - - // Add each admin menu - foreach( $this->admin_menu as $admin_menu ) { - $wp_admin_bar->add_menu( $admin_menu ); - } - } - - /** - * 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' ); - } - - /** - * Set up the component title. - * - * @since BuddyPress (1.5.0) - * - * @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. - * - * @since BuddyPress (2.0.0) - * - * @param array $tables - */ - public function register_global_tables( $tables = array() ) { - - /** - * 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 - if ( !empty( $tables ) && is_array( $tables ) ) { - foreach ( $tables as $global_name => $table_name ) { - $this->$global_name = $table_name; - } - - // Keep a record of the metadata tables in the 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' ); - } - - /** - * Register component metadata tables. - * - * Metadata tables are registered in the $wpdb global, for - * compatibility with the WordPress metadata API. - * - * @since BuddyPress (2.0.0) - * - * @param array $tables - */ - public function register_meta_tables( $tables = array() ) { - global $wpdb; - - /** - * 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 ); - - /** - * Add the name of each metadata table to WPDB to allow BuddyPress - * components to play nicely with the WordPress metadata API. - */ - if ( !empty( $tables ) && is_array( $tables ) ) { - foreach( $tables as $meta_prefix => $table_name ) { - $wpdb->{$meta_prefix . 'meta'} = $table_name; - } - - // Keep a record of the metadata tables in the 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' ); - } - - /** - * Set up the component post types. - * - * @since BuddyPress (1.5.0) - * - * @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' ); - } - - /** - * Register component-specific taxonomies. - * - * @since BuddyPress (1.5.0) - * - * @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' ); - } - - /** - * Add any additional rewrite tags. - * - * @since BuddyPress (1.5.0) - * - * @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' ); - } - - /** - * Add any additional rewrite rules. - * - * @since BuddyPress (1.9.0) - * - * @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' ); - } - - /** - * Add any permalink structures - * - * @since BuddyPress (1.9) - * - * @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' ); - } - - /** - * Allow components to parse the main query - * - * @since BuddyPress (1.9) - * - * @uses do_action() Calls 'bp_{@link bp_Component::name}_parse_query' - * @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 ) ); - } - - /** - * Generate any additional rewrite rules - * - * @since BuddyPress (1.5) - * - * @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' ); - } -} -endif; // BP_Component +require dirname( __FILE__ ) . '/classes/class-bp-component.php'; 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 45466e445fc372bbcc678e13696517c327770af9..ba3d3bd43a9430dbb39c3bd85e1f7348f96c3c2f 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php @@ -4,30 +4,31 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Register scripts commonly used by BuddyPress. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_core_register_common_scripts() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); $url = buddypress()->plugin_url . 'bp-core/js/'; /** * Filters the BuddyPress Core javascript files to register. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $value Array of javascript file information to register. */ $scripts = apply_filters( 'bp_core_register_common_scripts', array( - // Legacy + // Legacy. '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 ), @@ -43,6 +44,9 @@ function bp_core_register_common_scripts() { '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 ), + // 2.4 + 'bp-cover-image' => array( 'file' => "{$url}cover-image{$min}.js", 'dependencies' => array(), 'footer' => true ), + ) ); $version = bp_get_version(); @@ -56,16 +60,16 @@ add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_scripts', 1 ); /** * Register styles commonly used by BuddyPress. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_core_register_common_styles() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); $url = buddypress()->plugin_url . 'bp-core/css/'; /** * Filters the URL for the Admin Bar stylesheet. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value URL for the Admin Bar stylesheet. */ @@ -74,7 +78,7 @@ function bp_core_register_common_styles() { /** * Filters the BuddyPress Core stylesheet files to register. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $value Array of stylesheet file information to register. */ @@ -103,6 +107,8 @@ add_action( 'bp_admin_enqueue_scripts', 'bp_core_register_common_styles', 1 ); /** * Load the JS for "Are you sure?" .confirm links. + * + * @since 1.1.0 */ function bp_core_confirmation_js() { if ( is_multisite() && ! bp_is_root_blog() ) { @@ -120,27 +126,44 @@ 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 + * Enqueues the css and js required by the Avatar UI. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_core_avatar_scripts() { if ( ! bp_avatar_is_front_edit() ) { return false; } - // Enqueue the Attachments scripts for the Avatar UI + // Enqueue the Attachments scripts for the Avatar UI. bp_attachments_enqueue_scripts( 'BP_Attachment_Avatar' ); - // Add Some actions for Theme backcompat + // 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 the css and js required by the Cover Image UI. + * + * @since 2.4.0 + */ +function bp_core_cover_image_scripts() { + if ( ! bp_attachments_cover_image_is_edit() ) { + return false; + } + + // Enqueue the Attachments scripts for the Cover Image UI. + bp_attachments_enqueue_scripts( 'BP_Attachment_Cover_Image' ); +} +add_action( 'bp_enqueue_scripts', 'bp_core_cover_image_scripts' ); + /** * Enqueues jCrop library and hooks BP's custom cropper JS. + * + * @since 1.1.0 */ function bp_core_add_jquery_cropper() { wp_enqueue_style( 'jcrop' ); @@ -151,13 +174,15 @@ function bp_core_add_jquery_cropper() { /** * Output the inline JS needed for the cropper to work on a per-page basis. + * + * @since 1.1.0 */ function bp_core_add_cropper_inline_js() { /** * Filters the return value of getimagesize to determine if an image was uploaded. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $value Array of data found by getimagesize. */ @@ -166,48 +191,47 @@ function bp_core_add_cropper_inline_js() { return; } - // Get avatar full width and height + // Get avatar full width and height. $full_height = bp_core_avatar_full_height(); $full_width = bp_core_avatar_full_width(); - // Calculate Aspect Ratio + // Calculate Aspect Ratio. if ( !empty( $full_height ) && ( $full_width != $full_height ) ) { $aspect_ratio = $full_width / $full_height; } else { $aspect_ratio = 1; } - // Default cropper coordinates - - // Smaller than full-width: cropper defaults to entire image + // Default cropper coordinates. + // Smaller than full-width: cropper defaults to entire image. if ( $image[0] < $full_width ) { $crop_left = 0; $crop_right = $image[0]; - // Less than 2x full-width: cropper defaults to full-width + // Less than 2x full-width: cropper defaults to full-width. } elseif ( $image[0] < ( $full_width * 2 ) ) { $padding_w = round( ( $image[0] - $full_width ) / 2 ); $crop_left = $padding_w; $crop_right = $image[0] - $padding_w; - // Larger than 2x full-width: cropper defaults to 1/2 image width + // Larger than 2x full-width: cropper defaults to 1/2 image width. } else { $crop_left = round( $image[0] / 4 ); $crop_right = $image[0] - $crop_left; } - // Smaller than full-height: cropper defaults to entire image + // Smaller than full-height: cropper defaults to entire image. if ( $image[1] < $full_height ) { $crop_top = 0; $crop_bottom = $image[1]; - // Less than double full-height: cropper defaults to full-height + // Less than double full-height: cropper defaults to full-height. } elseif ( $image[1] < ( $full_height * 2 ) ) { $padding_h = round( ( $image[1] - $full_height ) / 2 ); $crop_top = $padding_h; $crop_bottom = $image[1] - $padding_h; - // Larger than 2x full-height: cropper defaults to 1/2 image height + // Larger than 2x full-height: cropper defaults to 1/2 image height. } else { $crop_top = round( $image[1] / 4 ); $crop_bottom = $image[1] - $crop_top; @@ -255,7 +279,7 @@ function bp_core_add_cropper_inline_js() { /** * Output the inline CSS for the BP image cropper. * - * @package BuddyPress Core + * @since 1.1.0 */ function bp_core_add_cropper_inline_css() { ?> @@ -277,7 +301,7 @@ function bp_core_add_cropper_inline_css() { /** * Define the 'ajaxurl' JS variable, used by themes as an AJAX endpoint. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ function bp_core_add_ajax_url_js() { ?> @@ -294,7 +318,7 @@ add_action( 'wp_head', 'bp_core_add_ajax_url_js' ); * Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite * configurations. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return string AJAX endpoint URL. */ @@ -303,7 +327,7 @@ function bp_core_ajax_url() { /** * Filters the proper value for BuddyPress' ajaxurl. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $value Proper ajaxurl value for BuddyPress. */ @@ -313,9 +337,9 @@ function bp_core_ajax_url() { /** * Get the JavaScript dependencies for buddypress.js. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @uses apply_filters() to allow other component to load extra dependencies + * @uses apply_filters() to allow other component to load extra dependencies. * * @return array The JavaScript dependencies. */ @@ -324,7 +348,7 @@ function bp_core_get_js_dependencies() { /** * Filters the javascript dependencies for buddypress.js. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $value Array of javascript dependencies for buddypress.js. */ @@ -337,3 +361,104 @@ function bp_core_get_js_dependencies() { 'bp-jquery-scroll-to' ) ); } + +/** + * Add inline css to display the component's single item cover image + * + * @since 2.4.0 + * + * @param bool $return True to get the inline css. + * @return string|array the inline css or an associative array containing + * the css rules and the style handle + */ +function bp_add_cover_image_inline_css( $return = false ) { + $bp = buddypress(); + + // Find the component of the current item. + if ( bp_is_user() ) { + + // User is not allowed to upload cover images + // no need to carry on. + if ( bp_disable_cover_image_uploads() ) { + return; + } + + $cover_image_object = array( + 'component' => 'xprofile', + 'object' => $bp->displayed_user + ); + } elseif ( bp_is_group() ) { + + // Users are not allowed to upload cover images for their groups + // no need to carry on. + if ( bp_disable_group_cover_image_uploads() ) { + return; + } + + $cover_image_object = array( + 'component' =>'groups', + 'object' => $bp->groups->current_group + ); + } else { + $cover_image_object = apply_filters( 'bp_current_cover_image_object_inline_css', array() ); + } + + // Bail if no component were found. + if ( empty( $cover_image_object['component'] ) || empty( $cover_image_object['object'] ) || ! bp_is_active( $cover_image_object['component'], 'cover_image' ) ) { + return; + } + + // Get the settings of the cover image feature for the current component. + $params = bp_attachments_get_cover_image_settings( $cover_image_object['component'] ); + + // Bail if no params. + if ( empty( $params ) ) { + return; + } + + // Try to call the callback. + if ( is_callable( $params['callback'] ) ) { + + $object_dir = $cover_image_object['component']; + + if ( 'xprofile' === $object_dir ) { + $object_dir = 'members'; + } + + $cover_image = bp_attachments_get_attachment( 'url', array( + 'object_dir' => $object_dir, + 'item_id' => $cover_image_object['object']->id, + ) ); + + if ( empty( $cover_image ) ) { + if ( ! empty( $params['default_cover'] ) ) { + $cover_image = $params['default_cover']; + } + } + + $inline_css = call_user_func_array( $params['callback'], array( array( + 'cover_image' => esc_url_raw( $cover_image ), + 'component' => sanitize_key( $cover_image_object['component'] ), + 'object_id' => (int) $cover_image_object['object']->id, + 'width' => (int) $params['width'], + 'height' => (int) $params['height'], + ) ) ); + + // Finally add the inline css to the handle. + if ( ! empty( $inline_css ) ) { + + // Used to get the css when Ajax setting the cover image. + if ( true === $return ) { + return array( + 'css_rules' => '<style type="text/css">' . "\n" . $inline_css . "\n" . '</style>', + 'handle' => $params['theme_handle'], + ); + } + + wp_add_inline_style( $params['theme_handle'], $inline_css ); + } else { + return false; + } + } +} +add_action( 'bp_enqueue_scripts', 'bp_add_cover_image_inline_css', 11 ); diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-customizer-email.php b/wp-content/plugins/buddypress/bp-core/bp-core-customizer-email.php new file mode 100644 index 0000000000000000000000000000000000000000..243fd7064e41265fcecf8c7230533a1b9895fe3c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/bp-core-customizer-email.php @@ -0,0 +1,441 @@ +<?php +/** + * BuddyPress Customizer implementation for email. + * + * @since 2.5.0 + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Initialize the Customizer for emails. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $wp_customize The Customizer object. + */ +function bp_email_init_customizer( WP_Customize_Manager $wp_customize ) { + + // Require WP 4.0+. + if ( ! method_exists( $wp_customize, 'add_panel' ) ) { + return; + } + + if ( ! bp_is_email_customizer() && ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) ) { + return; + } + + $wp_customize->add_panel( 'bp_mailtpl', array( + 'description' => __( 'Customize the appearance of emails sent by BuddyPress.', 'buddypress' ), + 'title' => _x( 'BuddyPress Emails', 'screen heading', 'buddypress' ), + ) ); + + $sections = bp_email_get_customizer_sections(); + foreach( $sections as $section_id => $args ) { + $wp_customize->add_section( $section_id, $args ); + } + + $settings = bp_email_get_customizer_settings(); + foreach( $settings as $setting_id => $args ) { + $wp_customize->add_setting( $setting_id, $args ); + } + + /** + * BP_Customizer_Control_Range class. + */ + require_once dirname( __FILE__ ) . '/classes/class-bp-customizer-control-range.php'; + + /** + * Fires to let plugins register extra Customizer controls for emails. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $wp_customize The Customizer object. + */ + do_action( 'bp_email_customizer_register_sections', $wp_customize ); + + $controls = bp_email_get_customizer_controls(); + foreach ( $controls as $control_id => $args ) { + $wp_customize->add_control( new $args['class']( $wp_customize, $control_id, $args ) ); + } + + + /* + * Hook actions/filters for further configuration. + */ + + add_filter( 'customize_section_active', 'bp_email_customizer_hide_sections', 12, 2 ); + + if ( is_customize_preview() ) { + /* + * Enqueue scripts/styles for the Customizer's preview window. + * + * Scripts can't be registered in bp_core_register_common_styles() etc because + * the Customizer loads very, very early. + */ + $bp = buddypress(); + $min = bp_core_get_minified_asset_suffix(); + + wp_enqueue_script( + 'bp-customizer-receiver-emails', + "{$bp->plugin_url}bp-core/admin/js/customizer-receiver-emails{$min}.js", + array( 'customize-preview' ), + bp_get_version(), + true + ); + + // Include the preview loading style + add_action( 'wp_footer', array( $wp_customize, 'customize_preview_loading_style' ) ); + } +} +add_action( 'bp_customize_register', 'bp_email_init_customizer' ); + +/** + * Are we looking at the email customizer? + * + * @since 2.5.0 + * + * @return bool + */ +function bp_is_email_customizer() { + return isset( $_GET['bp_customizer'] ) && $_GET['bp_customizer'] === 'email'; +} + +/** + * Only show email sections in the Customizer. + * + * @since 2.5.0 + * + * @param $active Whether the Customizer section is active. + * @param WP_Customize_Section $section {@see WP_Customize_Section} instance. + * @return bool + */ +function bp_email_customizer_hide_sections( $active, $section ) { + if ( ! bp_is_email_customizer() ) { + return $active; + } + + return in_array( $section->id, array_keys( bp_email_get_customizer_sections() ), true ); +} + +/** + * Get Customizer sections for emails. + * + * @since 2.5.0 + * + * @return array + */ +function bp_email_get_customizer_sections() { + + /** + * Filter Customizer sections for emails. + * + * @since 2.5.0 + * + * @param array $sections Email Customizer sections to add. + */ + return apply_filters( 'bp_email_get_customizer_sections', array( + 'section_bp_mailtpl_header' => array( + 'capability' => 'bp_moderate', + 'panel' => 'bp_mailtpl', + 'title' => _x( 'Header', 'email', 'buddypress' ), + ), + 'section_bp_mailtpl_body' => array( + 'capability' => 'bp_moderate', + 'panel' => 'bp_mailtpl', + 'title' => _x( 'Body', 'email', 'buddypress' ), + ), + 'section_bp_mailtpl_footer' => array( + 'capability' => 'bp_moderate', + 'panel' => 'bp_mailtpl', + 'title' => _x( 'Footer', 'email', 'buddypress' ), + ), + ) ); +} + +/** + * Get Customizer settings for emails. + * + * @since 2.5.0 + * + * @return array + */ +function bp_email_get_customizer_settings() { + $defaults = bp_email_get_appearance_settings(); + + /** + * Filter Customizer settings for emails. + * + * @since 2.5.0 + * + * @param array $settings Email Customizer settings to add. + */ + return apply_filters( 'bp_email_get_customizer_settings', array( + 'bp_email_options[email_bg]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['email_bg'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[header_bg]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['header_bg'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[header_text_size]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['header_text_size'], + 'sanitize_callback' => 'intval', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[header_text_color]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['header_text_color'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[highlight_color]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['highlight_color'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[body_bg]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['body_bg'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[body_text_size]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['body_text_size'], + 'sanitize_callback' => 'intval', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[body_text_color]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['body_text_color'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[footer_text]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['footer_text'], + 'sanitize_callback' => 'wp_filter_post_kses', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[footer_bg]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['footer_bg'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[footer_text_size]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['footer_text_size'], + 'sanitize_callback' => 'intval', + 'transport' => 'postMessage', + 'type' => 'option', + ), + 'bp_email_options[footer_text_color]' => array( + 'capability' => 'bp_moderate', + 'default' => $defaults['footer_text_color'], + 'sanitize_callback' => 'sanitize_hex_color', + 'transport' => 'postMessage', + 'type' => 'option', + ), + ) ); +} + +/** + * Get Customizer controls for emails. + * + * @since 2.5.0 + * + * @return array + */ +function bp_email_get_customizer_controls() { + + /** + * Filter Customizer controls for emails. + * + * @since 2.5.0 + * + * @param array $controls Email Customizer controls to add. + */ + return apply_filters( 'bp_email_get_customizer_controls', array( + 'bp_mailtpl_email_bg' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Email background color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_header', + 'settings' => 'bp_email_options[email_bg]', + ), + + 'bp_mailtpl_header_bg' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Header background color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_header', + 'settings' => 'bp_email_options[header_bg]', + ), + + 'bp_mailtpl_highlight_color' => array( + 'class' => 'WP_Customize_Color_Control', + 'description' => __( 'Applied to links and other decorative areas.', 'buddypress' ), + 'label' => __( 'Highlight color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_header', + 'settings' => 'bp_email_options[highlight_color]', + ), + + 'bp_mailtpl_header_text_color' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Text color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_header', + 'settings' => 'bp_email_options[header_text_color]', + ), + + 'bp_mailtpl_header_text_size' => array( + 'class' => 'BP_Customizer_Control_Range', + 'label' => __( 'Text size', 'buddypress' ), + 'section' => 'section_bp_mailtpl_header', + 'settings' => 'bp_email_options[header_text_size]', + + 'input_attrs' => array( + 'max' => 100, + 'min' => 1, + 'step' => 1, + ), + ), + + + 'bp_mailtpl_body_bg' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Background color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_body', + 'settings' => 'bp_email_options[body_bg]', + ), + + + 'bp_mailtpl_body_text_color' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Text color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_body', + 'settings' => 'bp_email_options[body_text_color]', + ), + + 'bp_mailtpl_body_text_size' => array( + 'class' => 'BP_Customizer_Control_Range', + 'label' => __( 'Text size', 'buddypress' ), + 'section' => 'section_bp_mailtpl_body', + 'settings' => 'bp_email_options[body_text_size]', + + 'input_attrs' => array( + 'max' => 24, + 'min' => 8, + 'step' => 1, + ), + ), + + + 'bp_mailtpl_footer_text' => array( + 'class' => 'WP_Customize_Control', + 'description' => __('Change the email footer here', 'buddypress' ), + 'label' => __( 'Footer text', 'buddypress' ), + 'section' => 'section_bp_mailtpl_footer', + 'settings' => 'bp_email_options[footer_text]', + 'type' => 'textarea', + ), + + 'bp_mailtpl_footer_bg' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Background color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_footer', + 'settings' => 'bp_email_options[footer_bg]', + ), + + 'bp_mailtpl_footer_text_color' => array( + 'class' => 'WP_Customize_Color_Control', + 'label' => __( 'Text color', 'buddypress' ), + 'section' => 'section_bp_mailtpl_footer', + 'settings' => 'bp_email_options[footer_text_color]', + ), + + 'bp_mailtpl_footer_text_size' => array( + 'class' => 'BP_Customizer_Control_Range', + 'label' => __( 'Text size', 'buddypress' ), + 'section' => 'section_bp_mailtpl_footer', + 'settings' => 'bp_email_options[footer_text_size]', + + 'input_attrs' => array( + 'max' => 24, + 'min' => 8, + 'step' => 1, + ), + ), + ) ); +} + +/** + * Implements a JS redirect to the Customizer, previewing a randomly selected email. + * + * @since 2.5.0 + */ +function bp_email_redirect_to_customizer() { + $switched = false; + + // Switch to the root blog, where the email posts live. + if ( ! bp_is_root_blog() ) { + switch_to_blog( bp_get_root_blog_id() ); + $switched = true; + } + + $email = get_posts( array( + 'fields' => 'ids', + 'orderby' => 'rand', + 'post_status' => 'publish', + 'post_type' => bp_get_email_post_type(), + 'posts_per_page' => 1, + 'suppress_filters' => false, + ) ); + + $preview_url = admin_url(); + + if ( $email ) { + $preview_url = get_post_permalink( $email[0] ) . '&bp_customizer=email'; + } + + $redirect_url = add_query_arg( + array( + 'autofocus[panel]' => 'bp_mailtpl', + 'bp_customizer' => 'email', + 'return' => rawurlencode( admin_url() ), + 'url' => rawurlencode( $preview_url ), + ), + admin_url( 'customize.php' ) + ); + + if ( $switched ) { + restore_current_blog(); + } + + printf( + '<script type="text/javascript">window.location = "%s";</script>', + esc_url_raw( $redirect_url ) + ); + + exit; +} 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 6534851cfa2d848561a095833e69bec2f6ec0118..8dc9122d534a2dde5d07434e59e95880046b745f 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php @@ -1,5 +1,4 @@ <?php - /** * Plugin Dependency Action Hooks. * @@ -15,43 +14,53 @@ * manually called and/or piggy-backed on top of other hooks if needed. * * @todo use anonymous functions when PHP minimum requirement allows (5.3) + * + * @package BuddyPress + * @subpackage Core + * @since 1.7.0 */ /** * Fire the 'bp_include' action, where plugins should include files. + * + * @since 1.2.5 */ function bp_include() { /** * Fires inside the 'bp_include' function, where plugins should include files. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 */ do_action( 'bp_include' ); } /** * Fire the 'bp_setup_components' action, where plugins should initialize components. + * + * @since 1.6.0 */ function bp_setup_components() { /** * Fires inside the 'bp_setup_components' function, where plugins should initialize components. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_setup_components' ); } /** * Fire the 'bp_setup_canonical_stack' action, where plugins should set up their canonical URL. + * + * @since 2.1.0 */ 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) + * @since 2.1.0 */ do_action( 'bp_setup_canonical_stack' ); } @@ -59,46 +68,67 @@ function bp_setup_canonical_stack() { /** * Fire the 'bp_register_taxonomies' action, where plugins should register taxonomies. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_register_taxonomies() { /** * Fires inside the 'bp_register_taxonomies' function, where plugins should register taxonomies. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ do_action( 'bp_register_taxonomies' ); } +/** + * Fire the 'bp_register_post_types' action, where plugins should register post types. + * + * @since 2.5.0 + */ +function bp_register_post_types() { + + /** + * Fires inside the 'bp_register_post_types' function, where plugins should register post types. + * + * @since 2.5.0 + */ + do_action( 'bp_register_post_types' ); +} + /** * Fire the 'bp_setup_globals' action, where plugins should initialize global settings. + * + * @since 1.2.0 */ function bp_setup_globals() { /** * Fires inside the 'bp_setup_globals' function, where plugins should initialize global settings. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_setup_globals' ); } /** * Fire the 'bp_setup_nav' action, where plugins should register their navigation items. + * + * @since 1.2.0 */ function bp_setup_nav() { /** * Fires inside the 'bp_setup_nav' function, where plugins should register their navigation items. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_setup_nav' ); } /** * Fire the 'bp_setup_admin_bar' action, where plugins should add items to the WP admin bar. + * + * @since 1.5.0 */ function bp_setup_admin_bar() { if ( bp_use_wp_admin_bar() ) { @@ -108,7 +138,7 @@ function bp_setup_admin_bar() { * * This hook will only fire if bp_use_wp_admin_bar() returns true. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_setup_admin_bar' ); } @@ -116,26 +146,30 @@ function bp_setup_admin_bar() { /** * Fire the 'bp_setup_title' action, where plugins should modify the page title. + * + * @since 1.5.0 */ function bp_setup_title() { /** * Fires inside the 'bp_setup_title' function, where plugins should modify the page title. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_setup_title' ); } /** * Fire the 'bp_register_widgets' action, where plugins should register widgets. + * + * @since 1.2.0 */ function bp_setup_widgets() { /** * Fires inside the 'bp_register_widgets' function, where plugins should register widgets. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_register_widgets' ); } @@ -143,14 +177,14 @@ function bp_setup_widgets() { /** * Fire the 'bp_register_member_types' action, where plugins should register member types. * - * @since BuddyPress (2.3.0) + * @since 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) + * @since 2.3.0 */ do_action( 'bp_register_member_types' ); } @@ -158,14 +192,14 @@ function bp_register_member_types() { /** * Fire the 'bp_setup_cache_groups' action, where cache groups are registered. * - * @since BuddyPress (2.2.0) + * @since 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) + * @since 2.2.0 */ do_action( 'bp_setup_cache_groups' ); } @@ -175,6 +209,8 @@ function bp_setup_cache_groups() { * * We white-list the WordPress customizer which purposely loads the user early. * + * @since 1.7.0 + * * @link https://buddypress.trac.wordpress.org/ticket/6046 * @link https://core.trac.wordpress.org/ticket/24169 * @@ -192,35 +228,59 @@ function bp_setup_current_user() { /** * Fires to set up the current user setup process. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_setup_current_user' ); } /** * Fire the 'bp_init' action, BuddyPress's main initialization hook. + * + * @since 1.2.5 */ function bp_init() { /** * Fires inside the 'bp_init' function, BuddyPress' main initialization hook. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_init' ); } +/** + * Fire the 'bp_customize_register' action when the Customizer has loaded, + * allowing scripts and styles to be initialized. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $customizer Customizer instance. + */ +function bp_customize_register( WP_Customize_Manager $customizer ) { + + /** + * Fires once the Customizer has loaded, allow scripts and styles to be initialized. + * + * @since 2.5.0 + * + * @param WP_Customize_Manager $customizer Customizer instance. + */ + do_action( 'bp_customize_register', $customizer ); +} + /** * Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded. * * Attached to 'plugins_loaded'. + * + * @since 1.2.0 */ 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) + * @since 1.2.5 */ do_action( 'bp_loaded' ); } @@ -229,13 +289,15 @@ function bp_loaded() { * Fire the 'bp_ready' action, which runs after BP is set up and the page is about to render. * * Attached to 'wp'. + * + * @since 1.6.0 */ 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) + * @since 1.6.0 */ do_action( 'bp_ready' ); } @@ -245,13 +307,15 @@ function bp_ready() { * * Attach potential template actions, such as catching form requests or routing * custom URLs. + * + * @since 1.5.0 */ function bp_actions() { /** * Fires inside the 'bp_actions' function, which runs just before rendering. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_actions' ); } @@ -261,6 +325,8 @@ function bp_actions() { * * Runs just after 'bp_actions'. Use this hook to attach your template * loaders. + * + * @since 1.5.0 */ function bp_screens() { @@ -269,7 +335,7 @@ function bp_screens() { * * Runs just after 'bp_actions'. Use this hook to attach your template loaders. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_screens' ); } @@ -278,6 +344,8 @@ function bp_screens() { * Fire 'bp_widgets_init', which runs after widgets have been set up. * * Hooked to 'widgets_init'. + * + * @since 1.6.0 */ function bp_widgets_init() { @@ -286,7 +354,7 @@ function bp_widgets_init() { * * Hooked to 'widgets_init'. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action ( 'bp_widgets_init' ); } @@ -295,8 +363,16 @@ function bp_widgets_init() { * Fire 'bp_head', which is used to hook scripts and styles in the <head>. * * Hooked to 'wp_head'. + * + * @since 1.6.0 */ function bp_head() { + + /** + * Fires inside the 'bp_head' function, which runs on 'wp_head'. + * + * @since 1.6.0 + */ do_action ( 'bp_head' ); } @@ -309,7 +385,7 @@ function bp_head() { * template. The main purpose of this hook in BuddyPress is to redirect users * who do not have the proper permission to access certain content. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() */ @@ -318,7 +394,7 @@ function bp_template_redirect() { /** * Fires inside the 'bp_template_redirect' function. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_template_redirect' ); } @@ -330,7 +406,7 @@ function bp_template_redirect() { * * The main action used registering theme directories. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses do_action() */ @@ -341,7 +417,7 @@ function bp_register_theme_directory() { * * The main action used registering theme directories. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_register_theme_directory' ); } @@ -351,7 +427,7 @@ function bp_register_theme_directory() { * * The main action used registering theme packages. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses do_action() */ @@ -360,7 +436,7 @@ function bp_register_theme_packages() { /** * Fires inside the 'bp_register_theme_packages' function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_register_theme_packages' ); } @@ -368,7 +444,7 @@ function bp_register_theme_packages() { /** * Fire the 'bp_enqueue_scripts' action, where BP enqueues its CSS and JS. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_enqueue_scripts'. */ @@ -377,7 +453,7 @@ function bp_enqueue_scripts() { /** * Fires inside the 'bp_enqueue_scripts' function, where BP enqueues its CSS and JS. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action ( 'bp_enqueue_scripts' ); } @@ -385,7 +461,7 @@ function bp_enqueue_scripts() { /** * Fire the 'bp_add_rewrite_tag' action, where BP adds its custom rewrite tags. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @uses do_action() Calls 'bp_add_rewrite_tags'. */ @@ -394,7 +470,7 @@ 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) + * @since 1.8.0 */ do_action( 'bp_add_rewrite_tags' ); } @@ -402,7 +478,7 @@ function bp_add_rewrite_tags() { /** * Fire the 'bp_add_rewrite_rules' action, where BP adds its custom rewrite rules. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses do_action() Calls 'bp_add_rewrite_rules'. */ @@ -411,7 +487,7 @@ 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) + * @since 1.9.0 */ do_action( 'bp_add_rewrite_rules' ); } @@ -419,7 +495,7 @@ function bp_add_rewrite_rules() { /** * Fire the 'bp_add_permastructs' action, where BP adds its BP-specific permalink structure. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses do_action() Calls 'bp_add_permastructs'. */ @@ -428,7 +504,7 @@ function bp_add_permastructs() { /** * Fires inside the 'bp_add_permastructs' function, where BP adds its BP-specific permalink structure. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ do_action( 'bp_add_permastructs' ); } @@ -439,7 +515,7 @@ function bp_add_permastructs() { * The main purpose of 'bp_setup_theme' is give themes a place to load their * BuddyPress-specific functionality. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_setup_theme'. */ @@ -448,7 +524,7 @@ function bp_setup_theme() { /** * Fires inside the 'bp_setup_theme' function. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action ( 'bp_setup_theme' ); } @@ -463,7 +539,7 @@ function bp_setup_theme() { * time for other themes to load their features, such as BuddyPress support, * before our theme compatibility layer kicks in. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_after_setup_theme'. */ @@ -472,7 +548,7 @@ function bp_after_setup_theme() { /** * Fires inside the 'bp_after_setup_theme' function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action ( 'bp_after_setup_theme' ); } @@ -482,7 +558,7 @@ function bp_after_setup_theme() { /** * Fire the 'bp_request' filter, a piggy-back of WP's 'request'. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see WP::parse_request() for a description of parameters. * @@ -494,7 +570,7 @@ function bp_request( $query_vars = array() ) { /** * Filters the query_vars for the current request. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $query_vars Array of query variables. */ @@ -504,12 +580,11 @@ function bp_request( $query_vars = array() ) { /** * Fire the 'bp_login_redirect' filter, a piggy-back of WP's 'login_redirect'. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param string $redirect_to See 'login_redirect'. + * @param string $redirect_to See 'login_redirect'. * @param string $redirect_to_raw See 'login_redirect'. - * @param bool $user See 'login_redirect'. - * + * @param bool $user See 'login_redirect'. * @return string */ function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) { @@ -517,7 +592,7 @@ function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = fa /** * Filters the URL to redirect to after login. * - * @since BuddyPress (1.7.0) + * @since 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. @@ -531,7 +606,7 @@ function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = fa * * Hooked to 'template_include'. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() * @@ -543,7 +618,7 @@ function bp_template_include( $template = '' ) { /** * Filters the template to use with template_include. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $template The path of the template to include. */ @@ -553,7 +628,7 @@ function bp_template_include( $template = '' ) { /** * Fire the 'bp_generate_rewrite_rules' action, where BP generates its rewrite rules. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}. * @@ -564,7 +639,7 @@ function bp_generate_rewrite_rules( $wp_rewrite ) { /** * Fires inside the 'bp_generate_rewrite_rules' function. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param WP_Rewrite $wp_rewrite WP_Rewrite object. Passed by reference. */ @@ -576,16 +651,19 @@ function bp_generate_rewrite_rules( $wp_rewrite ) { * * Filter the allowed themes list for BuddyPress-specific themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list. + * + * @param array $themes The path of the template to include. + * @return array */ function bp_allowed_themes( $themes ) { /** * Filters the allowed themes list for BuddyPress-specific themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template The path of the template to include. */ @@ -595,24 +673,25 @@ function bp_allowed_themes( $themes ) { /** Requests ******************************************************************/ /** - * The main action used for handling theme-side POST requests + * The main action used for handling theme-side POST requests. + * + * @since 1.9.0 * - * @since BuddyPress (1.9.0) * @uses do_action() */ function bp_post_request() { - // Bail if not a POST action + // Bail if not a POST action. if ( ! bp_is_post_request() ) { return; } - // Bail if no action + // Bail if no action. if ( empty( $_POST['action'] ) ) { return; } - // Sanitize the POST action + // Sanitize the POST action. $action = sanitize_key( $_POST['action'] ); /** @@ -621,7 +700,7 @@ function bp_post_request() { * 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) + * @since 1.9.0 */ do_action( 'bp_post_request_' . $action ); @@ -630,7 +709,7 @@ function bp_post_request() { * * Use this static action if you don't mind checking the 'action' yourself. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $action The action being run. */ @@ -638,24 +717,25 @@ function bp_post_request() { } /** - * The main action used for handling theme-side GET requests + * The main action used for handling theme-side GET requests. + * + * @since 1.9.0 * - * @since BuddyPress (1.9.0) * @uses do_action() */ function bp_get_request() { - // Bail if not a POST action + // Bail if not a POST action. if ( ! bp_is_get_request() ) { return; } - // Bail if no action + // Bail if no action. if ( empty( $_GET['action'] ) ) { return; } - // Sanitize the GET action + // Sanitize the GET action. $action = sanitize_key( $_GET['action'] ); /** @@ -664,7 +744,7 @@ function bp_get_request() { * 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) + * @since 1.9.0 */ do_action( 'bp_get_request_' . $action ); @@ -673,7 +753,7 @@ function bp_get_request() { * * Use this static action if you don't mind checking the 'action' yourself. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $action The action being run. */ 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 1f2447faa837d5c0561b5be3f20767c76a9eedb0..e03397211efd383c279b84d0486a6749b33880fc 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Filters. * @@ -17,10 +16,12 @@ * * @package BuddyPress * @subpackage Core + * @since 1.5.0 + * * @see bp-core-actions.php */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -44,7 +45,7 @@ add_filter( 'template_include', 'bp_template_include', 10 ); add_filter( 'login_redirect', 'bp_login_redirect', 10, 3 ); add_filter( 'map_meta_cap', 'bp_map_meta_caps', 10, 4 ); -// Add some filters to feedback messages +// Add some filters to feedback messages. add_filter( 'bp_core_render_message_content', 'wptexturize' ); add_filter( 'bp_core_render_message_content', 'convert_smilies' ); add_filter( 'bp_core_render_message_content', 'convert_chars' ); @@ -52,6 +53,12 @@ add_filter( 'bp_core_render_message_content', 'wpautop' ); add_filter( 'bp_core_render_message_content', 'shortcode_unautop' ); add_filter( 'bp_core_render_message_content', 'wp_kses_data', 5 ); +// Emails. +add_filter( 'bp_email_set_content_html', 'wp_filter_post_kses', 6 ); +add_filter( 'bp_email_set_content_html', 'stripslashes', 8 ); +add_filter( 'bp_email_set_content_plaintext', 'wp_strip_all_tags', 6 ); +add_filter( 'bp_email_set_subject', 'sanitize_text_field', 6 ); + /** * Template Compatibility. * @@ -62,24 +69,26 @@ add_filter( 'bp_core_render_message_content', 'wp_kses_data', 5 ); 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 +// Filter BuddyPress template locations. add_filter( 'bp_get_template_stack', 'bp_add_template_stack_locations' ); -// Turn comments off for BuddyPress pages +// Turn comments off for BuddyPress pages. add_filter( 'comments_open', 'bp_comments_open', 10, 2 ); /** * Prevent specific pages (eg 'Activate') from showing on page listings. * + * @since 1.5.0 + * * @uses bp_is_active() checks if a BuddyPress component is active. * * @param array $pages List of excluded page IDs, as passed to the - * 'wp_list_pages_excludes' filter. + * 'wp_list_pages_excludes' filter. * @return array The exclude list, with BP's pages added. */ function bp_core_exclude_pages( $pages = array() ) { - // Bail if not the root blog + // Bail if not the root blog. if ( ! bp_is_root_blog() ) return $pages; @@ -97,7 +106,7 @@ function bp_core_exclude_pages( $pages = array() ) { /** * Filters specific pages that shouldn't show up on page listings. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $pages Array of pages to exclude. */ @@ -108,17 +117,17 @@ add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' ); /** * Prevent specific pages (eg 'Activate') from showing in the Pages meta box of the Menu Administration screen. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @uses bp_is_root_blog() checks if current blog is root blog. * @uses buddypress() gets BuddyPress main instance * - * @param object $object The post type object used in the meta box - * @return object The $object, with a query argument to remove register and activate pages id. + * @param object|null $object The post type object used in the meta box. + * @return object|null The $object, with a query argument to remove register and activate pages id. */ function bp_core_exclude_pages_from_nav_menu_admin( $object = null ) { - // Bail if not the root blog + // Bail if not the root blog. if ( ! bp_is_root_blog() ) { return $object; } @@ -154,10 +163,10 @@ add_filter( 'nav_menu_meta_box_object', 'bp_core_exclude_pages_from_nav_menu_adm * 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) + * @since 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 + * @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 ) { @@ -167,26 +176,26 @@ function bp_core_menu_highlight_parent_page( $retval, $page ) { $page_id = false; - // loop against all BP component pages + // Loop against all BP component pages. foreach ( (array) buddypress()->pages as $component => $bp_page ) { - // handles the majority of components + // Handles the majority of components. if ( bp_is_current_component( $component ) ) { $page_id = (int) $bp_page->id; } - // stop if not on a user page + // 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 + // 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 + // 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 ) ) { @@ -211,10 +220,10 @@ add_filter( 'page_css_class', 'bp_core_menu_highlight_parent_page', 10, 2 ); * 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) + * @since 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 + * @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 ) { @@ -223,41 +232,23 @@ function bp_core_menu_highlight_nav_menu_item( $retval, $item ) { return $retval; } - // get the WP page + // Get the WP page. $page = get_post( $item->object_id ); - // see if we should add our highlight CSS classes for the page + // 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. - * - * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table. - * - * @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' ); - /** * Filter the blog post comments array and insert BuddyPress URLs for users. * + * @since 1.2.0 + * * @param array $comments The array of comments supplied to the comments template. - * @param int $post->ID The post ID. + * @param int $post_id The post ID. * @return array $comments The modified comment array. */ function bp_core_filter_comments( $comments, $post_id ) { @@ -293,24 +284,25 @@ add_filter( 'comments_array', 'bp_core_filter_comments', 10, 2 ); /** * When a user logs in, redirect him in a logical way. * + * @since 1.2.0 + * * @uses apply_filters() Filter 'bp_core_login_redirect' to modify where users * are redirected to on login. * - * @param string $redirect_to The URL to be redirected to, sanitized - * in wp-login.php. - * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to']) - * @param WP_User $user The WP_User object corresponding to a successfully - * logged-in user. Otherwise a WP_Error object. + * @param string $redirect_to The URL to be redirected to, sanitized in wp-login.php. + * @param string $redirect_to_raw The unsanitized redirect_to URL ($_REQUEST['redirect_to']). + * @param WP_User $user The WP_User object corresponding to a successfully + * logged-in user. Otherwise a WP_Error object. * @return string The redirect URL. */ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { - // Only modify the redirect if we're on the main BP blog + // Only modify the redirect if we're on the main BP blog. if ( !bp_is_root_blog() ) { return $redirect_to; } - // Only modify the redirect once the user is logged in + // Only modify the redirect once the user is logged in. if ( !is_a( $user, 'WP_User' ) ) { return $redirect_to; } @@ -320,9 +312,9 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { * * Allows plugins to have finer grained control of redirect upon login. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param bool $value Whether or not to redirect. + * @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 @@ -335,7 +327,7 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { // If a 'redirect_to' parameter has been passed that contains 'wp-admin', verify that the // logged-in user has any business to conduct in the Dashboard before allowing the - // redirect to go through + // redirect to go through. if ( !empty( $redirect_to ) && ( false === strpos( $redirect_to, 'wp-admin' ) || user_can( $user, 'edit_posts' ) ) ) { return $redirect_to; } @@ -347,7 +339,7 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { /** * Filters the URL to redirect users to upon successful login. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $value URL to redirect to. */ @@ -355,6 +347,34 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { } add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 ); +/** + * Decode HTML entities for plain-text emails. + * + * @since 2.5.0 + * + * @param string $retval Current email content. + * @param string $prop Email property to check against. + * @param string $transform Either 'raw' or 'replace-tokens'. + */ +function bp_email_plaintext_entity_decode( $retval, $prop, $transform ) { + switch ( $prop ) { + case 'content_plaintext' : + case 'subject' : + // Only decode if 'replace-tokens' is the current type. + if ( 'replace-tokens' === $transform ) { + return html_entity_decode( $retval, ENT_QUOTES ); + } else { + return $retval; + } + break; + + default : + return $retval; + break; + } +} +add_filter( 'bp_email_get_property', 'bp_email_plaintext_entity_decode', 10, 3 ); + /** * Replace the generated password in the welcome email with '[User Set]'. * @@ -364,13 +384,15 @@ add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 ); * * This filter will not fire when a user is registered by the site admin. * + * @since 1.2.1 + * * @param string $welcome_email Complete email passed through WordPress. * @return string Filtered $welcome_email with the password replaced - * by '[User Set]'. + * by '[User Set]'. */ function bp_core_filter_user_welcome_email( $welcome_email ) { - // Don't touch the email when a user is registered by the site admin + // Don't touch the email when a user is registered by the site admin. if ( ( is_admin() || is_network_admin() ) && buddypress()->members->admin->signups_page != get_current_screen()->id ) { return $welcome_email; } @@ -379,7 +401,7 @@ function bp_core_filter_user_welcome_email( $welcome_email ) { return $welcome_email; } - // Don't touch the email if we don't have a custom registration template + // Don't touch the email if we don't have a custom registration template. if ( ! bp_has_custom_signup_page() ) { return $welcome_email; } @@ -398,20 +420,22 @@ add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); * * This filter will not fire when a user is registered by the site admin. * + * @since 1.2.1 + * * @param string $welcome_email Complete email passed through WordPress. - * @param int $blog_id ID of the blog user is joining. - * @param int $user_id ID of the user joining. - * @param string $password Password of user. + * @param int $blog_id ID of the blog user is joining. + * @param int $user_id ID of the user joining. + * @param string $password Password of user. * @return string Filtered $welcome_email with $password replaced by '[User Set]'. */ function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) { - // Don't touch the email when a user is registered by the site admin + // Don't touch the email when a user is registered by the site admin. if ( ( is_admin() || is_network_admin() ) && buddypress()->members->admin->signups_page != get_current_screen()->id ) { return $welcome_email; } - // Don't touch the email if we don't have a custom registration template + // Don't touch the email if we don't have a custom registration template. if ( ! bp_has_custom_signup_page() ) return $welcome_email; @@ -426,134 +450,68 @@ add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 ) * This function filter's WP's 'wpmu_signup_blog_notification', and replaces * WP's default welcome email with a BuddyPress-specific message. * + * @since 1.0.0 + * * @see wpmu_signup_blog_notification() for a description of parameters. * - * @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 $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 By default, contains the requested privacy setting and - * lang_id. - * @return bool True on success, false on failure. + * @param string $key The activation key created in wpmu_signup_blog(). + * @return bool Returns false to stop original WPMU function from continuing. */ -function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) { - - // Set up activation link - $activate_url = bp_get_activation_page() ."?key=$key"; - $activate_url = esc_url( $activate_url ); - - // Email contents - $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 ) ) ); - - /** - * 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 - wp_mail( $to, $subject, $message ); - - // 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 ); +function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key ) { + $args = array( + 'tokens' => array( + 'activate-site.url' => esc_url( bp_get_activation_page() . '?key=' . urlencode( $key ) ), + 'domain' => $domain, + 'key_blog' => $key, + 'path' => $path, + 'user-site.url' => esc_url( "http://{$domain}{$path}" ), + 'title' => $title, + 'user.email' => $user_email, + ), + ); + bp_send_email( 'core-user-registration-with-blog', array( array( $user_email => $user ) ), $args ); - // Return false to stop the original WPMU function from continuing + // Return false to stop the original WPMU function from continuing. return false; } -add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 ); +add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 6 ); /** * Notify new users of a successful registration (without blog). * + * @since 1.0.0 + * * @see wpmu_signup_user_notification() for a full description of params. * - * @param string $user The user's login name. + * @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_user() - * @param array $meta By default, an empty array. - * @return bool True on success, false on failure. + * @param string $key The activation key created in wpmu_signup_user(). + * @param array $meta By default, an empty array. + * @return bool|string Returns false to stop original WPMU function from continuing. */ function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { - if ( is_admin() ) { - // If the user is created from the WordPress Add User screen, don't send BuddyPress signup notifications + + // If the user is created from the WordPress Add User screen, don't send BuddyPress signup notifications. if( in_array( get_current_screen()->id, array( 'user', 'user-network' ) ) ) { - // If the Super Admin want to skip confirmation email + // If the Super Admin want to skip confirmation email. if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) { return false; - // WordPress will manage the signup process + // WordPress will manage the signup process. } else { return $user; } - /** + /* * There can be a case where the user was created without the skip confirmation * 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 + * meta['password'] is not set, the activation url must be WordPress one. */ } elseif ( buddypress()->members->admin->signups_page == get_current_screen()->id ) { $is_hashpass_in_meta = maybe_unserialize( $meta ); @@ -564,75 +522,23 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key, } } - // Set up activation link - $activate_url = bp_get_activation_page() . "?key=$key"; - $activate_url = esc_url( $activate_url ); - - // Email contents - $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' ) ) ); - - /** - * 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 - wp_mail( $to, $subject, $message ); - - // Set up the $admin_email to pass to the filter - $admin_email = bp_get_option( 'admin_email' ); + $user_id = 0; + $user_object = get_user_by( 'login', $user ); + if ( $user_object ) { + $user_id = $user_object->ID; + } - /** - * 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 ); + $args = array( + 'tokens' => array( + 'activate.url' => esc_url( trailingslashit( bp_get_activation_page() ) . "{$key}/" ), + 'key' => $key, + 'user.email' => $user_email, + 'user.id' => $user_id, + ), + ); + bp_send_email( 'core-user-registration', array( array( $user_email => $user ) ), $args ); - // Return false to stop the original WPMU function from continuing + // Return false to stop the original WPMU function from continuing. return false; } add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); @@ -640,7 +546,7 @@ add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_not /** * Filter the page title for BuddyPress pages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see wp_title() * @global object $bp BuddyPress global settings. @@ -648,128 +554,20 @@ add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_not * @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 = 'right' ) { - global $bp, $paged, $page, $_wp_theme_features; + global $paged, $page, $_wp_theme_features; - // If this is not a BP page, just return the title produced by WP - if ( bp_is_blog_page() ) { - return $title; - } + // Get the BuddyPress title parts. + $bp_title_parts = bp_get_title_parts( $seplocation ); - // If this is a 404, let WordPress handle it - if ( is_404() ) { + // If not set, simply return the original title. + if ( ! $bp_title_parts ) { return $title; } - // If this is the front page of the site, return WP's title - if ( is_front_page() || is_home() ) { - return $title; - } - - // Return WP's title if not a BuddyPress page - if ( ! is_buddypress() ) { - return $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 ( ! empty( $displayed_user_name ) && ! is_404() ) { - - // Get the component's ID to try and get its name - $component_id = $component_name = bp_current_component(); - - // 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' ); - - if ( ! empty( $component_subnav_name ) ) { - $component_subnav_name = array_shift( $component_subnav_name ); - } - } - - // 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'] : ''; - $title_parts = array( $bp->bp_options_title, $subnav ); - - // A single item from a component other than groups - } elseif ( bp_is_single_item() ) { - $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?) - $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_parts = array( __( 'Create an Account', 'buddypress' ) ); - - // Activation page - } elseif ( bp_is_activation_page() ) { - $title_parts = array( __( 'Activate your Account', 'buddypress' ) ); - - // Group creation page - } elseif ( bp_is_group_create() ) { - $title_parts = array( __( 'Create a Group', 'buddypress' ) ); - - // Blog creation page - } elseif ( bp_is_create_blog() ) { - $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 + // Get the blog name, so we can check if the original $title included it. $blogname = get_bloginfo( 'name', 'display' ); /** @@ -780,30 +578,30 @@ function bp_modify_page_title( $title = '', $sep = '»', $seplocation = 'ri */ $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 + // Append the site title to title parts if theme supports title tag. if ( true === $title_tag_compatibility ) { - $title_parts[] = $blogname; + $bp_title_parts['site'] = $blogname; - if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) { - $title_parts[] = sprintf( __( 'Page %s', 'buddypress' ), max( $paged, $page ) ); + if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() && ! bp_is_single_activity() ) { + $bp_title_parts['page'] = sprintf( __( 'Page %s', 'buddypress' ), max( $paged, $page ) ); } } - // Pad the separator with 1 space on each side + // Pad the separator with 1 space on each side. $prefix = str_pad( $sep, strlen( $sep ) + 2, ' ', STR_PAD_BOTH ); - // Join the parts together - $new_title = join( $prefix, array_filter( $title_parts ) ); + // Join the parts together. + $new_title = join( $prefix, array_filter( $bp_title_parts ) ); - // Append the prefix for pre `title-tag` compatibility + // 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. + * Filters the older 'wp_title' page title for BuddyPress pages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $new_title The BuddyPress page title. * @param string $title The original WordPress page title. @@ -812,43 +610,73 @@ function bp_modify_page_title( $title = '', $sep = '»', $seplocation = 'ri */ return apply_filters( 'bp_modify_page_title', $new_title, $title, $sep, $seplocation ); } -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' ); +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. + * Filter the document title for BuddyPress pages. * - * This is a temporary function for compatibility with WordPress versions - * less than 4.0, and should be removed at a later date. + * @since 2.4.3 * - * @param string $title_part - * @return string + * @param array $title The WordPress document title parts. + * @return array the unchanged title parts or the BuddyPress ones */ -function _bp_strip_spans_from_title( $title_part = '' ) { - $title = $title_part; - $span = strpos( $title, '<span' ); - if ( false !== $span ) { - $title = substr( $title, 0, $span - 1 ); +function bp_modify_document_title_parts( $title = array() ) { + // Get the BuddyPress title parts. + $bp_title_parts = bp_get_title_parts(); + + // If not set, simply return the original title. + if ( ! $bp_title_parts ) { + return $title; } - return $title; + + // Get the separator used by wp_get_document_title(). + $sep = apply_filters( 'document_title_separator', '-' ); + + // Build the BuddyPress portion of the title. + // We don't need to sanitize this as WordPress will take care of it. + $bp_title = array( + 'title' => join( " $sep ", $bp_title_parts ) + ); + + // Add the pagination number if needed (not sure if this is necessary). + if ( isset( $title['page'] ) && ! bp_is_single_activity() ) { + $bp_title['page'] = $title['page']; + } + + // Add the sitename if needed. + if ( isset( $title['site'] ) ) { + $bp_title['site'] = $title['site']; + } + + /** + * Filters BuddyPress title parts that will be used into the document title. + * + * @since 2.4.3 + * + * @param array $bp_title The BuddyPress page title parts. + * @param array $title The original WordPress title parts. + */ + return apply_filters( 'bp_modify_document_title_parts', $bp_title, $title ); } +add_filter( 'document_title_parts', 'bp_modify_document_title_parts', 20, 1 ); /** * Add BuddyPress-specific items to the wp_nav_menu. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param WP_Post $menu_item The menu item. - * @return obj The modified WP_Post object. + * @return WP_Post The modified WP_Post object. */ function bp_setup_nav_menu_item( $menu_item ) { if ( is_admin() ) { return $menu_item; } - // Prevent a notice error when using the customizer + // Prevent a notice error when using the customizer. $menu_classes = $menu_item->classes; if ( is_array( $menu_classes ) ) { @@ -856,10 +684,10 @@ 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 + // menu item this is, and how it should be treated. preg_match( '/\sbp-(.*)-nav/', $menu_classes, $matches ); - // If this isn't a BP menu item, we can stop here + // If this isn't a BP menu item, we can stop here. if ( empty( $matches[1] ) ) { return $menu_item; } @@ -883,7 +711,7 @@ function bp_setup_nav_menu_item( $menu_item ) { break; - // Don't show the Register link to logged-in users + // Don't show the Register link to logged-in users. case 'register' : if ( is_user_logged_in() ) { $menu_item->_invalid = true; @@ -892,7 +720,7 @@ function bp_setup_nav_menu_item( $menu_item ) { break; // All other BP nav items are specific to the logged-in user, - // and so are not relevant to logged-out users + // and so are not relevant to logged-out users. default: if ( is_user_logged_in() ) { $menu_item->url = bp_nav_menu_get_item_url( $matches[1] ); @@ -903,11 +731,11 @@ function bp_setup_nav_menu_item( $menu_item ) { break; } - // If component is deactivated, make sure menu item doesn't render + // If component is deactivated, make sure menu item doesn't render. if ( empty( $menu_item->url ) ) { $menu_item->_invalid = true; - // Highlight the current page + // Highlight the current page. } else { $current = bp_get_requested_url(); if ( strpos( $current, $menu_item->url ) !== false ) { @@ -925,14 +753,14 @@ function bp_setup_nav_menu_item( $menu_item ) { add_filter( 'wp_setup_nav_menu_item', 'bp_setup_nav_menu_item', 10, 1 ); /** - * Populate BuddyPress user nav items for the customizer + * Populate BuddyPress user nav items for the customizer. * - * @since BuddyPress (2.3.3) + * @since 2.3.3 * - * @param array $items The array of menu items - * @param string $type The requested type - * @param string $object The requested object name - * @param integer $page The page num being requested + * @param array $items The array of menu items. + * @param string $type The requested type. + * @param string $object The requested object name. + * @param integer $page The page num being requested. * @return array The paginated BuddyPress user nav items. */ function bp_customizer_nav_menus_get_items( $items = array(), $type = '', $object = '', $page = 0 ) { @@ -962,11 +790,12 @@ function bp_customizer_nav_menus_get_items( $items = array(), $type = '', $objec add_filter( 'customize_nav_menu_available_items', 'bp_customizer_nav_menus_get_items', 10, 4 ); /** - * Set BuddyPress item navs for the customizer + * Set BuddyPress item navs for the customizer. * - * @since BuddyPress (2.3.3) + * @since 2.3.3 * - * @param array $item_types an associative array structured for the customizer + * @param array $item_types An associative array structured for the customizer. + * @return array $item_types An associative array structured for the customizer. */ function bp_customizer_nav_menus_set_item_types( $item_types = array() ) { $item_types = array_merge( $item_types, array( @@ -995,7 +824,7 @@ add_filter( 'customize_nav_menu_available_item_types', 'bp_customizer_nav_menus_ * usable for BuddyPress, we use this just-in-time filter on 'query' to swap * 'meta_id' with 'id. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @access private Do not use. * @@ -1025,14 +854,14 @@ function bp_filter_metaid_column_name( $q ) { } /** - * Filter the edit post link to avoid its display in BuddyPress pages + * Filter the edit post link to avoid its display in BuddyPress pages. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @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 + * @return bool|string Will be a boolean (false) if $post_id is 0. Will be a string (the unchanged edit link) + * otherwise */ function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) { if ( 0 === $post_id ) { @@ -1046,10 +875,11 @@ function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) { * 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. + * @since 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. - * @since BuddyPress (2.2.0) */ function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) { if ( ! $mentions_enabled ) { @@ -1063,3 +893,238 @@ function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $menti return $load_mentions; } add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_maybe_load_mentions_scripts_for_blog_content', 10, 2 ); + +/** + * Injects specific BuddyPress CSS classes into a widget sidebar. + * + * Helps to standardize styling of BuddyPress widgets within a theme that + * does not use dynamic CSS classes in their widget sidebar's 'before_widget' + * call. + * + * @since 2.4.0 + * @access private + * + * @global array $wp_registered_widgets Current registered widgets. + * @param array $params Current sidebar params. + * @return array + */ +function _bp_core_inject_bp_widget_css_class( $params ) { + global $wp_registered_widgets; + + $widget_id = $params[0]['widget_id']; + + // If callback isn't an array, bail. + if ( false === is_array( $wp_registered_widgets[ $widget_id ]['callback'] ) ) { + return $params; + } + + // If the current widget isn't a BuddyPress one, stop! + // We determine if a widget is a BuddyPress widget, if the widget class + // begins with 'bp_'. + if ( 0 !== strpos( $wp_registered_widgets[ $widget_id ]['callback'][0]->id_base, 'bp_' ) ) { + return $params; + } + + // Dynamically add our widget CSS classes for BP widgets if not already there. + $classes = array(); + + // Try to find 'widget' CSS class. + if ( false === strpos( $params[0]['before_widget'], 'widget ' ) ) { + $classes[] = 'widget'; + } + + // Try to find 'buddypress' CSS class. + if ( false === strpos( $params[0]['before_widget'], ' buddypress' ) ) { + $classes[] = 'buddypress'; + } + + // Stop if widget already has our CSS classes. + if ( empty( $classes ) ) { + return $params; + } + + // CSS injection time! + $params[0]['before_widget'] = str_replace( 'class="', 'class="' . implode( ' ', $classes ) . ' ', $params[0]['before_widget'] ); + + return $params; +} +add_filter( 'dynamic_sidebar_params', '_bp_core_inject_bp_widget_css_class' ); + +/** + * Add email link styles to rendered email template. + * + * This is only used when the email content has been merged into the email template. + * + * @since 2.5.0 + * + * @param string $value Property value. + * @param string $property_name + * @param string $transform How the return value was transformed. + * @return string Updated value. + */ +function bp_email_add_link_color_to_template( $value, $property_name, $transform ) { + if ( $property_name !== 'template' || $transform !== 'add-content' ) { + return $value; + } + + $settings = bp_email_get_appearance_settings(); + $replacement = 'style="color: ' . esc_attr( $settings['highlight_color'] ) . ';'; + + // Find all links. + preg_match_all( '#<a[^>]+>#i', $value, $links, PREG_SET_ORDER ); + foreach ( $links as $link ) { + $new_link = $link = array_shift( $link ); + + // Add/modify style property. + if ( strpos( $link, 'style="' ) !== false ) { + $new_link = str_replace( 'style="', $replacement, $link ); + } else { + $new_link = str_replace( '<a ', "<a {$replacement}\" ", $link ); + } + + if ( $new_link !== $link ) { + $value = str_replace( $link, $new_link, $value ); + } + } + + return $value; +} +add_filter( 'bp_email_get_property', 'bp_email_add_link_color_to_template', 6, 3 ); + +/** + * Add custom headers to outgoing emails. + * + * @since 2.5.0 + * + * @param array $headers + * @param string $property Name of property. Unused. + * @param string $transform Return value transformation. Unused. + * @param BP_Email $email Email object reference. + * @return array + */ +function bp_email_set_default_headers( $headers, $property, $transform, $email ) { + $headers['X-BuddyPress'] = bp_get_version(); + $headers['X-BuddyPress-Type'] = $email->get( 'type' ); + + return $headers; +} +add_filter( 'bp_email_get_headers', 'bp_email_set_default_headers', 6, 4 ); + +/** + * Add default email tokens. + * + * @since 2.5.0 + * + * @param array $tokens Email tokens. + * @param string $property_name Unused. + * @param string $transform Unused. + * @param BP_Email $email Email being sent. + * @return array + */ +function bp_email_set_default_tokens( $tokens, $property_name, $transform, $email ) { + $tokens['site.admin-email'] = bp_get_option( 'admin_email' ); + $tokens['site.url'] = home_url(); + + // These options are escaped with esc_html on the way into the database in sanitize_option(). + $tokens['site.description'] = wp_specialchars_decode( bp_get_option( 'blogdescription' ), ENT_QUOTES ); + $tokens['site.name'] = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES ); + + // Default values for tokens set conditionally below. + $tokens['email.preheader'] = ''; + $tokens['recipient.email'] = ''; + $tokens['recipient.name'] = ''; + $tokens['recipient.username'] = ''; + $tokens['unsubscribe'] = site_url( 'wp-login.php' ); + + + // Who is the email going to? + $recipient = $email->get( 'to' ); + if ( $recipient ) { + $recipient = array_shift( $recipient ); + $user_obj = $recipient->get_user( 'search-email' ); + + $tokens['recipient.email'] = $recipient->get_address(); + $tokens['recipient.name'] = $recipient->get_name(); + + if ( ! $user_obj && $tokens['recipient.email'] ) { + $user_obj = get_user_by( 'email', $tokens['recipient.email'] ); + } + + if ( $user_obj ) { + // Unsubscribe link. + $tokens['unsubscribe'] = esc_url( sprintf( + '%s%s/notifications/', + bp_core_get_user_domain( $user_obj->ID ), + function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings' + ) ); + $tokens['recipient.username'] = $user_obj->user_login; + } + } + + // Email preheader. + $post = $email->get_post_object(); + if ( $post ) { + $tokens['email.preheader'] = sanitize_text_field( get_post_meta( $post->ID, 'bp_email_preheader', true ) ); + } + + return $tokens; +} +add_filter( 'bp_email_get_tokens', 'bp_email_set_default_tokens', 6, 4 ); + +/** + * Find and render the template for Email posts (the Customizer and admin previews). + * + * Misuses the `template_include` filter which expects a string, but as we need to replace + * the `{{{content}}}` token with the post's content, we use object buffering to load the + * template, replace the token, and render it. + * + * The function returns an empty string to prevent WordPress rendering another template. + * + * @since 2.5.0 + * + * @param string $template Path to template (probably single.php). + * @return string + */ +function bp_core_render_email_template( $template ) { + if ( get_post_type() !== bp_get_email_post_type() || ! is_single() ) { + return $template; + } + + /** + * Filter template used to display Email posts. + * + * @since 2.5.0 + * + * @param string $template Path to current template (probably single.php). + */ + $email_template = apply_filters( 'bp_core_render_email_template', + bp_locate_template( bp_email_get_template( get_queried_object() ), false ), + $template + ); + + if ( ! $email_template ) { + return $template; + } + + ob_start(); + include( $email_template ); + $template = ob_get_contents(); + ob_end_clean(); + + // Make sure we add a <title> tag so WP Customizer picks it up. + $template = str_replace( '<head>', '<head><title>' . esc_html_x( 'BuddyPress Emails', 'screen heading', 'buddypress' ) . '</title>', $template ); + echo str_replace( '{{{content}}}', nl2br( get_post()->post_content ), $template ); + + /* + * Link colours are applied directly in the email template before sending, so we + * need to add an extra style here to set the colour for the Customizer or preview. + */ + $settings = bp_email_get_appearance_settings(); + printf( + '<style>a { color: %s; }</style>', + esc_attr( $settings['highlight_color'] ) + ); + + return ''; +} +add_action( 'bp_template_include', 'bp_core_render_email_template', 12 ); 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 55449bfe662d7133c268639558b6f899ddb52379..ea58ce7c0f3b3c1d03db63d586c96be9833f2e3c 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Common Functions. * * @package BuddyPress * @subpackage Functions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Versions ******************************************************************/ @@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit; /** * Output the BuddyPress version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_version() To get the BuddyPress version. */ @@ -25,7 +25,7 @@ function bp_version() { /** * Return the BuddyPress version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return string The BuddyPress version. */ @@ -36,7 +36,7 @@ function bp_version() { /** * Output the BuddyPress database version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_db_version() To get the BuddyPress database version. */ @@ -46,7 +46,8 @@ function bp_db_version() { /** * Return the BuddyPress database version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * * @return string The BuddyPress database version. */ function bp_get_db_version() { @@ -56,7 +57,7 @@ function bp_db_version() { /** * Output the BuddyPress database version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_db_version_raw() To get the current database BuddyPress version. */ @@ -64,9 +65,9 @@ function bp_db_version_raw() { echo bp_get_db_version_raw(); } /** - * Return the BuddyPress database version + * Return the BuddyPress database version. * - * @since BuddyPress (1.6) + * @since 1.6.0 * * @return string The BuddyPress version direct from the database. */ @@ -82,6 +83,8 @@ function bp_db_version_raw() { * * The filter is intended primarily for use in multinetwork installations. * + * @since 1.2.6 + * * @global object $wpdb WordPress database object. * * @return string Filtered database prefix. @@ -94,7 +97,7 @@ function bp_core_get_table_prefix() { * * Intended primarily for use in multinetwork installations. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $base_prefix Base prefix to use. */ @@ -107,44 +110,15 @@ function bp_core_get_table_prefix() { * The main purpose for this function is so that you can avoid having to create * your own awkward callback function for usort(). * - * @since BuddyPress (2.2.0) + * @since 2.2.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. - * @param string $type Sort type. 'alpha' for alphabetical, 'num' for numeric. Default: 'alpha'. - * @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_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 . '; - } elseif ( isset( $index["' . $key . '"] ) ) { - $values[ $indexi ] = $index["' . $key . '"]; - } - } - - 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; - } elseif ( 0 < $cmp ) { - $retval = 1; - } else { - $retval = 0; - } - return $retval; - } else { - return 0; - } - ') ); + usort( $items, array( new BP_Core_Sort_By_Key_Callback( $key, $type ), 'sort_callback' ) ); return $items; } @@ -156,11 +130,11 @@ function bp_sort_by_key( $items, $key, $type = 'alpha' ) { * them by post_name as follows: * $sorted_posts = bp_alpha_sort_by_key( $posts, 'post_name' ); * - * @since BuddyPress (1.9.0) + * @since 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. + * @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' ); @@ -169,13 +143,15 @@ function bp_alpha_sort_by_key( $items, $key ) { /** * Format numbers the BuddyPress way. * - * @param int $number The number to be formatted. + * @since 1.2.0 + * + * @param int $number The number to be formatted. * @param bool $decimals Whether to use decimals. See {@link number_format_i18n()}. * @return string The formatted number. */ function bp_core_number_format( $number = 0, $decimals = false ) { - // Force number to 0 if needed + // Force number to 0 if needed. if ( ! is_numeric( $number ) ) { $number = 0; } @@ -183,7 +159,7 @@ function bp_core_number_format( $number = 0, $decimals = false ) { /** * Filters the BuddyPress formatted number. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value BuddyPress formatted value. * @param int $number The number to be formatted. @@ -222,9 +198,10 @@ function bp_core_number_format( $number = 0, $decimals = false ) { * * For the second argument, $func_args, you should just pass the value of func_get_args(). * - * @since BuddyPress (1.6) + * @since 1.6.0 + * * @param array $old_args_keys Old argument indexs, keyed to their positions. - * @param array $func_args The parameters passed to the originating function. + * @param array $func_args The parameters passed to the originating function. * @return array $new_args The parsed arguments. */ function bp_core_parse_args_array( $old_args_keys, $func_args ) { @@ -248,16 +225,16 @@ function bp_core_parse_args_array( $old_args_keys, $func_args ) { * the optional $filter_key parameter. If no $filter_key is passed, no filters * are applied. * - * @since BuddyPress (r7704) + * @since 2.0.0 * - * @param string|array $args Value to merge with $defaults - * @param array $defaults Array that serves as the defaults. - * @param string $filter_key String to key the filters from + * @param string|array $args Value to merge with $defaults. + * @param array $defaults Array that serves as the defaults. + * @param string $filter_key String to key the filters from. * @return array Merged user defined values with defaults. */ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { - // Setup a temporary array from $args + // Setup a temporary array from $args. if ( is_object( $args ) ) { $r = get_object_vars( $args ); } elseif ( is_array( $args ) ) { @@ -266,7 +243,7 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { wp_parse_str( $args, $r ); } - // Passively filter the args before the parse + // Passively filter the args before the parse. if ( !empty( $filter_key ) ) { /** @@ -274,19 +251,19 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { * * This is a dynamic filter dependent on the specified key. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $r Array of arguments to use. */ $r = apply_filters( 'bp_before_' . $filter_key . '_parse_args', $r ); } - // Parse + // Parse. if ( is_array( $defaults ) && !empty( $defaults ) ) { $r = array_merge( $defaults, $r ); } - // Aggressively filter the args after the parse + // Aggressively filter the args after the parse. if ( !empty( $filter_key ) ) { /** @@ -294,14 +271,14 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { * * This is a dynamic filter dependent on the specified key. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $r Array of parsed arguments. */ $r = apply_filters( 'bp_after_' . $filter_key . '_parse_args', $r ); } - // Return the parsed results + // Return the parsed results. return $r; } @@ -310,22 +287,22 @@ function bp_parse_args( $args, $defaults = array(), $filter_key = '' ) { * 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) + * @since 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 + * @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 + // Check if request overrides exist. if ( isset( $_REQUEST[ $page_arg ] ) ) { - // Get the absolute integer value of the override + // 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 + // @see https://buddypress.trac.wordpress.org/ticket/5796. if ( $int ) { $page = $int; } @@ -340,7 +317,7 @@ function bp_sanitize_pagination_arg( $page_arg = '', $page = 1 ) { * Strings like 'DESC', 'desc', ' desc' will be interpreted into 'DESC'. * Everything else becomes 'ASC'. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $order The 'order' string, as passed to the SQL constructor. * @return string The sanitized value 'DESC' or 'ASC'. @@ -358,13 +335,13 @@ function bp_esc_sql_order( $order = '' ) { * maintain compatibility with versions of WP before 4.0, we duplicate the * logic of the replacement, wpdb::esc_like(). * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @see wpdb::esc_like() for more details on proper use. * * @param string $text The raw text to be escaped. * @return string Text in the form of a LIKE phrase. Not SQL safe. Run through - * wpdb::prepare() before use. + * wpdb::prepare() before use. */ function bp_esc_like( $text ) { global $wpdb; @@ -379,20 +356,20 @@ function bp_esc_like( $text ) { /** * Are we running username compatibility mode? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() Filter 'bp_is_username_compatibility_mode' to alter. * @todo Move to members component? * * @return bool False when compatibility mode is disabled, true when enabled. - * Default: false. + * Default: false. */ function bp_is_username_compatibility_mode() { /** * Filters whether or not to use username compatibility mode. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $value Whether or not username compatibility mode should be used. */ @@ -405,7 +382,7 @@ function bp_is_username_compatibility_mode() { * The WP Toolbar, introduced in WP 3.1, is fully supported in BuddyPress as * of BP 1.5. For BP 1.6, the WP Toolbar is the default. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() Filter 'bp_use_wp_admin_bar' to alter. * @@ -413,7 +390,7 @@ function bp_is_username_compatibility_mode() { */ function bp_use_wp_admin_bar() { - // Default to true (to avoid loading deprecated BuddyBar code) + // Default to true (to avoid loading deprecated BuddyBar code). $use_admin_bar = true; // Has the WP Toolbar constant been explicitly opted into? @@ -428,7 +405,7 @@ function bp_use_wp_admin_bar() { /** * Filters whether or not to use the admin bar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $use_admin_bar Whether or not to use the admin bar. */ @@ -440,7 +417,7 @@ function bp_use_wp_admin_bar() { /** * Returns an array of core component IDs. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return array */ @@ -457,8 +434,8 @@ function bp_core_get_packaged_component_ids() { 'notifications', ); - // only add legacy forums if it is enabled - // prevents conflicts with bbPress, which also uses the same 'forums' id + // Only add legacy forums if it is enabled + // prevents conflicts with bbPress, which also uses the same 'forums' id. if ( class_exists( 'BP_Forums_Component' ) ) { $components[] = 'forums'; } @@ -469,7 +446,7 @@ function bp_core_get_packaged_component_ids() { /** * Fetch a list of BP directory pages from the appropriate meta table. * - * @since BuddyPress (1.5.0) + * @since 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 @@ -480,7 +457,7 @@ function bp_core_get_packaged_component_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 + // 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 ) ) { @@ -508,7 +485,7 @@ function bp_core_get_directory_page_ids( $status = 'active' ) { /** * Filters the list of BP directory pages from the appropriate meta table. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $page_ids Array of directory pages. */ @@ -518,14 +495,14 @@ function bp_core_get_directory_page_ids( $status = 'active' ) { /** * Store the list of BP directory pages in the appropriate meta table. * - * bp-pages data is stored in site_options (falls back to options on non-MS), + * The bp-pages data is stored in site_options (falls back to options on non-MS), * in an array keyed by blog_id. This allows you to change your * bp_get_root_blog_id() and go through the setup process again. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $blog_page_ids The IDs of the WP pages corresponding to BP - * component directories. + * component directories. */ function bp_core_update_directory_page_ids( $blog_page_ids ) { bp_update_option( 'bp-pages', $blog_page_ids ); @@ -534,27 +511,27 @@ function bp_core_update_directory_page_ids( $blog_page_ids ) { /** * Get names and slugs for BuddyPress component directory pages. * - * @since BuddyPress (1.5.0). + * @since 1.5.0 * * @return object Page names, IDs, and slugs. */ function bp_core_get_directory_pages() { global $wpdb; - // Look in cache first - $pages = wp_cache_get( 'directory_pages', 'bp' ); + // Look in cache first. + $pages = wp_cache_get( 'directory_pages', 'bp_pages' ); if ( false === $pages ) { - // Set pages as standard class + // Set pages as standard class. $pages = new stdClass; - // Get pages and IDs + // Get pages and IDs. $page_ids = bp_core_get_directory_page_ids(); if ( !empty( $page_ids ) ) { // Always get page data from the root blog, except on multiblog mode, when it comes - // from the current blog + // from the current blog. $posts_table_name = bp_is_multiblog_mode() ? $wpdb->posts : $wpdb->get_blog_prefix( bp_get_root_blog_id() ) . 'posts'; $page_ids_sql = implode( ',', wp_parse_id_list( $page_ids ) ); $page_names = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_title FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) AND post_status = 'publish' " ); @@ -571,7 +548,7 @@ function bp_core_get_directory_pages() { $pages->{$component_id}->title = $page_name->post_title; $slug[] = $page_name->post_name; - // Get the slug + // Get the slug. while ( $page_name->post_parent != 0 ) { $parent = $wpdb->get_results( $wpdb->prepare( "SELECT post_name, post_parent FROM {$posts_table_name} WHERE ID = %d", $page_name->post_parent ) ); $slug[] = $parent[0]->post_name; @@ -586,13 +563,13 @@ function bp_core_get_directory_pages() { } } - wp_cache_set( 'directory_pages', $pages, 'bp' ); + wp_cache_set( 'directory_pages', $pages, 'bp_pages' ); } /** * Filters the names and slugs for BuddyPress component directory pages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param object $pages Object holding page names and slugs. */ @@ -605,12 +582,12 @@ function bp_core_get_directory_pages() { * Directory pages are those WordPress pages used by BP components to display * content (eg, the 'groups' page created by BP). * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param array $components Components to create pages for. - * @param string $existing 'delete' if you want to delete existing page - * mappings and replace with new ones. Otherwise existing page mappings - * are kept, and the gaps filled in with new pages. Default: 'keep'. + * @param array $components Components to create pages for. + * @param string $existing 'delete' if you want to delete existing page mappings + * and replace with new ones. Otherwise existing page mappings + * are kept, and the gaps filled in with new pages. Default: 'keep'. */ function bp_core_add_page_mappings( $components, $existing = 'keep' ) { @@ -627,7 +604,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) { $pages = bp_core_get_directory_page_ids( 'all' ); - // Delete any existing pages + // Delete any existing pages. if ( 'delete' === $existing ) { foreach ( (array) $pages as $page_id ) { wp_delete_post( $page_id, true ); @@ -653,7 +630,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) { } // Register and Activate are not components, but need pages when - // registration is enabled + // registration is enabled. if ( bp_get_signup_allowed() ) { foreach ( array( 'register', 'activate' ) as $slug ) { if ( ! isset( $pages[ $slug ] ) ) { @@ -662,21 +639,21 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) { } } - // No need for a Sites directory unless we're on multisite + // No need for a Sites directory unless we're on multisite. if ( ! is_multisite() && isset( $pages_to_create['sites'] ) ) { unset( $pages_to_create['sites'] ); } - // Members must always have a page, no matter what + // Members must always have a page, no matter what. if ( ! isset( $pages['members'] ) && ! isset( $pages_to_create['members'] ) ) { $pages_to_create['members'] = $page_titles['members']; } - // Create the pages + // Create the pages. foreach ( $pages_to_create as $component_name => $page_name ) { $exists = get_page_by_path( $component_name ); - // If page already exists, use it + // If page already exists, use it. if ( ! empty( $exists ) ) { $pages[ $component_name ] = $exists->ID; } else { @@ -690,7 +667,7 @@ function bp_core_add_page_mappings( $components, $existing = 'keep' ) { } } - // Save the page mapping + // Save the page mapping. bp_update_option( 'bp-pages', $pages ); // If we had to switch_to_blog, go back to the original site. @@ -703,15 +680,16 @@ 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) + * @since 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 + // Stop if we are not on the main BP root blog. if ( ! bp_is_root_blog() ) { return; } @@ -745,24 +723,24 @@ add_action( 'delete_post', 'bp_core_on_directory_page_delete' ); * in general, or define a specific component slug constant (e.g. * BP_MEMBERS_SLUG) to override specific component slugs. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug The root slug, which comes from $bp->pages->[component]->slug. * @return string The short slug for use in the middle of URLs. */ function bp_core_component_slug_from_root_slug( $root_slug ) { $slug_chunks = explode( '/', $root_slug ); - $slug = array_pop( $slug_chunks ); + $slug = array_pop( $slug_chunks ); /** * Filters the default component slug from a WP page root_slug. * - * @since BuddyPress (1.5.0) + * @since 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 ); + return apply_filters( 'bp_core_component_slug_from_root_slug', $slug, $root_slug ); } /** @@ -773,6 +751,8 @@ function bp_core_component_slug_from_root_slug( $root_slug ) { * WordPress pages and this function is now a convenience for compatibility * with the new method. * + * @since 1.0.0 + * * @param string $slug The slug of the component being added to the root list. */ function bp_core_add_root_component( $slug ) { @@ -784,26 +764,26 @@ function bp_core_add_root_component( $slug ) { $match = false; - // Check if the slug is registered in the $bp->pages global + // Check if the slug is registered in the $bp->pages global. foreach ( (array) $bp->pages as $key => $page ) { if ( $key == $slug || $page->slug == $slug ) { $match = true; } } - // Maybe create the add_root array + // Maybe create the add_root array. if ( empty( $bp->add_root ) ) { $bp->add_root = array(); } - // If there was no match, add a page for this root component + // If there was no match, add a page for this root component. if ( empty( $match ) ) { $add_root_items = $bp->add_root(); $add_root_items[] = $slug; $bp->add_root = $add_root_items; } - // Make sure that this component is registered as requiring a top-level directory + // Make sure that this component is registered as requiring a top-level directory. if ( isset( $bp->{$slug} ) ) { $bp->loaded_components[$bp->{$slug}->slug] = $bp->{$slug}->id; $bp->{$slug}->has_directory = true; @@ -812,10 +792,12 @@ function bp_core_add_root_component( $slug ) { /** * Create WordPress pages to be used as BP component directories. + * + * @since 1.5.0 */ function bp_core_create_root_component_page() { - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); $new_page_ids = array(); @@ -839,16 +821,43 @@ function bp_core_create_root_component_page() { * * For example, it would stop someone creating a blog with the slug "groups". * + * @since 1.0.0 + * * @todo Deprecate? */ function bp_core_add_illegal_names() { update_site_option( 'illegal_names', get_site_option( 'illegal_names' ), array() ); } +/** + * Get the 'search' query argument for a given component. + * + * @since 2.4.0 + * + * @param string $component Component name. + * @return string|bool Query argument on success. False on failure. + */ +function bp_core_get_component_search_query_arg( $component ) { + $query_arg = false; + if ( isset( buddypress()->{$component}->search_query_arg ) ) { + $query_arg = sanitize_title( buddypress()->{$component}->search_query_arg ); + } + + /** + * Filters the query arg for a component search string. + * + * @since 2.4.0 + * + * @param string $query_arg Query argument. + * @param string $component Component name. + */ + return apply_filters( 'bp_core_get_component_search_query_arg', $query_arg, $component ); +} + /** * Determine whether BuddyPress should register the bp-themes directory. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool True if bp-themes should be registered, false otherwise. */ @@ -856,7 +865,7 @@ function bp_do_register_theme_directory() { // If bp-default exists in another theme directory, bail. // This ensures that the version of bp-default in the regular themes // directory will always take precedence, as part of a migration away - // from the version packaged with BuddyPress + // from the version packaged with BuddyPress. foreach ( array_values( (array) $GLOBALS['wp_theme_directories'] ) as $directory ) { if ( is_dir( $directory . '/bp-default' ) ) { return false; @@ -864,10 +873,10 @@ function bp_do_register_theme_directory() { } // If the current theme is bp-default (or a bp-default child), BP - // should register its directory + // should register its directory. $register = 'bp-default' === get_stylesheet() || 'bp-default' === get_template(); - // Legacy sites continue to have the theme registered + // Legacy sites continue to have the theme registered. if ( empty( $register ) && ( 1 == get_site_option( '_bp_retain_bp_default' ) ) ) { $register = true; } @@ -875,7 +884,7 @@ function bp_do_register_theme_directory() { /** * Filters whether BuddyPress should register the bp-themes directory. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param bool $register If bp-themes should be registered. */ @@ -887,7 +896,9 @@ function bp_do_register_theme_directory() { /** * Return the domain for the root blog. * - * eg: http://example.com OR https://example.com + * Eg: http://example.com OR https://example.com + * + * @since 1.0.0 * * @uses get_blog_option() WordPress function to fetch blog meta. * @@ -900,7 +911,7 @@ function bp_core_get_root_domain() { /** * Filters the domain for the root blog. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string $domain The domain URL for the blog. */ @@ -910,11 +921,13 @@ function bp_core_get_root_domain() { /** * Perform a status-safe wp_redirect() that is compatible with BP's URI parser. * + * @since 1.0.0 + * * @uses wp_safe_redirect() * * @param string $location The redirect URL. - * @param int $status Optional. The numeric code to give in the redirect - * headers. Default: 302. + * @param int $status Optional. The numeric code to give in the redirect + * headers. Default: 302. */ function bp_core_redirect( $location = '', $status = 302 ) { @@ -940,7 +953,7 @@ function bp_core_redirect( $location = '', $status = 302 ) { * a webroot-relative path. For example, 'http://example.com/foo/' will be * reduced to '/foo/'. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @return bool|string Returns false on error, a URL path on success. */ @@ -960,6 +973,8 @@ function bp_get_referer_path() { /** * Get the path of the current site. * + * @since 1.0.0 + * * @global object $current_site * * @return string URL to the current site. @@ -975,7 +990,7 @@ function bp_core_get_site_path() { if ( count( $site_path ) < 2 ) { $site_path = '/'; } else { - // Unset the first three segments (http(s)://example.com part) + // Unset the first three segments (http(s)://example.com part). unset( $site_path[0] ); unset( $site_path[1] ); unset( $site_path[2] ); @@ -991,7 +1006,7 @@ function bp_core_get_site_path() { /** * Filters the path of the current site. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $site_path URL to the current site. */ @@ -1003,11 +1018,11 @@ function bp_core_get_site_path() { /** * Get the current GMT time to save into the DB. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * - * @param bool $gmt True to use GMT (rather than local) time. Default: true. + * @param bool $gmt True to use GMT (rather than local) time. Default: true. * @param string $type See the 'type' parameter in {@link current_time()}. - Default: 'mysql'. + * Default: 'mysql'. * @return string Current time in 'Y-m-d h:i:s' format. */ function bp_core_current_time( $gmt = true, $type = 'mysql' ) { @@ -1015,7 +1030,7 @@ function bp_core_current_time( $gmt = true, $type = 'mysql' ) { /** * Filters the current GMT time to save into the DB. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $value Current GMT time. */ @@ -1037,14 +1052,16 @@ function bp_core_current_time( $gmt = true, $type = 'mysql' ) { * an interval of 3 minutes will be represented by "3 minutes ago", as will an * interval of 3 minutes 59 seconds. * + * @since 1.0.0 + * * @uses apply_filters() Filter 'bp_core_time_since_pre' to bypass BP's calculations. * @uses apply_filters() Filter 'bp_core_time_since' to modify BP's calculations. * * @param int|string $older_date The earlier time from which you're calculating - * the time elapsed. Enter either as an integer Unix timestamp, or as a - * date string of the format 'Y-m-d h:i:s'. - * @param int $newer_date Optional. Unix timestamp of date to compare older - * date to. Default: false (current time). + * the time elapsed. Enter either as an integer Unix timestamp, + * or as a date string of the format 'Y-m-d h:i:s'. + * @param int|bool $newer_date Optional. Unix timestamp of date to compare older + * date to. Default: false (current time). * @return string String representing the time since the older date, eg * "2 hours and 50 minutes". */ @@ -1053,7 +1070,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Filters whether or not to bypass BuddyPress' time_since calculations. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param bool $value Whether or not to bypass. * @param string $older_date Earlier time from which we're calculating time elapsed. @@ -1067,7 +1084,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Filters the value to use if the time since is unknown. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value String representing the time since the older date. */ @@ -1076,7 +1093,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Filters the value to use if the time since is right now. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value String representing the time since the older date. */ @@ -1085,13 +1102,13 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Filters the value to use if the time since is some time ago. * - * @since BuddyPress (1.5.0) + * @since 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 + // Array of time period chunks. $chunks = array( YEAR_IN_SECONDS, 30 * DAY_IN_SECONDS, @@ -1115,7 +1132,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { */ $newer_date = ( !$newer_date ) ? bp_core_current_time( true, 'timestamp' ) : $newer_date; - // Difference in seconds + // Difference in seconds. $since = $newer_date - $older_date; // Something went wrong with date calculation and we ended up with a negative date. @@ -1130,24 +1147,24 @@ function bp_core_time_since( $older_date, $newer_date = false ) { */ } else { - // Step one: the first chunk + // Step one: the first chunk. for ( $i = 0, $j = count( $chunks ); $i < $j; ++$i ) { $seconds = $chunks[$i]; - // Finding the biggest chunk (if the chunk fits, break) + // Finding the biggest chunk (if the chunk fits, break). $count = floor( $since / $seconds ); if ( 0 != $count ) { break; } } - // If $i iterates all the way to $j, then the event happened 0 seconds ago + // If $i iterates all the way to $j, then the event happened 0 seconds ago. if ( !isset( $chunks[$i] ) ) { $output = $right_now_text; } else { - // Set output var + // Set output var. switch ( $seconds ) { case YEAR_IN_SECONDS : $output = sprintf( _n( '%s year', '%s years', $count, 'buddypress' ), $count ); @@ -1176,12 +1193,12 @@ function bp_core_time_since( $older_date, $newer_date = false ) { // condition fails in the case of minutes and seconds. // We've left the quirk in place, since fractions of a // minute are not a useful piece of information for our - // purposes + // purposes. if ( $i + 2 < $j ) { $seconds2 = $chunks[$i + 1]; $count2 = floor( ( $since - ( $seconds * $count ) ) / $seconds2 ); - // Add to output var + // Add to output var. if ( 0 != $count2 ) { $output .= _x( ',', 'Separator in time since', 'buddypress' ) . ' '; @@ -1207,14 +1224,14 @@ function bp_core_time_since( $older_date, $newer_date = false ) { } } - // No output, so happened right now + // No output, so happened right now. if ( ! (int) trim( $output ) ) { $output = $right_now_text; } } } - // Append 'ago' to the end of time-since if not 'right now' + // Append 'ago' to the end of time-since if not 'right now'. if ( $output != $right_now_text ) { $output = sprintf( $ago_text, $output ); } @@ -1222,7 +1239,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Filters the English-language representation of the time elapsed since a given date. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $output Final 'time since' string. * @param string $older_date Earlier time from which we're calculating time elapsed. @@ -1236,25 +1253,27 @@ function bp_core_time_since( $older_date, $newer_date = false ) { /** * Add a feedback (error/success) message to the WP cookie so it can be displayed after the page reloads. * + * @since 1.0.0 + * * @param string $message Feedback message to be displayed. - * @param string $type Message type. 'updated', 'success', 'error', 'warning'. - * Default: 'success'. + * @param string $type Message type. 'updated', 'success', 'error', 'warning'. + * Default: 'success'. */ function bp_core_add_message( $message, $type = '' ) { - // Success is the default + // Success is the default. if ( empty( $type ) ) { $type = 'success'; } - // Send the values to the cookie for page reload display + // Send the values to the cookie for page reload display. @setcookie( 'bp-message', $message, time() + 60 * 60 * 24, COOKIEPATH ); @setcookie( 'bp-message-type', $type, time() + 60 * 60 * 24, COOKIEPATH ); - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - /*** + /** * Send the values to the $bp global so we can still output messages * without a page reload */ @@ -1272,11 +1291,13 @@ function bp_core_add_message( $message, $type = '' ) { * After the message is displayed, it removes the message vars from the cookie * so that the message is not shown to the user multiple times. * + * @since 1.1.0 + * * @uses setcookie() Sets a cookie value for the user. */ function bp_core_setup_message() { - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); if ( empty( $bp->template_message ) && isset( $_COOKIE['bp-message'] ) ) { @@ -1304,10 +1325,12 @@ add_action( 'bp_actions', 'bp_core_setup_message', 5 ); * * The hook action 'template_notices' is used to call this function, it is not * called directly. + * + * @since 1.1.0 */ function bp_core_render_message() { - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); if ( !empty( $bp->template_message ) ) : @@ -1316,7 +1339,7 @@ function bp_core_render_message() { /** * Filters the 'template_notices' feedback message content. * - * @since BuddyPress (1.5.5) + * @since 1.5.5 * * @param string $template_message Feedback message content. * @param string $type The type of message being displayed. @@ -1335,7 +1358,7 @@ function bp_core_render_message() { /** * Fires after the display of any template_notices feedback messages. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_core_render_message' ); @@ -1352,6 +1375,8 @@ function bp_core_render_message() { * setting for the user every 5 minutes while the user is actively browsing the * site. * + * @since 1.0.0 + * * @uses bp_update_user_meta() BP function to update user metadata in the * usermeta table. * @@ -1359,31 +1384,31 @@ function bp_core_render_message() { */ function bp_core_record_activity() { - // Bail if user is not logged in + // Bail if user is not logged in. if ( ! is_user_logged_in() ) { return false; } - // Get the user ID + // Get the user ID. $user_id = bp_loggedin_user_id(); - // Bail if user is not active + // Bail if user is not active. if ( bp_is_user_inactive( $user_id ) ) { return false; } - // Get the user's last activity + // Get the user's last activity. $activity = bp_get_user_last_activity( $user_id ); - // Make sure it's numeric + // Make sure it's numeric. if ( ! is_numeric( $activity ) ) { $activity = strtotime( $activity ); } - // Get current time + // Get current time. $current_time = bp_core_current_time(); - // Use this action to detect the very first activity for a given member + // Use this action to detect the very first activity for a given member. if ( empty( $activity ) ) { /** @@ -1391,14 +1416,14 @@ function bp_core_record_activity() { * * Use this action to detect the very first activity for a given member. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $user_id ID of the user whose activity is recorded. */ do_action( 'bp_first_activity_for_member', $user_id ); } - // If it's been more than 5 minutes, record a newer last-activity time + // If it's been more than 5 minutes, record a newer last-activity time. if ( empty( $activity ) || ( strtotime( $current_time ) >= strtotime( '+5 minutes', $activity ) ) ) { bp_update_user_last_activity( $user_id, $current_time ); } @@ -1408,21 +1433,23 @@ add_action( 'wp_head', 'bp_core_record_activity' ); /** * Format last activity string based on time since date given. * + * @since 1.0.0 + * * @uses bp_core_time_since() This function will return an English * representation of the time elapsed. * * @param int|string $last_activity_date The date of last activity. - * @param string $string A sprintf()-able statement of the form 'active %s' + * @param string $string A sprintf()-able statement of the form 'active %s'. * @return string $last_active A string of the form '3 years ago'. */ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) { - // Setup a default string if none was passed + // Setup a default string if none was passed. $string = empty( $string ) - ? '%s' // Gettext placeholder + ? '%s' // Gettext placeholder. : $string; - // Use the string if a last activity date was passed + // Use the string if a last activity date was passed. $last_active = empty( $last_activity_date ) ? __( 'Not recently active', 'buddypress' ) : sprintf( $string, bp_core_time_since( $last_activity_date ) ); @@ -1430,7 +1457,7 @@ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) { /** * Filters last activity string based on time since date given. * - * @since BuddyPress (1.2.0) + * @since 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. @@ -1457,11 +1484,11 @@ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) { * $friend_count = get_user_meta( $user_id, bp_get_user_meta_key( 'total_friend_count' ), true ); * If using the WP functions, do not not hardcode your meta keys. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() Filter 'bp_get_user_meta_key' to modify keys individually. * - * @param string $key The usermeta meta_key. + * @param string|bool $key The usermeta meta_key. * @return string $key The usermeta meta_key. */ function bp_get_user_meta_key( $key = false ) { @@ -1469,7 +1496,7 @@ function bp_get_user_meta_key( $key = false ) { /** * Filters the meta_key for a given piece of user metadata. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $key The usermeta meta key. */ @@ -1483,16 +1510,16 @@ function bp_get_user_meta_key( $key = false ) { * bp_get_user_meta_key(), thereby increasing compatibility with non-standard * BP setups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see get_user_meta() For complete details about parameters and return values. * @uses bp_get_user_meta_key() For a filterable version of the meta key. * - * @param int $user_id The ID of the user whose meta you're fetching. - * @param string $key The meta key to retrieve. - * @param bool $single Whether to return a single value. + * @param int $user_id The ID of the user whose meta you're fetching. + * @param string $key The meta key to retrieve. + * @param bool $single Whether to return a single value. * @return mixed Will be an array if $single is false. Will be value of meta data field if $single - * is true. + * is true. */ function bp_get_user_meta( $user_id, $key, $single = false ) { return get_user_meta( $user_id, bp_get_user_meta_key( $key ), $single ); @@ -1505,15 +1532,15 @@ function bp_get_user_meta( $user_id, $key, $single = false ) { * bp_get_user_meta_key(), thereby increasing compatibility with non-standard * BP setups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see update_user_meta() For complete details about parameters and return values. * @uses bp_get_user_meta_key() For a filterable version of the meta key. * - * @param int $user_id The ID of the user whose meta you're setting. - * @param string $key The meta key to set. - * @param mixed $value Metadata value. - * @param mixed $prev_value Optional. Previous value to check before removing. + * @param int $user_id The ID of the user whose meta you're setting. + * @param string $key The meta key to set. + * @param mixed $value Metadata value. + * @param mixed $prev_value Optional. Previous value to check before removing. * @return bool False on failure, true on success. */ function bp_update_user_meta( $user_id, $key, $value, $prev_value = '' ) { @@ -1527,14 +1554,14 @@ function bp_update_user_meta( $user_id, $key, $value, $prev_value = '' ) { * bp_get_user_meta_key(), thereby increasing compatibility with non-standard * BP setups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see delete_user_meta() For complete details about parameters and return values. * @uses bp_get_user_meta_key() For a filterable version of the meta key. * - * @param int $user_id The ID of the user whose meta you're deleting. - * @param string $key The meta key to delete. - * @param mixed $value Optional. Metadata value. + * @param int $user_id The ID of the user whose meta you're deleting. + * @param string $key The meta key to delete. + * @param mixed $value Optional. Metadata value. * @return bool False for failure. True for success. */ function bp_delete_user_meta( $user_id, $key, $value = '' ) { @@ -1546,11 +1573,11 @@ function bp_delete_user_meta( $user_id, $key, $value = '' ) { /** * Initializes {@link BP_Embed} after everything is loaded. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_embed_init() { - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); if ( empty( $bp->embed ) ) { @@ -1562,17 +1589,17 @@ add_action( 'bp_init', 'bp_embed_init', 9 ); /** * Are oembeds allowed in activity items? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool False when activity embed support is disabled; true when - * enabled. Default: true. + * enabled. Default: true. */ function bp_use_embed_in_activity() { /** * Filters whether or not oEmbeds are allowed in activity items. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $value Whether or not oEmbeds are allowed. */ @@ -1582,17 +1609,17 @@ function bp_use_embed_in_activity() { /** * Are oembeds allowed in activity replies? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool False when activity replies embed support is disabled; true - * when enabled. Default: true. + * 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) + * @since 1.5.0 * * @param bool $value Whether or not oEmbeds are allowed. */ @@ -1602,17 +1629,17 @@ function bp_use_embed_in_activity_replies() { /** * Are oembeds allowed in forum posts? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool False when forum post embed support is disabled; true when - * enabled. Default: true. + * 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) + * @since 1.5.0 * * @param bool $value Whether or not oEmbeds are allowed. */ @@ -1622,17 +1649,17 @@ function bp_use_embed_in_forum_posts() { /** * Are oembeds allowed in private messages? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool False when private message embed support is disabled; true when - * enabled. Default: true. + * 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) + * @since 1.5.0 * * @param bool $value Whether or not oEmbeds are allowed. */ @@ -1644,11 +1671,11 @@ function bp_use_embed_in_private_messages() { /** * Output the correct admin URL based on BuddyPress and WordPress configuration. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see bp_get_admin_url() For description of parameters. * - * @param string $path See {@link bp_get_admin_url()}. + * @param string $path See {@link bp_get_admin_url()}. * @param string $scheme See {@link bp_get_admin_url()}. */ function bp_admin_url( $path = '', $scheme = 'admin' ) { @@ -1657,26 +1684,26 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) { /** * Return the correct admin URL based on BuddyPress and WordPress configuration. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_core_do_network_admin() * @uses network_admin_url() * @uses admin_url() * - * @param string $path Optional. The sub-path under /wp-admin to be - * appended to the admin URL. + * @param string $path Optional. The sub-path under /wp-admin to be + * appended to the admin URL. * @param string $scheme The scheme to use. Default is 'admin', which - * obeys {@link force_ssl_admin()} and {@link is_ssl()}. 'http' - * or 'https' can be passed to force those schemes. + * obeys {@link force_ssl_admin()} and {@link is_ssl()}. 'http' + * or 'https' can be passed to force those schemes. * @return string Admin url link with optional path appended. */ function bp_get_admin_url( $path = '', $scheme = 'admin' ) { - // Links belong in network admin + // Links belong in network admin. if ( bp_core_do_network_admin() ) { $url = network_admin_url( $path, $scheme ); - // Links belong in site admin + // Links belong in site admin. } else { $url = admin_url( $path, $scheme ); } @@ -1691,17 +1718,17 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) { * configurations, we need to check a few things to be confident about where * to hook into certain areas of WordPress's admin. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_is_network_activated() * @uses bp_is_multiblog_mode() * * @return bool True if the BP admin screen should appear in the Network Admin, - * otherwise false. + * otherwise false. */ function bp_core_do_network_admin() { - // Default + // Default. $retval = bp_is_network_activated(); if ( bp_is_multiblog_mode() ) { @@ -1711,7 +1738,7 @@ function bp_core_do_network_admin() { /** * Filters whether or not BuddyPress should appear in network admin. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $retval Whether or not BuddyPress should be in the network admin. */ @@ -1728,6 +1755,8 @@ function bp_core_do_network_admin() { * * add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' ); * + * @since 1.5.0 + * * @return string $hook The proper hook ('network_admin_menu' or 'admin_menu'). */ function bp_core_admin_hook() { @@ -1736,7 +1765,7 @@ function bp_core_admin_hook() { /** * Filters the action name that BuddyPress nav setup callbacks should be hooked to. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $hook Action name to be attached to. */ @@ -1748,30 +1777,30 @@ function bp_core_admin_hook() { /** * Is this the root blog? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $blog_id Optional. Default: the ID of the current blog. * @return bool $is_root_blog Returns true if this is bp_get_root_blog_id(). */ function bp_is_root_blog( $blog_id = 0 ) { - // Assume false + // Assume false. $is_root_blog = false; - // Use current blog if no ID is passed - if ( empty( $blog_id ) ) { + // Use current blog if no ID is passed. + if ( empty( $blog_id ) || ! is_int( $blog_id ) ) { $blog_id = get_current_blog_id(); } - // Compare to root blog ID - if ( $blog_id == bp_get_root_blog_id() ) { + // Compare to root blog ID. + if ( bp_get_root_blog_id() === $blog_id ) { $is_root_blog = true; } /** * Filters whether or not we're on the root blog. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $is_root_blog Whether or not we're on the root blog. */ @@ -1785,7 +1814,7 @@ function bp_is_root_blog( $blog_id = 0 ) { * appears (where member profile URLs resolve, where a given theme is loaded, * etc.). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int The root site ID. */ @@ -1794,7 +1823,7 @@ function bp_get_root_blog_id() { /** * Filters the ID for the root blog. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $root_blog_id ID for the root blog. */ @@ -1824,26 +1853,26 @@ function bp_get_root_blog_id() { * a very small use-case with large architectural shortcomings, so do not go * down this road unless you specifically need to. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() Filter 'bp_is_multiblog_mode' to alter. * * @return bool False when multiblog mode is disabled; true when enabled. - * Default: false. + * Default: false. */ function bp_is_multiblog_mode() { - // Setup some default values + // Setup some default values. $retval = false; $is_multisite = is_multisite(); $network_active = bp_is_network_activated(); $is_multiblog = defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG; - // Multisite, Network Activated, and Specifically Multiblog + // Multisite, Network Activated, and Specifically Multiblog. if ( $is_multisite && $network_active && $is_multiblog ) { $retval = true; - // Multisite, but not network activated + // Multisite, but not network activated. } elseif ( $is_multisite && ! $network_active ) { $retval = true; } @@ -1851,7 +1880,7 @@ function bp_is_multiblog_mode() { /** * Filters whether or not we're running in multiblog mode. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $retval Whether or not we're running multiblog mode. */ @@ -1866,20 +1895,20 @@ function bp_is_multiblog_mode() { * with an mu-plugin or some other method, you'll want to filter * 'bp_is_network_activated' and override the auto-determined value. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return bool True if BuddyPress is network activated. */ function bp_is_network_activated() { - // Default to is_multisite() + // Default to is_multisite(). $retval = is_multisite(); - // Check the sitewide plugins array + // Check the sitewide plugins array. $base = buddypress()->basename; $plugins = get_site_option( 'active_sitewide_plugins' ); - // Override is_multisite() if not network activated + // Override is_multisite() if not network activated. if ( ! is_array( $plugins ) || ! isset( $plugins[ $base ] ) ) { $retval = false; } @@ -1887,7 +1916,7 @@ function bp_is_network_activated() { /** * Filters whether or not we're active at the network level. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param bool $retval Whether or not we're network activated. */ @@ -1899,9 +1928,11 @@ function bp_is_network_activated() { /** * Set the "is_directory" global. * - * @param bool $is_directory Optional. Default: false. - * @param string $component Optional. Component name. Default: the current - * component. + * @since 1.5.0 + * + * @param bool $is_directory Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. */ function bp_update_is_directory( $is_directory = false, $component = '' ) { @@ -1912,7 +1943,7 @@ function bp_update_is_directory( $is_directory = false, $component = '' ) { /** * Filters the "is_directory" global value. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $is_directory Whether or not we're "is_directory". * @param string $component Component name. Default: the current component. @@ -1923,9 +1954,11 @@ function bp_update_is_directory( $is_directory = false, $component = '' ) { /** * Set the "is_item_admin" global. * - * @param bool $is_item_admin Optional. Default: false. - * @param string $component Optional. Component name. Default: the current - * component. + * @since 1.5.0 + * + * @param bool $is_item_admin Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. */ function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) { @@ -1936,7 +1969,7 @@ function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) { /** * Filters the "is_item_admin" global value. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -1947,9 +1980,11 @@ function bp_update_is_item_admin( $is_item_admin = false, $component = '' ) { /** * Set the "is_item_mod" global. * - * @param bool $is_item_mod Optional. Default: false. - * @param string $component Optional. Component name. Default: the current - * component. + * @since 1.5.0 + * + * @param bool $is_item_mod Optional. Default: false. + * @param string $component Optional. Component name. Default: the current + * component. */ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) { @@ -1960,7 +1995,7 @@ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) { /** * Filters the "is_item_mod" global value. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -1971,12 +2006,12 @@ function bp_update_is_item_mod( $is_item_mod = false, $component = '' ) { /** * Trigger a 404. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global WP_Query $wp_query WordPress query object. * - * @param string $redirect If 'remove_canonical_direct', remove WordPress' - * "helpful" redirect_canonical action. Default: 'remove_canonical_redirect'. + * @param string $redirect If 'remove_canonical_direct', remove WordPress' "helpful" + * redirect_canonical action. Default: 'remove_canonical_redirect'. */ function bp_do_404( $redirect = 'remove_canonical_direct' ) { global $wp_query; @@ -1984,7 +2019,7 @@ function bp_do_404( $redirect = 'remove_canonical_direct' ) { /** * Fires inside the triggering of a 404. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $redirect Redirect type used to determine if redirect_canonical * function should be be removed. @@ -2007,62 +2042,62 @@ function bp_do_404( $redirect = 'remove_canonical_direct' ) { * * To avoid security exploits within the theme. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_verify_nonce_request' on $action. * - * @param string $action Action nonce. - * @param string $query_arg where to look for nonce in $_REQUEST. + * @param string $action Action nonce. + * @param string $query_arg Where to look for nonce in $_REQUEST. * @return bool True if the nonce is verified, otherwise false. */ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { - /** Home URL **************************************************************/ + /* Home URL **************************************************************/ // Parse home_url() into pieces to remove query-strings, strange characters, // and other funny things that plugins might to do to it. - $parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https://' : 'http://' ) ) ); + $parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https' : 'http' ) ) ); - // Maybe include the port, if it's included + // Maybe include the port, if it's included in home_url(). if ( isset( $parsed_home['port'] ) ) { $parsed_host = $parsed_home['host'] . ':' . $parsed_home['port']; } else { $parsed_host = $parsed_home['host']; } - // Set the home URL for use in comparisons + // Set the home URL for use in comparisons. $home_url = trim( strtolower( $parsed_home['scheme'] . '://' . $parsed_host . $parsed_home['path'] ), '/' ); - /** Requested URL *********************************************************/ + /* Requested URL *********************************************************/ - // Maybe include the port, if it's included in home_url() - if ( isset( $parsed_home['port'] ) ) { + // Maybe include the port, if it's included in home_url(). + if ( isset( $parsed_home['port'] ) && false === strpos( $_SERVER['HTTP_HOST'], ':' ) ) { $request_host = $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT']; } else { $request_host = $_SERVER['HTTP_HOST']; } - // Build the currently requested URL + // Build the currently requested URL. $scheme = is_ssl() ? 'https://' : 'http://'; $requested_url = strtolower( $scheme . $request_host . $_SERVER['REQUEST_URI'] ); - /** Look for match ********************************************************/ + /* Look for match ********************************************************/ /** * Filters the requested URL being nonce-verified. * * Useful for configurations like reverse proxying. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $requested_url The requested URL. */ $matched_url = apply_filters( 'bp_verify_nonce_request_url', $requested_url ); - // Check the nonce + // Check the nonce. $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false; - // Nonce check failed + // Nonce check failed. if ( empty( $result ) || empty( $action ) || ( strpos( $matched_url, $home_url ) !== 0 ) ) { $result = false; } @@ -2070,7 +2105,7 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { /** * Fires at the end of the nonce verification check. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $action Action nonce. * @param bool $result Boolean result of nonce verification. @@ -2083,9 +2118,10 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { /** Requests ******************************************************************/ /** - * Return true|false if this is a POST request + * Return true|false if this is a POST request. + * + * @since 1.9.0 * - * @since BuddyPress (1.9.0) * @return bool */ function bp_is_post_request() { @@ -2093,9 +2129,10 @@ function bp_is_post_request() { } /** - * Return true|false if this is a GET request + * Return true|false if this is a GET request. + * + * @since 1.9.0 * - * @since BuddyPress (1.9.0) * @return bool */ function bp_is_get_request() { @@ -2108,6 +2145,8 @@ function bp_is_get_request() { /** * Load the buddypress translation file for current language. * + * @since 1.0.2 + * * @see load_textdomain() for a description of return values. * * @return bool True on success, false on failure. @@ -2118,7 +2157,7 @@ function bp_core_load_buddypress_textdomain() { /** * Filters the locale to be loaded for the language files. * - * @since BuddyPress (1.0.2) + * @since 1.0.2 * * @param string $value Current locale for the install. */ @@ -2127,7 +2166,7 @@ function bp_core_load_buddypress_textdomain() { /** * Filters the locations to load language files from. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $value Array of directories to check for language files in. */ @@ -2136,14 +2175,14 @@ function bp_core_load_buddypress_textdomain() { trailingslashit( WP_LANG_DIR ), ) ); - // Try custom locations in WP_LANG_DIR + // Try custom locations in WP_LANG_DIR. foreach ( $locations as $location ) { if ( load_textdomain( 'buddypress', $location . $mofile_custom ) ) { return true; } - } + } - // default to WP and glotpress + // Default to WP and glotpress. return load_plugin_textdomain( $domain ); } add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' ); @@ -2151,6 +2190,8 @@ add_action ( 'bp_core_loaded', 'bp_core_load_buddypress_textdomain' ); /** * A JavaScript-free implementation of the search functions in BuddyPress. * + * @since 1.0.1 + * * @param string $slug The slug to redirect to for searching. */ function bp_core_action_search_site( $slug = '' ) { @@ -2213,7 +2254,7 @@ function bp_core_action_search_site( $slug = '' ) { /** * Filters the constructed url for use with site searching. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL for use with site searching. * @param array $search_terms Array of search terms. @@ -2224,6 +2265,8 @@ add_action( 'bp_init', 'bp_core_action_search_site', 7 ); /** * Print the generation time in the footer of the site. + * + * @since 1.0.0 */ function bp_core_print_generation_time() { ?> @@ -2242,7 +2285,7 @@ add_action( 'wp_footer', 'bp_core_print_generation_time' ); * function, we remove these links when on a BuddyPress page. This also * prevents additional, unnecessary queries from running. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_remove_adjacent_posts_rel_link() { if ( ! is_buddypress() ) { @@ -2253,6 +2296,41 @@ function bp_remove_adjacent_posts_rel_link() { } add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' ); +/** + * Strip the span count of a menu item or of a title part. + * + * @since 2.2.2 + * + * @param string $title_part Title part to clean up. + * @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 trim( $title ); +} + +/** + * Get the correct filename suffix for minified assets. + * + * @since 2.5.0 + * + * @return string + */ +function bp_core_get_minified_asset_suffix() { + $ext = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; + + // Ensure the assets can be located when running from /src/. + if ( defined( 'BP_SOURCE_SUBDIRECTORY' ) && BP_SOURCE_SUBDIRECTORY === 'src' ) { + $ext = str_replace( '.min', '', $ext ); + } + + return $ext; +} + /** Nav Menu ******************************************************************/ /** @@ -2269,21 +2347,21 @@ add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' ); * example, "My Profile" will always point to the URL of the profile of the * logged-in user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return mixed A URL or an array of dummy pages. */ function bp_nav_menu_get_loggedin_pages() { - // Try to catch the cached version first + // Try to catch the cached version first. if ( ! empty( buddypress()->wp_nav_menu_items->loggedin ) ) { return buddypress()->wp_nav_menu_items->loggedin; } - // Pull up a list of items registered in BP's top-level nav array + // Pull up a list of items registered in BP's top-level nav array. $bp_menu_items = buddypress()->bp_nav; - // Alphabetize + // Alphabetize. $bp_menu_items = bp_alpha_sort_by_key( $bp_menu_items, 'name' ); // Some BP nav menu items will not be represented in bp_nav, because @@ -2294,7 +2372,7 @@ function bp_nav_menu_get_loggedin_pages() { 'link' => wp_logout_url(), ); - // If there's nothing to show, we're done + // If there's nothing to show, we're done. if ( count( $bp_menu_items ) < 1 ) { return false; } @@ -2303,9 +2381,8 @@ function bp_nav_menu_get_loggedin_pages() { foreach ( $bp_menu_items as $bp_item ) { - // Remove <span>number</span> - $item_name = preg_replace( '/([.0-9]+)/', '', $bp_item['name'] ); - $item_name = trim( strip_tags( $item_name ) ); + // Remove <span>number</span>. + $item_name = _bp_strip_spans_from_title( $bp_item['name'] ); $page_args[ $bp_item['slug'] ] = (object) array( 'ID' => -1, @@ -2339,13 +2416,13 @@ function bp_nav_menu_get_loggedin_pages() { * nor tax terms, so we fake a post-like object so as to be compatible with the * menu. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return mixed A URL or an array of dummy pages. */ function bp_nav_menu_get_loggedout_pages() { - // Try to catch the cached version first + // Try to catch the cached version first. if ( ! empty( buddypress()->wp_nav_menu_items->loggedout ) ) { return buddypress()->wp_nav_menu_items->loggedout; } @@ -2361,7 +2438,7 @@ function bp_nav_menu_get_loggedout_pages() { ); // The Register page will not always be available (ie, when - // registration is disabled) + // registration is disabled). $bp_directory_page_ids = bp_core_get_directory_page_ids(); if( ! empty( $bp_directory_page_ids['register'] ) ) { @@ -2373,7 +2450,7 @@ function bp_nav_menu_get_loggedout_pages() { ); } - // If there's nothing to show, we're done + // If there's nothing to show, we're done. if ( count( $bp_menu_items ) < 1 ) { return false; } @@ -2410,10 +2487,10 @@ function bp_nav_menu_get_loggedout_pages() { * based on the identity of the current user. This function lets you fetch the * proper URL for a given nav item slug (such as 'login' or 'messages'). * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $slug The slug of the nav item: login, register, or one of the - * slugs from buddypress()->bp_nav. + * slugs from buddypress()->bp_nav. * @return string $nav_item_url The URL generated for the current user. */ function bp_nav_menu_get_item_url( $slug ) { @@ -2435,9 +2512,10 @@ function bp_nav_menu_get_item_url( $slug ) { * This is used to power BuddyPress' at-mentions suggestions, but it is flexible enough to be used * for similar kinds of future requirements, or those implemented by third-party developers. * - * @param array $args + * @since 2.1.0 + * + * @param array $args Array of args for the suggestions. * @return array|WP_Error Array of results. If there were any problems, returns a WP_Error object. - * @since BuddyPress (2.1.0) */ function bp_core_get_suggestions( $args ) { $args = bp_parse_args( $args, array(), 'get_suggestions' ); @@ -2463,7 +2541,7 @@ function bp_core_get_suggestions( $args ) { * Use this hook to tell BP the name of your class * if you've built a custom suggestions service. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $value Custom class to use. Default: none. * @param array $args Array of arguments for sugggestions. @@ -2488,7 +2566,7 @@ function bp_core_get_suggestions( $args ) { /** * Filters the available type of at-mentions. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array|WP_Error $retval Array of results or WP_Error object. * @param array $args Array of arguments for suggestions. @@ -2505,13 +2583,15 @@ function bp_core_get_suggestions( $args ) { * This function ensures that we only need to use {@link switch_to_blog()} * once to get what we need. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @uses is_multisite() * @uses bp_is_root_blog() * @uses switch_to_blog() * @uses wp_upload_dir() * @uses restore_current_blog() + * + * @return string */ function bp_upload_dir() { $bp = buddypress(); @@ -2519,20 +2599,20 @@ function bp_upload_dir() { if ( empty( $bp->upload_dir ) ) { $need_switch = (bool) ( is_multisite() && ! bp_is_root_blog() ); - // Maybe juggle to 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) + // Get the upload directory (maybe for root blog). $wp_upload_dir = wp_upload_dir(); - // Maybe juggle back to current blog + // Maybe juggle back to current blog. if ( true === $need_switch ) { restore_current_blog(); } - // Bail if an error occurred + // Bail if an error occurred. if ( ! empty( $wp_upload_dir['error'] ) ) { return false; } @@ -2542,3 +2622,673 @@ function bp_upload_dir() { return $bp->upload_dir; } + + +/** Post Types *****************************************************************/ + +/** + * Output the name of the email post type. + * + * @since 2.5.0 + */ +function bp_email_post_type() { + echo bp_get_email_post_type(); +} + /** + * Returns the name of the email post type. + * + * @since 2.5.0 + * + * @return string The name of the email post type. + */ + function bp_get_email_post_type() { + + /** + * Filters the name of the email post type. + * + * @since 2.5.0 + * + * @param string $value Email post type name. + */ + return apply_filters( 'bp_get_email_post_type', buddypress()->email_post_type ); + } + +/** + * Return labels used by the email post type. + * + * @since 2.5.0 + * + * @return array + */ +function bp_get_email_post_type_labels() { + + /** + * Filters email post type labels. + * + * @since 2.5.0 + * + * @param array $value Associative array (name => label). + */ + return apply_filters( 'bp_get_email_post_type_labels', array( + 'add_new' => _x( 'Add New', 'email post type label', 'buddypress' ), + 'add_new_item' => _x( 'Add a New Email', 'email post type label', 'buddypress' ), + 'all_items' => _x( 'All Emails', 'email post type label', 'buddypress' ), + 'edit_item' => _x( 'Edit Email', 'email post type label', 'buddypress' ), + 'filter_items_list' => _x( 'Filter email list', 'email post type label', 'buddypress' ), + 'items_list' => _x( 'Email list', 'email post type label', 'buddypress' ), + 'items_list_navigation' => _x( 'Email list navigation', 'email post type label', 'buddypress' ), + 'menu_name' => _x( 'Emails', 'email post type name', 'buddypress' ), + 'name' => _x( 'BuddyPress Emails', 'email post type label', 'buddypress' ), + 'new_item' => _x( 'New Email', 'email post type label', 'buddypress' ), + 'not_found' => _x( 'No emails found', 'email post type label', 'buddypress' ), + 'not_found_in_trash' => _x( 'No emails found in Trash', 'email post type label', 'buddypress' ), + 'search_items' => _x( 'Search Emails', 'email post type label', 'buddypress' ), + 'singular_name' => _x( 'Email', 'email post type singular name', 'buddypress' ), + 'uploaded_to_this_item' => _x( 'Uploaded to this email', 'email post type label', 'buddypress' ), + 'view_item' => _x( 'View Email', 'email post type label', 'buddypress' ), + ) ); +} + +/** + * Return array of features that the email post type supports. + * + * @since 2.5.0 + * + * @return array + */ +function bp_get_email_post_type_supports() { + + /** + * Filters the features that the email post type supports. + * + * @since 2.5.0 + * + * @param array $value Supported features. + */ + return apply_filters( 'bp_get_email_post_type_supports', array( + 'custom-fields', + 'editor', + 'excerpt', + 'revisions', + 'title', + ) ); +} + + +/** Taxonomies *****************************************************************/ + +/** + * Output the name of the email type taxonomy. + * + * @since 2.5.0 + */ +function bp_email_tax_type() { + echo bp_get_email_tax_type(); +} + /** + * Return the name of the email type taxonomy. + * + * @since 2.5.0 + * + * @return string The unique email taxonomy type ID. + */ + function bp_get_email_tax_type() { + + /** + * Filters the name of the email type taxonomy. + * + * @since 2.5.0 + * + * @param string $value Email type taxonomy name. + */ + return apply_filters( 'bp_get_email_tax_type', buddypress()->email_taxonomy_type ); + } + +/** + * Return labels used by the email type taxonomy. + * + * @since 2.5.0 + * + * @return array + */ +function bp_get_email_tax_type_labels() { + + /** + * Filters email type taxonomy labels. + * + * @since 2.5.0 + * + * @param array $value Associative array (name => label). + */ + return apply_filters( 'bp_get_email_tax_type_labels', array( + 'add_new_item' => _x( 'New Email Situation', 'email type taxonomy label', 'buddypress' ), + 'all_items' => _x( 'All Email Situations', 'email type taxonomy label', 'buddypress' ), + 'edit_item' => _x( 'Edit Email Situations', 'email type taxonomy label', 'buddypress' ), + 'items_list' => _x( 'Email list', 'email type taxonomy label', 'buddypress' ), + 'items_list_navigation' => _x( 'Email list navigation', 'email type taxonomy label', 'buddypress' ), + 'menu_name' => _x( 'Situations', 'email type taxonomy label', 'buddypress' ), + 'name' => _x( 'Situation', 'email type taxonomy name', 'buddypress' ), + 'new_item_name' => _x( 'New email situation name', 'email type taxonomy label', 'buddypress' ), + 'not_found' => _x( 'No email situations found.', 'email type taxonomy label', 'buddypress' ), + 'no_terms' => _x( 'No email situations', 'email type taxonomy label', 'buddypress' ), + 'popular_items' => _x( 'Popular Email Situation', 'email type taxonomy label', 'buddypress' ), + 'search_items' => _x( 'Search Emails', 'email type taxonomy label', 'buddypress' ), + 'singular_name' => _x( 'Email', 'email type taxonomy singular name', 'buddypress' ), + 'update_item' => _x( 'Update Email Situation', 'email type taxonomy label', 'buddypress' ), + 'view_item' => _x( 'View Email Situation', 'email type taxonomy label', 'buddypress' ), + ) ); +} + + +/** Email *****************************************************************/ + +/** + * Get an BP_Email object for the specified email type. + * + * This function pre-populates the object with the subject, content, and template from the appropriate + * email post type item. It does not replace placeholder tokens in the content with real values. + * + * @since 2.5.0 + * + * @param string $email_type Unique identifier for a particular type of email. + * @return BP_Email|WP_Error BP_Email object, or WP_Error if there was a problem. + */ +function bp_get_email( $email_type ) { + $switched = false; + + // Switch to the root blog, where the email posts live. + if ( ! bp_is_root_blog() ) { + switch_to_blog( bp_get_root_blog_id() ); + $switched = true; + } + + $args = array( + 'no_found_rows' => true, + 'numberposts' => 1, + 'post_status' => 'publish', + 'post_type' => bp_get_email_post_type(), + 'suppress_filters' => false, + + 'tax_query' => array( + array( + 'field' => 'slug', + 'taxonomy' => bp_get_email_tax_type(), + 'terms' => $email_type, + ) + ), + ); + + /** + * Filters arguments used to find an email post type object. + * + * @since 2.5.0 + * + * @param array $args Arguments for get_posts() used to fetch a post object. + * @param string $email_type Unique identifier for a particular type of email. + */ + $args = apply_filters( 'bp_get_email_args', $args, $email_type ); + $post = get_posts( $args ); + if ( ! $post ) { + if ( $switched ) { + restore_current_blog(); + } + + return new WP_Error( 'missing_email', __FUNCTION__, array( $email_type, $args ) ); + } + + /** + * Filters arguments used to create the BP_Email object. + * + * @since 2.5.0 + * + * @param WP_Post $post Post object containing the contents of the email. + * @param string $email_type Unique identifier for a particular type of email. + * @param array $args Arguments used with get_posts() to fetch a post object. + * @param WP_Post $post All posts retrieved by get_posts( $args ). May only contain $post. + */ + $post = apply_filters( 'bp_get_email_post', $post[0], $email_type, $args, $post ); + $email = new BP_Email( $email_type ); + + + /* + * Set some email properties for convenience. + */ + + // Post object (sets subject, content, template). + $email->set_post_object( $post ); + + /** + * Filters the BP_Email object returned by bp_get_email(). + * + * @since 2.5.0 + * + * @param BP_Email $email An object representing a single email, ready for mailing. + * @param string $email_type Unique identifier for a particular type of email. + * @param array $args Arguments used with get_posts() to fetch a post object. + * @param WP_Post $post All posts retrieved by get_posts( $args ). May only contain $post. + */ + $retval = apply_filters( 'bp_get_email', $email, $email_type, $args, $post ); + + if ( $switched ) { + restore_current_blog(); + } + + return $retval; +} + +/** + * Send email, similar to WordPress' wp_mail(). + * + * A true return value does not automatically mean that the user received the + * email successfully. It just only means that the method used was able to + * process the request without any errors. + * + * @since 2.5.0 + * + * @param string $email_type Type of email being sent. + * @param string|array|int|WP_User $to Either a email address, user ID, WP_User object, + * or an array containg the address and name. + * @param array $args { + * Optional. Array of extra. parameters. + * + * @type array $tokens Optional. Assocative arrays of string replacements for the email. + * } + * @return bool|WP_Error True if the email was sent successfully. Otherwise, a WP_Error object + * describing why the email failed to send. The contents will vary based + * on the email delivery class you are using. + */ +function bp_send_email( $email_type, $to, $args = array() ) { + static $is_default_wpmail = null; + static $wp_html_emails = null; + + // Has wp_mail() been filtered to send HTML emails? + if ( is_null( $wp_html_emails ) ) { + /** This filter is documented in wp-includes/pluggable.php */ + $wp_html_emails = apply_filters( 'wp_mail_content_type', 'text/plain' ) === 'text/html'; + } + + // Since wp_mail() is a pluggable function, has it been re-defined by another plugin? + if ( is_null( $is_default_wpmail ) ) { + try { + $mirror = new ReflectionFunction( 'wp_mail' ); + $is_default_wpmail = substr( $mirror->getFileName(), -strlen( 'pluggable.php' ) ) === 'pluggable.php'; + } catch ( Exception $e ) { + $is_default_wpmail = true; + } + } + + $args = bp_parse_args( $args, array( + 'tokens' => array(), + ), 'send_email' ); + + + /* + * Build the email. + */ + + $email = bp_get_email( $email_type ); + if ( is_wp_error( $email ) ) { + return $email; + } + + // From, subject, content are set automatically. + $email->set_to( $to ); + $email->set_tokens( $args['tokens'] ); + + $status = $email->validate(); + if ( is_wp_error( $status ) ) { + return $status; + } + + /** + * Filter this to skip BP's email handling and instead send everything to wp_mail(). + * + * This is done if wp_mail_content_type() has been configured for HTML, + * or if wp_mail() has been redeclared (it's a pluggable function). + * + * @since 2.5.0 + * + * @param bool $use_wp_mail Whether to fallback to the regular wp_mail() function or not. + */ + $must_use_wpmail = apply_filters( 'bp_email_use_wp_mail', $wp_html_emails || ! $is_default_wpmail ); + + if ( $must_use_wpmail ) { + $to = $email->get( 'to' ); + + return wp_mail( + array_shift( $to )->get_address(), + $email->get( 'subject', 'replace-tokens' ), + $email->get( 'content_plaintext', 'replace-tokens' ) + ); + } + + + /* + * Send the email. + */ + + /** + * Filter the email delivery class. + * + * Defaults to BP_PHPMailer, which as you can guess, implements PHPMailer. + * + * @since 2.5.0 + * + * @param string $deliver_class The email delivery class name. + * @param string $email_type Type of email being sent. + * @param array|string $to Array or comma-separated list of email addresses to the email to. + * @param array $args { + * Optional. Array of extra parameters. + * + * @type array $tokens Optional. Assocative arrays of string replacements for the email. + * } + */ + $delivery_class = apply_filters( 'bp_send_email_delivery_class', 'BP_PHPMailer', $email_type, $to, $args ); + if ( ! class_exists( $delivery_class ) ) { + return new WP_Error( 'missing_class', __CLASS__, $this ); + } + + $delivery = new $delivery_class(); + $status = $delivery->bp_email( $email ); + + if ( is_wp_error( $status ) ) { + + /** + * Fires after BuddyPress has tried - and failed - to send an email. + * + * @since 2.5.0 + * + * @param WP_Error $status A WP_Error object describing why the email failed to send. The contents + * will vary based on the email delivery class you are using. + * @param BP_Email $email The email we tried to send. + */ + do_action( 'bp_send_email_failure', $status, $email ); + + } else { + + /** + * Fires after BuddyPress has succesfully sent an email. + * + * @since 2.5.0 + * + * @param bool $status True if the email was sent successfully. + * @param BP_Email $email The email sent. + */ + do_action( 'bp_send_email_success', $status, $email ); + } + + return $status; +} + +/** + * Return email appearance settings. + * + * @since 2.5.0 + * + * @return array + */ +function bp_email_get_appearance_settings() { + $default_args = array( + 'body_bg' => '#FFFFFF', + 'body_text_color' => '#555555', + 'body_text_size' => 15, + 'email_bg' => '#F7F3F0', + 'footer_bg' => '#F7F3F0', + 'footer_text_color' => '#525252', + 'footer_text_size' => 12, + 'header_bg' => '#F7F3F0', + 'highlight_color' => '#D84800', + 'header_text_color' => '#000000', + 'header_text_size' => 30, + + 'footer_text' => sprintf( + /* translators: email disclaimer, e.g. "© 2016 Site Name". */ + _x( '© %s %s', 'email', 'buddypress' ), + date_i18n( 'Y' ), + bp_get_option( 'blogname' ) + ), + ); + + return bp_parse_args( + bp_get_option( 'bp_email_options', array() ), + $default_args, + 'email_appearance_settings' + ); +} + +/** + * Get the paths to possible templates for the specified email object. + * + * @since 2.5.0 + * + * @param WP_Post $object Post to get email template for. + * @return array + */ +function bp_email_get_template( WP_Post $object ) { + $single = "single-{$object->post_type}"; + + /** + * Filter the possible template paths for the specified email object. + * + * @since 2.5.0 + * + * @param array $value Array of possible template paths. + * @param WP_Post $object WP_Post object. + */ + return apply_filters( 'bp_email_get_template', array( + "{$single}-{$object->post_name}.php", + "{$single}.php", + "assets/emails/{$single}.php", + ), $object ); +} + +/** + * Replace all tokens in the input text with appropriate values. + * + * Intended for use with the email system introduced in BuddyPress 2.5.0. + * + * @since 2.5.0 + * + * @param string $text + * @param array $tokens Token names and replacement values for the $text. + * @return string + */ +function bp_core_replace_tokens_in_text( $text, $tokens ) { + $unescaped = array(); + $escaped = array(); + + foreach ( $tokens as $token => $value ) { + if ( ! is_string( $value ) && is_callable( $value ) ) { + $value = call_user_func( $value ); + } + + // Tokens could be objects or arrays. + if ( ! is_scalar( $value ) ) { + continue; + } + + $unescaped[ '{{{' . $token . '}}}' ] = $value; + $escaped[ '{{' . $token . '}}' ] = esc_html( $value ); + } + + $text = strtr( $text, $unescaped ); // Do first. + $text = strtr( $text, $escaped ); + + /** + * Filters text that has had tokens replaced. + * + * @since 2.5.0 + * + * @param string $text + * @param array $tokens Token names and replacement values for the $text. + */ + return apply_filters( 'bp_core_replace_tokens_in_text', $text, $tokens ); +} + +/** + * Get a list of emails for populating the email post type. + *t + * @since 2.5.1 + * + * @return array + */ +function bp_email_get_schema() { + return array( + 'activity-comment' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "{{poster.name}} replied to one of your updates:\n\n<blockquote>"{{usermessage}}"</blockquote>\n\n<a href=\"{{{thread.url}}}\">Go to the discussion</a> to reply or catch up on the conversation.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{poster.name}} replied to one of your updates:\n\n\"{{usermessage}}\"\n\nGo to the discussion to reply or catch up on the conversation: {{{thread.url}}}", 'buddypress' ), + ), + 'activity-comment-author' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your comments', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "{{poster.name}} replied to one of your comments:\n\n<blockquote>"{{usermessage}}"</blockquote>\n\n<a href=\"{{{thread.url}}}\">Go to the discussion</a> to reply or catch up on the conversation.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{poster.name}} replied to one of your comments:\n\n\"{{usermessage}}\"\n\nGo to the discussion to reply or catch up on the conversation: {{{thread.url}}}", 'buddypress' ), + ), + 'activity-at-message' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] {{poster.name}} mentioned you in a status update', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "{{poster.name}} mentioned you in a status update:\n\n<blockquote>"{{usermessage}}"</blockquote>\n\n<a href=\"{{{mentioned.url}}}\">Go to the discussion</a> to reply or catch up on the conversation.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{poster.name}} mentioned you in a status update:\n\n\"{{usermessage}}\"\n\nGo to the discussion to reply or catch up on the conversation: {{{mentioned.url}}}", 'buddypress' ), + ), + 'groups-at-message' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] {{poster.name}} mentioned you in an update', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "{{poster.name}} mentioned you in the group \"{{group.name}}\":\n\n<blockquote>"{{usermessage}}"</blockquote>\n\n<a href=\"{{{mentioned.url}}}\">Go to the discussion</a> to reply or catch up on the conversation.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{poster.name}} mentioned you in the group \"{{group.name}}\":\n\n\"{{usermessage}}\"\n\nGo to the discussion to reply or catch up on the conversation: {{{mentioned.url}}}", 'buddypress' ), + ), + 'core-user-registration' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Activate your account', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "Thanks for registering!\n\nTo complete the activation of your account, go to the following link: <a href=\"{{{activate.url}}}\">{{{activate.url}}}</a>", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "Thanks for registering!\n\nTo complete the activation of your account, go to the following link: {{{activate.url}}}", 'buddypress' ), + ), + 'core-user-registration-with-blog' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Activate {{{user-site.url}}}', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "Thanks for registering!\n\nTo complete the activation of your account and site, go to the following link: <a href=\"{{{activate-site.url}}}\">{{{activate-site.url}}}</a>.\n\nAfter you activate, you can visit your site at <a href=\"{{{user-site.url}}}\">{{{user-site.url}}}</a>.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "Thanks for registering!\n\nTo complete the activation of your account and site, go to the following link: {{{activate-site.url}}}\n\nAfter you activate, you can visit your site at {{{user-site.url}}}.", 'buddypress' ), + ), + 'friends-request' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] New friendship request from {{initiator.name}}', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "<a href=\"{{{initiator.url}}}\">{{initiator.name}}</a> wants to add you as a friend.\n\nTo accept this request and manage all of your pending requests, visit: <a href=\"{{{friend-requests.url}}}\">{{{friend-requests.url}}}</a>", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{initiator.name}} wants to add you as a friend.\n\nTo accept this request and manage all of your pending requests, visit: {{{friend-requests.url}}}\n\nTo view {{initiator.name}}'s profile, visit: {{{initiator.url}}}", 'buddypress' ), + ), + 'friends-request-accepted' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] {{friend.name}} accepted your friendship request', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "<a href=\"{{{friendship.url}}}\">{{friend.name}}</a> accepted your friend request.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{friend.name}} accepted your friend request.\n\nTo learn more about them, visit their profile: {{{friendship.url}}}", 'buddypress' ), + ), + 'groups-details-updated' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Group details updated', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "Group details for the group "<a href=\"{{{group.url}}}\">{{group.name}}</a>" were updated:\n<blockquote>{{changed_text}}</blockquote>", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "Group details for the group "{{group.name}}" were updated:\n\n{{changed_text}}\n\nTo view the group, visit: {{{group.url}}}", 'buddypress' ), + ), + 'groups-invitation' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] You have an invitation to the group: "{{group.name}}"', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join the group: "{{group.name}}".\n<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a href=\"{{{group.url}}}\">visit the group</a> to learn more.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{inviter.name}} has invited you to join the group: "{{group.name}}".\n\nTo accept your invitation, visit: {{{invites.url}}}\n\nTo learn more about the group, visit {{{group.url}}}.\nTo view {{inviter.name}}'s profile, visit: {{{inviter.url}}}", 'buddypress' ), + ), + 'groups-member-promoted' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] You have been promoted in the group: "{{group.name}}"', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "You have been promoted to <b>{{promoted_to}}</b> in the group "<a href=\"{{{group.url}}}\">{{group.name}}</a>".", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "You have been promoted to {{promoted_to}} in the group: "{{group.name}}".\n\nTo visit the group, go to: {{{group.url}}}", 'buddypress' ), + ), + 'groups-membership-request' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Membership request for group: {{group.name}}', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "<a href=\"{{{profile.url}}}\">{{requesting-user.name}}</a> wants to join the group "{{group.name}}". As you are an administrator of this group, you must either accept or reject the membership request.\n\n<a href=\"{{{group-requests.url}}}\">Go here to manage this</a> and all other pending requests.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{requesting-user.name}} wants to join the group "{{group.name}}". As you are the administrator of this group, you must either accept or reject the membership request.\n\nTo manage this and all other pending requests, visit: {{{group-requests.url}}}\n\nTo view {{requesting-user.name}}'s profile, visit: {{{profile.url}}}", 'buddypress' ), + ), + 'messages-unread' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] New message from {{sender.name}}', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "{{sender.name}} sent you a new message: "{{usersubject}}"\n\n<blockquote>"{{usermessage}}"</blockquote>\n\n<a href=\"{{{message.url}}}\">Go to the discussion</a> to reply or catch up on the conversation.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "{{sender.name}} sent you a new message: "{{usersubject}}"\n\n"{{usermessage}}"\n\nGo to the discussion to reply or catch up on the conversation: {{{message.url}}}", 'buddypress' ), + ), + 'settings-verify-email-change' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Verify your new email address', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "You recently changed the email address associated with your account on {{site.name}}. If this is correct, <a href=\"{{{verify.url}}}\">go here to confirm the change</a>.\n\nOtherwise, you can safely ignore and delete this email if you have changed your mind, or if you think you have received this email in error.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "You recently changed the email address associated with your account on {{site.name}}. If this is correct, go to the following link to confirm the change: {{{verify.url}}}\n\nOtherwise, you can safely ignore and delete this email if you have changed your mind, or if you think you have received this email in error.", 'buddypress' ), + ), + 'groups-membership-request-accepted' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Membership request for group "{{group.name}}" accepted', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "Your membership request for the group "<a href=\"{{{group.url}}}\">{{group.name}}</a>" has been accepted.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "Your membership request for the group "{{group.name}}" has been accepted.\n\nTo view the group, visit: {{{group.url}}}", 'buddypress' ), + ), + 'groups-membership-request-rejected' => array( + /* translators: do not remove {} brackets or translate its contents. */ + 'post_title' => __( '[{{{site.name}}}] Membership request for group "{{group.name}}" rejected', 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_content' => __( "Your membership request for the group "<a href=\"{{{group.url}}}\">{{group.name}}</a>" has been rejected.", 'buddypress' ), + /* translators: do not remove {} brackets or translate its contents. */ + 'post_excerpt' => __( "Your membership request for the group "{{group.name}}" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ), + ), + ); +} + +/** + * Get a list of emails for populating email type taxonomy terms. + * + * @since 2.5.1 + * + * @return array + */ +function bp_email_get_type_schema() { + return array( + 'activity-comment' => __( 'A member has replied to an activity update that the recipient posted.', 'buddypress' ), + 'activity-comment-author' => __( 'A member has replied to a comment on an activity update that the recipient posted.', 'buddypress' ), + 'activity-at-message' => __( 'Recipient was mentioned in an activity update.', 'buddypress' ), + 'groups-at-message' => __( 'Recipient was mentioned in a group activity update.', 'buddypress' ), + 'core-user-registration' => __( 'Recipient has registered for an account.', 'buddypress' ), + 'core-user-registration-with-blog' => __( 'Recipient has registered for an account and site.', 'buddypress' ), + 'friends-request' => __( 'A member has sent a friend request to the recipient.', 'buddypress' ), + 'friends-request-accepted' => __( 'Recipient has had a friend request accepted by a member.', 'buddypress' ), + 'groups-details-updated' => __( "A group's details were updated.", 'buddypress' ), + 'groups-invitation' => __( 'A member has sent a group invitation to the recipient.', 'buddypress' ), + 'groups-member-promoted' => __( "Recipient's status within a group has changed.", 'buddypress' ), + 'groups-membership-request' => __( 'A member has requested permission to join a group.', 'buddypress' ), + 'messages-unread' => __( 'Recipient has received a private message.', 'buddypress' ), + 'settings-verify-email-change' => __( 'Recipient has changed their email address.', 'buddypress' ), + 'groups-membership-request-accepted' => __( 'Recipient had requested to join a group, which was accepted.', 'buddypress' ), + 'groups-membership-request-rejected' => __( 'Recipient had requested to join a group, which was rejected.', 'buddypress' ), + ); +} 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 03455a43f9ee62d93484ffbc81fd16a9ef7df8ff..a5650de8ade67806815674fbbb356d357eae1e13 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Core Loader. * @@ -7,327 +6,18 @@ * * @package BuddyPress * @subpackage Core + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Core extends BP_Component { - - /** - * Start the members component creation process. - * - * @since BuddyPress (1.5.0) - * - * @uses BP_Core::bootstrap() - */ - public function __construct() { - parent::start( - 'core', - __( 'BuddyPress Core', 'buddypress' ), - buddypress()->plugin_dir - ); - - $this->bootstrap(); - } - - /** - * Populate the global data needed before BuddyPress can continue. - * - * This involves figuring out the currently required, activated, deactivated, - * and optional components. - * - * @since BuddyPress (1.5.0) - */ - private function bootstrap() { - $bp = buddypress(); - - /** - * Fires before the loading of individual components and after BuddyPress Core. - * - * Allows plugins to run code ahead of the other components. - * - * @since BuddyPress (1.2.0) - */ - do_action( 'bp_core_loaded' ); - - /** 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' ) ); - - /** - * 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 - } elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) { - - // Trim off namespace and filename - foreach ( array_keys( (array) $deactivated_components ) as $component ) { - $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); - } - - /** 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' ); - - /** 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 - } else { - - // Set globals - $bp->deactivated_components = array(); - - // Setup the active components - $active_components = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' ); - - /** This filter is documented in bp-core/admin/bp-core-admin-components.php */ - $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); - } - - // Loop through optional components - foreach( $bp->optional_components as $component ) { - if ( bp_is_active( $component ) && file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { - include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); - } - } - - // Loop through required components - foreach( $bp->required_components as $component ) { - if ( file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { - include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); - } - } - - // 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' ); - } - - /** - * Include bp-core files. - * - * @see BP_Component::includes() for description of parameters. - * - * @param array $includes See {@link BP_Component::includes()}. - */ - public function includes( $includes = array() ) { - - if ( !is_admin() ) - return; - - $includes = array( - 'admin' - ); - - parent::includes( $includes ); - } - - /** - * Set up bp-core global settings. - * - * Sets up a majority of the BuddyPress globals that require a minimal - * amount of processing, meaning they cannot be set in the BuddyPress class. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for description of parameters. - * - * @param array $args See {@link BP_Component::setup_globals()}. - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - /** Database **********************************************************/ - - // Get the base database prefix - if ( empty( $bp->table_prefix ) ) - $bp->table_prefix = bp_core_get_table_prefix(); - - // The domain for the root of the site where the main blog resides - if ( empty( $bp->root_domain ) ) - $bp->root_domain = bp_core_get_root_domain(); - - // Fetches all of the core BuddyPress settings in one fell swoop - if ( empty( $bp->site_options ) ) - $bp->site_options = bp_core_get_root_options(); - - // The names of the core WordPress pages used to display BuddyPress content - if ( empty( $bp->pages ) ) - $bp->pages = bp_core_get_directory_pages(); - - /** Basic current user data *******************************************/ - - // Logged in user is the 'current_user' - $current_user = wp_get_current_user(); - - // The user ID of the user who is currently logged in. - $bp->loggedin_user = new stdClass; - $bp->loggedin_user->id = isset( $current_user->ID ) ? $current_user->ID : 0; - - /** Avatars ***********************************************************/ - - // 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 - // bp-notifications instead. - $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications'; - - /** - * Used to determine if user has admin rights on current content. If the - * logged in user is viewing their own profile and wants to delete - * something, is_item_admin is used. This is a generic variable so it - * can be used by other components. It can also be modified, so when - * viewing a group 'is_item_admin' would be 'true' if they are a group - * admin, and 'false' if they are not. - */ - bp_update_is_item_admin( bp_user_has_access(), 'core' ); - - // 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' ); - } - - /** - * Set up component navigation. - * - * @since BuddyPress (1.5.0) - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - $bp = buddypress(); - - // If xprofile component is disabled, revert to WordPress profile - if ( !bp_is_active( 'xprofile' ) ) { - - // Fallback values if xprofile is disabled - if ( ! isset( $bp->core->profile ) ) { - $bp->core->profile = new stdClass; - } - $bp->core->profile->slug = 'profile'; - $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug; - - // Add 'Profile' to the main navigation - $main_nav = array( - 'name' => _x( 'Profile', 'Main navigation', 'buddypress' ), - 'slug' => $bp->core->profile->slug, - 'position' => 20, - 'screen_function' => 'bp_core_catch_profile_uri', - 'default_subnav_slug' => 'public' - ); - - $profile_link = trailingslashit( bp_loggedin_user_domain() . '/' . $bp->core->profile->slug ); - - // Add the subnav items to the profile - $sub_nav[] = array( - 'name' => _x( 'View', 'Profile sub nav', 'buddypress' ), - 'slug' => 'public', - 'parent_url' => $profile_link, - 'parent_slug' => $bp->core->profile->slug, - 'screen_function' => 'bp_core_catch_profile_uri' - ); - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-core.php'; /** * Set up the BuddyPress Core component. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @global BuddyPress $bp BuddyPress global settings object. */ 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 c2cf37714be67c3721ccd969c69bde67006cc484..775f4f51fa48cebd08543ad6fee7831a2389816b 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php @@ -4,10 +4,10 @@ * * @package BuddyPress * @subpackage Core - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Moderation ****************************************************************/ @@ -18,7 +18,7 @@ defined( 'ABSPATH' ) || exit; * Check to make sure that a user is not making too many posts in a short amount * of time. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses current_user_can() To check if the current user can throttle. * @uses bp_get_option() To get the throttle time. @@ -35,7 +35,7 @@ function bp_core_check_for_flood( $user_id = 0 ) { return true; } - // Bail if no user ID passed + // Bail if no user ID passed. if ( empty( $user_id ) ) { return false; } @@ -51,14 +51,14 @@ function bp_core_check_for_flood( $user_id = 0 ) { /** * Check for moderation keys and too many links. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_current_author_ip() To get current user IP address. * @uses bp_current_author_ua() To get current user agent. * @uses bp_current_user_can() Allow super admins to bypass blacklist. * - * @param int $user_id Topic or reply author ID. - * @param string $title The title of the content. + * @param int $user_id Topic or reply author ID. + * @param string $title The title of the content. * @param string $content The content being posted. * @return bool True if test is passed, false if fail. */ @@ -67,7 +67,7 @@ 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) + * @since 2.2.0 * * @param bool $value Whether or not to bypass checking. Default false. * @param int $user_id Topic of reply author ID. @@ -78,23 +78,24 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' return true; } - // Bail if super admin is author + // Bail if super admin is author. if ( is_super_admin( $user_id ) ) { return true; } - // Define local variable(s) + // Define local variable(s). $_post = array(); $match_out = ''; - /** User Data *************************************************************/ + /** User Data ************************************************************ + */ if ( ! empty( $user_id ) ) { - // Get author data + // Get author data. $user = get_userdata( $user_id ); - // If data exists, map it + // If data exists, map it. if ( ! empty( $user ) ) { $_post['author'] = $user->display_name; $_post['email'] = $user->user_email; @@ -102,15 +103,16 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' } } - // Current user IP and user agent + // Current user IP and user agent. $_post['user_ip'] = bp_core_current_user_ip(); $_post['user_ua'] = bp_core_current_user_ua(); - // Post title and content + // Post title and content. $_post['title'] = $title; $_post['content'] = $content; - /** Max Links *************************************************************/ + /** Max Links ************************************************************ + */ $max_links = get_option( 'comment_max_links' ); if ( ! empty( $max_links ) ) { @@ -118,13 +120,13 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' // How many links? $num_links = preg_match_all( '/(http|ftp|https):\/\//i', $content, $match_out ); - // Allow for bumping the max to include the user's URL + // Allow for bumping the max to include the user's URL. if ( ! empty( $_post['url'] ) ) { /** * Filters the maximum amount of links allowed to include the user's URL. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $num_links How many links found. * @param string $value User's url. @@ -138,61 +140,62 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' } } - /** Blacklist *************************************************************/ + /** Blacklist ************************************************************ + */ - // Get the moderation keys + // Get the moderation keys. $blacklist = trim( get_option( 'moderation_keys' ) ); - // Bail if blacklist is empty + // Bail if blacklist is empty. if ( ! empty( $blacklist ) ) { - // Get words separated by new lines + // Get words separated by new lines. $words = explode( "\n", $blacklist ); - // Loop through words + // Loop through words. foreach ( (array) $words as $word ) { - // Trim the whitespace from the word + // Trim the whitespace from the word. $word = trim( $word ); - // Skip empty lines + // Skip empty lines. if ( empty( $word ) ) { continue; } // Do some escaping magic so that '#' chars in the - // spam words don't break things: + // spam words don't break things. $word = preg_quote( $word, '#' ); $pattern = "#$word#i"; - // Loop through post data + // Loop through post data. foreach ( $_post as $post_data ) { - // Check each user data for current word + // Check each user data for current word. if ( preg_match( $pattern, $post_data ) ) { - // Post does not pass + // Post does not pass. return false; } } } } - // Check passed successfully + // Check passed successfully. return true; } /** * Check for blocked keys. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_current_author_ip() To get current user IP address. * @uses bp_current_author_ua() To get current user agent. * @uses bp_current_user_can() Allow super admins to bypass blacklist. * - * @param int $user_id Topic or reply author ID. - * @param string $title The title of the content. + * @param int $user_id Topic or reply author ID. + * @param string $title The title of the content. * @param string $content The content being posted. * @return bool True if test is passed, false if fail. */ @@ -201,7 +204,7 @@ 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) + * @since 2.2.0 * * @param bool $value Whether or not to bypass checking. Default false. * @param int $user_id Topic of reply author ID. @@ -212,33 +215,35 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) return true; } - // Bail if super admin is author + // Bail if super admin is author. if ( is_super_admin( $user_id ) ) { return true; } - // Define local variable + // Define local variable. $_post = array(); - /** Blacklist *************************************************************/ + /** Blacklist ************************************************************ + */ - // Get the moderation keys + // Get the moderation keys. $blacklist = trim( get_option( 'blacklist_keys' ) ); - // Bail if blacklist is empty + // Bail if blacklist is empty. if ( empty( $blacklist ) ) { return true; } - /** User Data *************************************************************/ + /** User Data ************************************************************ + */ - // Map current user data + // Map current user data. if ( ! empty( $user_id ) ) { - // Get author data + // Get author data. $user = get_userdata( $user_id ); - // If data exists, map it + // If data exists, map it. if ( ! empty( $user ) ) { $_post['author'] = $user->display_name; $_post['email'] = $user->user_email; @@ -246,53 +251,54 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) } } - // Current user IP and user agent + // Current user IP and user agent. $_post['user_ip'] = bp_core_current_user_ip(); $_post['user_ua'] = bp_core_current_user_ua(); - // Post title and content + // Post title and content. $_post['title'] = $title; $_post['content'] = $content; - /** Words *****************************************************************/ + /** Words **************************************************************** + */ - // Get words separated by new lines + // Get words separated by new lines. $words = explode( "\n", $blacklist ); - // Loop through words + // Loop through words. foreach ( (array) $words as $word ) { - // Trim the whitespace from the word + // Trim the whitespace from the word. $word = trim( $word ); - // Skip empty lines + // Skip empty lines. if ( empty( $word ) ) { continue; } // Do some escaping magic so that '#' chars in the - // spam words don't break things: + // spam words don't break things. $word = preg_quote( $word, '#' ); $pattern = "#$word#i"; - // Loop through post data + // Loop through post data. foreach( $_post as $post_data ) { - // Check each user data for current word + // Check each user data for current word. if ( preg_match( $pattern, $post_data ) ) { - // Post does not pass + // Post does not pass. return false; } } } - // Check passed successfully + // Check passed successfully. return true; } /** * Get the current user's IP address. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return string IP address. */ @@ -302,7 +308,7 @@ function bp_core_current_user_ip() { /** * Filters the current user's IP address. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $retval Current user's IP Address. */ @@ -312,13 +318,13 @@ function bp_core_current_user_ip() { /** * Get the current user's user-agent. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return string User agent string. */ function bp_core_current_user_ua() { - // Sanity check the user agent + // Sanity check the user agent. if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) ) { $retval = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ); } else { @@ -328,9 +334,9 @@ function bp_core_current_user_ua() { /** * Filters the current user's user-agent. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param string $retval Current user's user-agent + * @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 1ca2ee6d4b8e411a78efe89aacd909fae5df9e47..d04568e8625a0d6b57163dca71a46fdafdf098e7 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-options.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-options.php @@ -1,100 +1,105 @@ <?php - /** * BuddyPress Options. * * @package BuddyPress * @subpackage Options + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Get the default site options and their values. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return array Filtered option names and values. */ function bp_get_default_options() { - // Default options + // Default options. $options = array ( - /** Components ********************************************************/ + /* Components ********************************************************/ + + 'bp-deactivated-components' => array(), + + /* bbPress ***********************************************************/ - 'bp-deactivated-components' => array(), + // Legacy bbPress config location. + 'bb-config-location' => ABSPATH . 'bb-config.php', - /** bbPress ***********************************************************/ + /* XProfile **********************************************************/ - // Legacy bbPress config location - 'bb-config-location' => ABSPATH . 'bb-config.php', + // Base profile groups name. + 'bp-xprofile-base-group-name' => 'Base', - /** XProfile **********************************************************/ + // Base fullname field name. + 'bp-xprofile-fullname-field-name' => 'Name', - // Base profile groups name - 'bp-xprofile-base-group-name' => 'Base', + /* Blogs *************************************************************/ - // Base fullname field name - 'bp-xprofile-fullname-field-name' => 'Name', + // Used to decide if blogs need indexing. + 'bp-blogs-first-install' => false, - /** Blogs *************************************************************/ + /* Settings **********************************************************/ - // Used to decide if blogs need indexing - 'bp-blogs-first-install' => false, + // Disable the WP to BP profile sync. + 'bp-disable-profile-sync' => false, - /** Settings **********************************************************/ + // Hide the Toolbar for logged out users. + 'hide-loggedout-adminbar' => false, - // Disable the WP to BP profile sync - 'bp-disable-profile-sync' => false, + // Avatar uploads. + 'bp-disable-avatar-uploads' => false, - // Hide the Toolbar for logged out users - 'hide-loggedout-adminbar' => false, + // Cover image uploads. + 'bp-disable-cover-image-uploads' => false, - // Avatar uploads - 'bp-disable-avatar-uploads' => false, + // Group Profile Photos. + 'bp-disable-group-avatar-uploads' => false, - // Group Profile Photos - 'bp-disable-group-avatar-uploads' => false, + // Group Cover image uploads. + 'bp-disable-group-cover-image-uploads' => false, - // Allow users to delete their own accounts - 'bp-disable-account-deletion' => false, + // Allow users to delete their own accounts. + 'bp-disable-account-deletion' => false, - // Allow comments on blog and forum activity items - 'bp-disable-blogforum-comments' => true, + // Allow comments on blog and forum activity items. + 'bp-disable-blogforum-comments' => true, // The ID for the current theme package. - '_bp_theme_package_id' => 'legacy', + '_bp_theme_package_id' => 'legacy', - /** Groups ************************************************************/ + /* Groups ************************************************************/ // @todo Move this into the groups component + // Restrict group creation to super admins. + 'bp_restrict_group_creation' => false, - // Restrict group creation to super admins - 'bp_restrict_group_creation' => false, + /* Akismet ***********************************************************/ - /** Akismet ***********************************************************/ + // Users from all sites can post. + '_bp_enable_akismet' => true, - // Users from all sites can post - '_bp_enable_akismet' => true, + /* Activity HeartBeat ************************************************/ - /** Activity HeartBeat ************************************************/ + // HeartBeat is on to refresh activities. + '_bp_enable_heartbeat_refresh' => true, - // HeartBeat is on to refresh activities - '_bp_enable_heartbeat_refresh' => true, + /* BuddyBar **********************************************************/ - /** BuddyBar **********************************************************/ + // Force the BuddyBar. + '_bp_force_buddybar' => false, - // Force the BuddyBar - '_bp_force_buddybar' => false, + /* Legacy theme *********************************************/ - /** Legacy theme *********************************************/ + // Whether to register the bp-default themes directory. + '_bp_retain_bp_default' => false, - // Whether to register the bp-default themes directory - '_bp_retain_bp_default' => false, - - /** Widgets **************************************************/ + /* Widgets **************************************************/ 'widget_bp_core_login_widget' => false, 'widget_bp_core_members_widget' => false, 'widget_bp_core_whos_online_widget' => false, @@ -106,7 +111,7 @@ function bp_get_default_options() { /** * Filters the default options to be set upon activation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $options Array of default options to set. */ @@ -119,7 +124,7 @@ function bp_get_default_options() { * Only called once when BuddyPress is activated. * Non-destructive, so existing settings will not be overridden. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_default_options() To get default options. * @uses add_option() Adds default options. @@ -127,10 +132,10 @@ function bp_get_default_options() { */ function bp_add_options() { - // Get the default options and values + // Get the default options and values. $options = bp_get_default_options(); - // Add default options + // Add default options. foreach ( $options as $key => $value ) { bp_add_option( $key, $value ); } @@ -140,7 +145,7 @@ function bp_add_options() { * * Allows previously activated plugins to append their own options. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_add_options' ); } @@ -153,7 +158,7 @@ function bp_add_options() { * * Currently unused. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_default_options() To get default options. * @uses delete_option() Removes default options. @@ -161,10 +166,10 @@ function bp_add_options() { */ function bp_delete_options() { - // Get the default options and values + // Get the default options and values. $options = bp_get_default_options(); - // Add default options + // Add default options. foreach ( array_keys( $options ) as $key ) { delete_option( $key ); } @@ -174,7 +179,7 @@ function bp_delete_options() { * * Allows previously activated plugins to append their own options. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_delete_options' ); } @@ -184,7 +189,7 @@ function bp_delete_options() { * * Currently unused. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_default_options() To get default options. * @uses add_filter() To add filters to 'pre_option_{$key}'. @@ -192,10 +197,10 @@ function bp_delete_options() { */ function bp_setup_option_filters() { - // Get the default options and values + // Get the default options and values. $options = bp_get_default_options(); - // Add filters to each BuddyPress option + // Add filters to each BuddyPress option. foreach ( array_keys( $options ) as $key ) { add_filter( 'pre_option_' . $key, 'bp_pre_get_option' ); } @@ -205,7 +210,7 @@ function bp_setup_option_filters() { * * Allows previously activated plugins to append their own options. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_setup_option_filters' ); } @@ -215,26 +220,26 @@ function bp_setup_option_filters() { * * Currently unused. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param bool $value Optional. Default value false - * @return mixed false if not overloaded, mixed if set + * @param bool $value Optional. Default value false. + * @return mixed False if not overloaded, mixed if set. */ function bp_pre_get_option( $value = false ) { $bp = buddypress(); - // Get the name of the current filter so we can manipulate it + // Get the name of the current filter so we can manipulate it. $filter = current_filter(); - // Remove the filter prefix + // Remove the filter prefix. $option = str_replace( 'pre_option_', '', $filter ); - // Check the options global for preset value + // Check the options global for preset value. if ( ! empty( $bp->options[ $option ] ) ) { $value = $bp->options[ $option ]; } - // Always return a value, even if false + // Always return a value, even if false. return $value; } @@ -246,13 +251,13 @@ function bp_pre_get_option( $value = false ) { * * The 'bp_get_option' filter is primarily for backward-compatibility. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @uses bp_get_root_blog_id() * * @param string $option_name The option to be retrieved. - * @param string $default Optional. Default value to be returned if the option - * isn't set. See {@link get_blog_option()}. + * @param string $default Optional. Default value to be returned if the option + * isn't set. See {@link get_blog_option()}. * @return mixed The value for the option. */ function bp_get_option( $option_name, $default = '' ) { @@ -261,7 +266,7 @@ function bp_get_option( $option_name, $default = '' ) { /** * Filters the option value for the requested option. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param mixed $value The value for the option. */ @@ -274,10 +279,10 @@ function bp_get_option( $option_name, $default = '' ) { * This is a wrapper for {@link add_blog_option()}, which in turn stores * settings data on the appropriate blog, given your current setup. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $option_name The option key to be set. - * @param mixed $value The value to be set. + * @param mixed $value The value to be set. * @return bool True on success, false on failure. */ function bp_add_option( $option_name, $value ) { @@ -291,12 +296,12 @@ function bp_add_option( $option_name, $value ) { * settings data (such as bp-pages) on the appropriate blog, given your current * setup. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_root_blog_id() * * @param string $option_name The option key to be set. - * @param string $value The value to be set. + * @param string $value The value to be set. * @return bool True on success, false on failure. */ function bp_update_option( $option_name, $value ) { @@ -310,7 +315,7 @@ function bp_update_option( $option_name, $value ) { * settings data (such as bp-pages) on the appropriate blog, given your current * setup. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_root_blog_id() * @@ -329,7 +334,11 @@ function bp_delete_option( $option_name ) { * * This function is no longer used. * + * @since 1.2.4 * @deprecated 1.6.0 + * + * @param array $keys Array of site options. + * @return bool */ function bp_core_activate_site_options( $keys = array() ) { @@ -363,6 +372,8 @@ function bp_core_activate_site_options( $keys = array() ) { * settings are needed at run time. Instead of fetching them all and adding many * initial queries to each page load, let's fetch them all in one go. * + * @since 1.5.0 + * * @todo Use settings API and audit these methods. * * @return array $root_blog_options_meta List of options. @@ -370,7 +381,7 @@ function bp_core_activate_site_options( $keys = array() ) { function bp_core_get_root_options() { global $wpdb; - // Get all the BuddyPress settings, and a few useful WP ones too + // Get all the BuddyPress settings, and a few useful WP ones too. $root_blog_options = bp_get_default_options(); $root_blog_options['registration'] = '0'; $root_blog_options['avatar_default'] = 'mysteryman'; @@ -379,7 +390,7 @@ function bp_core_get_root_options() { // Do some magic to get all the root blog options in 1 swoop // Check cache first - We cache here instead of using the standard WP // settings cache because the current blog may not be the root blog, - // and it's not practical to access the cache across blogs + // and it's not practical to access the cache across blogs. $root_blog_options_meta = wp_cache_get( 'root_blog_options', 'bp' ); if ( false === $root_blog_options_meta ) { @@ -388,13 +399,13 @@ function bp_core_get_root_options() { $blog_options_query = "SELECT option_name AS name, option_value AS value FROM {$blog_options_table} WHERE option_name IN ( {$blog_options_keys} )"; $root_blog_options_meta = $wpdb->get_results( $blog_options_query ); - // On Multisite installations, some options must always be fetched from sitemeta + // 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) + * @since 1.5.0 * * @param array $value Array of multisite options from sitemeta table. */ @@ -411,63 +422,63 @@ function bp_core_get_root_options() { $sitemeta_options_query = $wpdb->prepare( "SELECT meta_key AS name, meta_value AS value FROM {$wpdb->sitemeta} WHERE meta_key IN ( {$sitemeta_options_keys} ) AND site_id = %d", $current_site->id ); $network_options_meta = $wpdb->get_results( $sitemeta_options_query ); - // Sitemeta comes second in the merge, so that network 'registration' value wins + // Sitemeta comes second in the merge, so that network 'registration' value wins. $root_blog_options_meta = array_merge( $root_blog_options_meta, $network_options_meta ); } - // Missing some options, so do some one-time fixing + // Missing some options, so do some one-time fixing. if ( empty( $root_blog_options_meta ) || ( count( $root_blog_options_meta ) < count( $root_blog_option_keys ) ) ) { - // Get a list of the keys that are already populated + // Get a list of the keys that are already populated. $existing_options = array(); foreach( $root_blog_options_meta as $already_option ) { $existing_options[$already_option->name] = $already_option->value; } - // Unset the query - We'll be resetting it soon + // Unset the query - We'll be resetting it soon. unset( $root_blog_options_meta ); - // Loop through options + // Loop through options. foreach ( $root_blog_options as $old_meta_key => $old_meta_default ) { if ( isset( $existing_options[$old_meta_key] ) ) { continue; } - // Get old site option + // Get old site option. if ( is_multisite() ) { $old_meta_value = get_site_option( $old_meta_key ); } - // No site option so look in root blog + // No site option so look in root blog. if ( empty( $old_meta_value ) ) { $old_meta_value = bp_get_option( $old_meta_key, $old_meta_default ); } - // Update the root blog option + // Update the root blog option. bp_update_option( $old_meta_key, $old_meta_value ); - // Update the global array + // Update the global array. $root_blog_options_meta[$old_meta_key] = $old_meta_value; - // Clear out the value for the next time around + // Clear out the value for the next time around. unset( $old_meta_value ); } $root_blog_options_meta = array_merge( $root_blog_options_meta, $existing_options ); unset( $existing_options ); - // We're all matched up + // We're all matched up. } else { - // Loop through our results and make them usable + // Loop through our results and make them usable. foreach ( $root_blog_options_meta as $root_blog_option ) { $root_blog_options[$root_blog_option->name] = $root_blog_option->value; } - // Copy the options no the return val + // Copy the options no the return val. $root_blog_options_meta = $root_blog_options; - // Clean up our temporary copy + // Clean up our temporary copy. unset( $root_blog_options ); } @@ -477,7 +488,7 @@ function bp_core_get_root_options() { /** * Filters the global BP options. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $root_blog_options_meta Array of global BP options. */ @@ -491,7 +502,7 @@ function bp_core_get_root_options() { * 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) + * @since 2.3.0 * * @param string $option Name of the option key. * @return mixed Value, if found. @@ -516,12 +527,12 @@ function bp_core_get_root_option( $option ) { /** * Is profile syncing disabled? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the profile sync option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if profile sync is enabled, otherwise false. */ function bp_disable_profile_sync( $default = false ) { @@ -529,7 +540,7 @@ function bp_disable_profile_sync( $default = false ) { /** * Filters whether or not profile syncing is disabled. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Whether or not syncing is disabled. */ @@ -539,21 +550,21 @@ function bp_disable_profile_sync( $default = false ) { /** * Is the Toolbar hidden for logged out users? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the logged out Toolbar option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if the admin bar should be hidden for logged-out users, - * otherwise 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) + * @since 1.6.0 * * @param bool $value Whether or not the toolbar is hidden. */ @@ -563,12 +574,12 @@ function bp_hide_loggedout_adminbar( $default = true ) { /** * Are members able to upload their own avatars? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the avatar uploads option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if avatar uploads are disabled, otherwise false. */ function bp_disable_avatar_uploads( $default = true ) { @@ -576,23 +587,46 @@ function bp_disable_avatar_uploads( $default = true ) { /** * Filters whether or not members are able to upload their own avatars. * - * @since BuddyPress (1.6.0) + * @since 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 members able to upload their own cover images? + * + * @since 2.4.0 + * + * @uses bp_get_option() To get the cover image uploads option. + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if cover image uploads are disabled, otherwise false. + */ +function bp_disable_cover_image_uploads( $default = false ) { + + /** + * Filters whether or not members are able to upload their own cover images. + * + * @since 2.4.0 + * + * @param bool $value Whether or not members are able to upload their own cover images. + */ + return (bool) apply_filters( 'bp_disable_cover_image_uploads', (bool) bp_get_option( 'bp-disable-cover-image-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) + * @since 2.3.0 * - * @param bool $default Optional. Fallback value if not found in the database. - * Defaults to the value of `bp_disable_avatar_uploads()`. + * @param bool|null $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 ) { @@ -609,7 +643,7 @@ function bp_disable_group_avatar_uploads( $default = null ) { /** * Filters whether or not members are able to upload group avatars. * - * @since BuddyPress (2.3.0) + * @since 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. @@ -617,24 +651,47 @@ function bp_disable_group_avatar_uploads( $default = null ) { return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default ); } +/** + * Are group cover images disabled? + * + * @since 2.4.0 + * + * @uses bp_get_option() To get the group cover image uploads option. + * + * @param bool $default Optional. Fallback value if not found in the database. + * Default: false. + * @return bool True if group cover image uploads are disabled, otherwise false. + */ +function bp_disable_group_cover_image_uploads( $default = false ) { + + /** + * Filters whether or not members are able to upload group cover images. + * + * @since 2.4.0 + * + * @param bool $value Whether or not members are able to upload thier groups cover images. + */ + return (bool) apply_filters( 'bp_disable_group_cover_image_uploads', (bool) bp_get_option( 'bp-disable-group-cover-image-uploads', $default ) ); +} + /** * Are members able to delete their own accounts? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the account deletion option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if users are able to delete their own accounts, otherwise - * false. + * 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) + * @since 1.6.0 * * @param bool $value Whether or not members are able to delete their own accounts. */ @@ -644,22 +701,22 @@ function bp_disable_account_deletion( $default = false ) { /** * Are blog and forum activity stream comments disabled? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @todo split and move into blog and forum components. * @uses bp_get_option() To get the blog/forum comments option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: false. + * Default: false. * @return bool True if activity comments are disabled for blog and forum - * items, otherwise 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) + * @since 1.6.0 * * @param bool $value Whether or not blog and forum activity stream comments are disabled. */ @@ -669,13 +726,13 @@ function bp_disable_blogforum_comments( $default = false ) { /** * Is group creation turned off? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @todo Move into groups component. * @uses bp_get_option() To get the group creation. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if group creation is restricted, otherwise false. */ function bp_restrict_group_creation( $default = true ) { @@ -683,7 +740,7 @@ function bp_restrict_group_creation( $default = true ) { /** * Filters whether or not group creation is turned off. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Whether or not group creation is turned off. */ @@ -693,12 +750,12 @@ function bp_restrict_group_creation( $default = true ) { /** * Should the old BuddyBar be forced in place of the WP admin bar? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the BuddyBar option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if the BuddyBar should be forced on, otherwise false. */ function bp_force_buddybar( $default = true ) { @@ -706,7 +763,7 @@ 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) + * @since 1.6.0 * * @param bool $value Whether or not BuddyBar should be forced in place of WP Admin Bar. */ @@ -716,9 +773,9 @@ function bp_force_buddybar( $default = true ) { /** * Output the group forums root parent forum id. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param bool $default Optional. Default: '0'. + * @param bool|string $default Optional. Default: '0'. */ function bp_group_forums_root_id( $default = '0' ) { echo bp_get_group_forums_root_id( $default ); @@ -726,11 +783,11 @@ function bp_group_forums_root_id( $default = '0' ) { /** * Return the group forums root parent forum id. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the root forum ID from the database. * - * @param bool $default Optional. Default: '0'. + * @param bool|string $default Optional. Default: '0'. * @return int The ID of the group forums root forum. */ function bp_get_group_forums_root_id( $default = '0' ) { @@ -738,7 +795,7 @@ function bp_group_forums_root_id( $default = '0' ) { /** * Filters the group forums root parent forum id. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $value The group forums root parent forum id. */ @@ -748,12 +805,12 @@ function bp_group_forums_root_id( $default = '0' ) { /** * Check whether BuddyPress Group Forums are enabled. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the group forums option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if group forums are active, otherwise false. */ function bp_is_group_forums_active( $default = true ) { @@ -761,7 +818,7 @@ function bp_is_group_forums_active( $default = true ) { /** * Filters whether or not BuddyPress Group Forums are enabled. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Whether or not BuddyPress Group Forums are enabled. */ @@ -771,12 +828,12 @@ function bp_is_group_forums_active( $default = true ) { /** * Check whether Akismet is enabled. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_option() To get the Akismet option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if Akismet is enabled, otherwise false. */ function bp_is_akismet_active( $default = true ) { @@ -784,7 +841,7 @@ function bp_is_akismet_active( $default = true ) { /** * Filters whether or not Akismet is enabled. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $value Whether or not Akismet is enabled. */ @@ -794,12 +851,12 @@ function bp_is_akismet_active( $default = true ) { /** * Check whether Activity Heartbeat refresh is enabled. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @uses bp_get_option() To get the Heartbeat option. * * @param bool $default Optional. Fallback value if not found in the database. - * Default: true. + * Default: true. * @return bool True if Heartbeat refresh is enabled, otherwise false. */ function bp_is_activity_heartbeat_active( $default = true ) { @@ -807,7 +864,7 @@ function bp_is_activity_heartbeat_active( $default = true ) { /** * Filters whether or not Activity Heartbeat refresh is enabled. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param bool $value Whether or not Activity Heartbeat refresh is enabled. */ @@ -817,12 +874,12 @@ function bp_is_activity_heartbeat_active( $default = true ) { /** * Get the current theme package ID. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses get_option() To get the theme package option. * - * @param bool $default Optional. Fallback value if not found in the database. - * Default: 'legacy'. + * @param string $default Optional. Fallback value if not found in the database. + * Default: 'legacy'. * @return string ID of the theme package. */ function bp_get_theme_package_id( $default = 'legacy' ) { @@ -830,7 +887,7 @@ function bp_get_theme_package_id( $default = 'legacy' ) { /** * Filters the current theme package ID. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $value The current theme package ID. */ diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php b/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php index 1573157dbd29686353af6464bd0e3e12bd2c0fc9..bd544b4cd2a002b987edf490520cc001e7e07e3f 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-taxonomy.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress taxonomy functions. * @@ -7,26 +6,48 @@ * 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) + * @package BuddyPress + * @subpackage Core + * @since 2.2.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** * Register our default taxonomies. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_register_default_taxonomies() { // Member Type. register_taxonomy( 'bp_member_type', 'user', array( 'public' => false, ) ); + + // Email type. + register_taxonomy( + bp_get_email_tax_type(), + bp_get_email_post_type(), + apply_filters( 'bp_register_email_tax_type', array( + 'description' => _x( 'BuddyPress email types', 'email type taxonomy description', 'buddypress' ), + 'labels' => bp_get_email_tax_type_labels(), + 'meta_box_cb' => 'bp_email_tax_type_metabox', + 'public' => false, + 'query_var' => false, + 'rewrite' => false, + 'show_in_menu' => false, + 'show_tagcloud' => false, + 'show_ui' => bp_is_root_blog() && bp_current_user_can( 'bp_moderate' ), + ) ) + ); } add_action( 'bp_register_taxonomies', 'bp_register_default_taxonomies' ); /** * Set taxonomy terms on a BuddyPress object. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see wp_set_object_terms() for a full description of function and parameters. * @@ -41,6 +62,7 @@ function bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { if ( ! $is_root_blog ) { switch_to_blog( bp_get_root_blog_id() ); + bp_register_taxonomies(); } $retval = wp_set_object_terms( $object_id, $terms, $taxonomy, $append ); @@ -55,7 +77,7 @@ function bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { /** * Get taxonomy terms for a BuddyPress object. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see wp_get_object_terms() for a full description of function and parameters. * @@ -69,6 +91,7 @@ function bp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { if ( ! $is_root_blog ) { switch_to_blog( bp_get_root_blog_id() ); + bp_register_taxonomies(); } $retval = wp_get_object_terms( $object_ids, $taxonomies, $args ); @@ -83,7 +106,7 @@ function bp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { /** * Remove taxonomy terms on a BuddyPress object. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @see wp_remove_object_terms() for a full description of function and parameters. * @@ -97,6 +120,7 @@ function bp_remove_object_terms( $object_id, $terms, $taxonomy ) { if ( ! $is_root_blog ) { switch_to_blog( bp_get_root_blog_id() ); + bp_register_taxonomies(); } $retval = wp_remove_object_terms( $object_id, $terms, $taxonomy ); @@ -106,4 +130,4 @@ function bp_remove_object_terms( $object_id, $terms, $taxonomy ) { } 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 47d48fdf46601dfe49eb34c616901561c0afb659..87e2710e422354d95cd0d2d7d409cb44c1fd1aa2 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Template Functions. * @@ -9,53 +8,52 @@ * * @package BuddyPress * @subpackage TemplateFunctions + * @since 1.7.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Get a BuddyPress template part for display in a theme. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_locate_template() * @uses load_template() * @uses get_template_part() * - * @param string $slug Template part slug. Used to generate filenames, eg - * 'friends' for 'friends.php'. - * @param string $name Optional. Template part name. Used to generate - * secondary filenames, eg 'personal' for 'activity-personal.php'. + * @param string $slug Template part slug. Used to generate filenames, + * eg 'friends' for 'friends.php'. + * @param string|null $name Optional. Template part name. Used to generate + * secondary filenames, eg 'personal' for 'activity-personal.php'. * @return string Path to located template. See {@link bp_locate_template()}. */ 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) + * @since 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 + // Setup possible parts. $templates = array(); 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) + * @since 1.7.0 * * @param array $templates Array of templates located. * @param string $slug Template part slug requested. @@ -63,7 +61,7 @@ function bp_get_template_part( $slug, $name = null ) { */ $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name ); - // Return the part that is found + // Return the part that is found. return bp_locate_template( $templates, true, false ); } @@ -74,41 +72,41 @@ function bp_get_template_part( $slug, $name = null ) { * inherit from a parent theme can just overload one file. If the template is * not found in either of those, it looks in the theme-compat folder last. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string|array $template_names Template file(s) to search for, in order. - * @param bool $load Optional. If true, the template file will be loaded when - * found. If false, the path will be returned. Default: false. - * @param bool $require_once Optional. Whether to require_once or require. Has - * no effect if $load is false. Default: true. + * @param bool $load Optional. If true, the template file will be loaded when + * found. If false, the path will be returned. Default: false. + * @param bool $require_once Optional. Whether to require_once or require. Has + * no effect if $load is false. Default: true. * @return string The template filename if one is located. */ function bp_locate_template( $template_names, $load = false, $require_once = true ) { - // No file found yet + // No file found yet. $located = false; $template_locations = bp_get_template_stack(); - // Try to find a template file + // Try to find a template file. foreach ( (array) $template_names as $template_name ) { - // Continue if template is empty + // Continue if template is empty. if ( empty( $template_name ) ) { continue; } - // Trim off any slashes from the template name + // Trim off any slashes from the template name. $template_name = ltrim( $template_name, '/' ); - // Loop through template stack + // Loop through template stack. foreach ( (array) $template_locations as $template_location ) { - // Continue if $template_location is empty + // Continue if $template_location is empty. if ( empty( $template_location ) ) { continue; } - // Check child theme first + // Check child theme first. if ( file_exists( trailingslashit( $template_location ) . $template_name ) ) { $located = trailingslashit( $template_location ) . $template_name; break 2; @@ -125,10 +123,20 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru */ do_action( 'bp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once ); - // Maybe load the template if one was located + // Maybe load the template if one was located. $use_themes = defined( 'WP_USE_THEMES' ) && WP_USE_THEMES; $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; - if ( ( $use_themes || $doing_ajax ) && ( true == $load ) && ! empty( $located ) ) { + + /** + * Filter here to allow/disallow template loading. + * + * @since 2.5.0 + * + * @param bool $value True to load the template, false otherwise. + */ + $load_template = (bool) apply_filters( 'bp_locate_template_and_load', $use_themes || $doing_ajax ); + + if ( $load_template && ( true == $load ) && ! empty( $located ) ) { load_template( $located, $require_once ); } @@ -142,44 +150,44 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru * relationship, to allow for custom template locations. Used in conjunction * with bp_locate_template(), this allows for easy template overrides. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $location_callback Callback function that returns the stack location. - * @param int $priority Optional. The priority parameter as passed to - * add_filter(). Default: 10. + * @param int $priority Optional. The priority parameter as passed to + * add_filter(). Default: 10. * @return bool See {@link add_filter()}. */ function bp_register_template_stack( $location_callback = '', $priority = 10 ) { - // Bail if no location, or function/method is not callable + // Bail if no location, or function/method is not callable. if ( empty( $location_callback ) || ! is_callable( $location_callback ) ) { return false; } - // Add location callback to template stack + // Add location callback to template stack. return add_filter( 'bp_template_stack', $location_callback, (int) $priority ); } /** * Deregister a previously registered template stack location. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_register_template_stack() * * @param string $location_callback Callback function that returns the stack location. - * @param int $priority Optional. The priority parameter passed to - * {@link bp_register_template_stack()}. Default: 10. + * @param int $priority Optional. The priority parameter passed to + * {@link bp_register_template_stack()}. Default: 10. * @return bool See {@link remove_filter()}. */ function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) { - // Bail if no location, or function/method is not callable + // Bail if no location, or function/method is not callable. if ( empty( $location_callback ) || ! is_callable( $location_callback ) ) { return false; } - // Add location callback to template stack + // Add location callback to template stack. return remove_filter( 'bp_template_stack', $location_callback, (int) $priority ); } @@ -189,55 +197,61 @@ function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) * Calls the functions added to the 'bp_template_stack' filter hook, and return * an array of the template locations. * - * @see bp_register_template_stack() + * @since 1.7.0 * - * @since BuddyPress (1.7.0) + * @see bp_register_template_stack() * - * @global array $wp_filter Stores all of the filters. - * @global array $merged_filters Merges the filter hooks using this function.. - * @global array $wp_current_filter stores the list of current filters with - * the current one last. + * @global array $wp_filter Stores all of the filters. + * @global array $merged_filters Merges the filter hooks using this function. + * @global array $wp_current_filter Stores the list of current filters with + * the current one last. * @return array The filtered value after all hooked functions are applied to it. */ function bp_get_template_stack() { global $wp_filter, $merged_filters, $wp_current_filter; - // Setup some default variables + // Setup some default variables. $tag = 'bp_template_stack'; $args = $stack = array(); - // Add 'bp_template_stack' to the current filter array + // Add 'bp_template_stack' to the current filter array. $wp_current_filter[] = $tag; - // Sort - if ( ! isset( $merged_filters[ $tag ] ) ) { - ksort( $wp_filter[$tag] ); - $merged_filters[ $tag ] = true; + // Sort. + if ( class_exists( 'WP_Hook' ) ) { + $filter = $wp_filter[ $tag ]->callbacks; + } else { + $filter = &$wp_filter[ $tag ]; + + if ( ! isset( $merged_filters[ $tag ] ) ) { + ksort( $filter ); + $merged_filters[ $tag ] = true; + } } - // Ensure we're always at the beginning of the filter array - reset( $wp_filter[ $tag ] ); + // Ensure we're always at the beginning of the filter array. + reset( $filter ); - // Loop through 'bp_template_stack' filters, and call callback functions + // Loop through 'bp_template_stack' filters, and call callback functions. do { - foreach( (array) current( $wp_filter[$tag] ) as $the_ ) { + foreach( (array) current( $filter ) as $the_ ) { if ( ! is_null( $the_['function'] ) ) { $args[1] = $stack; $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) ); } } - } while ( next( $wp_filter[$tag] ) !== false ); + } while ( next( $filter ) !== false ); - // Remove 'bp_template_stack' from the current filter array + // Remove 'bp_template_stack' from the current filter array. array_pop( $wp_current_filter ); - // Remove empties and duplicates + // 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) + * @since 1.7.0 * * @param array $stack Array of registered directories for template locations. */ @@ -247,31 +261,31 @@ function bp_get_template_stack() { /** * Put a template part into an output buffer, and return it. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_get_template_part() for a description of $slug and $name params. * - * @param string $slug See {@link bp_get_template_part()}. - * @param string $name See {@link bp_get_template_part()}. - * @param bool $echo If true, template content will be echoed. If false, - * returned. Default: true. + * @param string $slug See {@link bp_get_template_part()}. + * @param string|null $name See {@link bp_get_template_part()}. + * @param bool $echo If true, template content will be echoed. If false, + * returned. Default: true. * @return string|null If $echo, returns the template content. */ function bp_buffer_template_part( $slug, $name = null, $echo = true ) { ob_start(); - // Remove 'bp_replace_the_content' filter to prevent infinite loops + // Remove 'bp_replace_the_content' filter to prevent infinite loops. remove_filter( 'the_content', 'bp_replace_the_content' ); bp_get_template_part( $slug, $name ); - // Remove 'bp_replace_the_content' filter to prevent infinite loops + // Remove 'bp_replace_the_content' filter to prevent infinite loops. add_filter( 'the_content', 'bp_replace_the_content' ); - // Get the output buffer contents + // Get the output buffer contents. $output = ob_get_clean(); - // Echo or return the output buffer contents + // Echo or return the output buffer contents. if ( true === $echo ) { echo $output; } else { @@ -287,14 +301,14 @@ function bp_buffer_template_part( $slug, $name = null, $echo = true ) { * the use of {@link bp_locate_template()}. Allows for more generic template * locations without the use of the other get_*_template() functions. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_set_theme_compat_templates() * @uses bp_locate_template() * @uses bp_set_theme_compat_template() * - * @param string $type Filename without extension. - * @param array $templates An optional list of template candidates. + * @param string $type Filename without extension. + * @param array $templates An optional list of template candidates. * @return string Full path to file. */ function bp_get_query_template( $type, $templates = array() ) { @@ -310,7 +324,7 @@ function bp_get_query_template( $type, $templates = array() ) { * This is a variable filter based on the type passed into * bp_get_query_template. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $templates Array of template files already prepared. */ @@ -328,7 +342,7 @@ function bp_get_query_template( $type, $templates = array() ) { * This is a variable filter based on the type passed into * bp_get_query_template. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template Path to the most appropriate found template file. */ @@ -336,11 +350,12 @@ function bp_get_query_template( $type, $templates = array() ) { } /** - * Get the possible subdirectories to check for templates in + * Get the possible subdirectories to check for templates in. + * + * @since 1.7.0 * - * @since BuddyPress (1.7.0) - * @param array $templates Templates we are looking for - * @return array Possible subfolders to look in + * @param array $templates Templates we are looking for. + * @return array Possible subfolders to look in. */ function bp_get_template_locations( $templates = array() ) { $locations = array( @@ -352,7 +367,7 @@ function bp_get_template_locations( $templates = array() ) { /** * Filters the possible subdirectories to check for templates in. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $locations Array of subfolders to look in. * @param array $templates Array of templates we are looking for. @@ -363,18 +378,18 @@ function bp_get_template_locations( $templates = array() ) { /** * Add template locations to template files being searched for. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $stacks Array of template locations. - * @return array() Array of all template locations registered so far. + * @return array Array of all template locations registered so far. */ function bp_add_template_stack_locations( $stacks = array() ) { $retval = array(); - // Get alternate locations + // Get alternate locations. $locations = bp_get_template_locations(); - // Loop through locations and stacks and combine + // Loop through locations and stacks and combine. foreach ( (array) $stacks as $stack ) { foreach ( (array) $locations as $custom_location ) { $retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location ); @@ -384,7 +399,7 @@ function bp_add_template_stack_locations( $stacks = array() ) { /** * Filters the template locations to template files being searched for. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $value Array of all template locations registered so far. * @param array $stacks Array of template locations. @@ -395,23 +410,23 @@ function bp_add_template_stack_locations( $stacks = array() ) { /** * Add checks for BuddyPress conditions to 'parse_query' action. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param WP_Query $posts_query + * @param WP_Query $posts_query WP_Query object. */ function bp_parse_query( $posts_query ) { - // Bail if $posts_query is not the main loop + // Bail if $posts_query is not the main loop. if ( ! $posts_query->is_main_query() ) { return; } - // Bail if filters are suppressed on this query + // Bail if filters are suppressed on this query. if ( true == $posts_query->get( 'suppress_filters' ) ) { return; } - // Bail if in admin + // Bail if in admin. if ( is_admin() ) { return; } @@ -421,7 +436,7 @@ function bp_parse_query( $posts_query ) { * * Allow BuddyPress components to parse the main query. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param WP_Query $posts_query WP_Query instance. Passed by reference. */ @@ -433,14 +448,14 @@ function bp_parse_query( $posts_query ) { * * Listens to the 'template_include' filter and waits for any BuddyPress specific * template condition to be met. If one is met and the template file exists, - * it will be used; otherwise + * it will be used; otherwise. * * Note that the _edit() checks are ahead of their counterparts, to prevent them * from being stomped on accident. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param string $template + * @param string $template The path to the template file that is being used. * @return string The path to the template file that is being used. */ function bp_template_include_theme_supports( $template = '' ) { @@ -448,7 +463,7 @@ function bp_template_include_theme_supports( $template = '' ) { /** * Filters whether or not to override the template being loaded in parent/child themes. * - * @since BuddyPress (1.7.0) + * @since 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. @@ -464,7 +479,7 @@ function bp_template_include_theme_supports( $template = '' ) { /** * Filters the final template being loaded in parent/child themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template The path to the template file that is being used. */ @@ -474,7 +489,7 @@ function bp_template_include_theme_supports( $template = '' ) { /** * Set the included template. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param mixed $template Default: false. * @return mixed False if empty. Template name if template included. @@ -488,7 +503,8 @@ function bp_set_template_included( $template = false ) { /** * Is a BuddyPress template being included? * - * @since BuddyPress (1.8.0) + * @since 1.8.0 + * * @return bool True if yes, false if no. */ function bp_is_template_included() { @@ -498,7 +514,7 @@ function bp_is_template_included() { /** * Attempt to load a custom BP functions file, similar to each themes functions.php file. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global string $pagenow * @uses bp_locate_template() @@ -506,12 +522,12 @@ function bp_is_template_included() { function bp_load_theme_functions() { global $pagenow, $wp_query; - // do not load our custom BP functions file if theme compat is disabled + // Do not load our custom BP functions file if theme compat is disabled. if ( ! bp_use_theme_compat_with_current_theme() ) { return; } - // Do not include on BuddyPress deactivation + // Do not include on BuddyPress deactivation. if ( bp_is_deactivation() ) { return; } @@ -519,12 +535,12 @@ function bp_load_theme_functions() { // 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 // global values. This does not happen on a normal page load, but can - // cause problems when running automated tests + // cause problems when running automated tests. if ( ! is_a( $wp_query, 'WP_Query' ) ) { return; } - // Only include if not installing or if activating via wp-activate.php + // Only include if not installing or if activating via wp-activate.php. if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { bp_locate_template( 'buddypress-functions.php', true ); } @@ -533,7 +549,8 @@ function bp_load_theme_functions() { /** * Get the templates to use as the endpoint for BuddyPress template parts. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * @since 2.4.0 Added singular.php to stack * * @return array Array of possible root level wrapper template files. */ @@ -545,6 +562,7 @@ function bp_get_theme_compat_templates() { 'generic.php', 'page.php', 'single.php', + 'singular.php', 'index.php' ) ); } 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 f1c833a45c62a988da49d3b9f7bf25b094bb1929..1f2c5e94b3876ec29de1d2068c0fe03f07ab8797 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-template.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-template.php @@ -1,12 +1,13 @@ <?php /** - * Core component template tag functions + * Core component template tag functions. * * @package BuddyPress * @subpackage TemplateFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -23,14 +24,19 @@ defined( 'ABSPATH' ) || exit; * The function will also analyze the current action for the current component * to determine whether or not to highlight a particular sub nav item. * + * @since 1.0.0 + * * @uses bp_get_user_nav() Renders the navigation for a profile of a currently * viewed user. + * + * @param string $parent_slug Options nav slug. + * @return string */ 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 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(); @@ -55,7 +61,7 @@ function bp_get_options_nav( $parent_slug = '' ) { } } - // Loop through each navigation item + // Loop through each navigation item. foreach ( (array) $bp->bp_options_nav[$the_index] as $subnav_item ) { if ( empty( $subnav_item['user_has_access'] ) ) { continue; @@ -68,7 +74,7 @@ function bp_get_options_nav( $parent_slug = '' ) { $selected = ''; } - // List type depends on our current component + // List type depends on our current component. $list_type = bp_is_group() ? 'groups' : 'personal'; /** @@ -76,7 +82,7 @@ function bp_get_options_nav( $parent_slug = '' ) { * * This is a dynamic filter that is dependent on the provided css_id value. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value HTML list item for the submenu item. * @param array $subnav_item Submenu array item being displayed. @@ -90,6 +96,7 @@ function bp_get_options_nav( $parent_slug = '' ) { * Get the 'bp_options_title' property from the BP global. * * Not currently used in BuddyPress. + * * @todo Deprecate. */ function bp_get_options_title() { @@ -108,18 +115,19 @@ function bp_get_options_title() { * Used for the <title> element and the page header on the component directory * page. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * + * @param string $component Component to get directory title for. * @return string */ function bp_get_directory_title( $component = '' ) { $title = ''; - // Use the string provided by the component + // Use the string provided by the component. if ( ! empty( buddypress()->{$component}->directory_title ) ) { $title = buddypress()->{$component}->directory_title; - // If none is found, concatenate + // If none is found, concatenate. } elseif ( isset( buddypress()->{$component}->name ) ) { $title = sprintf( __( '%s Directory', 'buddypress' ), buddypress()->{$component}->name ); } @@ -127,7 +135,7 @@ function bp_get_directory_title( $component = '' ) { /** * Filters the directory title for a component. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $title Text to be used in <title> tag. * @param string $component Current componet being displayed. @@ -145,7 +153,7 @@ function bp_get_directory_title( $component = '' ) { * * Not currently used in BuddyPress. * - * @return bool Returns true if an options avatar has been set, otherwise false. + * @return bool $value Returns true if an options avatar has been set, otherwise false. */ function bp_has_options_avatar() { return (bool) buddypress()->bp_options_avatar; @@ -202,6 +210,8 @@ function bp_post_author_avatar() { /** * Output the current avatar upload step. + * + * @since 1.1.0 */ function bp_avatar_admin_step() { echo bp_get_avatar_admin_step(); @@ -209,6 +219,8 @@ function bp_avatar_admin_step() { /** * Return the current avatar upload step. * + * @since 1.1.0 + * * @return string The current avatar upload step. Returns 'upload-image' * if none is found. */ @@ -221,7 +233,7 @@ function bp_avatar_admin_step() { /** * Filters the current avatar upload step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $step The current avatar upload step. */ @@ -230,6 +242,8 @@ function bp_avatar_admin_step() { /** * Output the URL of the avatar to crop. + * + * @since 1.1.0 */ function bp_avatar_to_crop() { echo bp_get_avatar_to_crop(); @@ -237,6 +251,8 @@ function bp_avatar_to_crop() { /** * Return the URL of the avatar to crop. * + * @since 1.1.0 + * * @return string URL of the avatar awaiting cropping. */ function bp_get_avatar_to_crop() { @@ -248,7 +264,7 @@ function bp_avatar_to_crop() { /** * Filters the URL of the avatar to crop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $url URL for the avatar. */ @@ -257,6 +273,8 @@ function bp_avatar_to_crop() { /** * Output the relative file path to the avatar to crop. + * + * @since 1.1.0 */ function bp_avatar_to_crop_src() { echo bp_get_avatar_to_crop_src(); @@ -264,6 +282,8 @@ function bp_avatar_to_crop_src() { /** * Return the relative file path to the avatar to crop. * + * @since 1.1.0 + * * @return string Relative file path to the avatar. */ function bp_get_avatar_to_crop_src() { @@ -275,7 +295,7 @@ function bp_avatar_to_crop_src() { /** * Filters the relative file path to the avatar to crop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $src Relative file path for the avatar. */ @@ -297,6 +317,8 @@ function bp_avatar_cropper() { /** * Output the name of the BP site. Used in RSS headers. + * + * @since 1.0.0 */ function bp_site_name() { echo bp_get_site_name(); @@ -304,14 +326,16 @@ function bp_site_name() { /** * Returns the name of the BP site. Used in RSS headers. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * + * @return string */ function bp_get_site_name() { /** * Filters the name of the BP site. Used in RSS headers. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Current BP site name. */ @@ -319,7 +343,7 @@ function bp_site_name() { } /** - * Format a date based on a UNIX timestamp + * Format a date based on a UNIX timestamp. * * 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 @@ -332,67 +356,66 @@ function bp_site_name() { * 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. + * @since 1.1.0 * - * @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. + * @param int|string $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 = '', $exclude_time = false, $gmt = true ) { // Bail if time is empty or not numeric - // @todo We should output something smarter here + // @todo We should output something smarter here. if ( empty( $time ) || ! is_numeric( $time ) ) { return false; } - // Get GMT offset from root blog + // Get GMT offset from root blog. if ( true === $gmt ) { - // Use Timezone string if set + // 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; - // Fall back on less reliable gmt_offset + // Fall back on less reliable gmt_offset. } else { $timezone_offset = bp_get_option( 'gmt_offset' ); } - // Calculate time based on the 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 + // No localizing, so just use the time that was submitted. } else { $calculated_time = $time; } - // Formatted date: "March 18, 2014" + // Formatted date: "March 18, 2014". $formatted_date = date_i18n( bp_get_option( 'date_format' ), $calculated_time, $gmt ); // Should we show the time also? if ( true !== $exclude_time ) { - // Formatted time: "2:00 pm" + // Formatted time: "2:00 pm". $formatted_time = date_i18n( bp_get_option( 'time_format' ), $calculated_time, $gmt ); - // Return string formatted with date and time + // Return string formatted with date and time. $formatted_date = sprintf( esc_html__( '%1$s at %2$s', 'buddypress' ), $formatted_date, $formatted_time ); } /** * Filters the date based on a UNIX timestamp. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $formatted_date Formatted date from the timestamp. */ @@ -408,14 +431,16 @@ function bp_format_time( $time = '', $exclude_time = false, $gmt = true ) { * of the phrase, and bp_word_or_name() will detect which is appropriate, and * do the necessary argument swapping for dynamic phrases. * - * @param string $youtext The "you" version of the phrase (eg "Your Friends"). - * @param string $nametext The other-user version of the phrase. Should be in - * a format appropriate for sprintf() - use %s in place of the displayed - * user's name (eg "%'s Friends"). - * @param bool $capitalize Optional. Force into title case. Default: true. - * @param bool $echo Optional. True to echo the results, false to return them. - * Default: true. - * @return string|null If ! $echo, returns the appropriate string. + * @since 1.0.0 + * + * @param string $youtext The "you" version of the phrase (eg "Your Friends"). + * @param string $nametext The other-user version of the phrase. Should be in + * a format appropriate for sprintf() - use %s in place of the displayed + * user's name (eg "%'s Friends"). + * @param bool $capitalize Optional. Force into title case. Default: true. + * @param bool $echo Optional. True to echo the results, false to return them. + * Default: true. + * @return string|null $nametext If ! $echo, returns the appropriate string. */ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true ) { @@ -429,7 +454,7 @@ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true /** * Filters the text used based on context of own profile or someone else's profile. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $youtext Context-determined string to display. */ @@ -472,6 +497,8 @@ function bp_styles() { /** * Return the "action" attribute for search forms. * + * @since 1.0.0 + * * @return string URL action attribute for search forms, eg example.com/search/. */ function bp_search_form_action() { @@ -479,7 +506,7 @@ function bp_search_form_action() { /** * Filters the "action" attribute for search forms. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Search form action url. */ @@ -489,7 +516,7 @@ function bp_search_form_action() { /** * Generate the basic search form as used in BP-Default's header. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return string HTML <select> element. */ @@ -522,7 +549,7 @@ function bp_search_form_type_select() { /** * Filters all of the component options available for search scope. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $options Array of options to add to select field. */ @@ -536,7 +563,7 @@ function bp_search_form_type_select() { /** * Filters the complete <select> input used for search scope. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $selection_box <select> input for selecting search scope. */ @@ -546,7 +573,7 @@ function bp_search_form_type_select() { /** * Output the default text for the search box for a given component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see bp_get_search_default_text() * @@ -558,7 +585,7 @@ function bp_search_default_text( $component = '' ) { /** * Return the default text for the search box for a given component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $component Component name. Default: current component. * @return string Placeholder text for search field. @@ -573,13 +600,13 @@ function bp_search_default_text( $component = '' ) { $default_text = __( 'Search anything...', 'buddypress' ); - // Most of the time, $component will be the actual component ID + // Most of the time, $component will be the actual component ID. if ( !empty( $component ) ) { if ( !empty( $bp->{$component}->search_string ) ) { $default_text = $bp->{$component}->search_string; } else { // When the request comes through AJAX, we need to get the component - // name out of $bp->pages + // name out of $bp->pages. if ( !empty( $bp->pages->{$component}->slug ) ) { $key = $bp->pages->{$component}->slug; if ( !empty( $bp->{$key}->search_string ) ) { @@ -592,7 +619,7 @@ function bp_search_default_text( $component = '' ) { /** * Filters the default text for the search box for a given component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $default_text Default text for search box. * @param string $component Current component displayed. @@ -625,7 +652,7 @@ function bp_custom_profile_sidebar_boxes() { /** * Output the attributes for a form field. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $name The field name to output attributes for. * @param array $attributes Array of existing attributes to add. @@ -640,7 +667,7 @@ function bp_form_field_attributes( $name = '', $attributes = array() ) { * can use the 'bp_get_form_field_extra_attributes' filter for further * manipulation. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $name The field name to get attributes for. * @param array $attributes Array of existing attributes to add. @@ -682,10 +709,10 @@ function bp_form_field_attributes( $name = '', $attributes = array() ) { /** * Filter the attributes for a field before rendering output. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param array $attributes The field attributes - * @param string $name The field name + * @param array $attributes The field attributes. + * @param string $name The field name. */ $attributes = (array) apply_filters( 'bp_get_form_field_attributes', $attributes, $name ); @@ -699,9 +726,11 @@ function bp_form_field_attributes( $name = '', $attributes = array() ) { /** * Create and output a button. * + * @since 1.2.6 + * * @see bp_get_button() * - * @param array $args See {@link BP_Button}. + * @param array|string $args See {@link BP_Button}. */ function bp_button( $args = '' ) { echo bp_get_button( $args ); @@ -709,9 +738,11 @@ function bp_button( $args = '' ) { /** * Create and return a button. * + * @since 1.2.6 + * * @see BP_Button for a description of arguments and return value. * - * @param array $args See {@link BP_Button}. + * @param array|string $args See {@link BP_Button}. * @return string HTML markup for the button. */ function bp_get_button( $args = '' ) { @@ -720,7 +751,7 @@ function bp_button( $args = '' ) { /** * Filters the requested button output. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $contents Button context to be used. * @param array $args Array of args for the button. @@ -740,30 +771,32 @@ function bp_button( $args = '' ) { * * ### Options: * - * - `ending` Will be used as Ending and appended to the trimmed string - * - `exact` If false, $text will not be cut mid-word - * - `html` If true, HTML tags would be handled correctly - * - `filter_shortcodes` If true, shortcodes will be stripped before truncating + * - `ending` Will be used as Ending and appended to the trimmed string. + * - `exact` If false, $text will not be cut mid-word. + * - `html` If true, HTML tags would be handled correctly. + * - `filter_shortcodes` If true, shortcodes will be stripped before truncating. * - * @param string $text String to truncate. - * @param int $length Optional. Length of returned string, including ellipsis. - * Default: 225. - * @param array $options { + * @since 1.0.0 + * + * @param string $text String to truncate. + * @param int $length Optional. Length of returned string, including ellipsis. + * Default: 225. + * @param array $options { * An array of HTML attributes and options. Each item is optional. - * @type string $ending The string used after truncation. - * Default: ' […]'. - * @type bool $exact If true, $text will be trimmed to exactly $length. - * If false, $text will not be cut mid-word. Default: false. - * @type bool $html If true, don't include HTML tags when calculating - * excerpt length. Default: true. - * @type bool $filter_shortcodes If true, shortcodes will be stripped. - * Default: true. + * @type string $ending The string used after truncation. + * Default: ' […]'. + * @type bool $exact If true, $text will be trimmed to exactly $length. + * If false, $text will not be cut mid-word. Default: false. + * @type bool $html If true, don't include HTML tags when calculating + * excerpt length. Default: true. + * @type bool $filter_shortcodes If true, shortcodes will be stripped. + * Default: true. * } * @return string Trimmed string. */ function bp_create_excerpt( $text, $length = 225, $options = array() ) { - // Backward compatibility. The third argument used to be a boolean $filter_shortcodes + // Backward compatibility. The third argument used to be a boolean $filter_shortcodes. $filter_shortcodes_default = is_bool( $options ) ? $options : true; $r = bp_parse_args( $options, array( @@ -773,13 +806,13 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) { 'filter_shortcodes' => $filter_shortcodes_default ), 'create_excerpt' ); - // Save the original text, to be passed along to the filter + // Save the original text, to be passed along to the filter. $original_text = $text; /** * Filters the excerpt length to trim text to. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $length Length of returned string, including ellipsis. */ @@ -788,22 +821,22 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) { /** * Filters the excerpt appended text value. * - * @since BuddyPress (1.5.0) + * @since 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 + // Remove shortcodes if necessary. if ( ! empty( $r['filter_shortcodes'] ) ) { $text = strip_shortcodes( $text ); } // When $html is true, the excerpt should be created without including HTML tags in the - // excerpt length + // excerpt length. if ( ! empty( $r['html'] ) ) { - // The text is short enough. No need to truncate + // The text is short enough. No need to truncate. if ( mb_strlen( preg_replace( '/<.*?>/', '', $text ) ) <= $length ) { return $text; } @@ -812,11 +845,11 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) { $openTags = array(); $truncate = ''; - // Find all the tags and HTML comments and put them in a stack for later use + // 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 + // 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] ) ) { array_unshift( $openTags, $tag[2] ); @@ -863,7 +896,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) { } } - // If $exact is false, we can't break on words + // If $exact is false, we can't break on words. if ( empty( $r['exact'] ) ) { // Find the position of the last space character not part of a tag. preg_match_all( '/<[a-z\!\/][^>]*>/', $truncate, $_truncate_tags, PREG_OFFSET_CAPTURE ); @@ -941,7 +974,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) { /** * Filters the final generated excerpt. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $truncate Generated excerpt. * @param string $original_text Original text provided. @@ -955,6 +988,8 @@ add_filter( 'bp_create_excerpt', 'force_balance_tags' ); /** * Output the total member count for the site. + * + * @since 1.2.0 */ function bp_total_member_count() { echo bp_get_total_member_count(); @@ -971,6 +1006,8 @@ function bp_total_member_count() { * which did not take into account last_activity, and thus often * resulted in higher counts than shown by member directory pagination. * + * @since 1.2.0 + * * @return int Member count. */ function bp_get_total_member_count() { @@ -978,7 +1015,7 @@ function bp_total_member_count() { /** * Filters the total member count in your BP instance. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Member count. */ @@ -1000,6 +1037,8 @@ function bp_blog_signup_allowed() { * Returns true if is_multisite() and blog creation is enabled at * Network Admin > Settings. * + * @since 1.2.0 + * * @return bool True if blog signup is allowed, otherwise false. */ function bp_get_blog_signup_allowed() { @@ -1019,8 +1058,10 @@ function bp_blog_signup_allowed() { /** * Check whether an activation has just been completed. * + * @since 1.1.0 + * * @return bool True if the activation_complete global flag has been set, - * otherwise false. + * otherwise false. */ function bp_account_was_activated() { $bp = buddypress(); @@ -1038,6 +1079,8 @@ function bp_account_was_activated() { * activation. This filter exists so that customizations that omit activation * can remove certain notification text from the registration screen. * + * @since 1.2.0 + * * @return bool True by default. */ function bp_registration_needs_activation() { @@ -1045,7 +1088,7 @@ function bp_registration_needs_activation() { /** * Filters whether registrations require activation on this installation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param bool $value Whether registrations require activation. Default true. */ @@ -1058,20 +1101,21 @@ function bp_registration_needs_activation() { * The blogname option is escaped with esc_html on the way into the database in * sanitize_option, we want to reverse this for the plain text arena of emails. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * @since 2.5.0 No longer used by BuddyPress, but not deprecated in case any existing plugins use it. * * @see https://buddypress.trac.wordpress.org/ticket/4401 * * @param array $args { * Array of optional parameters. - * @type string $before String to appear before the site name in the - * email subject. Default: '['. - * @type string $after String to appear after the site name in the - * email subject. Default: ']'. + * @type string $before String to appear before the site name in the + * email subject. Default: '['. + * @type string $after String to appear after the site name in the + * email subject. Default: ']'. * @type string $default The default site name, to be used when none is - * found in the database. Default: 'Community'. - * @type string $text Text to append to the site name (ie, the main text of - * the email subject). + * found in the database. Default: 'Community'. + * @type string $text Text to append to the site name (ie, the main text of + * the email subject). * } * @return string Sanitized email subject. */ @@ -1089,7 +1133,7 @@ function bp_get_email_subject( $args = array() ) { /** * Filters a client friendly version of the root blog name. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $subject Client friendy version of the root blog name. * @param array $r Array of arguments for the email subject. @@ -1107,7 +1151,9 @@ function bp_get_email_subject( $args = array() ) { * errors if someone copies the templates from the default theme into another * WordPress theme without coping the functions from functions.php. * - * @param string $object + * @since 1.2.0 + * + * @param string|bool $object Current template component. * @return string The AJAX querystring. */ function bp_ajax_querystring( $object = false ) { @@ -1122,7 +1168,7 @@ function bp_ajax_querystring( $object = false ) { * * Allows templates to pass parameters into the template loops via AJAX. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $ajax_querystring Current query string. * @param string $object Current template component. @@ -1135,6 +1181,8 @@ function bp_ajax_querystring( $object = false ) { /** * Return the name of the current component. * + * @since 1.0.0 + * * @return string Component name. */ function bp_current_component() { @@ -1146,7 +1194,7 @@ function bp_current_component() { /** * Filters the name of the current component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string|bool $current_component Current component if available or false. */ @@ -1156,6 +1204,8 @@ function bp_current_component() { /** * Return the name of the current action. * + * @since 1.0.0 + * * @return string Action name. */ function bp_current_action() { @@ -1167,7 +1217,7 @@ function bp_current_action() { /** * Filters the name of the current action. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $current_action Current action. */ @@ -1177,7 +1227,9 @@ function bp_current_action() { /** * Return the name of the current item. * - * @return unknown + * @since 1.1.0 + * + * @return string|bool */ function bp_current_item() { $bp = buddypress(); @@ -1188,7 +1240,7 @@ function bp_current_item() { /** * Filters the name of the current item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string|bool $current_item Current item if available or false. */ @@ -1198,8 +1250,10 @@ function bp_current_item() { /** * Return the value of $bp->action_variables. * + * @since 1.0.0 + * * @return array|bool $action_variables The action variables array, or false - * if the array is empty. + * if the array is empty. */ function bp_action_variables() { $bp = buddypress(); @@ -1210,7 +1264,7 @@ function bp_action_variables() { /** * Filters the value of $bp->action_variables. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array|bool $action_variables Available action variables. */ @@ -1220,11 +1274,11 @@ function bp_action_variables() { /** * Return the value of a given action variable. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $position The key of the action_variables array that you want. * @return string|bool $action_variable The value of that position in the - * array, or false if not found. + * array, or false if not found. */ function bp_action_variable( $position = 0 ) { $action_variables = bp_action_variables(); @@ -1235,7 +1289,7 @@ function bp_action_variable( $position = 0 ) { /** * Filters the value of a given action variable. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string|bool $action_variable Requested action variable based on position. * @param int $position The key of the action variable requested. @@ -1245,6 +1299,8 @@ function bp_action_variable( $position = 0 ) { /** * Output the "root domain", the URL of the BP root blog. + * + * @since 1.1.0 */ function bp_root_domain() { echo bp_get_root_domain(); @@ -1252,6 +1308,8 @@ function bp_root_domain() { /** * Return the "root domain", the URL of the BP root blog. * + * @since 1.1.0 + * * @return string URL of the BP root blog. */ function bp_get_root_domain() { @@ -1267,7 +1325,7 @@ function bp_root_domain() { /** * Filters the "root domain", the URL of the BP root blog. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $domain URL of the BP root blog. */ @@ -1277,7 +1335,7 @@ function bp_root_domain() { /** * Output the root slug for a given component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $component The component name. */ @@ -1297,11 +1355,11 @@ function bp_root_slug( $component = '' ) { * In order to maintain backward compatibility, the following procedure * is used: * 1) Use the short slug to get the canonical component name from the - * active component array + * active component array. * 2) Use the component name to get the root slug out of the - * appropriate part of the $bp global + * appropriate part of the $bp global. * 3) If nothing turns up, it probably means that $component is itself - * a root slug + * a root slug. * * Example: If your groups directory is at /community/companies, this * function first uses the short slug 'companies' (ie the current @@ -1309,7 +1367,7 @@ function bp_root_slug( $component = '' ) { * $bp->active_components. Then it uses 'groups' to get the root slug, * from $bp->groups->root_slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $component Optional. Defaults to the current component. * @return string $root_slug The root slug. @@ -1318,27 +1376,27 @@ function bp_root_slug( $component = '' ) { $bp = buddypress(); $root_slug = ''; - // Use current global component if none passed + // Use current global component if none passed. if ( empty( $component ) ) { $component = bp_current_component(); } - // Component is active + // Component is active. if ( ! empty( $bp->active_components[ $component ] ) ) { // Backward compatibility: in legacy plugins, the canonical component id - // was stored as an array value in $bp->active_components + // was stored as an array value in $bp->active_components. $component_name = ( '1' == $bp->active_components[ $component ] ) ? $component : $bp->active_components[$component]; - // Component has specific root slug + // Component has specific root slug. if ( ! empty( $bp->{$component_name}->root_slug ) ) { $root_slug = $bp->{$component_name}->root_slug; } } - // No specific root slug, so fall back to component slug + // No specific root slug, so fall back to component slug. if ( empty( $root_slug ) ) { $root_slug = $component; } @@ -1346,7 +1404,7 @@ function bp_root_slug( $component = '' ) { /** * Filters the root slug for given component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Root slug for given component. * @param string $component Current component. @@ -1357,7 +1415,7 @@ function bp_root_slug( $component = '' ) { /** * Return the component name based on a root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Needle to our active component haystack. * @return mixed False if none found, component name if found. @@ -1365,17 +1423,17 @@ function bp_root_slug( $component = '' ) { function bp_get_name_from_root_slug( $root_slug = '' ) { $bp = buddypress(); - // If no slug is passed, look at current_component + // If no slug is passed, look at current_component. if ( empty( $root_slug ) ) { $root_slug = bp_current_component(); } - // No current component or root slug, so flee + // No current component or root slug, so flee. if ( empty( $root_slug ) ) { return false; } - // Loop through active components and look for a match + // Loop through active components and look for a match. foreach ( array_keys( $bp->active_components ) as $component ) { if ( ( ! empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) || ( ! empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug === $root_slug ) ) ) { return $bp->{$component}->name; @@ -1385,15 +1443,20 @@ function bp_get_name_from_root_slug( $root_slug = '' ) { return false; } +/** + * Returns whether or not a user has access. + * + * @since 1.2.4 + * + * @return bool + */ function bp_user_has_access() { - $has_access = ( bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() ) - ? true - : false; + $has_access = bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile(); /** * Filters whether or not a user has access. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param bool $has_access Whether or not user has access. */ @@ -1403,7 +1466,7 @@ function bp_user_has_access() { /** * Output the search slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_search_slug() */ @@ -1413,7 +1476,7 @@ function bp_search_slug() { /** * Return the search slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string The search slug. Default: 'search'. */ @@ -1422,9 +1485,9 @@ function bp_search_slug() { /** * Filters the search slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string BP_SEARCH_SLUG The search slug. Default "search". + * @const string BP_SEARCH_SLUG The search slug. Default "search". */ return apply_filters( 'bp_get_search_slug', BP_SEARCH_SLUG ); } @@ -1432,9 +1495,11 @@ function bp_search_slug() { /** * Get the ID of the currently displayed user. * + * @since 1.0.0 + * * @uses apply_filters() Filter 'bp_displayed_user_id' to change this value. * - * @return int ID of the currently displayed user. + * @return int $id ID of the currently displayed user. */ function bp_displayed_user_id() { $bp = buddypress(); @@ -1445,7 +1510,7 @@ function bp_displayed_user_id() { /** * Filters the ID of the currently displayed user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the currently displayed user. */ @@ -1455,6 +1520,8 @@ function bp_displayed_user_id() { /** * Get the ID of the currently logged-in user. * + * @since 1.0.0 + * * @uses apply_filters() Filter 'bp_loggedin_user_id' to change this value. * * @return int ID of the logged-in user. @@ -1468,60 +1535,60 @@ function bp_loggedin_user_id() { /** * Filters the ID of the currently logged-in user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the currently logged-in user. */ return (int) apply_filters( 'bp_loggedin_user_id', $id ); } -/** is_() functions to determine the current page *****************************/ +/** The is_() functions to determine the current page *****************************/ /** * Check to see whether the current page belongs to the specified component. * * This function is designed to be generous, accepting several different kinds * of value for the $component parameter. It checks $component_name against: - * - the component's root_slug, which matches the page slug in $bp->pages - * - the component's regular slug - * - the component's id, or 'canonical' name + * - the component's root_slug, which matches the page slug in $bp->pages. + * - the component's regular slug. + * - the component's id, or 'canonical' name. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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 = '' ) { - // Default is no match. We'll check a few places for matches + // 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 + // Always return false if a null value is passed to the function. if ( empty( $component ) ) { return false; } - // Backward compatibility: 'xprofile' should be read as 'profile' + // Backward compatibility: 'xprofile' should be read as 'profile'. if ( 'xprofile' === $component ) { $component = 'profile'; } $bp = buddypress(); - // Only check if BuddyPress found a current_component + // Only check if BuddyPress found a current_component. if ( ! empty( $bp->current_component ) ) { // First, check to see whether $component_name and the current - // component are a simple match + // component are a simple match. if ( $bp->current_component == $component ) { $is_current_component = true; // Since the current component is based on the visible URL slug let's - // check the component being passed and see if its root_slug matches + // check the component being passed and see if its root_slug matches. } elseif ( isset( $bp->{$component}->root_slug ) && $bp->{$component}->root_slug == $bp->current_component ) { $is_current_component = true; - // Because slugs can differ from root_slugs, we should check them too + // Because slugs can differ from root_slugs, we should check them too. } elseif ( isset( $bp->{$component}->slug ) && $bp->{$component}->slug == $bp->current_component ) { $is_current_component = true; @@ -1534,11 +1601,11 @@ function bp_is_current_component( $component = '' ) { } // If we haven't found a match yet, check against the root_slugs - // created by $bp->pages, as well as the regular slugs + // created by $bp->pages, as well as the regular slugs. } else { foreach ( $bp->active_components as $id ) { // If the $component parameter does not match the current_component, - // then move along, these are not the droids you are looking for + // then move along, these are not the droids you are looking for. if ( empty( $bp->{$id}->root_slug ) || $bp->{$id}->root_slug != $bp->current_component ) { continue; } @@ -1554,12 +1621,12 @@ function bp_is_current_component( $component = '' ) { /** * Filters whether the current page belongs to the specified component. * - * @since BuddyPress (1.5.0) + * @since 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 ); + return apply_filters( 'bp_is_current_component', $is_current_component, $component ); } /** @@ -1574,7 +1641,7 @@ function bp_is_current_component( $component = '' ) { * http://example.com/groups/my-group/members * the current_action is 'members'. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $action The action being tested against. * @return bool True if the current action matches $action. @@ -1595,35 +1662,35 @@ function bp_is_current_action( $action = '' ) { * http://example.com/groups/my-group/admin/group-settings * $action_variables[0] is 'group-settings'. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $action_variable The action_variable being tested against. - * @param int $position Optional. The array key you're testing against. If you - * don't provide a $position, the function will return true if the - * $action_variable is found *anywhere* in the action variables array. + * @param string $action_variable The action_variable being tested against. + * @param int|bool $position Optional. The array key you're testing against. If you + * don't provide a $position, the function will return true if the + * $action_variable is found *anywhere* in the action variables array. * @return bool True if $action_variable matches at the $position provided. */ function bp_is_action_variable( $action_variable = '', $position = false ) { $is_action_variable = false; if ( false !== $position ) { - // When a $position is specified, check that slot in the action_variables array + // When a $position is specified, check that slot in the action_variables array. if ( $action_variable ) { $is_action_variable = $action_variable == bp_action_variable( $position ); } else { // If no $action_variable is provided, we are essentially checking to see - // whether the slot is empty + // whether the slot is empty. $is_action_variable = !bp_action_variable( $position ); } } else { - // When no $position is specified, check the entire array + // When no $position is specified, check the entire array. $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) + * @since 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. @@ -1635,6 +1702,8 @@ function bp_is_action_variable( $action_variable = '', $position = false ) { /** * Check against the current_item. * + * @since 1.5.0 + * * @param string $item The item being checked. * @return bool True if $item is the current item. */ @@ -1644,7 +1713,7 @@ function bp_is_current_item( $item = '' ) { /** * Filters whether or not an item is the current item. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not an item is the current item. * @param string $item The item being checked. @@ -1653,7 +1722,9 @@ function bp_is_current_item( $item = '' ) { } /** - * Are we looking at a single item? (group, user, etc) + * Are we looking at a single item? (group, user, etc). + * + * @since 1.1.0 * * @return bool True if looking at a single item, otherwise false. */ @@ -1668,7 +1739,7 @@ function bp_is_single_item() { /** * Filters whether or not an item is the a single item. (group, user, etc) * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not an item is a single item. */ @@ -1678,8 +1749,10 @@ function bp_is_single_item() { /** * Is the logged-in user an admin for the current item? * + * @since 1.5.0 + * * @return bool True if the current user is an admin for the current item, - * otherwise false. + * otherwise false. */ function bp_is_item_admin() { $bp = buddypress(); @@ -1692,7 +1765,7 @@ function bp_is_item_admin() { /** * Filters whether or not the logged-in user is an admin for the current item. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not the logged-in user is an admin. */ @@ -1702,8 +1775,10 @@ function bp_is_item_admin() { /** * Is the logged-in user a mod for the current item? * + * @since 1.5.0 + * * @return bool True if the current user is a mod for the current item, - * otherwise false. + * otherwise false. */ function bp_is_item_mod() { $bp = buddypress(); @@ -1716,7 +1791,7 @@ function bp_is_item_mod() { /** * Filters whether or not the logged-in user is a mod for the current item. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not the logged-in user is a mod. */ @@ -1726,8 +1801,9 @@ function bp_is_item_mod() { /** * Is this a component directory page? * - * @return bool True if the current page is a component directory, otherwise - * false. + * @since 1.0.0 + * + * @return bool True if the current page is a component directory, otherwise false. */ function bp_is_directory() { $bp = buddypress(); @@ -1740,7 +1816,7 @@ function bp_is_directory() { /** * Filters whether or not user is on a component directory page. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not user is on a component directory page. */ @@ -1756,18 +1832,22 @@ function bp_is_directory() { * This function is on the chopping block. It's currently only used by a few * already deprecated functions. * + * @since 1.5.0 + * + * @param string $component_name Component name to check. + * * @return bool True if root component, else false. */ function bp_is_root_component( $component_name = '' ) { $bp = buddypress(); $retval = false; - // Default to the current component if none is passed + // Default to the current component if none is passed. if ( empty( $component_name ) ) { $component_name = bp_current_component(); } - // Loop through active components and check for key/slug matches + // Loop through active components and check for key/slug matches. if ( ! empty( $bp->active_components ) ) { foreach ( (array) $bp->active_components as $key => $slug ) { if ( ( $key === $component_name ) || ( $slug === $component_name ) ) { @@ -1780,7 +1860,7 @@ 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) + * @since 2.1.0 * * @param bool $retval Whether or not URL should be in the root. */ @@ -1792,9 +1872,9 @@ function bp_is_root_component( $component_name = '' ) { * * Corresponds to the setting in wp-admin's Settings > Reading screen. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @global $current_blog WordPress global for the current blog. + * @global int $current_blog WordPress global for the current blog. * * @param string $component Optional. Name of the component to check for. * Default: current component. @@ -1806,17 +1886,17 @@ function bp_is_component_front_page( $component = '' ) { $bp = buddypress(); - // Default to the current component if none is passed + // Default to the current component if none is passed. if ( empty( $component ) ) { $component = bp_current_component(); } - // Get the path for the current blog/site + // Get the path for the current blog/site. $path = is_main_site() ? bp_core_get_site_path() : $current_blog->path; - // Get the front page variables + // Get the front page variables. $show_on_front = get_option( 'show_on_front' ); $page_on_front = get_option( 'page_on_front' ); @@ -1827,7 +1907,7 @@ function bp_is_component_front_page( $component = '' ) { /** * Filters whether or not the specified BuddyPress component directory is set to be the front page. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -1841,6 +1921,8 @@ function bp_is_component_front_page( $component = '' ) { * You can tell if a page is displaying BP content by whether the * current_component has been defined. * + * @since 1.0.0 + * * @return bool True if it's a non-BP page, false otherwise. */ function bp_is_blog_page() { @@ -1857,7 +1939,7 @@ function bp_is_blog_page() { /** * Filters whether or not current page is a blog page or not. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $is_blog_page Whether or not current page is a blog page. */ @@ -1874,7 +1956,7 @@ function bp_is_blog_page() { * The one exception is single user home tabs, where $bp->current_component * is unset. Thus the addition of the bp_is_user() check. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return bool True if it's a BuddyPress page, false otherwise. */ @@ -1884,7 +1966,7 @@ function is_buddypress() { /** * Filters whether or not this is a BuddyPress component. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param bool $retval Whether or not this is a BuddyPress component. */ @@ -1896,8 +1978,8 @@ function is_buddypress() { /** * 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. + * @since 1.2.0 See r2539. + * @since 2.3.0 Added $feature as a parameter. * * @param string $component The component name. * @param string $feature The feature name. @@ -1906,17 +1988,22 @@ function is_buddypress() { function bp_is_active( $component = '', $feature = '' ) { $retval = false; - // Default to the current component if none is passed + // Default to the current component if none is passed. if ( empty( $component ) ) { $component = bp_current_component(); } - // Is component in either the active or required components arrays + // 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 ) ) { + // The xProfile component is specific. + if ( 'xprofile' === $component ) { + $component = 'profile'; + } + if ( empty( buddypress()->$component->features ) || false === in_array( $feature, buddypress()->$component->features, true ) ) { $retval = false; } @@ -1924,7 +2011,10 @@ function bp_is_active( $component = '', $feature = '' ) { /** * Filters whether or not a given feature for a component is active. * - * @since BuddyPress (2.3.0) + * This is a variable filter that is based on the component and feature + * that you are checking of active status of. + * + * @since 2.3.0 * * @param bool $retval */ @@ -1935,7 +2025,7 @@ function bp_is_active( $component = '', $feature = '' ) { /** * Filters whether or not a given component has been activated by the admin. * - * @since BuddyPress (2.1.0) + * @since 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. @@ -1946,6 +2036,8 @@ function bp_is_active( $component = '', $feature = '' ) { /** * Check whether the current page is part of the Members component. * + * @since 1.5.0 + * * @return bool True if the current page is part of the Members component. */ function bp_is_members_component() { @@ -1955,6 +2047,8 @@ function bp_is_members_component() { /** * Check whether the current page is part of the Profile component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Profile component. */ function bp_is_profile_component() { @@ -1964,6 +2058,8 @@ function bp_is_profile_component() { /** * Check whether the current page is part of the Activity component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Activity component. */ function bp_is_activity_component() { @@ -1973,6 +2069,8 @@ function bp_is_activity_component() { /** * Check whether the current page is part of the Blogs component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Blogs component. */ function bp_is_blogs_component() { @@ -1982,6 +2080,8 @@ function bp_is_blogs_component() { /** * Check whether the current page is part of the Messages component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Messages component. */ function bp_is_messages_component() { @@ -1991,6 +2091,8 @@ function bp_is_messages_component() { /** * Check whether the current page is part of the Friends component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Friends component. */ function bp_is_friends_component() { @@ -2000,6 +2102,8 @@ function bp_is_friends_component() { /** * Check whether the current page is part of the Groups component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Groups component. */ function bp_is_groups_component() { @@ -2009,6 +2113,8 @@ function bp_is_groups_component() { /** * Check whether the current page is part of the Forums component. * + * @since 1.5.0 + * * @return bool True if the current page is part of the Forums component. */ function bp_is_forums_component() { @@ -2018,7 +2124,7 @@ function bp_is_forums_component() { /** * Check whether the current page is part of the Notifications component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool True if the current page is part of the Notifications component. */ @@ -2029,6 +2135,8 @@ function bp_is_notifications_component() { /** * Check whether the current page is part of the Settings component. * + * @since 1.1.0 + * * @return bool True if the current page is part of the Settings component. */ function bp_is_settings_component() { @@ -2044,8 +2152,10 @@ function bp_is_settings_component() { * it will return false. If the current component is active, and is part of * BuddyPress core, it will return true. * + * @since 1.7.0 + * * @return bool True if the current component is active and is one of BP's - * packaged components. + * packaged components. */ function bp_is_current_component_core() { $retval = false; @@ -2063,11 +2173,11 @@ function bp_is_current_component_core() { /** Activity ******************************************************************/ /** - * Is the current page the activity directory ? + * Is the current page the activity directory? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @return True if the current page is the activity directory. + * @return bool True if the current page is the activity directory. */ function bp_is_activity_directory() { if ( ! bp_displayed_user_id() && bp_is_activity_component() && ! bp_current_action() ) { @@ -2080,7 +2190,9 @@ function bp_is_activity_directory() { /** * Is the current page a single activity item permalink? * - * @return True if the current page is a single activity item permalink. + * @since 1.5.0 + * + * @return bool True if the current page is a single activity item permalink. */ function bp_is_single_activity() { return (bool) ( bp_is_activity_component() && is_numeric( bp_current_action() ) ); @@ -2089,11 +2201,11 @@ function bp_is_single_activity() { /** User **********************************************************************/ /** - * Is the current page the members directory ? + * Is the current page the members directory? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @return True if the current page is the members directory. + * @return bool True if the current page is the members directory. */ function bp_is_members_directory() { if ( ! bp_is_user() && bp_is_members_component() ) { @@ -2109,7 +2221,9 @@ function bp_is_members_directory() { * Will return true for any subpage of the logged-in user's profile, eg * http://example.com/members/joe/friends/. * - * @return True if the current page is part of the profile of the logged-in user. + * @since 1.2.0 + * + * @return bool True if the current page is part of the profile of the logged-in user. */ function bp_is_my_profile() { if ( is_user_logged_in() && bp_loggedin_user_id() == bp_displayed_user_id() ) { @@ -2121,7 +2235,7 @@ function bp_is_my_profile() { /** * Filters whether or not current page is part of the profile for the logged-in user. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param bool $my_profile Whether or not current page is part of the profile for the logged-in user. */ @@ -2133,7 +2247,9 @@ function bp_is_my_profile() { * * Will return true anytime there is a displayed user. * - * @return True if the current page is a user page. + * @since 1.5.0 + * + * @return bool True if the current page is a user page. */ function bp_is_user() { return (bool) bp_displayed_user_id(); @@ -2144,7 +2260,9 @@ function bp_is_user() { * * Eg http://example.com/members/joe/activity/ (or any subpages thereof). * - * @return True if the current page is a user's activity stream page. + * @since 1.1.0 + * + * @return bool True if the current page is a user's activity stream page. */ function bp_is_user_activity() { return (bool) ( bp_is_user() && bp_is_activity_component() ); @@ -2155,7 +2273,9 @@ function bp_is_user_activity() { * * Eg http://example.com/members/joe/friends/ * - * @return True if the current page is a user's Friends activity stream. + * @since 1.1.0 + * + * @return bool True if the current page is a user's Friends activity stream. */ function bp_is_user_friends_activity() { @@ -2181,7 +2301,9 @@ function bp_is_user_friends_activity() { * * Eg http://example.com/members/joe/groups/ * - * @return True if the current page is a user's Groups activity stream. + * @since 1.5.0 + * + * @return bool True if the current page is a user's Groups activity stream. */ function bp_is_user_groups_activity() { @@ -2205,7 +2327,9 @@ function bp_is_user_groups_activity() { * * Eg http://example.com/members/joe/profile/ (or a subpage thereof). * - * @return True if the current page is part of a user's extended profile. + * @since 1.1.0 + * + * @return bool True if the current page is part of a user's extended profile. */ function bp_is_user_profile() { return (bool) ( bp_is_profile_component() || bp_is_current_component( 'profile' ) ); @@ -2216,21 +2340,47 @@ function bp_is_user_profile() { * * Eg http://example.com/members/joe/profile/edit/ (or a subpage thereof). * - * @return True if the current page is a user's profile edit page. + * @since 1.5.0 + * + * @return bool True if the current page is a user's profile edit page. */ function bp_is_user_profile_edit() { return (bool) ( bp_is_profile_component() && bp_is_current_action( 'edit' ) ); } +/** + * Is the current page part of a user's profile avatar editing section? + * + * Eg http://example.com/members/joe/profile/change-avatar/ (or a subpage thereof). + * + * @since 1.5.0 + * + * @return bool True if the current page is the user's avatar edit page. + */ function bp_is_user_change_avatar() { return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-avatar' ) ); } +/** + * Is the current page the a user's change cover image profile page? + * + * Eg http://example.com/members/joe/profile/change-cover-image/ (or a subpage thereof). + * + * @since 2.4.0 + * + * @return bool True if the current page is a user's profile edit cover image page. + */ +function bp_is_user_change_cover_image() { + return (bool) ( bp_is_profile_component() && bp_is_current_action( 'change-cover-image' ) ); +} + /** * Is this a user's forums page? * * Eg http://example.com/members/joe/forums/ (or a subpage thereof). * + * @since 1.5.0 + * * @return bool True if the current page is a user's forums page. */ function bp_is_user_forums() { @@ -2251,7 +2401,7 @@ function bp_is_user_forums() { * * Eg http://example.com/members/joe/forums/topics/. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current page is a user's Topics Started page. */ @@ -2264,7 +2414,7 @@ function bp_is_user_forums_started() { * * Eg http://example.com/members/joe/forums/replies/. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current page is a user's Replied To forums page. */ @@ -2277,6 +2427,8 @@ function bp_is_user_forums_replied_to() { * * Eg http://example.com/members/joe/groups/ (or a subpage thereof). * + * @since 1.1.0 + * * @return bool True if the current page is a user's Groups page. */ function bp_is_user_groups() { @@ -2288,6 +2440,8 @@ function bp_is_user_groups() { * * Eg http://example.com/members/joe/blogs/ (or a subpage thereof). * + * @since 1.1.0 + * * @return bool True if the current page is a user's Blogs page. */ function bp_is_user_blogs() { @@ -2299,6 +2453,8 @@ function bp_is_user_blogs() { * * Eg http://example.com/members/joe/blogs/recent-posts/. * + * @since 1.1.0 + * * @return bool True if the current page is a user's Recent Blog Posts page. */ function bp_is_user_recent_posts() { @@ -2310,6 +2466,8 @@ function bp_is_user_recent_posts() { * * Eg http://example.com/members/joe/blogs/recent-comments/. * + * @since 1.1.0 + * * @return bool True if the current page is a user's Recent Blog Comments page. */ function bp_is_user_recent_commments() { @@ -2321,6 +2479,8 @@ function bp_is_user_recent_commments() { * * Eg http://example.com/members/joe/blogs/friends/ (or a subpage thereof). * + * @since 1.1.0 + * * @return bool True if the current page is a user's Friends page. */ function bp_is_user_friends() { @@ -2332,6 +2492,8 @@ function bp_is_user_friends() { * * Eg http://example.com/members/joe/friends/requests/. * + * @since 1.5.0 + * * @return bool True if the current page is a user's Friends Requests page. */ function bp_is_user_friend_requests() { @@ -2343,7 +2505,7 @@ function bp_is_user_friend_requests() { * * Eg http://example.com/members/joe/notifications/ (or a subpage thereof). * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool True if the current page is a user's Notifications page. */ @@ -2356,6 +2518,8 @@ function bp_is_user_notifications() { * * Eg http://example.com/members/joe/settings/ (or a subpage thereof). * + * @since 1.5.0 + * * @return bool True if the current page is a user's Settings page. */ function bp_is_user_settings() { @@ -2367,7 +2531,7 @@ function bp_is_user_settings() { * * Eg http://example.com/members/joe/settings/general/. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current page is a user's General Settings page. */ @@ -2380,7 +2544,7 @@ function bp_is_user_settings_general() { * * Eg http://example.com/members/joe/settings/notifications/. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current page is a user's Notification Settings page. */ @@ -2393,7 +2557,7 @@ function bp_is_user_settings_notifications() { * * Eg http://example.com/members/joe/settings/delete-account/. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current page is a user's Delete Account page. */ @@ -2406,7 +2570,7 @@ function bp_is_user_settings_account_delete() { * * Eg http://example.com/members/joe/settings/profile/. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return bool True if the current page is a user's Profile Settings page. */ @@ -2417,9 +2581,9 @@ function bp_is_user_settings_profile() { /** Groups ********************************************************************/ /** - * Is the current page the groups directory ? + * Is the current page the groups directory? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return True if the current page is the groups directory. */ @@ -2436,6 +2600,8 @@ function bp_is_groups_directory() { * * Will return true for any subpage of a single group. * + * @since 1.2.0 + * * @return bool True if the current page is part of a single group. */ function bp_is_group() { @@ -2454,6 +2620,8 @@ function bp_is_group() { * URL will vary depending on which group tab is set to be the "home". By * default, it's the group's recent activity. * + * @since 1.1.0 + * * @return bool True if the current page is a single group's home page. */ function bp_is_group_home() { @@ -2467,6 +2635,8 @@ function bp_is_group_home() { /** * Is the current page part of the group creation process? * + * @since 1.1.0 + * * @return bool True if the current page is part of the group creation process. */ function bp_is_group_create() { @@ -2478,6 +2648,8 @@ function bp_is_group_create() { * * Eg http://example.com/groups/mygroup/admin/settings/. * + * @since 1.1.0 + * * @return bool True if the current page is part of a single group's admin. */ function bp_is_group_admin_page() { @@ -2489,12 +2661,14 @@ function bp_is_group_admin_page() { * * Only applies to legacy bbPress forums. * + * @since 1.1.0 + * * @return bool True if the current page is a group forum page. */ function bp_is_group_forum() { $retval = false; - // At a forum URL + // At a forum URL. if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) { $retval = true; @@ -2511,10 +2685,22 @@ function bp_is_group_forum() { /** * Is the current page a group's activity page? * + * @since 1.2.1 + * * @return True if the current page is a group's activity page. */ function bp_is_group_activity() { - return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'activity' ) ); + $retval = false; + + if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'activity' ) ) { + $retval = true; + } + + if ( bp_is_group_home() && bp_is_active( 'activity' ) && ! bp_is_group_custom_front() ) { + $retval = true; + } + + return $retval; } /** @@ -2522,6 +2708,8 @@ function bp_is_group_activity() { * * Only applies to legacy bbPress (1.x) forums. * + * @since 1.1.0 + * * @return bool True if the current page is part of a group forum topic. */ function bp_is_group_forum_topic() { @@ -2533,6 +2721,8 @@ function bp_is_group_forum_topic() { * * Only applies to legacy bbPress (1.x) forums. * + * @since 1.2.0 + * * @return bool True if the current page is part of a group forum topic edit page. */ function bp_is_group_forum_topic_edit() { @@ -2544,10 +2734,22 @@ function bp_is_group_forum_topic_edit() { * * Eg http://example.com/groups/mygroup/members/. * + * @since 1.1.0 + * * @return bool True if the current page is part of a group's Members page. */ function bp_is_group_members() { - return (bool) ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'members' ) ); + $retval = false; + + if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'members' ) ) { + $retval = true; + } + + if ( bp_is_group_home() && ! bp_is_active( 'activity' ) && ! bp_is_group_custom_front() ) { + $retval = true; + } + + return $retval; } /** @@ -2555,6 +2757,8 @@ function bp_is_group_members() { * * Eg http://example.com/groups/mygroup/send-invites/. * + * @since 1.1.0 + * * @return bool True if the current page is a group's Send Invites page. */ function bp_is_group_invites() { @@ -2566,6 +2770,8 @@ function bp_is_group_invites() { * * Eg http://example.com/groups/mygroup/request-membership/. * + * @since 1.2.0 + * * @return bool True if the current page is a group's Request Membership page. */ function bp_is_group_membership_request() { @@ -2575,6 +2781,8 @@ function bp_is_group_membership_request() { /** * Is the current page a leave group attempt? * + * @since 1.1.0 + * * @return bool True if the current page is a Leave Group attempt. */ function bp_is_group_leave() { @@ -2594,11 +2802,25 @@ function bp_is_group_single() { return (bool) ( bp_is_groups_component() && bp_is_single_item() ); } +/** + * Is the current group page a custom front? + * + * @since 2.4.0 + * + * @return bool True if the current group page is a custom front. + */ +function bp_is_group_custom_front() { + $bp = buddypress(); + return (bool) bp_is_group_home() && ! empty( $bp->groups->current_group->front_template ); +} + /** * Is the current page the Create a Blog page? * * Eg http://example.com/sites/create/. * + * @since 1.1.0 + * * @return bool True if the current page is the Create a Blog page. */ function bp_is_create_blog() { @@ -2608,7 +2830,7 @@ function bp_is_create_blog() { /** * Is the current page the blogs directory ? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return True if the current page is the blogs directory. */ @@ -2627,6 +2849,8 @@ function bp_is_blogs_directory() { * * Eg http://example.com/members/joe/messages/ (or a subpage thereof). * + * @since 1.2.0 + * * @return bool True if the current page is part of a user's Messages pages. */ function bp_is_user_messages() { @@ -2638,6 +2862,8 @@ function bp_is_user_messages() { * * Eg http://example.com/members/joe/messages/inbox/. * + * @since 1.1.0 + * * @return bool True if the current page is a user's Messages Inbox. */ function bp_is_messages_inbox() { @@ -2653,6 +2879,8 @@ function bp_is_messages_inbox() { * * Eg http://example.com/members/joe/messages/sentbox/. * + * @since 1.1.0 + * * @return bool True if the current page is a user's Messages Sentbox. */ function bp_is_messages_sentbox() { @@ -2664,6 +2892,8 @@ function bp_is_messages_sentbox() { * * Eg http://example.com/members/joe/messages/compose/. * + * @since 1.1.0 + * * @return bool True if the current page is a user's Messages Compose screen. */ function bp_is_messages_compose_screen() { @@ -2675,6 +2905,8 @@ function bp_is_messages_compose_screen() { * * Eg http://example.com/members/joe/messages/notices/. * + * @since 1.1.0 + * * @return bool True if the current page is the Notices screen. */ function bp_is_notices() { @@ -2684,6 +2916,8 @@ function bp_is_notices() { /** * Is the current page a single Messages conversation thread? * + * @since 1.6.0 + * * @return bool True if the current page a single Messages conversation thread? */ function bp_is_messages_conversation() { @@ -2693,6 +2927,8 @@ function bp_is_messages_conversation() { /** * Not currently used by BuddyPress. * + * @param string $component Current component to check for. + * @param string $callback Callback to invoke. * @return bool */ function bp_is_single( $component, $callback ) { @@ -2706,6 +2942,8 @@ function bp_is_single( $component, $callback ) { * * Eg http://example.com/activate/. * + * @since 1.1.0 + * * @return bool True if the current page is the Activate page. */ function bp_is_activation_page() { @@ -2717,6 +2955,8 @@ function bp_is_activation_page() { * * Eg http://example.com/register/. * + * @since 1.1.0 + * * @return bool True if the current page is the Register page. */ function bp_is_register_page() { @@ -2724,22 +2964,167 @@ function bp_is_register_page() { } /** - * Customize the body class, according to the currently displayed BP content. + * Get the title parts of the BuddyPress displayed page + * + * @since 2.4.3 * - * Uses the above is_() functions to output a body class for each scenario. + * @param string $seplocation Location for the separator. + * @return array the title parts + */ +function bp_get_title_parts( $seplocation = 'right' ) { + $bp = buddypress(); + + // Defaults to an empty array. + $bp_title_parts = array(); + + // If this is not a BP page, return the empty array. + if ( bp_is_blog_page() ) { + return $bp_title_parts; + } + + // If this is a 404, return the empty array. + if ( is_404() ) { + return $bp_title_parts; + } + + // If this is the front page of the site, return the empty array. + if ( is_front_page() || is_home() ) { + return $bp_title_parts; + } + + // Return the empty array if not a BuddyPress page. + if ( ! is_buddypress() ) { + return $bp_title_parts; + } + + // Now we can build the BP Title Parts + // Is there a displayed user, and do they have a name? + $displayed_user_name = bp_get_displayed_user_fullname(); + + // Displayed user. + if ( ! empty( $displayed_user_name ) && ! is_404() ) { + + // Get the component's ID to try and get its name. + $component_id = $component_name = bp_current_component(); + + // 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' ); + + if ( ! empty( $component_subnav_name ) ) { + $component_subnav_name = array_shift( $component_subnav_name ); + } + } + + // 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() ) ) { + $bp_title_parts[] = $displayed_user_name; + + // Use component name on member pages. + } else { + $bp_title_parts = array_merge( $bp_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 ) ) { + $bp_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'] : ''; + $bp_title_parts = array( $bp->bp_options_title, $subnav ); + + // A single item from a component other than groups. + } elseif ( bp_is_single_item() ) { + $bp_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?). + $bp_title_parts = array( _x( 'Directory', 'component directory title', 'buddypress' ) ); + + if ( ! empty( $current_component ) ) { + $bp_title_parts = array( bp_get_directory_title( $current_component ) ); + } + + // Sign up page. + } elseif ( bp_is_register_page() ) { + $bp_title_parts = array( __( 'Create an Account', 'buddypress' ) ); + + // Activation page. + } elseif ( bp_is_activation_page() ) { + $bp_title_parts = array( __( 'Activate Your Account', 'buddypress' ) ); + + // Group creation page. + } elseif ( bp_is_group_create() ) { + $bp_title_parts = array( __( 'Create a Group', 'buddypress' ) ); + + // Blog creation page. + } elseif ( bp_is_create_blog() ) { + $bp_title_parts = array( __( 'Create a Site', 'buddypress' ) ); + } + + // Strip spans. + $bp_title_parts = array_map( '_bp_strip_spans_from_title', $bp_title_parts ); + + // Sep on right, so reverse the order. + if ( 'right' === $seplocation ) { + $bp_title_parts = array_reverse( $bp_title_parts ); + } + + /** + * Filter BuddyPress title parts before joining. + * + * @since 2.4.3 + * + * @param array $bp_title_parts Current BuddyPress title parts + * @return array + */ + return (array) apply_filters( 'bp_get_title_parts', $bp_title_parts ); +} + +/** + * Customize the body class, according to the currently displayed BP content. * - * @param array $wp_classes The body classes coming from WP. - * @param array $custom_classes Classes that were passed to get_body_class(). - * @return array $classes The BP-adjusted body classes. + * @since 1.1.0 */ function bp_the_body_class() { echo bp_get_the_body_class(); } + /** + * Customize the body class, according to the currently displayed BP content. + * + * Uses the above is_() functions to output a body class for each scenario. + * + * @since 1.1.0 + * + * @param array $wp_classes The body classes coming from WP. + * @param array|bool $custom_classes Classes that were passed to get_body_class(). + * @return array $classes The BP-adjusted body classes. + */ function bp_get_the_body_class( $wp_classes = array(), $custom_classes = false ) { $bp_classes = array(); - /** Pages *************************************************************/ + /* Pages *************************************************************/ if ( is_front_page() ) { $bp_classes[] = 'home-page'; @@ -2753,7 +3138,7 @@ function bp_the_body_class() { $bp_classes[] = 'single-item'; } - /** Components ********************************************************/ + /* Components ********************************************************/ if ( ! bp_is_blog_page() ) { if ( bp_is_user_profile() ) { @@ -2785,7 +3170,7 @@ function bp_the_body_class() { } } - /** User **************************************************************/ + /* User **************************************************************/ if ( bp_is_user() ) { $bp_classes[] = 'bp-user'; @@ -2845,7 +3230,7 @@ function bp_the_body_class() { $bp_classes[] = 'groups-activity'; } - /** Messages **********************************************************/ + /* Messages **********************************************************/ if ( bp_is_messages_inbox() ) { $bp_classes[] = 'inbox'; @@ -2871,7 +3256,7 @@ function bp_the_body_class() { $bp_classes[] = 'create-blog'; } - /** Groups ************************************************************/ + /* Groups ************************************************************/ if ( bp_is_group() ) { $bp_classes[] = 'group-' . groups_get_current_group()->slug; @@ -2919,7 +3304,7 @@ function bp_the_body_class() { $bp_classes[] = 'activity-permalink'; } - /** Registration ******************************************************/ + /* Registration ******************************************************/ if ( bp_is_register_page() ) { $bp_classes[] = 'registration'; @@ -2929,27 +3314,27 @@ function bp_the_body_class() { $bp_classes[] = 'activation'; } - /** Current Component & Action ****************************************/ + /* Current Component & Action ****************************************/ if ( ! bp_is_blog_page() ) { $bp_classes[] = bp_current_component(); $bp_classes[] = bp_current_action(); } - /** Clean up ***********************************************************/ + /* Clean up ***********************************************************/ - // Add BuddyPress class if we are within a BuddyPress page + // Add BuddyPress class if we are within a BuddyPress page. if ( ! bp_is_blog_page() ) { $bp_classes[] = 'buddypress'; } - // Merge WP classes with BuddyPress classes and remove any duplicates + // 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) + * @since 1.1.0 * * @param array $classes Array of body classes to add. * @param array $bp_classes Array of BuddyPress-based classes. @@ -2965,13 +3350,13 @@ function bp_the_body_class() { * * Hooked to the 'post_class' filter. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $wp_classes The post classes coming from WordPress. * @return array */ function bp_get_the_post_class( $wp_classes = array() ) { - // don't do anything if we're not on a BP page + // Don't do anything if we're not on a BP page. if ( ! is_buddypress() ) { return $wp_classes; } @@ -3004,19 +3389,12 @@ function bp_get_the_post_class( $wp_classes = array() ) { return $wp_classes; } - // emulate post type css class + // Emulate post type css class. foreach ( $bp_classes as $bp_class ) { $bp_classes[] = "type-{$bp_class}"; } - // removes the 'page' and 'type-page' post classes - // we need to remove these classes since they did not exist before we switched - // theme compat to use the 'page' post type - $page_key = array_search( 'page', $wp_classes ); - $page_type_key = array_search( 'type-page', $wp_classes ); - unset( $wp_classes[$page_key], $wp_classes[$page_type_key] ); - - // okay let's merge! + // Okay let's merge! return array_unique( array_merge( $bp_classes, $wp_classes ) ); } add_filter( 'post_class', 'bp_get_the_post_class' ); @@ -3028,12 +3406,13 @@ add_filter( 'post_class', 'bp_get_the_post_class' ); * a later release. Do not use. * * @access private - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $a First item. * @param array $b Second item. * @return int Returns an integer less than, equal to, or greater than zero if - * the first argument is considered to be respectively less than, equal to, or greater than the second. + * the first argument is considered to be respectively less than, + * equal to, or greater than the second. */ function _bp_nav_menu_sort( $a, $b ) { if ( $a['position'] == $b['position'] ) { @@ -3048,14 +3427,14 @@ function _bp_nav_menu_sort( $a, $b ) { /** * Get the items registered in the primary and secondary BuddyPress navigation menus. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return array A multidimensional array of all navigation items. */ function bp_get_nav_menu_items() { $menus = $selected_menus = array(); - // Get the second level menus + // Get the second level menus. foreach ( (array) buddypress()->bp_options_nav as $parent_menu => $sub_menus ) { // The root menu's ID is "xprofile", but the Profile submenus are using "profile". See BP_Core::setup_nav(). @@ -3063,27 +3442,27 @@ function bp_get_nav_menu_items() { $parent_menu = 'xprofile'; } - // Sort the items in this menu's navigation by their position property + // Sort the items in this menu's navigation by their position property. $second_level_menus = (array) $sub_menus; usort( $second_level_menus, '_bp_nav_menu_sort' ); - // Iterate through the second level menus + // Iterate through the second level menus. foreach( $second_level_menus as $sub_nav ) { - // Skip items we don't have access to + // Skip items we don't have access to. if ( empty( $sub_nav['user_has_access'] ) ) { continue; } - // Add this menu + // Add this menu. $menu = new stdClass; $menu->class = array( 'menu-child' ); $menu->css_id = $sub_nav['css_id']; $menu->link = $sub_nav['link']; $menu->name = $sub_nav['name']; - $menu->parent = $parent_menu; // Associate this sub nav with a top-level menu + $menu->parent = $parent_menu; // Associate this sub nav with a top-level menu. - // If we're viewing this item's screen, record that we need to mark its parent menu to be selected + // If we're viewing this item's screen, record that we need to mark its parent menu to be selected. if ( $sub_nav['slug'] == bp_current_action() ) { $menu->class[] = 'current-menu-item'; $selected_menus[] = $parent_menu; @@ -3093,22 +3472,22 @@ function bp_get_nav_menu_items() { } } - // Get the top-level menu parts (Friends, Groups, etc) and sort by their position property + // Get the top-level menu parts (Friends, Groups, etc) and sort by their position property. $top_level_menus = (array) buddypress()->bp_nav; usort( $top_level_menus, '_bp_nav_menu_sort' ); - // Iterate through the top-level menus + // Iterate through the top-level menus. foreach ( $top_level_menus as $nav ) { - // Skip items marked as user-specific if you're not on your own profile + // Skip items marked as user-specific if you're not on your own profile. if ( empty( $nav['show_for_displayed_user'] ) && ! bp_core_can_edit_settings() ) { continue; } - // Get the correct menu link. See https://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 + // Add this menu. $menu = new stdClass; $menu->class = array( 'menu-parent' ); $menu->css_id = $nav['css_id']; @@ -3116,7 +3495,7 @@ function bp_get_nav_menu_items() { $menu->name = $nav['name']; $menu->parent = 0; - // Check if we need to mark this menu as selected + // Check if we need to mark this menu as selected. if ( in_array( $nav['css_id'], $selected_menus ) ) { $menu->class[] = 'current-menu-parent'; } @@ -3127,7 +3506,7 @@ function bp_get_nav_menu_items() { /** * Filters the items registered in the primary and secondary BuddyPress navigation menus. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $menus Array of items registered in the primary and secondary BuddyPress navigation. */ @@ -3137,38 +3516,39 @@ function bp_get_nav_menu_items() { /** * Display a navigation menu. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string|array $args { * An array of optional arguments. - * @type string $after Text after the link text. Default: ''. - * @type string $before Text before the link text. Default: ''. - * @type string $container The name of the element to wrap the navigation - * with. 'div' or 'nav'. Default: 'div'. + * + * @type string $after Text after the link text. Default: ''. + * @type string $before Text before the link text. Default: ''. + * @type string $container The name of the element to wrap the navigation + * with. 'div' or 'nav'. Default: 'div'. * @type string $container_class The class that is applied to the container. - * Default: 'menu-bp-container'. - * @type string $container_id The ID that is applied to the container. - * Default: ''. - * @type int depth How many levels of the hierarchy are to be included. 0 - * means all. Default: 0. - * @type bool $echo True to echo the menu, false to return it. - * Default: true. - * @type bool $fallback_cb If the menu doesn't exist, should a callback - * function be fired? Default: false (no fallback). - * @type string $items_wrap How the list items should be wrapped. Should be - * in the form of a printf()-friendly string, using numbered - * placeholders. Default: '<ul id="%1$s" class="%2$s">%3$s</ul>'. - * @type string $link_after Text after the link. Default: ''. - * @type string $link_before Text before the link. Default: ''. - * @type string $menu_class CSS class to use for the <ul> element which - * forms the menu. Default: 'menu'. - * @type string $menu_id The ID that is applied to the <ul> element which - * forms the menu. Default: 'menu-bp', incremented. - * @type string $walker Allows a custom walker class to be specified. - * Default: 'BP_Walker_Nav_Menu'. + * Default: 'menu-bp-container'. + * @type string $container_id The ID that is applied to the container. + * Default: ''. + * @type int $depth How many levels of the hierarchy are to be included. + * 0 means all. Default: 0. + * @type bool $echo True to echo the menu, false to return it. + * Default: true. + * @type bool $fallback_cb If the menu doesn't exist, should a callback + * function be fired? Default: false (no fallback). + * @type string $items_wrap How the list items should be wrapped. Should be + * in the form of a printf()-friendly string, using numbered + * placeholders. Default: '<ul id="%1$s" class="%2$s">%3$s</ul>'. + * @type string $link_after Text after the link. Default: ''. + * @type string $link_before Text before the link. Default: ''. + * @type string $menu_class CSS class to use for the <ul> element which + * forms the menu. Default: 'menu'. + * @type string $menu_id The ID that is applied to the <ul> element which + * forms the menu. Default: 'menu-bp', incremented. + * @type string $walker Allows a custom walker class to be specified. + * Default: 'BP_Walker_Nav_Menu'. * } * @return string|null If $echo is false, returns a string containing the nav - * menu markup. + * menu markup. */ function bp_nav_menu( $args = array() ) { static $menu_id_slugs = array(); @@ -3194,7 +3574,7 @@ function bp_nav_menu( $args = array() ) { /** * Filters the parsed bp_nav_menu arguments. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $args Array of parsed arguments. */ @@ -3204,22 +3584,22 @@ function bp_nav_menu( $args = array() ) { $items = $nav_menu = ''; $show_container = false; - // Create custom walker if one wasn't set + // Create custom walker if one wasn't set. if ( empty( $args->walker ) ) { $args->walker = new BP_Walker_Nav_Menu; } - // Sanitise values for class and ID + // Sanitise values for class and ID. $args->container_class = sanitize_html_class( $args->container_class ); $args->container_id = sanitize_html_class( $args->container_id ); - // Whether to wrap the ul, and what to wrap it with + // 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) + * @since 1.7.0 * * @param array $value Array of allowed tags. Default 'div' and 'nav'. */ @@ -3237,7 +3617,7 @@ function bp_nav_menu( $args = array() ) { /** * Filters the BuddyPress menu objects. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $value Array of nav menu objects. * @param array $args Array of arguments for the menu. @@ -3253,7 +3633,7 @@ function bp_nav_menu( $args = array() ) { } else { $wrap_id = 'menu-bp'; - // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique + // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique. while ( in_array( $wrap_id, $menu_id_slugs ) ) { if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) { $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id ); @@ -3269,19 +3649,19 @@ function bp_nav_menu( $args = array() ) { * * Allow plugins to hook into the menu to add their own <li>'s * - * @since BuddyPress (1.7.0) + * @since 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 + // Build the output. $wrap_class = $args->menu_class ? $args->menu_class : ''; $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items ); unset( $items ); - // If we've wrapped the ul, close it + // If we've wrapped the ul, close it. if ( ! empty( $show_container ) ) { $nav_menu .= '</' . $args->container . '>'; } @@ -3289,7 +3669,7 @@ function bp_nav_menu( $args = array() ) { /** * Filters the final BuddyPress menu output. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $nav_menu Final nav menu output. * @param array $args Array of arguments for the menu. @@ -3302,3 +3682,37 @@ function bp_nav_menu( $args = array() ) { return $nav_menu; } } + +/** + * Prints the Recipient Salutation. + * + * @since 2.5.0 + * + * @param array $settings Email Settings. + */ +function bp_email_the_salutation( $settings = array() ) { + echo bp_email_get_salutation( $settings ); +} + + /** + * Gets the Recipient Salutation. + * + * @since 2.5.0 + * + * @param array $settings Email Settings. + * @return string The Recipient Salutation. + */ + function bp_email_get_salutation( $settings = array() ) { + $token = '{{recipient.name}}'; + + /** + * Filters The Recipient Salutation inside the Email Template. + * + * @since 2.5.0 + * + * @param string $value The Recipient Salutation. + * @param array $settings Email Settings. + * @param string $token The Recipient token. + */ + return apply_filters( 'bp_email_get_salutation', sprintf( _x( 'Hi %s,', 'recipient salutation', 'buddypress' ), $token ), $settings, $token ); + } 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 d88c27ac294f4cd11cdb6b14fdfafeac9ecd939a..bf69b11335fc7dcebdb6527d4d5ee0c1c4a403f5 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 @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Core Theme Compatibility. * * @package BuddyPress * @subpackage ThemeCompatibility + * @since 1.7.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Theme Compat **************************************************************/ @@ -24,130 +24,26 @@ defined( 'ABSPATH' ) || exit; /** Base Class ****************************************************************/ -/** - * Theme Compatibility base class. - * - * This is only intended to be extended, and is included here as a basic guide - * for future Theme Packs to use. {@link BP_Legacy} is a good example of - * extending this class. - * - * @since BuddyPress (1.7.0) - * - * @todo We should probably do something similar to BP_Component::start(). - * @todo If this is only intended to be extended, it should be abstract. - * - * @param array $properties { - * An array of properties describing the theme compat package. - * @type string $id ID of the package. Must be unique. - * @type string $name Name of the theme. This should match the name given - * in style.css. - * @type string $version Theme version. Used for busting script and style - * browser caches. - * @type string $dir Filesystem path of the theme. - * @type string $url Base URL of the theme. - * } - */ -class BP_Theme_Compat { - - /** - * Template package properties, as passed to the constructor. - * - * @var array - */ - protected $_data = array(); - - /** - * Pass the $properties to the object on creation. - * - * @since BuddyPress (1.7.0) - */ - public function __construct( Array $properties = array() ) { - $this->_data = $properties; - } - - /** - * Set up the BuddyPress-specific theme compat methods. - * - * Themes should use this method in their constructor. - * - * @since BuddyPress (1.7.0) - */ - protected function start() { - // Sanity check - if ( ! bp_use_theme_compat_with_current_theme() ) { - return; - } - - // Setup methods - $this->setup_globals(); - $this->setup_actions(); - } - - /** - * Set up global data for your template package. - * - * Meant to be overridden in your class. See - * {@link BP_Legacy::setup_globals()} for an example. - * - * @since BuddyPress (1.7.0) - */ - protected function setup_globals() {} - - /** - * Set up theme hooks for your template package. - * - * Meant to be overridden in your class. See - * {@link BP_Legacy::setup_actions()} for an example. - * - * @since BuddyPress (1.7.0) - */ - protected function setup_actions() {} - - /** - * Set a theme's property. - * - * @since BuddyPress (1.7.0) - * - * @param string $property Property name. - * @param mixed $value Property value. - * @return bool True on success, false on failure. - */ - public function __set( $property, $value ) { - return $this->_data[$property] = $value; - } - - /** - * Get a theme's property. - * - * @since BuddyPress (1.7.0) - * - * @param string $property Property name. - * @return mixed The value of the property if it exists, otherwise an - * empty string. - */ - public function __get( $property ) { - return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : ''; - } -} +require dirname( __FILE__ ) . '/classes/class-bp-theme-compat.php'; /** Functions *****************************************************************/ /** * Set up the default theme compat theme. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $theme Optional. The unique ID identifier of a theme package. */ function bp_setup_theme_compat( $theme = '' ) { $bp = buddypress(); - // Make sure theme package is available, set to default if not + // Make sure theme package is available, set to default if not. if ( ! isset( $bp->theme_compat->packages[$theme] ) || ! is_a( $bp->theme_compat->packages[$theme], 'BP_Theme_Compat' ) ) { $theme = 'legacy'; } - // Set the active theme compat theme + // Set the active theme compat theme. $bp->theme_compat->theme = $bp->theme_compat->packages[$theme]; } @@ -157,7 +53,7 @@ function bp_setup_theme_compat( $theme = '' ) { * This can be filtered or set manually. Tricky theme authors can override the * default and include their own BuddyPress compatibility layers for their themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -168,7 +64,7 @@ function bp_get_theme_compat_id() { /** * Filters the ID of the theme package being used. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $id ID of the theme package in use. */ @@ -181,7 +77,7 @@ function bp_get_theme_compat_id() { * This can be filtered or set manually. Tricky theme authors can override the * default and include their own BuddyPress compatibility layers for their themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -192,7 +88,7 @@ function bp_get_theme_compat_name() { /** * Filters the name of the theme package being used. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $name Name of the theme package in use. */ @@ -205,7 +101,7 @@ function bp_get_theme_compat_name() { * This can be filtered or set manually. Tricky theme authors can override the * default and include their own BuddyPress compatibility layers for their themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -216,7 +112,7 @@ function bp_get_theme_compat_version() { /** * Filters the version of the theme package being used. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $version The version string of the theme package in use. */ @@ -226,10 +122,10 @@ 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 + * Or set manually. Tricky theme authors can override the default and include * their own BuddyPress compatibility layers for their themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -240,7 +136,7 @@ function bp_get_theme_compat_dir() { /** * Filters the absolute path of the theme package being used. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $dir The absolute path of the theme package in use. */ @@ -254,7 +150,7 @@ function bp_get_theme_compat_dir() { * the default and include their own BuddyPress compatibility layers for their * themes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses apply_filters() * @@ -265,7 +161,7 @@ function bp_get_theme_compat_url() { /** * Filters the URL of the theme package being used. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $url URL of the theme package in use. */ @@ -278,7 +174,7 @@ function bp_get_theme_compat_url() { * If the current theme's need for theme compat hasn't yet been detected, we * do so using bp_detect_theme_compat_with_current_theme(). * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses bp_detect_theme_compat_with_current_theme() * @@ -292,7 +188,7 @@ function bp_use_theme_compat_with_current_theme() { /** * Filters whether or not to use theme compat for the active theme. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param bool $use_with_current_theme True if the current theme needs theme compatibility. */ @@ -311,7 +207,7 @@ function bp_use_theme_compat_with_current_theme() { * this category will have the members-loop.php template, and so use its * presence as an indicator that theme compatibility is not required * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool True if the current theme needs theme compatibility. */ @@ -320,27 +216,27 @@ function bp_detect_theme_compat_with_current_theme() { return buddypress()->theme_compat->use_with_current_theme; } - // theme compat enabled by default + // Theme compat enabled by default. $theme_compat = true; // If the theme supports 'buddypress', bail. if ( current_theme_supports( 'buddypress' ) ) { $theme_compat = false; - // If the theme doesn't support BP, do some additional checks + // If the theme doesn't support BP, do some additional checks. } else { - // Bail if theme is a derivative of bp-default + // Bail if theme is a derivative of bp-default. if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) { $theme_compat = false; - // Brute-force check for a BP template - // Examples are clones of bp-default + // Brute-force check for a BP template. + // Examples are clones of bp-default. } elseif ( locate_template( 'members/members-loop.php', false, false ) ) { $theme_compat = false; } } - // set a flag in the buddypress() singleton so we don't have to run this again + // Set a flag in the buddypress() singleton so we don't have to run this again. buddypress()->theme_compat->use_with_current_theme = $theme_compat; return $theme_compat; @@ -349,7 +245,7 @@ function bp_detect_theme_compat_with_current_theme() { /** * Is the current page using theme compatibility? * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return bool True if the current page uses theme compatibility. */ @@ -366,7 +262,7 @@ function bp_is_theme_compat_active() { /** * Set the flag that tells whether the current page is using theme compatibility. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param bool $set True to set the flag to true, false to set it to false. * @return bool Returns the value of $set. @@ -383,7 +279,7 @@ function bp_set_theme_compat_active( $set = true ) { * Stash possible template files for the current query. Useful if plugins want * to override them, or see what files are being scanned for inclusion. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $templates The template stack. * @return array The template stack (value of $templates). @@ -400,7 +296,7 @@ function bp_set_theme_compat_templates( $templates = array() ) { * Stash the template file for the current query. Useful if plugins want * to override it, or see what file is being included. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template The template currently in use. * @return string The template currently in use (value of $template). @@ -417,7 +313,7 @@ function bp_set_theme_compat_template( $template = '' ) { * Stash the original template file for the current query. Useful for checking * if BuddyPress was able to find a more appropriate template. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template The template originally selected by WP. * @return string The template originally selected by WP (value of $template). @@ -428,14 +324,179 @@ function bp_set_theme_compat_original_template( $template = '' ) { return buddypress()->theme_compat->original_template; } +/** + * Set a theme compat feature + * + * @since 2.4.0 + * + * @param string $theme_id The theme id (eg: legacy). + * @param array $feature An associative array (eg: array( name => 'feature_name', 'settings' => array() )). + */ +function bp_set_theme_compat_feature( $theme_id, $feature = array() ) { + if ( empty( $theme_id ) || empty( $feature['name'] ) ) { + return; + } + + // Get BuddyPress instance. + $bp = buddypress(); + + // Get current theme compat theme. + $theme_compat_theme = $bp->theme_compat->theme; + + // Bail if the Theme Compat theme is not in use. + if ( $theme_id !== bp_get_theme_compat_id() ) { + return; + } + + $features = $theme_compat_theme->__get( 'features' ); + if ( empty( $features ) ) { + $features = array(); + } + + // Bail if the feature is already registered or no settings were provided. + if ( isset( $features[ $feature['name'] ] ) || empty( $feature['settings'] ) ) { + return; + } + + // Add the feature. + $features[ $feature['name'] ] = (object) $feature['settings']; + + // The feature is attached to components. + if ( isset( $features[ $feature['name'] ]->components ) ) { + // Set the feature for each concerned component. + foreach ( (array) $features[ $feature['name'] ]->components as $component ) { + // The xProfile component is specific. + if ( 'xprofile' === $component ) { + $component = 'profile'; + } + + if ( isset( $bp->{$component} ) ) { + if ( isset( $bp->{$component}->features ) ) { + $bp->{$component}->features[] = $feature['name']; + } else { + $bp->{$component}->features = array( $feature['name'] ); + } + } + } + } + + // Finally update the theme compat features. + $theme_compat_theme->__set( 'features', $features ); +} + +/** + * Get a theme compat feature + * + * @since 2.4.0 + * + * @param string $feature The feature (eg: cover_image). + * @return object The feature settings. + */ +function bp_get_theme_compat_feature( $feature = '' ) { + // Get current theme compat theme. + $theme_compat_theme = buddypress()->theme_compat->theme; + + // Get features. + $features = $theme_compat_theme->__get( 'features' ); + + if ( ! isset( $features[ $feature ] ) ) { + return false; + } + + return $features[ $feature ]; +} + +/** + * Setup the theme's features + * + * Note: BP Legacy's buddypress-functions.php is not loaded in WP Administration + * as it's loaded using bp_locate_template(). That's why this function is here. + * + * @since 2.4.0 + * + * @global string $content_width the content width of the theme + */ +function bp_register_theme_compat_default_features() { + global $content_width; + + // Do not set up default features on deactivation. + if ( bp_is_deactivation() ) { + return; + } + + // If the current theme doesn't need theme compat, bail at this point. + if ( ! bp_use_theme_compat_with_current_theme() ) { + return; + } + + // Make sure BP Legacy is the Theme Compat in use. + if ( 'legacy' !== bp_get_theme_compat_id() ) { + return; + } + + // Get the theme. + $current_theme = wp_get_theme(); + $theme_handle = $current_theme->get_stylesheet(); + $parent = $current_theme->parent(); + + if ( $parent ) { + $theme_handle = $parent->get_stylesheet(); + } + + /** + * Since Companion stylesheets, the $content_width is smaller + * than the width used by BuddyPress, so we need to manually set the + * content width for the concerned themes. + * + * Example: array( stylesheet => content width used by BuddyPress ) + */ + $bp_content_widths = array( + 'twentyfifteen' => 1300, + 'twentyfourteen' => 955, + 'twentythirteen' => 890, + ); + + // Default values. + $bp_content_width = (int) $content_width; + $bp_handle = 'bp-legacy-css'; + + // Specific to themes having companion stylesheets. + if ( isset( $bp_content_widths[ $theme_handle ] ) ) { + $bp_content_width = $bp_content_widths[ $theme_handle ]; + $bp_handle = 'bp-' . $theme_handle; + } + + if ( is_rtl() ) { + $bp_handle .= '-rtl'; + } + + $top_offset = 150; + $avatar_height = apply_filters( 'bp_core_avatar_full_height', $top_offset ); + + if ( $avatar_height > $top_offset ) { + $top_offset = $avatar_height; + } + + bp_set_theme_compat_feature( 'legacy', array( + 'name' => 'cover_image', + 'settings' => array( + 'components' => array( 'xprofile', 'groups' ), + 'width' => $bp_content_width, + 'height' => $top_offset + round( $avatar_height / 2 ), + 'callback' => 'bp_legacy_theme_cover_image', + 'theme_handle' => $bp_handle, + ), + ) ); +} + /** * Check whether a given template is the one that WP originally selected to display current page. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template The template name to check. * @return bool True if the value of $template is the same as the - * "original_template" originally selected by WP. Otherwise false. + * "original_template" originally selected by WP. Otherwise false. */ function bp_is_theme_compat_original_template( $template = '' ) { $bp = buddypress(); @@ -453,31 +514,31 @@ 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.0) + * @since 1.7.0 * * @see BP_Theme_Compat for a description of the $theme parameter arguments. * - * @param array $theme See {@link BP_Theme_Compat}. - * @param bool $override If true, overrides whatever package is currently set. - * Default: true. + * @param array $theme See {@link BP_Theme_Compat}. + * @param bool $override If true, overrides whatever package is currently set. + * Default: true. */ function bp_register_theme_package( $theme = array(), $override = true ) { - // Create new BP_Theme_Compat object from the $theme array + // Create new BP_Theme_Compat object from the $theme array. if ( is_array( $theme ) ) { $theme = new BP_Theme_Compat( $theme ); } - // Bail if $theme isn't a proper object + // Bail if $theme isn't a proper object. if ( ! is_a( $theme, 'BP_Theme_Compat' ) ) { return; } - // Load up BuddyPress + // Load up BuddyPress. $bp = buddypress(); // Only set if the theme package was not previously registered or if the - // override flag is set + // override flag is set. if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) { $bp->theme_compat->packages[$theme->id] = $theme; } @@ -491,18 +552,18 @@ function bp_register_theme_package( $theme = array(), $override = true ) { * (at least, no WordPress post content). By providing dummy data, we ensure * that template functions - things like is_page() - don't throw errors. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WP_Query $wp_query WordPress database access object. * @global object $post Current post object. * - * @param array $args Array of optional arguments. Arguments parallel the - * properties of {@link WP_Post}; see that class for more details. + * @param array $args Array of optional arguments. Arguments parallel the properties + * of {@link WP_Post}; see that class for more details. */ function bp_theme_compat_reset_post( $args = array() ) { global $wp_query, $post; - // Switch defaults if post is set + // Switch defaults if post is set. if ( isset( $wp_query->post ) ) { $dummy = wp_parse_args( $args, array( 'ID' => $wp_query->post->ID, @@ -571,19 +632,19 @@ function bp_theme_compat_reset_post( $args = array() ) { ) ); } - // Bail if dummy post is empty + // Bail if dummy post is empty. if ( empty( $dummy ) ) { return; } - // Set the $post global + // Set the $post global. $post = new WP_Post( (object) $dummy ); - // Copy the new post global into the main $wp_query + // Copy the new post global into the main $wp_query. $wp_query->post = $post; $wp_query->posts = array( $post ); - // Prevent comments form from appearing + // Prevent comments form from appearing. $wp_query->post_count = 1; $wp_query->is_404 = $dummy['is_404']; $wp_query->is_page = $dummy['is_page']; @@ -591,7 +652,7 @@ function bp_theme_compat_reset_post( $args = array() ) { $wp_query->is_archive = $dummy['is_archive']; $wp_query->is_tax = $dummy['is_tax']; - // Clean up the dummy post + // Clean up the dummy post. unset( $dummy ); /** @@ -603,17 +664,17 @@ function bp_theme_compat_reset_post( $args = array() ) { status_header( 200 ); } - // If we are resetting a post, we are in theme compat + // If we are resetting a post, we are in theme compat. bp_set_theme_compat_active( true ); - // If we are in theme compat, we don't need the 'Edit' post link + // If we are in theme compat, we don't need the 'Edit' post link. add_filter( 'get_edit_post_link', 'bp_core_filter_edit_post_link', 10, 2 ); } /** * Reset main query vars and filter 'the_content' to output a BuddyPress template part as needed. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses bp_is_single_user() To check if page is single user. * @uses bp_get_single_user_template() To get user template. @@ -650,11 +711,11 @@ function bp_template_include_theme_compat( $template = '' ) { * theme compatibility layer whether or not we're replacing the_content() * with some other template part. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_template_include_reset_dummy_post_data' ); - // Bail if the template already matches a BuddyPress template + // Bail if the template already matches a BuddyPress template. if ( ! empty( buddypress()->theme_compat->found_template ) ) { return $template; } @@ -681,7 +742,7 @@ function bp_template_include_theme_compat( $template = '' ) { add_filter( 'the_content', 'bp_replace_the_content' ); - // Add BuddyPress's head action to wp_head + // Add BuddyPress's head action to wp_head. if ( ! has_action( 'wp_head', 'bp_head' ) ) { add_action( 'wp_head', 'bp_head' ); } @@ -690,7 +751,7 @@ function bp_template_include_theme_compat( $template = '' ) { /** * Filters the template name to include. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $template Template name. */ @@ -704,14 +765,14 @@ function bp_template_include_theme_compat( $template = '' ) { * normally be handled by BuddyPress, but proper single page templates do not * exist in the currently active theme. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $content Original post content. * @return string $content Post content, potentially modified. */ function bp_replace_the_content( $content = '' ) { - // Bail if not the main loop where theme compat is happening + // Bail if not the main loop where theme compat is happening. if ( ! bp_do_theme_compat() ) { return $content; } @@ -723,36 +784,36 @@ function bp_replace_the_content( $content = '' ) { /** * Filters the content to replace in the post. * - * @since BuddyPress (1.7.0) + * @since 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 + // Juggle the content around and try to prevent unsightly comments. if ( ! empty( $new_content ) && ( $new_content !== $content ) ) { - // Set the content to be the new content + // Set the content to be the new content. $content = $new_content; - // Clean up after ourselves + // Clean up after ourselves. unset( $new_content ); - // Reset the $post global + // Reset the $post global. wp_reset_postdata(); } - // Return possibly hi-jacked content + // Return possibly hi-jacked content. return $content; } /** * Are we currently replacing the_content? * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @return bool True if the_content is currently in the process of being - * filtered and replaced. + * filtered and replaced. */ function bp_do_theme_compat() { return (bool) ( ! bp_is_template_included() && in_the_loop() && bp_is_theme_compat_active() ); @@ -766,15 +827,15 @@ function bp_do_theme_compat() { * Removed filters are stashed in the $bp global, in case they need to be * restored later. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WP_filter $wp_filter * @global array $merged_filters * - * @param string $tag The filter tag to remove filters from. - * @param int $priority Optional. If present, only those callbacks attached - * at a given priority will be removed. Otherwise, all callbacks - * attached to the tag will be removed, regardless of priority. + * @param string $tag The filter tag to remove filters from. + * @param int|bool $priority Optional. If present, only those callbacks attached + * at a given priority will be removed. Otherwise, all callbacks + * attached to the tag will be removed, regardless of priority. * @return bool True on success. */ function bp_remove_all_filters( $tag, $priority = false ) { @@ -782,36 +843,36 @@ function bp_remove_all_filters( $tag, $priority = false ) { $bp = buddypress(); - // Filters exist + // Filters exist. if ( isset( $wp_filter[$tag] ) ) { - // Filters exist in this priority + // Filters exist in this priority. if ( ! empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) { - // Store filters in a backup + // Store filters in a backup. $bp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority]; - // Unset the filters + // Unset the filters. unset( $wp_filter[$tag][$priority] ); - // Priority is empty + // Priority is empty. } else { - // Store filters in a backup + // Store filters in a backup. $bp->filters->wp_filter[$tag] = $wp_filter[$tag]; - // Unset the filters + // Unset the filters. unset( $wp_filter[$tag] ); } } - // Check merged filters + // Check merged filters. if ( isset( $merged_filters[$tag] ) ) { - // Store filters in a backup + // Store filters in a backup. $bp->filters->merged_filters[$tag] = $merged_filters[$tag]; - // Unset the filters + // Unset the filters. unset( $merged_filters[$tag] ); } @@ -821,16 +882,15 @@ function bp_remove_all_filters( $tag, $priority = false ) { /** * Restore filters that were removed using bp_remove_all_filters(). * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WP_filter $wp_filter * @global array $merged_filters * - * @param string $tag The tag to which filters should be restored. - * @param int $priority Optional. If present, only those filters that were - * originally attached to the tag with $priority will be restored. - * Otherwise, all available filters will be restored, regardless of - * priority. + * @param string $tag The tag to which filters should be restored. + * @param int|bool $priority Optional. If present, only those filters that were originally + * attached to the tag with $priority will be restored. Otherwise, + * all available filters will be restored, regardless of priority. * @return bool True on success. */ function bp_restore_all_filters( $tag, $priority = false ) { @@ -838,36 +898,36 @@ function bp_restore_all_filters( $tag, $priority = false ) { $bp = buddypress(); - // Filters exist + // Filters exist. if ( isset( $bp->filters->wp_filter[$tag] ) ) { - // Filters exist in this priority + // Filters exist in this priority. if ( ! empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) { - // Store filters in a backup + // Store filters in a backup. $wp_filter[$tag][$priority] = $bp->filters->wp_filter[$tag][$priority]; - // Unset the filters + // Unset the filters. unset( $bp->filters->wp_filter[$tag][$priority] ); - // Priority is empty + // Priority is empty. } else { - // Store filters in a backup + // Store filters in a backup. $wp_filter[$tag] = $bp->filters->wp_filter[$tag]; - // Unset the filters + // Unset the filters. unset( $bp->filters->wp_filter[$tag] ); } } - // Check merged filters + // Check merged filters. if ( isset( $bp->filters->merged_filters[$tag] ) ) { - // Store filters in a backup + // Store filters in a backup. $merged_filters[$tag] = $bp->filters->merged_filters[$tag]; - // Unset the filters + // Unset the filters. unset( $bp->filters->merged_filters[$tag] ); } @@ -877,10 +937,10 @@ function bp_restore_all_filters( $tag, $priority = false ) { /** * Force comments_status to 'closed' for BuddyPress post types. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param bool $open True if open, false if closed. - * @param int $post_id ID of the post to check. + * @param bool $open True if open, false if closed. + * @param int $post_id ID of the post to check. * @return bool True if open, false if closed. */ function bp_comments_open( $open, $post_id = 0 ) { @@ -890,7 +950,7 @@ function bp_comments_open( $open, $post_id = 0 ) { /** * Filters whether or not to force comments_status to closed for BuddyPress post types. * - * @since BuddyPress (1.7.0) + * @since 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. @@ -913,16 +973,17 @@ function bp_comments_open( $open, $post_id = 0 ) { * This is done during the output buffer as late as possible to prevent any * wonkiness. * - * @since BuddyPress (1.9.2) + * @since 1.9.2 * * @param string $retval The current post content. + * @return string $retval */ function bp_theme_compat_toggle_is_page( $retval = '' ) { global $wp_query; $wp_query->is_page = false; - // Set a switch so we know that we've toggled these WP_Query properties + // Set a switch so we know that we've toggled these WP_Query properties. buddypress()->theme_compat->is_page_toggled = true; return $retval; @@ -932,25 +993,25 @@ add_filter( 'bp_replace_the_content', 'bp_theme_compat_toggle_is_page', 9999 ); /** * Restores the 'is_single' and 'is_page' flags if toggled by BuddyPress. * - * @since BuddyPress (1.9.2) + * @since 1.9.2 * * @see bp_theme_compat_toggle_is_page() * @param object $query The WP_Query object. */ function bp_theme_compat_loop_end( $query ) { - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - // Bail if page is not toggled + // Bail if page is not toggled. if ( ! isset( $bp->theme_compat->is_page_toggled ) ) { return; } - // Revert our toggled WP_Query properties + // Revert our toggled WP_Query properties. $query->is_page = true; - // Unset our switch + // Unset our switch. unset( $bp->theme_compat->is_page_toggled ); } add_action( 'loop_end', 'bp_theme_compat_loop_end' ); 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 fb8e468ab6160cc43cb9c9934a482686ddba3583..7fbdd30807e459604bf32d31e4de6fb66cd1132e 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-update.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-update.php @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Updater. * * @package BuddyPress * @subpackage Updater + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit; * * If there is no raw DB version, we infer that this is the first installation. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @uses get_option() * @uses bp_get_db_version() To get BuddyPress's database version. @@ -33,7 +33,7 @@ function bp_is_install() { * number stored in the database. If the registered version is greater, it's * an update. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses get_option() * @uses bp_get_db_version() To get BuddyPress's database version. @@ -42,24 +42,25 @@ function bp_is_install() { */ function bp_is_update() { - // Current DB version of this site (per site in a multisite network) + // Current DB version of this site (per site in a multisite network). $current_db = bp_get_option( '_bp_db_version' ); $current_live = bp_get_db_version(); - // Compare versions (cast as int and bool to be safe) + // Compare versions (cast as int and bool to be safe). $is_update = (bool) ( (int) $current_db < (int) $current_live ); - // Return the product of version comparison + // Return the product of version comparison. return $is_update; } /** * Determine whether BuddyPress is in the process of being activated. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses buddypress() * + * @param string $basename BuddyPress basename. * @return bool True if activating BuddyPress, false if not. */ function bp_is_activation( $basename = '' ) { @@ -72,24 +73,24 @@ function bp_is_activation( $basename = '' ) { $action = $_REQUEST['action2']; } - // Bail if not activating + // Bail if not activating. if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) { return false; } - // The plugin(s) being activated + // The plugin(s) being activated. if ( $action == 'activate' ) { $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); } else { $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); } - // Set basename if empty + // Set basename if empty. if ( empty( $basename ) && !empty( $bp->basename ) ) { $basename = $bp->basename; } - // Bail if no basename + // Bail if no basename. if ( empty( $basename ) ) { return false; } @@ -101,10 +102,11 @@ function bp_is_activation( $basename = '' ) { /** * Determine whether BuddyPress is in the process of being deactivated. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses buddypress() * + * @param string $basename BuddyPress basename. * @return bool True if deactivating BuddyPress, false if not. */ function bp_is_deactivation( $basename = '' ) { @@ -117,24 +119,24 @@ function bp_is_deactivation( $basename = '' ) { $action = $_REQUEST['action2']; } - // Bail if not deactivating + // Bail if not deactivating. if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) { return false; } - // The plugin(s) being deactivated + // The plugin(s) being deactivated. if ( 'deactivate' == $action ) { $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); } else { $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); } - // Set basename if empty + // Set basename if empty. if ( empty( $basename ) && !empty( $bp->basename ) ) { $basename = $bp->basename; } - // Bail if no basename + // Bail if no basename. if ( empty( $basename ) ) { return false; } @@ -146,7 +148,7 @@ function bp_is_deactivation( $basename = '' ) { /** * Update the BP version stored in the database to the current version. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses bp_get_db_version() To get BuddyPress's database version. * @uses bp_update_option() To update BuddyPress's database version. @@ -158,7 +160,7 @@ function bp_version_bump() { /** * Set up the BuddyPress updater. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_setup_updater() { @@ -180,17 +182,17 @@ function bp_setup_updater() { * This is most often used when the data schema changes, but should also be used * to correct issues with BuddyPress metadata silently on software update. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_version_updater() { - // Get the raw database version + // 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) + * @since 1.7.0 * * @param array $value Array of default components to activate. */ @@ -203,19 +205,29 @@ function bp_version_updater() { ) ); require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); + $switched_to_root_blog = false; + + // Make sure the current blog is set to the root blog + if ( ! bp_is_root_blog() ) { + switch_to_blog( bp_get_root_blog_id() ); + bp_register_taxonomies(); - // Install BP schema and activate only Activity and XProfile + $switched_to_root_blog = true; + } + + // Install BP schema and activate only Activity and XProfile. if ( bp_is_install() ) { - // Apply schema and set Activity and XProfile components as active + // Apply schema and set Activity and XProfile components as active. bp_core_install( $default_components ); bp_update_option( 'bp-active-components', $default_components ); bp_core_add_page_mappings( $default_components, 'delete' ); + bp_core_install_emails(); - // Upgrades + // Upgrades. } else { - // Run the schema install to update tables + // Run the schema install to update tables. bp_core_install(); // 1.5.0 @@ -258,12 +270,21 @@ function bp_version_updater() { if ( $raw_db_version < 9615 ) { bp_update_to_2_3(); } + + // 2.5.0 + if ( $raw_db_version < 10440 ) { + bp_update_to_2_5(); + } } - /** All done! *************************************************************/ + /* All done! *************************************************************/ - // Bump the version + // Bump the version. bp_version_bump(); + + if ( $switched_to_root_blog ) { + restore_current_blog(); + } } /** @@ -271,7 +292,7 @@ function bp_version_updater() { * * `dbDelta()` cannot handle certain operations - like changing indexes - so we do it here instead. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_pre_schema_upgrade() { global $wpdb; @@ -281,7 +302,7 @@ function bp_pre_schema_upgrade() { // 2.3.0: Change index lengths to account for utf8mb4. if ( $raw_db_version < 9695 ) { - // table_name => columns. + // Map table_name => columns. $tables = array( $bp_prefix . 'bp_activity_meta' => array( 'meta_key' ), $bp_prefix . 'bp_groups_groupmeta' => array( 'meta_key' ), @@ -308,11 +329,11 @@ function bp_pre_schema_upgrade() { * * Database update methods based on version numbers. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_update_to_1_5() { - // Delete old database version options + // Delete old database version options. delete_site_option( 'bp-activity-db-version' ); delete_site_option( 'bp-blogs-db-version' ); delete_site_option( 'bp-friends-db-version' ); @@ -326,17 +347,17 @@ function bp_update_to_1_5() { * * Database update methods based on version numbers. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_update_to_1_6() { - // Delete possible site options + // Delete possible site options. delete_site_option( 'bp-db-version' ); delete_site_option( '_bp_db_version' ); delete_site_option( 'bp-core-db-version' ); delete_site_option( '_bp-core-db-version' ); - // Delete possible blog options + // Delete possible blog options. delete_blog_option( bp_get_root_blog_id(), 'bp-db-version' ); delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version' ); delete_site_option( bp_get_root_blog_id(), '_bp-core-db-version' ); @@ -350,23 +371,23 @@ function bp_update_to_1_6() { * have the core notifications API active. We need to add the new Notifications * component to the active components option to retain existing functionality. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_update_to_1_9() { - // Setup hardcoded keys + // Setup hardcoded keys. $active_components_key = 'bp-active-components'; $notifications_component_id = 'notifications'; - // Get the active components + // Get the active components. $active_components = bp_get_option( $active_components_key ); - // Add notifications + // Add notifications. if ( ! in_array( $notifications_component_id, $active_components ) ) { $active_components[ $notifications_component_id ] = 1; } - // Update the active components option + // Update the active components option. bp_update_option( $active_components_key, $active_components ); } @@ -384,7 +405,7 @@ function bp_update_to_1_9() { * deactivated temporarily. Thus, new installations will not see bp-default, * but legacy installations using the theme will continue to see it. * - * @since BuddyPress (1.9.2) + * @since 1.9.2 */ function bp_update_to_1_9_2() { if ( 'bp-default' === get_stylesheet() || 'bp-default' === get_template() ) { @@ -396,41 +417,41 @@ function bp_update_to_1_9_2() { * 2.0 update routine. * * - Ensure that the activity tables are installed, for last_activity storage. - * - Migrate last_activity data from usermeta to activity table - * - Add values for all BuddyPress options to the options table + * - Migrate last_activity data from usermeta to activity table. + * - Add values for all BuddyPress options to the options table. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_update_to_2_0() { - /** Install activity tables for 'last_activity' ***************************/ + /* Install activity tables for 'last_activity' ***************************/ bp_core_install_activity_streams(); - /** Migrate 'last_activity' data ******************************************/ + /* Migrate 'last_activity' data ******************************************/ bp_last_activity_migrate(); - /** Migrate signups data **************************************************/ + /* Migrate signups data **************************************************/ if ( ! is_multisite() ) { - // Maybe install the signups table + // Maybe install the signups table. bp_core_maybe_install_signups(); - // Run the migration script + // Run the migration script. bp_members_migrate_signups(); } - /** Add BP options to the options table ***********************************/ + /* Add BP options to the options table ***********************************/ bp_add_options(); } /** - * 2.0.1 database upgrade routine + * 2.0.1 database upgrade routine. * - * @since BuddyPress (2.0.1) + * @since 2.0.1 * * @return void */ @@ -444,15 +465,15 @@ function bp_update_to_2_0_1() { /** * 2.2.0 update routine. * - * - Add messages meta table - * - Update the component field of the 'new members' activity type - * - Clean up hidden friendship activities + * - Add messages meta table. + * - Update the component field of the 'new members' activity type. + * - Clean up hidden friendship activities. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_update_to_2_2() { - // Also handled by `bp_core_install()` + // Also handled by `bp_core_install()`. if ( bp_is_active( 'messages' ) ) { bp_core_install_private_messaging(); } @@ -469,34 +490,44 @@ function bp_update_to_2_2() { /** * 2.3.0 update routine. * - * - Add notifications meta table + * - Add notifications meta table. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_update_to_2_3() { - // Also handled by `bp_core_install()` + // Also handled by `bp_core_install()`. if ( bp_is_active( 'notifications' ) ) { bp_core_install_notifications(); } } +/** + * 2.5.0 update routine. + * + * - Add emails. + * + * @since 2.5.0 + */ +function bp_update_to_2_5() { + bp_core_install_emails(); +} + /** * Updates the component field for new_members type. * - * @since BuddyPress (2.2.0) + * @since 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 + // Update the component for the new_member type. $wpdb->update( - // Activity table + // Activity table. $bp->members->table_name_last_activity, array( 'component' => $bp->members->id, @@ -505,11 +536,11 @@ function bp_migrate_new_member_activity_component() { 'component' => 'xprofile', 'type' => 'new_member', ), - // Data sanitization format + // Data sanitization format. array( '%s', ), - // WHERE sanitization format + // WHERE sanitization format. array( '%s', '%s' @@ -518,11 +549,11 @@ function bp_migrate_new_member_activity_component() { } /** - * Remove all hidden friendship activities + * Remove all hidden friendship activities. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @uses bp_activity_delete() to delete the corresponding friendship activities + * @uses bp_activity_delete() to delete the corresponding friendship activities. */ function bp_cleanup_friendship_activities() { bp_activity_delete( array( @@ -530,12 +561,12 @@ function bp_cleanup_friendship_activities() { 'type' => 'friendship_created', 'hide_sitewide' => true, ) ); - } +} /** * Redirect user to BP's What's New page on first page load after activation. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @internal Used internally to redirect BuddyPress to the about page on activation. * @@ -543,18 +574,18 @@ function bp_cleanup_friendship_activities() { */ function bp_add_activation_redirect() { - // Bail if activating from network, or bulk + // Bail if activating from network, or bulk. if ( isset( $_GET['activate-multi'] ) ) { return; } // Record that this is a new installation, so we show the right - // welcome message + // welcome message. if ( bp_is_install() ) { set_transient( '_bp_is_new_install', true, 30 ); } - // Add the transient to redirect + // Add the transient to redirect. set_transient( '_bp_activation_redirect', true, 30 ); } @@ -563,28 +594,26 @@ function bp_add_activation_redirect() { /** * Check if the signups table needs to be created or upgraded. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @global WPDB $wpdb - * - * @return bool If signups table exists */ function bp_core_maybe_install_signups() { global $wpdb; - // The table to run queries against + // The table to run queries against. $signups_table = $wpdb->base_prefix . 'signups'; - // Suppress errors because users shouldn't see what happens next + // Suppress errors because users shouldn't see what happens next. $old_suppress = $wpdb->suppress_errors(); - // Never use bp_core_get_table_prefix() for any global users tables + // Never use bp_core_get_table_prefix() for any global users tables. $table_exists = (bool) $wpdb->get_results( "DESCRIBE {$signups_table};" ); // Table already exists, so maybe upgrade instead? if ( true === $table_exists ) { - // Look for the 'signup_id' column + // Look for the 'signup_id' column. $column_exists = $wpdb->query( "SHOW COLUMNS FROM {$signups_table} LIKE 'signup_id'" ); // 'signup_id' column doesn't exist, so run the upgrade @@ -598,7 +627,7 @@ function bp_core_maybe_install_signups() { bp_core_install_signups(); } - // Restore previous error suppression setting + // Restore previous error suppression setting. $wpdb->suppress_errors( $old_suppress ); } @@ -609,7 +638,7 @@ function bp_core_maybe_install_signups() { * * Runs on BuddyPress activation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_activation' hook. */ @@ -618,7 +647,7 @@ function bp_activation() { // Force refresh theme roots. delete_site_transient( 'theme_roots' ); - // Add options + // Add options. bp_add_options(); /** @@ -626,7 +655,7 @@ function bp_activation() { * * Use as of (1.6.0) * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_activation' ); @@ -639,7 +668,7 @@ function bp_activation() { * * Runs on BuddyPress deactivation. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_deactivation' hook. */ @@ -661,7 +690,7 @@ function bp_deactivation() { * * Use as of (1.6.0) * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_deactivation' ); @@ -674,7 +703,7 @@ function bp_deactivation() { * * Runs when uninstalling BuddyPress. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses do_action() Calls 'bp_uninstall' hook. */ @@ -683,7 +712,7 @@ function bp_uninstall() { /** * Fires during the uninstallation of BuddyPress. * - * @since BuddyPress (1.6.0) + * @since 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 48a29e217411364dd2e88e11bfcc49028482a124..6088747496f244a652d2541b8aab6d14360ffbee 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php @@ -4,174 +4,20 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-core-login-widget.php'; + /** * Register bp-core widgets. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ function bp_core_register_widgets() { add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");') ); } add_action( 'bp_register_widgets', 'bp_core_register_widgets' ); - -/** - * BuddyPress Login Widget. - * - * @since BuddyPress (1.9.0) - */ -class BP_Core_Login_Widget extends WP_Widget { - - /** - * Constructor method. - */ - public function __construct() { - parent::__construct( - false, - _x( '(BuddyPress) Log In', 'Title of the login widget', 'buddypress' ), - array( - 'description' => __( 'Show a Log In form to logged-out visitors, and a Log Out link to those who are logged in.', 'buddypress' ), - 'classname' => 'widget_bp_core_login_widget buddypress widget', - ) - ); - } - - /** - * Display the login 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 ) { - $title = isset( $instance['title'] ) ? $instance['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']; - - echo $args['before_title'] . esc_html( $title ) . $args['after_title']; ?> - - <?php if ( is_user_logged_in() ) : ?> - - <?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(); ?>"> - <?php bp_loggedin_user_avatar( 'type=thumb&width=50&height=50' ); ?> - </a> - </div> - - <div class="bp-login-widget-user-links"> - <div class="bp-login-widget-user-link"><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></div> - <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 - - /** - * 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 - - /** - * 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="" <?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> - - <input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php esc_attr_e( 'Log In', 'buddypress' ); ?>" /> - - <?php if ( bp_get_signup_allowed() ) : ?> - - <span class="bp-login-widget-register-link"><?php printf( __( '<a href="%s" title="Register for a new account">Register</a>', 'buddypress' ), bp_get_signup_page() ); ?></span> - - <?php endif; ?> - - </form> - - <?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; - - echo $args['after_widget']; - } - - /** - * Update the login 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'] = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; - - return $instance; - } - - /** - * Output the login widget options form. - * - * @param $instance Settings for this widget. - */ - public function form( $instance = array() ) { - - $settings = wp_parse_args( $instance, array( - 'title' => '', - ) ); ?> - - <p> - <label for="<?php echo $this->get_field_id( '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( $settings['title'] ); ?>" /></label> - </p> - - <?php - } -} 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 7344245f580c0d25a96d4868aaeeb9cd64caf8fe..4ec75c58cc62effed612d12208ec441bf5ebb9c2 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php @@ -7,17 +7,22 @@ * * The code below mostly contains function mappings. This file is subject to * change at any time. + * + * @package BuddyPress + * @subpackage WPAbstraction + * @since 1.2.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Parse the WordPress core version number into the major release. * - * @since BuddyPress (1.5.2) + * @since 1.5.2 * * @global string $wp_version + * * @return string $wp_version */ function bp_get_major_wp_version() { @@ -26,8 +31,8 @@ function bp_get_major_wp_version() { return (float) $wp_version; } -/** - * Only add MS-specific abstraction functions if WordPress is not in multisite mode +/* + * Only add MS-specific abstraction functions if WordPress is not in multisite mode. */ if ( !is_multisite() ) { global $wpdb; @@ -36,8 +41,19 @@ if ( !is_multisite() ) { $wpdb->blogid = BP_ROOT_BLOG; if ( !function_exists( 'get_blog_option' ) ) { + /** + * Retrieve blog option. + * + * @since 1.0.0 + * * @see get_blog_option() + * + * @param int $blog_id Blog ID to fetch for. Not used. + * @param string $option_name Option name to fetch. + * @param bool $default Whether or not default. + * + * @return mixed */ function get_blog_option( $blog_id, $option_name, $default = false ) { return get_option( $option_name, $default ); @@ -45,8 +61,19 @@ if ( !is_multisite() ) { } if ( ! function_exists( 'add_blog_option' ) ) { + /** + * Add blog option. + * + * @since 1.2.0 + * * @see add_blog_option() + * + * @param int $blog_id Blog ID to add for. Not used. + * @param string $option_name Option name to add. + * @param mixed $option_value Option value to add. + * + * @return mixed */ function add_blog_option( $blog_id, $option_name, $option_value ) { return add_option( $option_name, $option_value ); @@ -54,8 +81,19 @@ if ( !is_multisite() ) { } if ( !function_exists( 'update_blog_option' ) ) { + /** + * Update blog option. + * + * @since 1.2.0 + * * @see update_blog_option() + * + * @param int $blog_id Blog ID to update for. Not used. + * @param string $option_name Option name to update. + * @param mixed $value Option value to update. + * + * @return mixed */ function update_blog_option( $blog_id, $option_name, $value ) { return update_option( $option_name, $value ); @@ -63,8 +101,18 @@ if ( !is_multisite() ) { } if ( !function_exists( 'delete_blog_option' ) ) { + /** + * Delete blog option. + * + * @since 1.5.0 + * * @see delete_blog_option() + * + * @param int $blog_id Blog ID to delete for. Not used. + * @param string $option_name Option name to delete. + * + * @return mixed */ function delete_blog_option( $blog_id, $option_name ) { return delete_option( $option_name ); @@ -72,8 +120,18 @@ if ( !is_multisite() ) { } if ( !function_exists( 'switch_to_blog' ) ) { + /** + * Switch to specified blog. + * + * @since 1.2.0 + * * @see switch_to_blog() + * + * @param mixed $new_blog New blog to switch to. Not used. + * @param null $deprecated Whether or not deprecated. Not used. + * + * @return int */ function switch_to_blog( $new_blog, $deprecated = null ) { return bp_get_root_blog_id(); @@ -81,8 +139,15 @@ if ( !is_multisite() ) { } if ( !function_exists( 'restore_current_blog' ) ) { + /** + * Restore current blog. + * + * @since 1.2.0 + * * @see restore_current_blog() + * + * @return int */ function restore_current_blog() { return bp_get_root_blog_id(); @@ -90,8 +155,18 @@ if ( !is_multisite() ) { } if ( !function_exists( 'get_blogs_of_user' ) ) { + /** + * Retrive blogs associated with user. + * + * @since 1.2.0 + * * @see get_blogs_of_user() + * + * @param int $user_id ID of the user. Not used. + * @param bool $all Whether or not to return all. Not used. + * + * @return false */ function get_blogs_of_user( $user_id, $all = false ) { return false; @@ -99,8 +174,20 @@ if ( !is_multisite() ) { } if ( !function_exists( 'update_blog_status' ) ) { + /** + * Whether or not to update blog status. + * + * @since 1.2.0 + * * @see update_blog_status() + * + * @param int $blog_id Blog to update status for. Not used. + * @param mixed $pref Preference. Not used. + * @param string $value Value. Not used. + * @param null $deprecated Whether or not deprecated. Not used. + * + * @return true */ function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) { return true; @@ -108,8 +195,15 @@ if ( !is_multisite() ) { } if ( !function_exists( 'is_subdomain_install' ) ) { + /** + * Whether or not if subdomain install. + * + * @since 1.2.5.1 + * * @see is_subdomain_install() + * + * @return bool */ function is_subdomain_install() { if ( ( defined( 'VHOST' ) && 'yes' == VHOST ) || ( defined( 'SUBDOMAIN_INSTALL' ) && SUBDOMAIN_INSTALL ) ) @@ -126,7 +220,7 @@ if ( !is_multisite() ) { * @internal * @todo Why is this function defined in this file? * - * @param string $prefix Global table prefix. + * @param string|bool $prefix Global table prefix. * @return string SQL chunk. */ function bp_core_get_status_sql( $prefix = false ) { @@ -137,7 +231,7 @@ function bp_core_get_status_sql( $prefix = false ) { } /** - * Multibyte encoding fallback functions + * Multibyte encoding fallback functions. * * The PHP multibyte encoding extension is not enabled by default. In cases where it is not enabled, * these functions provide a fallback. @@ -145,6 +239,7 @@ function bp_core_get_status_sql( $prefix = false ) { * Borrowed from MediaWiki, under the GPLv2. Thanks! */ if ( !function_exists( 'mb_strlen' ) ) { + /** * Fallback implementation of mb_strlen(), hardcoded to UTF-8. * @@ -156,12 +251,12 @@ if ( !function_exists( 'mb_strlen' ) ) { $counts = count_chars( $str ); $total = 0; - // Count ASCII bytes + // Count ASCII bytes. for( $i = 0; $i < 0x80; $i++ ) { $total += $counts[$i]; } - // Count multibyte sequence heads + // Count multibyte sequence heads. for( $i = 0xc0; $i < 0xff; $i++ ) { $total += $counts[$i]; } @@ -170,13 +265,14 @@ if ( !function_exists( 'mb_strlen' ) ) { } if ( !function_exists( 'mb_strpos' ) ) { + /** * Fallback implementation of mb_strpos(), hardcoded to UTF-8. * * @param string $haystack String to search in. * @param string $needle String to search for. - * @param int $offset Optional. Start position for the search. Default: 0. - * @param string $enc Optional. Encoding type. Ignored. + * @param int $offset Optional. Start position for the search. Default: 0. + * @param string $encoding Optional. Encoding type. Ignored. * @return int|bool Position of needle in haystack if found, else false. */ function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) { @@ -194,13 +290,14 @@ if ( !function_exists( 'mb_strpos' ) ) { } if ( !function_exists( 'mb_strrpos' ) ) { + /** * Fallback implementation of mb_strrpos(), hardcoded to UTF-8. * * @param string $haystack String to search in. * @param string $needle String to search for. - * @param int $offset Optional. Start position for the search. Default: 0. - * @param string $enc Optional. Encoding type. Ignored. + * @param int $offset Optional. Start position for the search. Default: 0. + * @param string $encoding Optional. Encoding type. Ignored. * @return int Position of last needle in haystack if found, else false. */ function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) { diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-admin.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-admin.php new file mode 100644 index 0000000000000000000000000000000000000000..a989439118bb0b235719e6623389081a8e91f622 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-admin.php @@ -0,0 +1,1049 @@ +<?php +/** + * Main BuddyPress Admin Class. + * + * @package BuddyPress + * @subpackage CoreAdministration + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +if ( !class_exists( 'BP_Admin' ) ) : + +/** + * Load BuddyPress plugin admin area. + * + * @todo Break this apart into each applicable Component. + * + * @since 1.6.0 + */ +class BP_Admin { + + /** Directory *************************************************************/ + + /** + * Path to the BuddyPress admin directory. + * + * @since 1.6.0 + * @var string $admin_dir + */ + public $admin_dir = ''; + + /** URLs ******************************************************************/ + + /** + * URL to the BuddyPress admin directory. + * + * @since 1.6.0 + * @var string $admin_url + */ + public $admin_url = ''; + + /** + * URL to the BuddyPress images directory. + * + * @since 1.6.0 + * @var string $images_url + */ + public $images_url = ''; + + /** + * URL to the BuddyPress admin CSS directory. + * + * @since 1.6.0 + * @var string $css_url + */ + public $css_url = ''; + + /** + * URL to the BuddyPress admin JS directory. + * + * @since 1.6.0 + * @var string + */ + public $js_url = ''; + + /** Other *****************************************************************/ + + /** + * Notices used for user feedback, like saving settings. + * + * @since 1.9.0 + * @var array() + */ + public $notices = array(); + + /** Methods ***************************************************************/ + + /** + * The main BuddyPress admin loader. + * + * @since 1.6.0 + * + * @uses BP_Admin::setup_globals() Setup the globals needed. + * @uses BP_Admin::includes() Include the required files. + * @uses BP_Admin::setup_actions() Setup the hooks and actions. + */ + public function __construct() { + $this->setup_globals(); + $this->includes(); + $this->setup_actions(); + } + + /** + * Set admin-related globals. + * + * @since 1.6.0 + */ + private function setup_globals() { + $bp = buddypress(); + + // Paths and URLs + $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path. + $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url. + $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL. + $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL. + $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL. + + // Main settings page. + $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; + + // Main capability. + $this->capability = bp_core_do_network_admin() ? 'manage_network_options' : 'manage_options'; + } + + /** + * Include required files. + * + * @since 1.6.0 + */ + private function includes() { + require( $this->admin_dir . 'bp-core-admin-classes.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' ); + } + + /** + * Set up the admin hooks, actions, and filters. + * + * @since 1.6.0 + * + * @uses add_action() To add various actions. + * @uses add_filter() To add various filters. + */ + private function setup_actions() { + + /* General Actions ***************************************************/ + + // Add some page specific output to the <head>. + add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); + + // Add menu item to settings menu. + add_action( 'admin_menu', array( $this, 'site_admin_menus' ), 5 ); + add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); + + // Enqueue all admin JS and CSS. + add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_styles' ), 1 ); + add_action( 'bp_admin_enqueue_scripts', array( $this, 'admin_register_scripts' ), 1 ); + add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + + /* BuddyPress Actions ************************************************/ + + // Load the BuddyPress metabox in the WP Nav Menu Admin UI. + add_action( 'load-nav-menus.php', 'bp_admin_wp_nav_menu_meta_box' ); + + // Add settings. + add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) ); + + // Add a link to BuddyPress About page to the admin bar. + 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( 'bp_network_tool_box', 'bp_core_admin_available_tools_intro' ); + + // On non-multisite, catch. + add_action( 'load-users.php', 'bp_core_admin_user_manage_spammers' ); + + /* Filters ***********************************************************/ + + // Add link to settings page. + add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); + add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); + + // Add "Mark as Spam" row actions on users.php. + add_filter( 'ms_user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); + add_filter( 'user_row_actions', 'bp_core_admin_user_row_actions', 10, 2 ); + + // Emails + add_filter( 'bp_admin_menu_order', array( $this, 'emails_admin_menu_order' ), 20 ); + } + + /** + * Register site- or network-admin nav menu elements. + * + * Contextually hooked to site or network-admin depending on current configuration. + * + * @since 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 + * section. + */ + public function admin_menus() { + + // Bail if user cannot moderate. + if ( ! bp_current_user_can( 'manage_options' ) ) { + return; + } + + // About. + add_dashboard_page( + __( 'Welcome to BuddyPress', 'buddypress' ), + __( 'Welcome to BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-about', + array( $this, 'about_screen' ) + ); + + // Credits. + add_dashboard_page( + __( 'Welcome to BuddyPress', 'buddypress' ), + __( 'Welcome to BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-credits', + array( $this, 'credits_screen' ) + ); + + $hooks = array(); + + // Changed in BP 1.6 . See bp_core_admin_backpat_menu(). + $hooks[] = add_menu_page( + __( 'BuddyPress', 'buddypress' ), + __( 'BuddyPress', 'buddypress' ), + $this->capability, + 'bp-general-settings', + 'bp_core_admin_backpat_menu', + 'div' + ); + + $hooks[] = add_submenu_page( + 'bp-general-settings', + __( 'BuddyPress Help', 'buddypress' ), + __( 'Help', 'buddypress' ), + $this->capability, + 'bp-general-settings', + 'bp_core_admin_backpat_page' + ); + + // Add the option pages. + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Components', 'buddypress' ), + __( 'BuddyPress', 'buddypress' ), + $this->capability, + 'bp-components', + 'bp_core_admin_components_settings' + ); + + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Pages', 'buddypress' ), + __( 'BuddyPress Pages', 'buddypress' ), + $this->capability, + 'bp-page-settings', + 'bp_core_admin_slugs_settings' + ); + + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Options', 'buddypress' ), + __( 'BuddyPress Options', 'buddypress' ), + $this->capability, + 'bp-settings', + 'bp_core_admin_settings' + ); + + // For consistency with non-Multisite, we add a Tools menu in + // the Network Admin as a home for our Tools panel. + if ( is_multisite() && bp_core_do_network_admin() ) { + $tools_parent = 'network-tools'; + + $hooks[] = add_menu_page( + __( 'Tools', 'buddypress' ), + __( 'Tools', 'buddypress' ), + $this->capability, + $tools_parent, + 'bp_core_tools_top_level_item', + '', + 24 // Just above Settings. + ); + + $hooks[] = add_submenu_page( + $tools_parent, + __( 'Available Tools', 'buddypress' ), + __( 'Available Tools', 'buddypress' ), + $this->capability, + 'available-tools', + 'bp_core_admin_available_tools_page' + ); + } else { + $tools_parent = 'tools.php'; + } + + $hooks[] = add_submenu_page( + $tools_parent, + __( 'BuddyPress Tools', 'buddypress' ), + __( 'BuddyPress', 'buddypress' ), + $this->capability, + 'bp-tools', + 'bp_core_admin_tools' + ); + + // For network-wide configs, add a link to (the root site's) Emails screen. + if ( is_network_admin() && bp_is_network_activated() ) { + $email_labels = bp_get_email_post_type_labels(); + $email_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ); + + $hooks[] = add_menu_page( + $email_labels['name'], + $email_labels['menu_name'], + $this->capability, + '', + '', + 'dashicons-email', + 26 + ); + + // Hack: change the link to point to the root site's admin, not the network admin. + $GLOBALS['menu'][26][2] = esc_url_raw( $email_url ); + } + + foreach( $hooks as $hook ) { + add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); + } + } + + /** + * Register site-admin nav menu elements. + * + * @since 2.5.0 + */ + public function site_admin_menus() { + if ( ! bp_current_user_can( 'manage_options' ) ) { + return; + } + + $hooks = array(); + + // Require WP 4.0+. + if ( bp_is_root_blog() && version_compare( $GLOBALS['wp_version'], '4.0', '>=' ) ) { + // Appearance > Emails. + $hooks[] = add_theme_page( + _x( 'Emails', 'screen heading', 'buddypress' ), + _x( 'Emails', 'screen heading', 'buddypress' ), + $this->capability, + 'bp-emails-customizer-redirect', + 'bp_email_redirect_to_customizer' + ); + + // Emails > Customize. + $hooks[] = add_submenu_page( + 'edit.php?post_type=' . bp_get_email_post_type(), + _x( 'Customize', 'email menu label', 'buddypress' ), + _x( 'Customize', 'email menu label', 'buddypress' ), + $this->capability, + 'bp-emails-customizer-redirect', + 'bp_email_redirect_to_customizer' + ); + } + + foreach( $hooks as $hook ) { + add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); + } + } + + /** + * Register the settings. + * + * @since 1.6.0 + * + * @uses add_settings_section() To add our own settings section. + * @uses add_settings_field() To add various settings fields. + * @uses register_setting() To register various settings. + */ + public function register_admin_settings() { + + /* Main Section ******************************************************/ + + // Add the main section. + 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' ); + + // 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 ) ) { + add_settings_field( '_bp_force_buddybar', __( 'Toolbar', 'buddypress' ), 'bp_admin_setting_callback_force_buddybar', 'buddypress', 'bp_main' ); + register_setting( 'buddypress', '_bp_force_buddybar', 'bp_admin_sanitize_callback_force_buddybar' ); + } + + // 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' ); + + /* XProfile Section **************************************************/ + + if ( bp_is_active( 'xprofile' ) ) { + + // Add the main section. + add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); + + // Avatars. + 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' ); + + // Cover images. + if ( bp_is_active( 'xprofile', 'cover_image' ) ) { + add_settings_field( 'bp-disable-cover-image-uploads', __( 'Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_cover_image_uploads', 'buddypress', 'bp_xprofile' ); + register_setting( 'buddypress', 'bp-disable-cover-image-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' ); + } + + /* Groups Section ****************************************************/ + + if ( bp_is_active( 'groups' ) ) { + + // Add the main section. + 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' ); + + // 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' ); + + // Allow group cover images. + if ( bp_is_active( 'groups', 'cover_image' ) ) { + add_settings_field( 'bp-disable-group-cover-image-uploads', __( 'Group Cover Image Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_cover_image_uploads', 'buddypress', 'bp_groups' ); + register_setting( 'buddypress', 'bp-disable-group-cover-image-uploads', 'intval' ); + } + } + + /* Forums ************************************************************/ + + 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' ); + + // 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', '' ); + } + + /* Activity Section **************************************************/ + + if ( bp_is_active( 'activity' ) ) { + + // Add the main section. + 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 & Forum Comments', 'buddypress' ), 'bp_admin_setting_callback_blogforum_comments', 'buddypress', 'bp_activity' ); + register_setting( 'buddypress', 'bp-disable-blogforum-comments', 'bp_admin_sanitize_callback_blogforum_comments' ); + + // Activity Heartbeat refresh. + add_settings_field( '_bp_enable_heartbeat_refresh', __( 'Activity auto-refresh', 'buddypress' ), 'bp_admin_setting_callback_heartbeat', 'buddypress', 'bp_activity' ); + register_setting( 'buddypress', '_bp_enable_heartbeat_refresh', 'intval' ); + + // 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 a link to BuddyPress About page to the admin bar. + * + * @since 1.9.0 + * + * @param WP_Admin_Bar $wp_admin_bar As passed to 'admin_bar_menu'. + */ + public function admin_bar_about_link( $wp_admin_bar ) { + if ( is_user_logged_in() ) { + $wp_admin_bar->add_menu( array( + 'parent' => 'wp-logo', + 'id' => 'bp-about', + 'title' => esc_html__( 'About BuddyPress', 'buddypress' ), + 'href' => add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ), + ) ); + } + } + + /** + * Add Settings link to plugins area. + * + * @since 1.6.0 + * + * @param array $links Links array in which we would prepend our link. + * @param string $file Current plugin basename. + * @return array Processed links. + */ + public function modify_plugin_action_links( $links, $file ) { + + // Return normal links if not BuddyPress. + 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="' . 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>' + ) ); + } + + /** + * Add some general styling to the admin area. + * + * @since 1.6.0 + */ + public function admin_head() { + + // Settings pages. + remove_submenu_page( $this->settings_page, 'bp-page-settings' ); + remove_submenu_page( $this->settings_page, 'bp-settings' ); + + // Network Admin Tools. + remove_submenu_page( 'network-tools', 'network-tools' ); + + // About and Credits pages. + remove_submenu_page( 'index.php', 'bp-about' ); + remove_submenu_page( 'index.php', 'bp-credits' ); + } + + /** + * Add some general styling to the admin area. + * + * @since 1.6.0 + */ + public function enqueue_scripts() { + wp_enqueue_style( 'bp-admin-common-css' ); + } + + /** About *****************************************************************/ + + /** + * Output the about screen. + * + * @since 1.7.0 + */ + public function about_screen() { + ?> + + <div class="wrap about-wrap"> + + <?php self::welcome_text(); ?> + + <?php self::tab_navigation( __METHOD__ ); ?> + + <?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> + <ul> + <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>', 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>', 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> + </div> + <div class="welcome-panel-column"> + <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>', 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>', 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>', 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>', 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>', 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="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’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> + </div> + + <?php endif; ?> + + <div class="headline-feature"> + <h3 class="headline-title"><?php esc_html_e( 'Customizable BuddyPress Emails', 'buddypress' ); ?></h3> + + <div class="featured-image"> + <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/bp-emails-feature.png' ); ?>" alt="<?php esc_html_e( 'Change colors of the email template using the Customizer.', 'buddypress' ); ?>"> + </div> + + <p class="introduction"><?php _e( 'Keep your users coming back with beautiful and flexible email notifications.', 'buddypress' ); ?> </p> + <p><?php _e( 'Edit the content of your emails, create new email templates, or change the design of the template in the Customizer. These are just a few of the customizations you can make to engage your users and increase their participation in your community with the new email features.', 'buddypress' ); ?> <a href="https://codex.buddypress.org/emails/"><?php esc_html_e( 'Learn more →', 'buddypress' ); ?></a></p> + + <div class="clear"></div> + </div> + + <hr /> + + <div class="bp-features-section"> + + <div class="feature-section two-col"> + <div> + <h3 class="feature-title"><?php esc_html_e( 'Post Type Comments Tracking', 'buddypress' ); ?></h3> + <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/post-type.png' ); ?>" alt="<?php esc_attr_e( 'Registered post types', 'buddypress' ); ?>"> + <p><?php esc_html_e( 'New Activity functions help you track post type comments in sync with the Blogs component when activated.', 'buddypress' ); ?></p> + </div> + <div class="last-feature"> + <h3 class="feature-title"><?php esc_html_e( 'Twenty Twelve Companion Stylesheet', 'buddypress' ); ?></h3> + <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/twentytwelve.png' ); ?>" alt="<?php esc_attr_e( 'BuddyPress styles Twenty Twelve', 'buddypress' ); ?>"> + <p><?php esc_html_e( 'BuddyPress components never looked so fine as they do now in the Twenty Twelve theme.', 'buddypress' ); ?></p> + </div> + </div> + + <div class="feature-section two-col"> + <div> + <h3 class="feature-title"><?php esc_html_e( 'Support for Emojis', 'buddypress' ); ?></h3> + <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/emoji-feature.png' ); ?>" alt="<?php esc_attr_e( 'Fun with Emojies', 'buddypress' ); ?>"> + <p><?php esc_html_e( 'Have fun and be merry! You can now use Emojis in activity updates, messages, and group descriptions.', 'buddypress' ); ?></p> + + </div> + <div class="last-feature"> + <h3 class="feature-title"><?php esc_html_e( 'Autolink Settings for Profile Fields', 'buddypress' ); ?></h3> + <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/admin/images/autolink-feature.png' ); ?>" alt="<?php esc_attr_e( 'Autolink settings in the profile fields panel', 'buddypress' ); ?>"> + <p><?php _e( 'Administrators can enable or disable autolink settings for each new profile field type.', 'buddypress' ); ?></p> + </div> + </div> + + </div> + + <div class="changelog"> + <h3 class="changelog-title"><?php esc_html_e( 'Under The Hood', 'buddypress' ); ?></h3> + + <div class="feature-section col two-col"> + <div> + <h4 class="title"><?php esc_html_e( 'Localization Improvements', 'buddypress' ); ?></h4> + <p><?php esc_html_e( 'We continue to improve on localization for translation editors so that BuddyPress will be available for everyone in their own language.', 'buddypress' ); ?></p> + <h4 class="title"><?php esc_html_e( 'Accessibility Upgrades', 'buddypress' ); ?></h4> + <p><?php esc_html_e( 'Continued improvements in the frontend and backend to make BuddyPress usable for everyone.', 'buddypress' ); ?></p> + </div> + + <div class="last-feature"> + <h4 class="title"><?php esc_html_e( 'Enhanced Multisite Support', 'buddypress' ); ?></h4> + <p><?php esc_html_e( 'BuddyPress is already primed for all multisite configurations available. We just made it better.', 'buddypress' ); ?></p> + <h4 class="title"><?php esc_html_e( 'Developer Reference', 'buddypress' ); ?></h4> + <p><?php esc_html_e( 'Regular updates to inline code documentation make it easier for developers to understand how BuddyPress works.', '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> • <a href="https://buddypress.org/support/"><?php _ex( 'Support', 'About screen, link to support site', 'buddypress' ); ?></a> • <a href="https://codex.buddypress.org/"><?php _ex( 'Documentation', 'About screen, link to documentation', 'buddypress' ); ?></a> • <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> • <a href="https://twitter.com/bptrac/"><?php _ex( 'Trac', '@bptrac twitter account name', 'buddypress' ); ?></a> • <a href="https://twitter.com/buddypressdev/"><?php _ex( 'Development', '@buddypressdev twitter account name', 'buddypress' ); ?></a></p> + + </div> + + <?php + } + + /** + * Output the credits screen. + * + * Hardcoding this in here is pretty janky. It's fine for now, but we'll + * want to leverage api.wordpress.org eventually. + * + * @since 1.7.0 + */ + public function credits_screen() { + ?> + + <div class="wrap about-wrap"> + + <?php self::welcome_text(); ?> + + <?php self::tab_navigation( __METHOD__ ); ?> + + <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks like these.', 'buddypress' ); ?></p> + + <h3 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h3> + <ul class="wp-people-group " id="wp-people-group-project-leaders"> + <li class="wp-person" id="wp-person-johnjamesjacoby"> + <a class="web" href="https://profiles.wordpress.org/johnjamesjacoby"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60"> + John James Jacoby</a> + <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-boonebgorges"> + <a class="web" href="https://profiles.wordpress.org/boonebgorges"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60"> + Boone B. Gorges</a> + <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-djpaul"> + <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60"> + Paul Gibbs</a> + <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> + </li> + </ul> + + <h3 class="wp-people-group"><?php _e( 'Core Team', 'buddypress' ); ?></h3> + <ul class="wp-people-group " id="wp-people-group-core-team"> + <li class="wp-person" id="wp-person-r-a-y"> + <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60"> + Ray</a> + <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-imath"> + <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=60"> + Mathieu Viet</a> + <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-mercime"> + <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60"> + Mercime</a> + <span class="title"><?php _e( 'Navigator', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-dcavins"> + <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=60"> + David Cavins</a> + <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-tw2113"> + <a class="web" href="https://profiles.wordpress.org/tw2113"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5d7c934621fa1c025b83ee79bc62366?s=60"> + Michael Beckwith</a> + <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-hnla"> + <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=60"> + Hugo</a> + <span class="title"><?php _e( 'Core Developer', 'buddypress' ); ?></span> + </li> + </ul> + + <h3 class="wp-people-group"><?php _e( '🌟Recent Rockstars🌟', 'buddypress' ); ?></h3> + <ul class="wp-people-group " id="wp-people-group-rockstars"> + <li class="wp-person" id="wp-person-henry-wright"> + <a class="web" href="https://profiles.wordpress.org/henry.wright"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60"> + Henry Wright</a> + </li> + <li class="wp-person" id="wp-person-danbp"> + <a class="web" href="https://profiles.wordpress.org/danbp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/0deae2e7003027fbf153500cd3fa5501?s=60"> + danbp</a> + </li> + <li class="wp-person" id="wp-person-shanebp"> + <a class="web" href="https://profiles.wordpress.org/shanebp"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/ffd294ab5833ba14aaf175f9acc71cc4?s=60"> + shanebp</a> + </li> + <li class="wp-person" id="wp-person-netweb"> + <a class="web" href="https://profiles.wordpress.org/netweb"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/97e1620b501da675315ba7cfb740e80f?s=60"> + Stephen Edgar</a> + </li> + <li class="wp-person" id="wp-person-dimensionmedia"> + <a class="web" href="https://profiles.wordpress.org/dimensionmedia"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/7735aada1ec39d0c1118bd92ed4551f1?s=60"> + David Bisset</a> + </li> + + </ul> + + <h3 class="wp-people-group"><?php printf( esc_html__( 'Contributors to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h3> + <p class="wp-credits-list"> + <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>, + <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>, + <a href="https://profiles.wordpress.org/thebrandonallen/">Brandon Allen (thebrandonallen)</a>, + <a href="https://profiles.wordpress.org/needle/">Christian Wach (needle)</a>, + <a href="https://profiles.wordpress.org/timersys/">Damian (timersys)</a>, + <a href="https://profiles.wordpress.org/danbrellis/">danbrellis</a>, + <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>, + <a href="https://profiles.wordpress.org/wpdennis/">Dennis (wpdennis)</a>, + <a href="https://profiles.wordpress.org/wdfee/">Fee (wdfee)</a>, + <a href="https://profiles.wordpress.org/garrett-eclipse/">Garrett Hyder (garrett-eclipse)</a>, + <a href="https://profiles.wordpress.org/Mamaduka/">George Mamadashvili (Mamaduka)</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/jeffsayre/">Jeff Sayre (jeffsayre)</a>, + <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>, + <a href="https://profiles.wordpress.org/Jonnyauk/">Jonnyauk</a>, + <a href="https://profiles.wordpress.org/joost-abrahams/">Joost Abrahams (joost-abrahams)</a>, + <a href="https://profiles.wordpress.org/kennibc/">kennibc</a>, + <a href="https://profiles.wordpress.org/sooskriszta/">OC2PS (sooskriszta)</a>, + <a href="https://profiles.wordpress.org/Offereins">Laurens Offereins (Offereins)</a>, + <a href="https://profiles.wordpress.org/LenLay/">LenLay</a>, + <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</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/modemlooper/">modemlooper</a>, + <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>, + <a href="https://profiles.wordpress.org/ramiy/">Rami Yushuvaev (ramiy)</a>, + <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</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/jozik/">Srdjan (jozik)</a>, + <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>, + <a href="https://profiles.wordpress.org/timeuser/">timeuser</a>, + <a href="https://profiles.wordpress.org/vnd/">vnd</a>. + </p> + + <h3 class="wp-people-group"><?php _e( '💖With our thanks to these Open Source projects💖', 'buddypress' ); ?></h3> + <p class="wp-credits-list"> + <a href="https://github.com/ichord/At.js">At.js</a>, + <a href="https://bbpress.org">bbPress</a>, + <a href="https://github.com/ichord/Caret.js">Caret.js</a>, + <a href="http://tedgoas.github.io/Cerberus/">Cerberus</a>, + <a href="https://github.com/carhartl/jquery-cookie">jquery.cookie</a>, + <a href="https://www.mediawiki.org/wiki/MediaWiki">MediaWiki</a>, + <a href="https://wordpress.org">WordPress</a>. + </p> + + </div> + + <?php + } + + /** + * Output welcome text and badge for What's New and Credits pages. + * + * @since 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 helps you build any type of community website using WordPress, with member profiles, activity streams, user groups, messaging, and more.', 'buddypress' ) + : __( 'Thank you for updating! BuddyPress %s has many new features that you will enjoy.', 'buddypress' ); + + ?> + + <h1><?php printf( esc_html__( 'Welcome to BuddyPress %s', 'buddypress' ), self::display_version() ); ?></h1> + + <div class="about-text"> + <?php + if ( self::is_new_install() ) { + echo $welcome_text; + } else { + printf( $welcome_text, self::display_version() ); + } + ?> + </div> + + <div class="bp-badge"></div> + + <?php + } + + /** + * Output tab navigation for `What's New` and `Credits` pages. + * + * @since 2.2.0 + * + * @param string $tab Tab to highlight as active. + */ + 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’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 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 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; + } + + /** + * Add Emails menu item to custom menus array. + * + * Several BuddyPress components have top-level menu items in the Dashboard, + * which all appear together in the middle of the Dashboard menu. This function + * adds the Emails screen to the array of these menu items. + * + * @since 2.4.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 Emails added. + */ + public function emails_admin_menu_order( $custom_menus = array() ) { + array_push( $custom_menus, 'edit.php?post_type=' . bp_get_email_post_type() ); + + if ( is_network_admin() && bp_is_network_activated() ) { + array_push( + $custom_menus, + get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ) + ); + } + + return $custom_menus; + } + + /** + * Register styles commonly used by BuddyPress wp-admin screens. + * + * @since 2.5.0 + */ + public function admin_register_styles() { + $min = bp_core_get_minified_asset_suffix(); + $url = $this->css_url; + + /** + * Filters the BuddyPress Core Admin CSS file path. + * + * @since 1.6.0 + * + * @param string $file File path for the admin CSS. + */ + $common_css = apply_filters( 'bp_core_admin_common_css', "{$url}common{$min}.css" ); + + /** + * Filters the BuddyPress admin stylesheet files to register. + * + * @since 2.5.0 + * + * @param array $value Array of admin stylesheet file information to register. + */ + $styles = apply_filters( 'bp_core_admin_register_styles', array( + // Legacy. + 'bp-admin-common-css' => array( + 'file' => $common_css, + 'dependencies' => array(), + ), + + // 2.5 + 'bp-customizer-controls' => array( + 'file' => "{$url}customizer-controls{$min}.css", + 'dependencies' => array(), + ), + ) ); + + + $version = bp_get_version(); + + foreach ( $styles as $id => $style ) { + wp_register_style( $id, $style['file'], $style['dependencies'], $version ); + wp_style_add_data( $id, 'rtl', true ); + + if ( $min ) { + wp_style_add_data( $id, 'suffix', $min ); + } + } + } + + /** + * Register JS commonly used by BuddyPress wp-admin screens. + * + * @since 2.5.0 + */ + public function admin_register_scripts() { + $min = bp_core_get_minified_asset_suffix(); + $url = $this->js_url; + + /** + * Filters the BuddyPress admin JS files to register. + * + * @since 2.5.0 + * + * @param array $value Array of admin JS file information to register. + */ + $scripts = apply_filters( 'bp_core_admin_register_scripts', array( + // 2.5 + 'bp-customizer-controls' => array( + 'file' => "{$url}customizer-controls{$min}.js", + 'dependencies' => array( 'jquery' ), + 'footer' => true, + ), + ) ); + + $version = bp_get_version(); + + foreach ( $scripts as $id => $script ) { + wp_register_script( $id, $script['file'], $script['dependencies'], $version, $script['footer'] ); + } + } +} +endif; // End class_exists check. 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 index 1c394a76b77832e8c97f5f7e6d3030aec9c1b8a4..09e8f922d0d10e1b9137ae287d3a852a77c576fa 100644 --- 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 @@ -1,34 +1,35 @@ <?php /** - * Core Avatars attachment class + * Core Avatars attachment class. * * @package BuddyPress * @subpackage Core + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * BP Attachment Avatar class + * BP Attachment Avatar class. * - * Extends BP Attachment to manage the avatar uploads + * Extends BP Attachment to manage the avatar uploads. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ class BP_Attachment_Avatar extends BP_Attachment { /** - * Construct Upload parameters + * Construct Upload parameters. * - * @since BuddyPress (2.3.0) + * @since 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 avatar types. $allowed_types = bp_core_get_allowed_avatar_types(); parent::__construct( array( @@ -36,7 +37,7 @@ class BP_Attachment_Avatar extends BP_Attachment { 'file_input' => 'file', 'original_max_filesize' => bp_core_avatar_original_max_filesize(), - // Specific errors for avatars + // 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 ) ), @@ -45,10 +46,12 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Gets the available avatar types + * Gets the available avatar types. * - * @since BuddyPress (2.3.0) - * @return string comma separated list of allowed avatar types + * @since 2.3.0 + * + * @param array $allowed_types Array of allowed avatar types. + * @return string comma separated list of allowed avatar types. */ public static function get_avatar_types( $allowed_types = array() ) { $types = array_map( 'strtoupper', $allowed_types ); @@ -57,9 +60,9 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Set Upload Dir data for avatars + * Set Upload Dir data for avatars. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @uses bp_core_avatar_upload_path() * @uses bp_core_avatar_url() @@ -77,93 +80,115 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Avatar specific rules + * 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 + * 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) + * @since 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 + * + * @param array $file the temporary file attributes (before it has been moved). + * @return array the file with extra errors if needed. */ public function validate_upload( $file = array() ) { - // Bail if already an error + // Bail if already an error. if ( ! empty( $file['error'] ) ) { return $file; } - // File size is too big + // File size is too big. if ( ! bp_core_check_avatar_size( array( 'file' => $file ) ) ) { $file['error'] = 9; - // File is of invalid type + // File is of invalid type. } elseif ( ! bp_core_check_avatar_type( array( 'file' => $file ) ) ) { $file['error'] = 10; } - // Return with error code attached + // Return with error code attached. return $file; } /** - * Maybe shrink the attachment to fit maximum allowed width + * Maybe shrink the attachment to fit maximum allowed width. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 + * @since 2.4.0 Add the $ui_available_width parameter, to inform about the Avatar UI width. * - * @param string $file the absolute path to the file * @uses bp_core_avatar_original_max_width() - * @uses wp_get_image_editor() + * + * @param string $file The absolute path to the file. + * @param int $ui_available_width Available width for the UI. * @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; - } + public static function shrink( $file = '', $ui_available_width = 0 ) { + // Get image size. + $avatar_data = parent::get_image_data( $file ); - } else { - $retval = $editor; + // Init the edit args. + $edit_args = array(); + + // Defaults to the Avatar original max width constant. + $original_max_width = bp_core_avatar_original_max_width(); + + // The ui_available_width is defined and it's smaller than the Avatar original max width. + if ( ! empty( $ui_available_width ) && $ui_available_width < $original_max_width ) { + /** + * In this case, to make sure the content of the image will be fully displayed + * during the cropping step, let's use the Avatar UI Available width. + */ + $original_max_width = $ui_available_width; + + // $original_max_width has to be larger than the avatar's full width + if ( $original_max_width < bp_core_avatar_full_width() ) { + $original_max_width = bp_core_avatar_full_width(); } } - return $retval; + // Do we need to resize the image? + if ( isset( $avatar_data['width'] ) && $avatar_data['width'] > $original_max_width ) { + $edit_args = array( + 'max_w' => $original_max_width, + 'max_h' => $original_max_width, + ); + } + + // Do we need to rotate the image? + $angles = array( + 3 => 180, + 6 => -90, + 8 => 90, + ); + + if ( isset( $avatar_data['meta']['orientation'] ) && isset( $angles[ $avatar_data['meta']['orientation'] ] ) ) { + $edit_args['rotate'] = $angles[ $avatar_data['meta']['orientation'] ]; + } + + // No need to edit the avatar, original file will be used. + if ( empty( $edit_args ) ) { + return false; + + // Add the file to the edit arguments. + } else { + $edit_args['file'] = $file; + } + + return parent::edit_image( 'avatar', $edit_args ); } /** - * Check if the image dimensions are smaller than full avatar dimensions + * Check if the image dimensions are smaller than full avatar dimensions. * - * @since BuddyPress (2.3.0) + * @since 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 + * + * @param string $file the absolute path to the file. + * @return bool */ public static function is_too_small( $file = '' ) { $uploaded_image = @getimagesize( $file ); @@ -178,22 +203,23 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Crop the avatar + * Crop the avatar. * - * @since BuddyPress (2.3.0) + * @since 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) + * + * @param array $args Array of arguments for the cropping. + * @return array The cropped avatars (full and thumb). */ public function crop( $args = array() ) { - // Bail if the original file is missing + // Bail if the original file is missing. if ( empty( $args['original_file'] ) ) { return false; } @@ -205,7 +231,7 @@ class BP_Attachment_Avatar extends BP_Attachment { $relative_path = $args['original_file']; $absolute_path = $this->upload_path . $relative_path; - // Bail if the avatar is not available + // Bail if the avatar is not available. if ( ! file_exists( $absolute_path ) ) { return false; } @@ -220,12 +246,12 @@ class BP_Attachment_Avatar extends BP_Attachment { $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 + // 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 + // Delete the existing avatar files for the object. $existing_avatar = bp_core_fetch_avatar( array( 'object' => $args['object'], 'item_id' => $args['item_id'], @@ -240,7 +266,7 @@ class BP_Attachment_Avatar extends BP_Attachment { 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 + // Make sure we at least have minimal data for cropping. if ( empty( $args['crop_w'] ) ) { $args['crop_w'] = bp_core_avatar_full_width(); } @@ -249,7 +275,7 @@ class BP_Attachment_Avatar extends BP_Attachment { $args['crop_h'] = bp_core_avatar_full_height(); } - // Get the file extension + // Get the file extension. $data = @getimagesize( $absolute_path ); $ext = $data['mime'] == 'image/png' ? 'png' : 'jpg'; @@ -266,24 +292,25 @@ class BP_Attachment_Avatar extends BP_Attachment { $args['dst_h'] = bp_core_avatar_full_height(); } - $args['dst_file'] = $avatar_folder_dir . '/' . wp_hash( $absolute_path . time() ) . '-bp' . $key_type . '.' . $ext; + $filename = wp_unique_filename( $avatar_folder_dir, uniqid() . "-bp{$key_type}.{$ext}" ); + $args['dst_file'] = $avatar_folder_dir . '/' . $filename; $avatar_types[ $key_type ] = parent::crop( $args ); } - // Remove the original + // Remove the original. @unlink( $absolute_path ); - // Return the full and thumb cropped avatars + // Return the full and thumb cropped avatars. return $avatar_types; } /** - * Get the user id to set its avatar + * Get the user id to set its avatar. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return integer the user ID + * @return integer The user ID. */ private function get_user_id() { $bp = buddypress(); @@ -301,11 +328,11 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Get the group id to set its avatar + * Get the group id to set its avatar. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return integer the group id + * @return integer The group ID. */ private function get_group_id() { $group_id = 0; @@ -318,28 +345,28 @@ class BP_Attachment_Avatar extends BP_Attachment { } /** - * Build script datas for the Uploader UI + * Build script datas for the Uploader UI. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return array the javascript localization data + * @return array The javascript localization data. */ public function script_data() { - // Get default script data + // Get default script data. $script_data = parent::script_data(); - // Defaults to Avatar Backbone script + // Defaults to Avatar Backbone script. $js_scripts = array( 'bp-avatar' ); - // Default object + // Default object. $object = ''; - // Get the possible item ids + // 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 + // Should we load the the Webcam Avatar javascript file. if ( bp_avatar_use_webcam() ) { $js_scripts = array( 'bp-webcam' ); } @@ -354,7 +381,7 @@ class BP_Attachment_Avatar extends BP_Attachment { ), ); - // Set feedback messages + // 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' ), @@ -372,7 +399,7 @@ class BP_Attachment_Avatar extends BP_Attachment { ), ); - // Set feedback messages + // 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' ), @@ -380,35 +407,36 @@ class BP_Attachment_Avatar extends BP_Attachment { 4 => __( 'The group profile photo was deleted successfully!', 'buddypress' ), ); } else { + /** - * Use this filter to include specific BuddyPress params for your object - * e.g. Blavatar + * Use this filter to include specific BuddyPress params for your object. + * e.g. Blavatar. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param array the avatar specific BuddyPress parameters + * @param array $value The avatar specific BuddyPress parameters. */ $script_data['bp_params'] = apply_filters( 'bp_attachment_avatar_params', array() ); } - // Include the specific css + // Include the specific css. $script_data['extra_css'] = array( 'bp-avatar' ); - // Include the specific css + // Include the specific css. $script_data['extra_js'] = $js_scripts; - // Set the object to contextualize the filter + // 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 + * Use this filter to override/extend the avatar script data. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param array $script_data the avatar script data - * @param string $object the object the avatar belongs to (eg: user or group) + * @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-cover-image.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-cover-image.php new file mode 100644 index 0000000000000000000000000000000000000000..1feb3a46193f1f6341314c0d1d01f5a6ff08795c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment-cover-image.php @@ -0,0 +1,291 @@ +<?php +/** + * Core Cover Image attachment class. + * + * @package BuddyPress + * @subpackage Core + * @since 2.4.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * BP Attachment Cover Image class. + * + * Extends BP Attachment to manage the cover images uploads. + * + * @since 2.4.0 + */ +class BP_Attachment_Cover_Image extends BP_Attachment { + /** + * The constuctor. + * + * @since 2.4.0 + */ + public function __construct() { + // Allowed cover image types & upload size. + $allowed_types = bp_attachments_get_allowed_types( 'cover_image' ); + $max_upload_file_size = bp_attachments_get_max_upload_file_size( 'cover_image' ); + + parent::__construct( array( + 'action' => 'bp_cover_image_upload', + 'file_input' => 'file', + 'original_max_filesize' => $max_upload_file_size, + 'base_dir' => bp_attachments_uploads_dir_get( 'dir' ), + 'required_wp_files' => array( 'file', 'image' ), + + // Specific errors for cover images. + 'upload_error_strings' => array( + 11 => sprintf( __( 'That image is too big. Please upload one smaller than %s', 'buddypress' ), size_format( $max_upload_file_size ) ), + 12 => sprintf( _n( 'Please upload only this file type: %s.', 'Please upload only these file types: %s.', count( $allowed_types ), 'buddypress' ), self::get_cover_image_types( $allowed_types ) ), + ), + ) ); + } + + /** + * Gets the available cover image types. + * + * @since 2.4.0 + * + * @param array $allowed_types Array of allowed cover image types. + * @return string $value Comma-separated list of allowed cover image types. + */ + public static function get_cover_image_types( $allowed_types = array() ) { + $types = array_map( 'strtoupper', $allowed_types ); + $comma = _x( ',', 'cover image types separator', 'buddypress' ); + return join( $comma . ' ', $types ); + } + + /** + * Cover image specific rules. + * + * Adds an error if the cover image size or type don't match BuddyPress needs. + * The error code is the index of $upload_error_strings. + * + * @since 2.4.0 + * + * @param array $file The temporary file attributes (before it has been moved). + * @return array $file 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 ( $file['size'] > $this->original_max_filesize ) { + $file['error'] = 11; + + // File is of invalid type. + } elseif ( ! bp_attachments_check_filetype( $file['tmp_name'], $file['name'], bp_attachments_get_allowed_mimes( 'cover_image' ) ) ) { + $file['error'] = 12; + } + + // Return with error code attached. + return $file; + } + + /** + * Set the directory when uploading a file. + * + * @since 2.4.0 + * + * @param array $upload_dir The original Uploads dir. + * @return array $value Upload data (path, url, basedir...). + */ + public function upload_dir_filter( $upload_dir = array() ) { + // Default values are for profiles. + $object_id = bp_displayed_user_id(); + + if ( empty( $object_id ) ) { + $object_id = bp_loggedin_user_id(); + } + + $object_directory = 'members'; + + // We're in a group, edit default values. + if ( bp_is_group() || bp_is_group_create() ) { + $object_id = bp_get_current_group_id(); + $object_directory = 'groups'; + } + + // Set the subdir. + $subdir = '/' . $object_directory . '/' . $object_id . '/cover-image'; + + /** + * Filters the cover image upload directory. + * + * @since 2.4.0 + * + * @param array $value Array containing the path, URL, and other helpful settings. + * @param array $upload_dir The original Uploads dir. + */ + return apply_filters( 'bp_attachments_cover_image_upload_dir', array( + 'path' => $this->upload_path . $subdir, + 'url' => $this->url . $subdir, + 'subdir' => $subdir, + 'basedir' => $this->upload_path, + 'baseurl' => $this->url, + 'error' => false + ), $upload_dir ); + } + + /** + * Adjust the cover image to fit with advised width & height. + * + * @since 2.4.0 + * + * @param string $file The absolute path to the file. + * @param array $dimensions Array of dimensions for the cover image. + * @return mixed + */ + public function fit( $file = '', $dimensions = array() ) { + if ( empty( $dimensions['width'] ) || empty( $dimensions['height'] ) ) { + return false; + } + + // Get image size. + $cover_data = parent::get_image_data( $file ); + + // Init the edit args. + $edit_args = array(); + + // Do we need to resize the image? + if ( ( isset( $cover_data['width'] ) && $cover_data['width'] > $dimensions['width'] ) || + ( isset( $cover_data['height'] ) && $cover_data['height'] > $dimensions['height'] ) ) { + $edit_args = array( + 'max_w' => $dimensions['width'], + 'max_h' => $dimensions['height'], + 'crop' => true, + ); + } + + // Do we need to rotate the image? + $angles = array( + 3 => 180, + 6 => -90, + 8 => 90, + ); + + if ( isset( $cover_data['meta']['orientation'] ) && isset( $angles[ $cover_data['meta']['orientation'] ] ) ) { + $edit_args['rotate'] = $angles[ $cover_data['meta']['orientation'] ]; + } + + // No need to edit the avatar, original file will be used. + if ( empty( $edit_args ) ) { + return false; + + // Add the file to the edit arguments. + } else { + $edit_args = array_merge( $edit_args, array( 'file' => $file, 'save' => false ) ); + } + + // Get the editor so that we can use a specific save method. + $editor = parent::edit_image( 'cover_image', $edit_args ); + + if ( is_wp_error( $editor ) ) { + return $editor; + } elseif ( ! is_a( $editor, 'WP_Image_Editor' ) ) { + return false; + } + + // Save the new image file. + return $editor->save( $this->generate_filename( $file ) ); + } + + /** + * Generate a filename for the cover image. + * + * @since 2.4.0 + * + * @param string $file The absolute path to the file. + * @return string $value The absolute path to the new file name. + */ + public function generate_filename( $file = '' ) { + if ( empty( $file ) || ! file_exists( $file ) ) { + return false; + } + + $info = pathinfo( $file ); + $ext = strtolower( $info['extension'] ); + $name = wp_unique_filename( $info['dirname'], uniqid() . "-bp-cover-image.$ext" ); + + return trailingslashit( $info['dirname'] ) . $name; + } + + /** + * Build script datas for the Uploader UI. + * + * @since 2.4.0 + * + * @return array The javascript localization data + */ + public function script_data() { + // Get default script data. + $script_data = parent::script_data(); + + if ( bp_is_user() ) { + $item_id = bp_displayed_user_id(); + + $script_data['bp_params'] = array( + 'object' => 'user', + 'item_id' => $item_id, + 'has_cover_image' => bp_attachments_get_user_has_cover_image( $item_id ), + 'nonces' => array( + 'remove' => wp_create_nonce( 'bp_delete_cover_image' ), + ), + ); + + // Set feedback messages. + $script_data['feedback_messages'] = array( + 1 => __( 'Your new cover image was uploaded successfully.', 'buddypress' ), + 2 => __( 'There was a problem deleting your cover image. Please try again.', 'buddypress' ), + 3 => __( 'Your cover image was deleted successfully!', 'buddypress' ), + ); + } elseif ( bp_is_group() ) { + $item_id = bp_get_current_group_id(); + + $script_data['bp_params'] = array( + 'object' => 'group', + 'item_id' => bp_get_current_group_id(), + 'has_cover_image' => bp_attachments_get_group_has_cover_image( $item_id ), + 'nonces' => array( + 'remove' => wp_create_nonce( 'bp_delete_cover_image' ), + ), + ); + + // Set feedback messages. + $script_data['feedback_messages'] = array( + 1 => __( 'The group cover image was uploaded successfully.', 'buddypress' ), + 2 => __( 'There was a problem deleting the group cover image. Please try again.', 'buddypress' ), + 3 => __( 'The group cover image was deleted successfully!', 'buddypress' ), + ); + } else { + + /** + * Filters the cover image params to include specific BuddyPress params for your object. + * e.g. Cover image for blogs single item. + * + * @since 2.4.0 + * + * @param array $value The cover image specific BuddyPress parameters. + */ + $script_data['bp_params'] = apply_filters( 'bp_attachment_cover_image_params', array() ); + } + + // Include our specific js & css. + $script_data['extra_js'] = array( 'bp-cover-image' ); + $script_data['extra_css'] = array( 'bp-avatar' ); + + /** + * Filters the cover image script data. + * + * @since 2.4.0 + * + * @param array $script_data Array of data for the cover image. + */ + return apply_filters( 'bp_attachments_cover_image_script_data', $script_data ); + } +} 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 index 3e62182bd13d1b0ada15462c1bfce7ff7cfe58cb..fec79160c46392f162912cfb4ff5c45a598097be 100644 --- a/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-attachment.php @@ -4,24 +4,25 @@ * * @package BuddyPress * @subpackage Core + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * BP Attachment class + * BP Attachment class. * * Extend it to manage your component's uploads. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ abstract class BP_Attachment { /** Upload properties *****************************************************/ /** - * The file being uploaded + * The file being uploaded. * * @var array */ @@ -29,49 +30,53 @@ abstract class BP_Attachment { /** * The default args to be merged with the - * ones passed by the child class + * 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' ), + 'original_max_filesize' => 0, + 'allowed_mime_types' => array(), + 'base_dir' => '', + 'action' => '', + 'file_input' => '', + 'upload_error_strings' => array(), + 'required_wp_files' => array( 'file' ), + 'upload_dir_filter_args' => 0, ); /** - * Construct Upload parameters + * Construct Upload parameters. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 + * @since 2.4.0 Add the $upload_dir_filter_args argument to the $arguments array + * @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() * - * @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' ); + * @param array|string $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' ). + * @type int $upload_dir_filter_args 1 to receive the original Upload dir array in the Upload dir filter, 0 otherwise. + * Defaults to 0 (optional). * } - * @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 + // 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 + // Sanitize the action ID and the file input name. $this->action = sanitize_key( $args['action'] ); $this->file_input = sanitize_key( $args['file_input'] ); @@ -87,29 +92,33 @@ abstract class BP_Attachment { if ( 'upload_error_strings' === $key ) { $this->{$key} = $this->set_upload_error_strings( $param ); - // Sanitize the base dir + // Sanitize the base dir. } elseif ( 'base_dir' === $key ) { $this->{$key} = sanitize_title( $param ); - // Action & File input are already set and sanitized + // Sanitize the upload dir filter arg to pass. + } elseif ( 'upload_dir_filter_args' === $key ) { + $this->{$key} = (int) $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 + // 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) + * @since 2.3.0 * - * @uses bp_upload_dir() + * @uses bp_upload_dir() */ public function set_upload_dir() { - // Set the directory, path, & url variables + // Set the directory, path, & url variables. $this->upload_dir = bp_upload_dir(); if ( empty( $this->upload_dir ) ) { @@ -119,7 +128,7 @@ abstract class BP_Attachment { $this->upload_path = $this->upload_dir['basedir']; $this->url = $this->upload_dir['baseurl']; - // Ensure URL is https if SSL is set/forced + // Ensure URL is https if SSL is set/forced. if ( is_ssl() ) { $this->url = str_replace( 'http://', 'https://', $this->url ); } @@ -133,20 +142,20 @@ abstract class BP_Attachment { $this->upload_path = trailingslashit( $this->upload_path ) . $this->base_dir; $this->url = trailingslashit( $this->url ) . $this->base_dir; - // Finally create the base dir + // Finally create the base dir. $this->create_dir(); } } /** - * Set Upload error messages + * Set Upload error messages. * * Used into the $overrides argument of BP_Attachment->upload() * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param array $param a list of error messages to add to BuddyPress core ones - * @return array the list of upload errors + * @param array $param A list of error messages to add to BuddyPress core ones. + * @return array $upload_errors The list of upload errors. */ public function set_upload_error_strings( $param = array() ) { /** @@ -175,9 +184,9 @@ abstract class BP_Attachment { } /** - * Include the WordPress core needed files + * Include the WordPress core needed files. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ public function includes() { foreach ( array_unique( $this->required_wp_files ) as $wp_file ) { @@ -190,21 +199,21 @@ abstract class BP_Attachment { } /** - * Upload the attachment + * Upload the attachment. * - * @since BuddyPress (2.3.0) + * @since 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 ) ) + * @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|null $time Optional. Time formatted in 'yyyy/mm'. Default null. + * @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 ) { /** @@ -227,7 +236,7 @@ abstract class BP_Attachment { */ add_filter( 'wp_handle_upload_prefilter', array( $this, 'validate_upload' ), 10, 1 ); - // Set Default overrides + // Set Default overrides. $overrides = array( 'action' => $this->action, 'upload_error_strings' => $this->upload_error_strings, @@ -246,9 +255,9 @@ abstract class BP_Attachment { } /** - * If you need to add some overrides we haven't thought of + * If you need to add some overrides we haven't thought of. * - * @var array $overrides the wp_handle_upload overrides + * @param array $overrides The wp_handle_upload overrides */ $overrides = apply_filters( 'bp_attachment_upload_overrides', $overrides ); @@ -264,34 +273,35 @@ abstract class BP_Attachment { $upload_dir_filter = array( $this, 'upload_dir_filter' ); } - // Make sure the file will be uploaded in the attachment directory + // 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 ); + add_filter( 'upload_dir', $upload_dir_filter, 10, $this->upload_dir_filter_args ); } - // Upload the attachment + // Upload the attachment. $this->attachment = wp_handle_upload( $file[ $this->file_input ], $overrides, $time ); - // Restore WordPress Uploads data + // Restore WordPress Uploads data. if ( ! empty( $upload_dir_filter ) ) { - remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 ); + remove_filter( 'upload_dir', $upload_dir_filter, 10, $this->upload_dir_filter_args ); } - // Remove the pre WordPress 4.0 static filter + // 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 + // Finally return the uploaded file or the error. return $this->attachment; } /** - * Validate the allowed mime types using WordPress allowed mime types + * 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) + * @since 2.3.0 * * @uses get_allowed_mime_types() */ @@ -299,7 +309,7 @@ abstract class BP_Attachment { $wp_mimes = get_allowed_mime_types(); $valid_mimes = array(); - // Set the allowed mimes for the upload + // 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 ) { @@ -311,7 +321,7 @@ abstract class BP_Attachment { } /** - * Specific upload rules + * 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 @@ -319,13 +329,13 @@ abstract class BP_Attachment { * * @see BP_Attachment_Avatar->validate_upload() for an example of use * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param array $file the temporary file attributes (before it has been moved) - * @return array the file + * @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 + // Bail if already an error. if ( ! empty( $file['error'] ) ) { return $file; } @@ -334,26 +344,32 @@ abstract class BP_Attachment { $file['error'] = 2; } - // Return the file + // Return the file. return $file; } /** - * Default filter to save the attachments + * Default filter to save the attachments. + * + * @since 2.3.0 + * @since 2.4.0 Add the $upload_dir parameter to the method * - * @since BuddyPress (2.3.0) + * @uses apply_filters() call 'bp_attachment_upload_dir' to eventually override the upload location + * regarding to context * - * @uses apply_filters() call 'bp_attachment_upload_dir' to eventually override the upload location - * regarding to context - * @return array the upload directory data + * @param array $upload_dir The original Uploads dir. + * @return array The upload directory data. */ - public function upload_dir_filter() { + public function upload_dir_filter( $upload_dir = array() ) { + /** * Filters the component's upload directory. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 + * @since 2.4.0 Include the original Upload directory as the second parameter of the filter. * - * @param array $value Array containing the path, URL, and other helpful settings. + * @param array $value Array containing the path, URL, and other helpful settings. + * @param array $upload_dir The original Uploads dir. */ return apply_filters( 'bp_attachment_upload_dir', array( 'path' => $this->upload_path, @@ -362,55 +378,56 @@ abstract class BP_Attachment { 'basedir' => $this->upload_path, 'baseurl' => $this->url, 'error' => false - ) ); + ), $upload_dir ); } /** - * Create the custom base directory for the component uploads + * Create the custom base directory for the component uploads. * - * Override this function in your child class to run specific actions + * Override this function in your child class to run specific actions. * (eg: add an .htaccess file) * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @uses wp_mkdir_p() + * @uses wp_mkdir_p() */ public function create_dir() { - // Bail if no specific base dir is set + // Bail if no specific base dir is set. if ( empty( $this->base_dir ) ) { return false; } - // Check if upload path already exists + // Check if upload path already exists. if ( ! is_dir( $this->upload_path ) ) { - // If path does not exist, attempt to create it + // If path does not exist, attempt to create it. if ( ! wp_mkdir_p( $this->upload_path ) ) { return false; } } - // Directory exists + // Directory exists. return true; } /** - * Crop an image file + * Crop an image file. * - * @since BuddyPress (2.3.0) + * @since 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. + * @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() ) { @@ -433,10 +450,10 @@ abstract class BP_Attachment { return $wp_error; } - // Check image file pathes + // 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 + // 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; @@ -445,21 +462,21 @@ abstract class BP_Attachment { /** * 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 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 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 + * WordPress image supported types. * @see wp_attachment_is() */ $supported_image_types = array( @@ -480,27 +497,27 @@ abstract class BP_Attachment { } } - // Add the image.php to the required WordPress files, if it's not already the case + // 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 + // Load the files. $this->includes(); - // Finally crop the image + // 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 + * Build script datas for the Uploader UI. * - * Override this method from your child class to build the script datas + * Override this method from your child class to build the script datas. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return array the javascript localization data + * @return array The javascript localization data. */ public function script_data() { $script_data = array( @@ -515,4 +532,141 @@ abstract class BP_Attachment { return $script_data; } + + /** + * Get full data for an image + * + * @since 2.4.0 + * + * @param string $file Absolute path to the uploaded image. + * @return bool|array An associate array containing the width, height and metadatas. + * False in case an important image attribute is missing. + */ + public static function get_image_data( $file ) { + // Try to get image basic data. + list( $width, $height, $sourceImageType ) = @getimagesize( $file ); + + // No need to carry on if we couldn't get image's basic data. + if ( is_null( $width ) || is_null( $height ) || is_null( $sourceImageType ) ) { + return false; + } + + // Initialize the image data. + $image_data = array( + 'width' => $width, + 'height' => $height, + ); + + /** + * Make sure the wp_read_image_metadata function is reachable for the old Avatar UI + * or if WordPress < 3.9 (New Avatar UI is not available in this case) + */ + if ( ! function_exists( 'wp_read_image_metadata' ) ) { + require_once( ABSPATH . 'wp-admin/includes/image.php' ); + } + + // Now try to get image's meta data. + $meta = wp_read_image_metadata( $file ); + + if ( ! empty( $meta ) ) { + // Before 4.0 the Orientation wasn't included. + if ( ! isset( $meta['orientation'] ) && + is_callable( 'exif_read_data' ) && + in_array( $sourceImageType, apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) + ) { + $exif = exif_read_data( $file ); + + if ( ! empty( $exif['Orientation'] ) ) { + $meta['orientation'] = $exif['Orientation']; + } + } + + // Now add the metas to image data. + $image_data['meta'] = $meta; + } + + /** + * Filter here to add/remove/edit data to the image full data + * + * @since 2.4.0 + * + * @param array $image_data An associate array containing the width, height and metadatas. + */ + return apply_filters( 'bp_attachments_get_image_data', $image_data ); + } + + /** + * Edit an image file to resize it or rotate it + * + * @since 2.4.0 + * + * @param string $attachment_type The attachment type (eg: avatar or cover_image). Required. + * @param array $args { + * @type string $file Absolute path to the image file (required). + * @type int $max_w Max width attribute for the editor's resize method (optional). + * @type int $max_h Max height attribute for the editor's resize method (optional). + * @type bool $crop Crop attribute for the editor's resize method (optional). + * @type float $rotate Angle for the editor's rotate method (optional). + * @type int $quality Compression quality on a 1-100% scale (optional). + * @type bool $save Whether to use the editor's save method or not (optional). + * } + * @return string|WP_Image_Editor|WP_Error The edited image path or the WP_Image_Editor object in case of success, + * an WP_Error object otherwise. + */ + public static function edit_image( $attachment_type, $args = array() ) { + if ( empty( $attachment_type ) ) { + return new WP_Error( 'missing_parameter' ); + } + + $r = bp_parse_args( $args, array( + 'file' => '', + 'max_w' => 0, + 'max_h' => 0, + 'crop' => false, + 'rotate' => 0, + 'quality' => 90, + 'save' => true, + ), 'attachment_' . $attachment_type . '_edit_image' ); + + // Make sure we have to edit the image. + if ( empty( $r['max_w'] ) && empty( $r['max_h'] ) && empty( $r['rotate'] ) && empty( $r['file'] ) ) { + return new WP_Error( 'missing_parameter' ); + } + + // Get the image editor. + $editor = wp_get_image_editor( $r['file'] ); + + if ( is_wp_error( $editor ) ) { + return $editor; + } + + $editor->set_quality( $r['quality'] ); + + if ( ! empty( $r['rotate'] ) ) { + $rotated = $editor->rotate( $r['rotate'] ); + + // Stop in case of error. + if ( is_wp_error( $rotated ) ) { + return $rotated; + } + } + + if ( ! empty( $r['max_w'] ) || ! empty( $r['max_h'] ) ) { + $resized = $editor->resize( $r['max_w'], $r['max_h'], $r['crop'] ); + + // Stop in case of error. + if ( is_wp_error( $resized ) ) { + return $resized; + } + } + + // Use the editor save method to get a path to the edited image. + if ( true === $r['save'] ) { + return $editor->save( $editor->generate_filename() ); + + // Need to do some other edit actions or use a specific method to save file. + } else { + return $editor; + } + } } 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 index 4be4b7646a5d5084cccb7023dd1ac03d1ebbe7c5..81378995498f12dd6cf9ccd445ba62527eeb0cc5 100644 --- a/wp-content/plugins/buddypress/bp-core/classes/class-bp-button.php +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-button.php @@ -4,42 +4,45 @@ * * @package BuddyPress * @subpackage Core + * @since 1.2.6 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * API to create BuddyPress buttons. * - * @since BuddyPress (1.2.6) + * @since 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: ''. + * + * @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 { @@ -141,8 +144,10 @@ class BP_Button { */ public $link_text = ''; - /** HTML result ***********************************************************/ - + /** HTML result + * + * @var string + */ public $contents = ''; /** Methods ***************************************************************/ @@ -150,17 +155,15 @@ class BP_Button { /** * Builds the button based on class parameters. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * - * @param array $args See {@BP_Button}. - * @return bool|null Returns false when the button is not allowed for - * the current context. + * @param array|string $args See {@BP_Button}. */ public function __construct( $args = '' ) { $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) ); - // Required button properties + // Required button properties. $this->id = $r['id']; $this->component = $r['component']; $this->must_be_logged_in = (bool) $r['must_be_logged_in']; @@ -171,56 +174,56 @@ class BP_Button { if ( empty( $r['id'] ) || empty( $r['component'] ) ) return false; - // No button if component is not active + // No button if component is not active. if ( ! bp_is_active( $this->component ) ) return false; - // No button for guests if must be logged in + // No button for guests if must be logged in. if ( true == $this->must_be_logged_in && ! is_user_logged_in() ) return false; - // block_self + // The block_self property. 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 + // 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) + // a members loop). } elseif ( bp_is_my_profile() ) { return false; } } - // Wrapper properties + // Wrapper properties. if ( false !== $this->wrapper ) { - // Wrapper ID + // Wrapper ID. if ( !empty( $r['wrapper_id'] ) ) { $this->wrapper_id = ' id="' . $r['wrapper_id'] . '"'; } - // Wrapper class + // 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 + // Set before and after. $before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>'; $after = '</' . $r['wrapper'] . '>'; - // No wrapper + // No wrapper. } else { $before = $after = ''; } - // Link properties + // 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'] . '"'; @@ -228,7 +231,7 @@ class BP_Button { 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 + // 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; /** @@ -237,7 +240,7 @@ class BP_Button { * This filter is a dynamic filter based on component and component ID and * allows button to be manipulated externally. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $contents HTML being used for the button. * @param BP_Button $this Current BP_Button instance. @@ -250,7 +253,7 @@ class BP_Button { /** * Return the markup for the generated button. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @return string Button markup. */ @@ -261,7 +264,7 @@ class BP_Button { /** * Output the markup of button. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ public function display() { if ( !empty( $this->contents ) ) diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php new file mode 100644 index 0000000000000000000000000000000000000000..8a53680dcfdfdaa077c5b9b2c57f8216df688c45 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-component.php @@ -0,0 +1,858 @@ +<?php +/** + * Component classes. + * + * @package BuddyPress + * @subpackage Core + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +if ( !class_exists( 'BP_Component' ) ) : + +/** + * BuddyPress Component Class. + * + * The BuddyPress component class is responsible for simplifying the creation + * of components that share similar behaviors and routines. It is used + * internally by BuddyPress to create the bundled components, but can be + * extended to create other really neat things. + * + * @since 1.5.0 + */ +class BP_Component { + + /** Variables *************************************************************/ + + /** + * Translatable name for the component. + * + * @internal + * @var string $name + */ + public $name = ''; + + /** + * Unique ID for the component. + * + * @since 1.5.0 + * @var string $id + */ + public $id = ''; + + /** + * Unique slug for the component, for use in query strings and URLs. + * + * @since 1.5.0 + * @var string $slug + */ + public $slug = ''; + + /** + * Does the component need a top-level directory? + * + * @since 1.5.0 + * @var bool $has_directory + */ + public $has_directory = false; + + /** + * The path to the component's files. + * + * @since 1.5.0 + * @var string $path + */ + public $path = ''; + + /** + * The WP_Query loop for this component. + * + * @since 1.5.0 + * @var WP_Query $query + */ + public $query = false; + + /** + * The current ID of the queried object. + * + * @since 1.5.0 + * @var string $current_id + */ + public $current_id = ''; + + /** + * Callback for formatting notifications. + * + * @since 1.5.0 + * @var callable $notification_callback + */ + public $notification_callback = ''; + + /** + * WordPress Toolbar links. + * + * @since 1.5.0 + * @var array $admin_menu + */ + public $admin_menu = ''; + + /** + * Placeholder text for component directory search box. + * + * @since 1.6.0 + * @var string $search_string + */ + public $search_string = ''; + + /** + * Root slug for the component. + * + * @since 1.6.0 + * @var string $root_slug + */ + public $root_slug = ''; + + /** + * Metadata tables for the component (if applicable). + * + * @since 2.0.0 + * + * @var array + */ + public $meta_tables = array(); + + /** + * Global tables for the component (if applicable). + * + * @since 2.0.0 + * + * @var array + */ + public $global_tables = array(); + + /** + * Query argument for component search URLs. + * + * @since 2.4.0 + * @var string + */ + public $search_query_arg = 's'; + + /** Methods ***************************************************************/ + + /** + * Component loader. + * + * @since 1.5.0 + * @since 1.9.0 Added $params as a parameter. + * @since 2.3.0 Added $params['features'] as a configurable value. + * @since 2.4.0 Added $params['search_query_arg'] 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. + * @type string $search_query_arg String to be used as the query argument in component search URLs. + * } + */ + public function start( $id = '', $name = '', $path = '', $params = array() ) { + + // Internal identifier of component. + $this->id = $id; + + // Internal component name. + $this->name = $name; + + // Path for includes. + $this->path = $path; + + // Miscellaneous component parameters that need to be set early on. + if ( ! empty( $params ) ) { + // Sets the position for our menu under the WP Toolbar's "My Account" menu. + if ( ! empty( $params['adminbar_myaccount_order'] ) ) { + $this->adminbar_myaccount_order = (int) $params['adminbar_myaccount_order']; + } + + // Register features. + if ( ! empty( $params['features'] ) ) { + $this->features = array_map( 'sanitize_title', (array) $params['features'] ); + } + + if ( ! empty( $params['search_query_arg'] ) ) { + $this->search_query_arg = sanitize_title( $params['search_query_arg'] ); + } + + // Set defaults if not passed. + } else { + // New component menus are added before the settings menu if not set. + $this->adminbar_myaccount_order = 90; + } + + // Move on to the next step. + $this->setup_actions(); + } + + /** + * Set up component global variables. + * + * @since 1.5.0 + * + * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id'. + * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug'. + * + * @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. + * } + */ + public function setup_globals( $args = array() ) { + + /** Slugs ************************************************************ + */ + + // If a WP directory page exists for the component, it should + // be the default value of 'root_slug'. + $default_root_slug = isset( buddypress()->pages->{$this->id}->slug ) ? buddypress()->pages->{$this->id}->slug : ''; + + $r = wp_parse_args( $args, array( + 'slug' => $this->id, + 'root_slug' => $default_root_slug, + 'has_directory' => false, + 'directory_title' => '', + 'notification_callback' => '', + 'search_string' => '', + 'global_tables' => '', + 'meta_tables' => '', + ) ); + + /** + * Filters the slug to be used for the permalink URI chunk after root. + * + * @since 1.5.0 + * + * @param string $value Slug to use in permalink URI chunk. + */ + $this->slug = apply_filters( 'bp_' . $this->id . '_slug', $r['slug'] ); + + /** + * Filters the slug used for root directory. + * + * @since 1.5.0 + * + * @param string $value Root directory slug. + */ + $this->root_slug = apply_filters( 'bp_' . $this->id . '_root_slug', $r['root_slug'] ); + + /** + * Filters the component's top-level directory if available. + * + * @since 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'] ); + + /** + * Filters the component's directory title. + * + * @since 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'] ); + + /** + * Filters the placeholder text for search inputs for component. + * + * @since 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'] ); + + /** + * Filters the callable function that formats the component's notifications. + * + * @since 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. + if ( ! empty( $r['global_tables'] ) ) { + $this->register_global_tables( $r['global_tables'] ); + } + + // Set the metadata table, if applicable. + if ( ! empty( $r['meta_tables'] ) ) { + $this->register_meta_tables( $r['meta_tables'] ); + } + + /** BuddyPress ******************************************************* + */ + + // Register this component in the loaded components array. + buddypress()->loaded_components[$this->slug] = $this->id; + + /** + * 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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_setup_globals' ); + } + + /** + * Include required files. + * + * Please note that, by default, this method is fired on the bp_include + * hook, with priority 8. This is necessary so that core components are + * loaded in time to be available to third-party plugins. However, this + * load order means that third-party plugins whose main files are + * loaded at bp_include with priority 10 (as recommended), will not be + * loaded in time for their includes() method to fire automatically. + * + * For this reason, it is recommended that your plugin has its own + * method or function for requiring necessary files. If you must use + * this method, you will have to call it manually in your constructor + * class, ie + * $this->includes(); + * + * Note that when you pass an array value like 'actions' to includes, + * it looks for the following three files (assuming your component is + * called 'my_component'): + * - ./actions + * - ./bp-my_component/actions + * - ./bp-my_component/bp-my_component-actions.php + * + * @since 1.5.0 + * + * @uses do_action() Calls 'bp_{@link bp_Component::name}includes'. + * + * @param array $includes An array of file names, or file name chunks, + * to be parsed and then included. + */ + public function includes( $includes = array() ) { + + // Bail if no files to include. + if ( ! empty( $includes ) ) { + $slashed_path = trailingslashit( $this->path ); + + // Loop through files to be included. + foreach ( (array) $includes as $file ) { + + $paths = array( + + // Passed with no extension. + 'bp-' . $this->id . '/bp-' . $this->id . '-' . $file . '.php', + 'bp-' . $this->id . '-' . $file . '.php', + 'bp-' . $this->id . '/' . $file . '.php', + + // Passed with extension. + $file, + 'bp-' . $this->id . '-' . $file, + 'bp-' . $this->id . '/' . $file, + ); + + foreach ( $paths as $path ) { + if ( @is_file( $slashed_path . $path ) ) { + require( $slashed_path . $path ); + break; + } + } + } + } + + /** + * 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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_includes' ); + } + + /** + * Set up the actions. + * + * @since 1.5.0 + * + * @uses add_action() To add various actions. + * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions'. + */ + public function setup_actions() { + + // Setup globals. + add_action( 'bp_setup_globals', array( $this, 'setup_globals' ), 10 ); + + // Set up canonical stack. + add_action( 'bp_setup_canonical_stack', array( $this, 'setup_canonical_stack' ), 10 ); + + // Include required files. Called early to ensure that BP core + // components are loaded before plugins that hook their loader functions + // to bp_include with the default priority of 10. This is for backwards + // compatibility; henceforth, plugins should register themselves by + // extending this base class. + add_action( 'bp_include', array( $this, 'includes' ), 8 ); + + // Setup navigation. + add_action( 'bp_setup_nav', array( $this, 'setup_nav' ), 10 ); + + // Setup WP Toolbar menus. + add_action( 'bp_setup_admin_bar', array( $this, 'setup_admin_bar' ), $this->adminbar_myaccount_order ); + + // 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 ); + + // Register taxonomies. + add_action( 'bp_register_taxonomies', array( $this, 'register_taxonomies' ), 10 ); + + // Add the rewrite tags. + add_action( 'bp_add_rewrite_tags', array( $this, 'add_rewrite_tags' ), 10 ); + + // Add the rewrite rules. + add_action( 'bp_add_rewrite_rules', array( $this, 'add_rewrite_rules' ), 10 ); + + // Add the permalink structure. + add_action( 'bp_add_permastructs', array( $this, 'add_permastructs' ), 10 ); + + // Allow components to parse the main query. + add_action( 'bp_parse_query', array( $this, 'parse_query' ), 10 ); + + // Generate rewrite rules. + add_action( 'bp_generate_rewrite_rules', array( $this, 'generate_rewrite_rules' ), 10 ); + + /** + * 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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_setup_actions' ); + } + + /** + * Set up the canonical URL stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() {} + + /** + * Set up component navigation. + * + * @since 1.5.0 + * + * @see bp_core_new_nav_item() For a description of the $main_nav + * parameter formatting. + * @see bp_core_new_subnav_item() For a description of how each item + * in the $sub_nav parameter array should be formatted. + * + * @param array $main_nav Optional. Passed directly to bp_core_new_nav_item(). + * See that function for a description. + * @param array $sub_nav Optional. Multidimensional array, each item in + * which is passed to bp_core_new_subnav_item(). See that + * function for a description. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // No sub nav items without a main nav item. + if ( !empty( $main_nav ) ) { + bp_core_new_nav_item( $main_nav ); + + // Sub nav items are not required. + if ( !empty( $sub_nav ) ) { + foreach( (array) $sub_nav as $nav ) { + bp_core_new_subnav_item( $nav ); + } + } + } + + /** + * 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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_setup_nav' ); + } + + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @see WP_Admin_Bar::add_menu() for a description of the syntax + * required by each item in the $wp_admin_nav parameter array. + * @global object $wp_admin_bar + * + * @param array $wp_admin_nav An array of nav item arguments. Each item in this parameter + * array is passed to {@link WP_Admin_Bar::add_menu()}. + * See that method for a description of the required syntax for + * each item. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Bail if this is an ajax request. + if ( defined( 'DOING_AJAX' ) ) { + return; + } + + // Do not proceed if BP_USE_WP_ADMIN_BAR constant is not set or is false. + if ( ! bp_use_wp_admin_bar() ) { + return; + } + + /** + * Filters the admin navigation passed into setup_admin_bar. + * + * This is a dynamic hook that is based on the component string ID. + * + * @since 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? + if ( !empty( $wp_admin_nav ) ) { + // Fill in position if one wasn't passed for backpat. + $pos = 0; + $not_set_pos = 1; + foreach( $wp_admin_nav as $key => $nav ) { + if ( ! isset( $nav['position'] ) ) { + $wp_admin_nav[$key]['position'] = $pos + $not_set_pos; + + if ( 9 !== $not_set_pos ) { + ++$not_set_pos; + } + } else { + $pos = $nav['position']; + + // Reset not set pos to 1 + if ( $pos % 10 === 0 ) { + $not_set_pos = 1; + } + } + } + + // Sort admin nav by position. + $wp_admin_nav = bp_sort_by_key( $wp_admin_nav, 'position', 'num' ); + + // Set this objects menus. + $this->admin_menu = $wp_admin_nav; + + // Define the WordPress global. + global $wp_admin_bar; + + // Add each admin menu. + foreach( $this->admin_menu as $admin_menu ) { + $wp_admin_bar->add_menu( $admin_menu ); + } + } + + /** + * 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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_setup_admin_bar' ); + } + + /** + * Set up the component title. + * + * @since 1.5.0 + * + * @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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_setup_title' ); + } + + /** + * Setup component-specific cache groups. + * + * @since 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 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. + * + * @since 2.0.0 + * + * @param array $tables Table names to register. + */ + public function register_global_tables( $tables = array() ) { + + /** + * 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 1.6.0 + */ + $tables = apply_filters( 'bp_' . $this->id . '_global_tables', $tables ); + + // Add to the BuddyPress global object. + if ( !empty( $tables ) && is_array( $tables ) ) { + foreach ( $tables as $global_name => $table_name ) { + $this->$global_name = $table_name; + } + + // Keep a record of the metadata tables in the 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 2.0.0 + */ + do_action( 'bp_' . $this->id . '_register_global_tables' ); + } + + /** + * Register component metadata tables. + * + * Metadata tables are registered in the $wpdb global, for + * compatibility with the WordPress metadata API. + * + * @since 2.0.0 + * + * @param array $tables Table names to register. + */ + public function register_meta_tables( $tables = array() ) { + global $wpdb; + + /** + * 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 2.0.0 + */ + $tables = apply_filters( 'bp_' . $this->id . '_meta_tables', $tables ); + + /** + * Add the name of each metadata table to WPDB to allow BuddyPress + * components to play nicely with the WordPress metadata API. + */ + if ( !empty( $tables ) && is_array( $tables ) ) { + foreach( $tables as $meta_prefix => $table_name ) { + $wpdb->{$meta_prefix . 'meta'} = $table_name; + } + + // Keep a record of the metadata tables in the 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 2.0.0 + */ + do_action( 'bp_' . $this->id . '_register_meta_tables' ); + } + + /** + * Set up the component post types. + * + * @since 1.5.0 + * + * @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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_register_post_types' ); + } + + /** + * Register component-specific taxonomies. + * + * @since 1.5.0 + * + * @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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_register_taxonomies' ); + } + + /** + * Add any additional rewrite tags. + * + * @since 1.5.0 + * + * @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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_add_rewrite_tags' ); + } + + /** + * Add any additional rewrite rules. + * + * @since 1.9.0 + * + * @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 1.9.0 + */ + do_action( 'bp_' . $this->id . '_add_rewrite_rules' ); + } + + /** + * Add any permalink structures. + * + * @since 1.9.0 + * + * @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 1.9.0 + */ + do_action( 'bp_' . $this->id . '_add_permastructs' ); + } + + /** + * Allow components to parse the main query. + * + * @since 1.9.0 + * + * @uses do_action() Calls 'bp_{@link bp_Component::name}_parse_query'. + * + * @param object $query 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 1.9.0 + * + * @param object $query Main WP_Query object. Passed by reference. + */ + do_action_ref_array( 'bp_' . $this->id . '_parse_query', array( &$query ) ); + } + + /** + * Generate any additional rewrite rules. + * + * @since 1.5.0 + * + * @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 1.5.0 + */ + do_action( 'bp_' . $this->id . '_generate_rewrite_rules' ); + } +} +endif; // BP_Component. diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-login-widget.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-login-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..b0336b5e5ba284d6da29d26d549274ad608d5080 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-login-widget.php @@ -0,0 +1,185 @@ +<?php +/** + * BuddyPress Core Login Widget. + * + * @package BuddyPress + * @subpackage Core + * @since 1.9.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * BuddyPress Login Widget. + * + * @since 1.9.0 + */ +class BP_Core_Login_Widget extends WP_Widget { + + /** + * Constructor method. + * + * @since 1.9.0 + */ + public function __construct() { + parent::__construct( + false, + _x( '(BuddyPress) Log In', 'Title of the login widget', 'buddypress' ), + array( + 'description' => __( 'Show a Log In form to logged-out visitors, and a Log Out link to those who are logged in.', 'buddypress' ), + 'classname' => 'widget_bp_core_login_widget buddypress widget', + ) + ); + } + + /** + * Display the login widget. + * + * @since 1.9.0 + * + * @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 ) { + $title = isset( $instance['title'] ) ? $instance['title'] : ''; + + /** + * Filters the title of the Login widget. + * + * @since 1.9.0 + * @since 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'] . esc_html( $title ) . $args['after_title']; ?> + + <?php if ( is_user_logged_in() ) : ?> + + <?php + /** + * Fires before the display of widget content if logged in. + * + * @since 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(); ?>"> + <?php bp_loggedin_user_avatar( 'type=thumb&width=50&height=50' ); ?> + </a> + </div> + + <div class="bp-login-widget-user-links"> + <div class="bp-login-widget-user-link"><?php echo bp_core_get_userlink( bp_loggedin_user_id() ); ?></div> + <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 + + /** + * Fires after the display of widget content if logged in. + * + * @since 1.9.0 + */ + do_action( 'bp_after_login_widget_loggedin' ); ?> + + <?php else : ?> + + <?php + + /** + * Fires before the display of widget content if logged out. + * + * @since 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="" <?php bp_form_field_attributes( 'password' ) ?> /> + + <div class="forgetmenot"><label for="bp-login-widget-rememberme"><input name="rememberme" type="checkbox" id="bp-login-widget-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ); ?></label></div> + + <input type="submit" name="wp-submit" id="bp-login-widget-submit" value="<?php esc_attr_e( 'Log In', 'buddypress' ); ?>" /> + + <?php if ( bp_get_signup_allowed() ) : ?> + + <span class="bp-login-widget-register-link"><a href="<?php echo esc_url( bp_get_signup_page() ); ?>" title="<?php esc_attr_e( 'Register for a new account', 'buddypress' ); ?>"><?php _e( 'Register', 'buddypress' ); ?></a></span> + + <?php endif; ?> + + <?php + + /** + * Fires inside the display of the login widget form. + * + * @since 2.4.0 + */ + do_action( 'bp_login_widget_form' ); ?> + + </form> + + <?php + + /** + * Fires after the display of widget content if logged out. + * + * @since 1.9.0 + */ + do_action( 'bp_after_login_widget_loggedout' ); ?> + + <?php endif; + + echo $args['after_widget']; + } + + /** + * Update the login widget options. + * + * @since 1.9.0 + * + * @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'] = isset( $new_instance['title'] ) ? strip_tags( $new_instance['title'] ) : ''; + + return $instance; + } + + /** + * Output the login widget options form. + * + * @since 1.9.0 + * + * @param array $instance Settings for this widget. + * @return void + */ + public function form( $instance = array() ) { + + $settings = wp_parse_args( $instance, array( + 'title' => '', + ) ); ?> + + <p> + <label for="<?php echo $this->get_field_id( '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( $settings['title'] ); ?>" /></label> + </p> + + <?php + } +} 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 index 19ab42de761ac74dfa9ccb65af922192b1e4ae14..c944a5ad0e2ea14818a6eb39e9d6e6d743ce7d6f 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -14,36 +15,35 @@ defined( 'ABSPATH' ) || exit; * * Use BP_Notifications_Notification instead. * - * @package BuddyPress Core - * @deprecated since BuddyPress (1.9.0) + * @deprecated since 1.9.0 */ class BP_Core_Notification { /** - * The notification id + * The notification id. * - * @var integer + * @var int */ public $id; /** * The ID to which the notification relates to within the component. * - * @var integer + * @var int */ public $item_id; /** * The secondary ID to which the notification relates to within the component. * - * @var integer + * @var int */ public $secondary_item_id = null; /** * The user ID for who the notification is for. * - * @var integer + * @var int */ public $user_id; @@ -80,7 +80,7 @@ class BP_Core_Notification { /** * Constructor * - * @param integer $id + * @param int $id ID for the notification. */ public function __construct( $id = 0 ) { if ( !empty( $id ) ) { @@ -92,19 +92,20 @@ class BP_Core_Notification { /** * Update or insert notification details into the database. * - * @global wpdb $wpdb WordPress database object - * @return bool Success or failure + * @global wpdb $wpdb WordPress database object. + * + * @return bool Success or failure. */ public function save() { global $wpdb; $bp = buddypress(); - // Update + // 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 + // 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 ); } @@ -122,7 +123,7 @@ class BP_Core_Notification { /** * Fetches the notification data from the database. * - * @global wpdb $wpdb WordPress database object + * @global wpdb $wpdb WordPress database object. */ public function populate() { global $wpdb; @@ -142,6 +143,13 @@ class BP_Core_Notification { /** Static Methods ********************************************************/ + /** + * Check the access for a user. + * + * @param int $user_id ID to check access for. + * @param int $notification_id Notification ID to check for. + * @return string + */ public static function check_access( $user_id, $notification_id ) { global $wpdb; @@ -154,10 +162,12 @@ class BP_Core_Notification { * 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 + * + * @param int $user_id User ID. + * @param string $status 'is_new' or 'all'. + * @return array Associative array */ public static function get_all_for_user( $user_id, $status = 'is_new' ) { global $wpdb; @@ -168,17 +178,20 @@ class BP_Core_Notification { ? ' 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 ) ); + 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 + * @global wpdb $wpdb WordPress database object. + * * @static + * + * @param int $user_id ID of the user to delet notification for. + * @param string $component_name Component name. + * @param string $component_action Component action. + * @return mixed */ public static function delete_for_user_by_type( $user_id, $component_name, $component_action ) { global $wpdb; @@ -191,13 +204,17 @@ class BP_Core_Notification { /** * 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. + * @global wpdb $wpdb WordPress database object. + * * @static + * + * @param int $user_id The ID of the user who the notifications are for. + * @param int $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 int|bool $secondary_item_id (optional) The secondary item id of the notifications that we wish to + * use to delete. + * @return mixed */ public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) { global $wpdb; @@ -214,11 +231,14 @@ class BP_Core_Notification { /** * 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. + * @global wpdb $wpdb WordPress database object. + * * @static + * + * @param int $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. + * @return mixed */ public static function delete_from_user_by_type( $user_id, $component_name, $component_action ) { global $wpdb; @@ -229,14 +249,18 @@ class BP_Core_Notification { } /** - * Deletes all the notifications for all users by item id, and optional secondary item id, and component name and 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. * - * @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 + * + * @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. + * @return mixed */ public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) { global $wpdb; diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-sort-by-key-callback.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-sort-by-key-callback.php new file mode 100644 index 0000000000000000000000000000000000000000..53ae5c070c082098e2048f6fd02628749c15ac1d --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core-sort-by-key-callback.php @@ -0,0 +1,83 @@ +<?php + +/** + * Callback class for bp_sort_by_key(). + * + * Used in place of an anonymous closure. + * + * Developers should not use this class directly, as it may be removed once support for PHP 5.2 is dropped. + * + * @ignore + * + * @since 2.5.0 + */ +class BP_Core_Sort_By_Key_Callback { + /** + * Object/array index to use for sorting. + * + * @since 2.5.0 + * @var mixed + */ + protected $key; + + /** + * Sort type. + * + * @since 2.5.0 + * @var string + */ + protected $type; + + /** + * Constructor. + * + * @since 2.5.0 + * + * @param mixed $key Object or array index to use for sorting. + * @param string $type Sort type. + */ + public function __construct( $key, $type ) { + $this->key = $key; + $this->type = $type; + } + + /** + * Sort callback. + * + * @since 2.5.0 + * + * @param $a object|array + * @param $b object|array + * @return int + */ + public function sort_callback( $a, $b ) { + $values = array( 0 => false, 1 => false, ); + $func_args = func_get_args(); + foreach ( $func_args as $indexi => $index ) { + if ( isset( $index->{$this->key} ) ) { + $values[ $indexi ] = $index->{$this->key}; + } elseif ( isset( $index[ $this->key ] ) ) { + $values[ $indexi ] = $index[ $this->key ]; + } + } + + if ( isset( $values[0], $values[1] ) ) { + if ( 'num' === $this->type ) { + $cmp = $values[0] - $values[1]; + } else { + $cmp = strcmp( $values[0], $values[1] ); + } + + if ( 0 > $cmp ) { + $retval = -1; + } elseif ( 0 < $cmp ) { + $retval = 1; + } else { + $retval = 0; + } + return $retval; + } else { + return 0; + } + } +} 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 index fb25b9686adf15d6165df12b933ac2037b044045..a8c9cc2056785202a9f4242f9e405380cf0e7697 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -18,7 +19,7 @@ defined( 'ABSPATH' ) || exit; * Example: * $user = new BP_Core_User( $user_id ); * $user_avatar = $user->avatar; - * $user_email = $user->email; + * $user_email = $user->email; * $user_status = $user->status; * etc. */ @@ -53,7 +54,7 @@ class BP_Core_User { public $avatar_mini; /** - * The full name of the user + * The full name of the user. * * @var string */ @@ -99,7 +100,7 @@ class BP_Core_User { public $total_friends; /** - * The total number of blog posts posted by the user + * The total number of blog posts posted by the user. * * @var integer * @deprecated No longer used @@ -118,7 +119,7 @@ class BP_Core_User { /** * Profile information for the specific user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var array */ public $profile_data; @@ -128,9 +129,9 @@ class BP_Core_User { /** * 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. + * @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 ) ) { @@ -177,7 +178,7 @@ class BP_Core_User { $this->email = esc_attr( bp_core_get_user_email( $this->id ) ); } - // Cache a few things that are fetched often + // 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' ); @@ -227,25 +228,25 @@ class BP_Core_User { * @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. + * @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 int $total_users Total number of users matched by query + * params. * @type array $paged_users The current page of users matched by - * query params. + * 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 ) { @@ -281,12 +282,12 @@ class BP_Core_User { $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 + // 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 + // 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"; } @@ -348,7 +349,7 @@ class BP_Core_User { 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 a meta value is provided, match it. if ( $meta_value ) { $sql['where_meta'] .= $wpdb->prepare( " AND umm.meta_value = %s", $meta_value ); } @@ -379,7 +380,7 @@ class BP_Core_User { /** * Filters the SQL used to query for paged users. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $value Concatenated SQL statement for the query. * @param array $sql Array of SQL statement parts for the query. @@ -387,7 +388,7 @@ class BP_Core_User { $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 + // Re-jig the SQL so we can get the total user count. unset( $sql['select_main'] ); if ( !empty( $sql['select_active'] ) ) { @@ -411,7 +412,7 @@ class BP_Core_User { /** * Filters the SQL used to query for total users. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $value Concatenated SQL statement for the query. * @param array $sql Array of SQL statement parts for the query. @@ -419,9 +420,9 @@ class BP_Core_User { $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) + * 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(); @@ -430,7 +431,7 @@ class BP_Core_User { $user_ids[] = $user->id; } - // Add additional data to the returned results + // Add additional data to the returned results. $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids, $type ); } @@ -443,14 +444,13 @@ class BP_Core_User { * * @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. + * @param string $letter The letter the users names are to start with. + * @param int|null $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 If we should 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 = '' ) { @@ -461,7 +461,7 @@ class BP_Core_User { $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); } - // Multibyte compliance + // Multibyte compliance. if ( function_exists( 'mb_strlen' ) ) { if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) { return false; @@ -487,7 +487,7 @@ class BP_Core_User { /** * Filters the SQL used to query for total user count by first letter. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value SQL prepared statement for the user count query. */ @@ -496,7 +496,7 @@ class BP_Core_User { /** * Filters the SQL used to query for users by first letter. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value SQL prepared statement for the user query. */ @@ -505,7 +505,7 @@ class BP_Core_User { $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 @@ -516,7 +516,7 @@ class BP_Core_User { foreach ( (array) $paged_users as $user ) $user_ids[] = (int) $user->id; - // Add additional data to the returned results + // Add additional data to the returned results. if ( $populate_extras ) { $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); } @@ -530,11 +530,12 @@ class BP_Core_User { * 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? + * + * @param array $user_ids The user IDs of the users who we wish to + * fetch information on. + * @param int|null $limit The limit of results we want. + * @param int $page The page we are on for pagination. + * @param bool $populate_extras If we should populate extra user fields. * @return array Associative array. */ public static function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) { @@ -553,7 +554,7 @@ class BP_Core_User { * 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) + * @deprecated 2.3.0 * * @param string $sql SQL string. */ @@ -564,7 +565,7 @@ class BP_Core_User { * * Use this instead of the deprecated 'bp_core_get_specific_users_count_sql'. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string $sql SQL string. * @param array $user_ids Array of IDs of specific users to fetch. @@ -580,7 +581,7 @@ class BP_Core_User { * 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) + * @deprecated 2.3.0 * * @param string $sql SQL string. */ @@ -591,7 +592,7 @@ class BP_Core_User { * * Use this instead of the deprecated 'bp_core_get_specific_users_count_sql'. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string $sql SQL string. * @param array $user_ids Array of IDs of specific users to fetch. @@ -604,7 +605,7 @@ class BP_Core_User { $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 @@ -612,7 +613,7 @@ class BP_Core_User { * usermeta and won't support any type of directional join) */ - // Add additional data to the returned results + // Add additional data to the returned results. if ( !empty( $populate_extras ) ) { $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); } @@ -625,11 +626,11 @@ class BP_Core_User { * * @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? + * @param string $search_terms The terms to search the profile table + * value column for. + * @param int|null $limit The limit of results we want. + * @param int $page The page we are on for pagination. + * @param boolean $populate_extras If we should populate extra user fields. * @return array Associative array. */ public static function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) { @@ -646,7 +647,7 @@ class BP_Core_User { /** * Filters the SQL used to query for searched users count. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value SQL statement for the searched users count query. */ @@ -655,7 +656,7 @@ class BP_Core_User { /** * Filters the SQL used to query for searched users. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value SQL statement for the searched users query. */ @@ -664,14 +665,14 @@ class BP_Core_User { $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 + // Add additional data to the returned results. if ( $populate_extras ) $paged_users = BP_Core_User::get_user_extras( $paged_users, $user_ids ); @@ -685,9 +686,9 @@ class BP_Core_User { * * @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. + * @param array $paged_users An array of stdClass containing the users. + * @param string $user_ids The user ids to select information about. + * @param string|bool $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 ) { @@ -698,10 +699,10 @@ class BP_Core_User { if ( empty( $user_ids ) ) return $paged_users; - // Sanitize user IDs + // Sanitize user IDs. $user_ids = implode( ',', wp_parse_id_list( $user_ids ) ); - // Fetch the user's full name + // 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 ) { @@ -712,7 +713,7 @@ class BP_Core_User { } } - // Fetch the user's total friend count + // 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 ) { @@ -723,7 +724,7 @@ class BP_Core_User { } } - // Fetch whether or not the user is a friend + // 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 ) { @@ -744,7 +745,7 @@ class BP_Core_User { } } - // Fetch the user's 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 ) { @@ -755,7 +756,7 @@ class BP_Core_User { } } - // Fetch the user's latest update + // 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 ) { @@ -772,7 +773,7 @@ class BP_Core_User { * * @global wpdb $wpdb WordPress database object. * - * @param integer $user_id User ID. + * @param int $user_id User ID. * @return array Associative array. */ public static function get_core_userdata( $user_id ) { @@ -787,13 +788,13 @@ class BP_Core_User { /** * Get last activity data for a user or set of users. * - * @param int|array User IDs or multiple user IDs. + * @param int|array $user_id User IDs or multiple user IDs. * @return array */ public static function get_last_activity( $user_id ) { global $wpdb; - // Sanitize and remove empty values + // Sanitize and remove empty values. $user_ids = array_filter( wp_parse_id_list( $user_id ) ); if ( empty( $user_ids ) ) { @@ -818,7 +819,7 @@ class BP_Core_User { } } - // Fetch all user data from the cache + // 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' ); @@ -833,10 +834,10 @@ class BP_Core_User { * Will create a new entry if it does not exist. Otherwise updates the * existing entry. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $user_id ID of the user whose last_activity you are updating. - * @param string $time MySQL-formatted time string. + * @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 ) { @@ -850,35 +851,35 @@ class BP_Core_User { $updated = $wpdb->update( $table_name, - // Data to update + // Data to update. array( 'date_recorded' => $time, ), - // WHERE + // WHERE. array( 'id' => $activity[ $user_id ]['activity_id'], ), - // Data sanitization format + // Data sanitization format. array( '%s', ), - // WHERE sanitization format + // WHERE sanitization format. array( '%d', ) ); - // add new date to existing activity entry for caching + // Add new date to existing activity entry for caching. $activity[ $user_id ]['date_recorded'] = $time; } else { $updated = $wpdb->insert( $table_name, - // Data + // Data. array( 'user_id' => $user_id, 'component' => buddypress()->members->id, @@ -890,7 +891,7 @@ class BP_Core_User { 'date_recorded' => $time, ), - // Data sanitization format + // Data sanitization format. array( '%d', '%s', @@ -903,8 +904,8 @@ class BP_Core_User { ) ); - // set up activity array for caching - // view the foreach loop in the get_last_activity() method for format + // 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, @@ -913,7 +914,7 @@ class BP_Core_User { ); } - // set cache + // Set cache. wp_cache_set( $user_id, $activity[ $user_id ], 'bp_last_activity' ); return $updated; @@ -922,11 +923,11 @@ class BP_Core_User { /** * Delete a user's last_activity value. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $user_id + * @param int $user_id ID of the user whose activity should be deleted. * @return bool True on success, false on failure or if no last_activity - * is found for the user. + * is found for the user. */ public static function delete_last_activity( $user_id ) { global $wpdb; @@ -940,12 +941,12 @@ class BP_Core_User { $deleted = $wpdb->delete( buddypress()->members->table_name_last_activity, - // WHERE + // WHERE. array( 'id' => $existing[ $user_id ]['activity_id'], ), - // WHERE sanitization format + // WHERE sanitization format. array( '%s', ) diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-core.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core.php new file mode 100644 index 0000000000000000000000000000000000000000..3cdfc0eeca227bfd855cbabb504cdba7464a4610 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-core.php @@ -0,0 +1,321 @@ +<?php +/** + * BuddyPress Core Loader. + * + * Core contains the commonly used functions, classes, and APIs. + * + * @package BuddyPress + * @subpackage Core + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Creates the Core component. + * + * @since 1.5.0 + */ +class BP_Core extends BP_Component { + + /** + * Start the members component creation process. + * + * @since 1.5.0 + * + * @uses BP_Core::bootstrap() + */ + public function __construct() { + parent::start( + 'core', + __( 'BuddyPress Core', 'buddypress' ), + buddypress()->plugin_dir + ); + + $this->bootstrap(); + } + + /** + * Populate the global data needed before BuddyPress can continue. + * + * This involves figuring out the currently required, activated, deactivated, + * and optional components. + * + * @since 1.5.0 + */ + private function bootstrap() { + $bp = buddypress(); + + /** + * Fires before the loading of individual components and after BuddyPress Core. + * + * Allows plugins to run code ahead of the other components. + * + * @since 1.2.0 + */ + do_action( 'bp_core_loaded' ); + + /** Components ******************************************************* + */ + + /** + * Filters the included and optional components. + * + * @since 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' ) ); + + /** + * Filters the required components. + * + * @since 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 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. + } elseif ( $deactivated_components = bp_get_option( 'bp-deactivated-components' ) ) { + + // Trim off namespace and filename. + foreach ( array_keys( (array) $deactivated_components ) as $component ) { + $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); + } + + /** 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' ); + + /** 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. + } else { + + // Set globals. + $bp->deactivated_components = array(); + + // Setup the active components. + $active_components = array_fill_keys( array_values( array_merge( $bp->optional_components, $bp->required_components ) ), '1' ); + + /** This filter is documented in bp-core/admin/bp-core-admin-components.php */ + $bp->active_components = apply_filters( 'bp_active_components', $bp->active_components ); + } + + // Loop through optional components. + foreach( $bp->optional_components as $component ) { + if ( bp_is_active( $component ) && file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { + include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); + } + } + + // Loop through required components. + foreach( $bp->required_components as $component ) { + if ( file_exists( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ) ) { + include( $bp->plugin_dir . '/bp-' . $component . '/bp-' . $component . '-loader.php' ); + } + } + + // Add Core to required components. + $bp->required_components[] = 'core'; + + /** + * Fires after the loading of individual components. + * + * @since 2.0.0 + */ + do_action( 'bp_core_components_included' ); + } + + /** + * Include bp-core files. + * + * @since 1.6.0 + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes( $includes = array() ) { + + if ( ! is_admin() ) { + return; + } + + $includes = array( + 'admin' + ); + + parent::includes( $includes ); + } + + /** + * Set up bp-core global settings. + * + * Sets up a majority of the BuddyPress globals that require a minimal + * amount of processing, meaning they cannot be set in the BuddyPress class. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals( $args = array() ) { + $bp = buddypress(); + + /** Database ********************************************************* + */ + + // Get the base database prefix. + if ( empty( $bp->table_prefix ) ) { + $bp->table_prefix = bp_core_get_table_prefix(); + } + + // The domain for the root of the site where the main blog resides. + if ( empty( $bp->root_domain ) ) { + $bp->root_domain = bp_core_get_root_domain(); + } + + // Fetches all of the core BuddyPress settings in one fell swoop. + if ( empty( $bp->site_options ) ) { + $bp->site_options = bp_core_get_root_options(); + } + + // The names of the core WordPress pages used to display BuddyPress content. + if ( empty( $bp->pages ) ) { + $bp->pages = bp_core_get_directory_pages(); + } + + /** Basic current user data ****************************************** + */ + + // Logged in user is the 'current_user'. + $current_user = wp_get_current_user(); + + // The user ID of the user who is currently logged in. + $bp->loggedin_user = new stdClass; + $bp->loggedin_user->id = isset( $current_user->ID ) ? $current_user->ID : 0; + + /** Avatars ********************************************************** + */ + + // 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 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 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 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 + // bp-notifications instead. + $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications'; + + /** + * Used to determine if user has admin rights on current content. If the + * logged in user is viewing their own profile and wants to delete + * something, is_item_admin is used. This is a generic variable so it + * can be used by other components. It can also be modified, so when + * viewing a group 'is_item_admin' would be 'true' if they are a group + * admin, and 'false' if they are not. + */ + bp_update_is_item_admin( bp_user_has_access(), 'core' ); + + // 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 1.1.0 + */ + do_action( 'bp_core_setup_globals' ); + } + + /** + * Setup cache groups + * + * @since 2.2.0 + */ + public function setup_cache_groups() { + + // Global groups. + wp_cache_add_global_groups( array( + 'bp' + ) ); + + parent::setup_cache_groups(); + } + + /** + * Set up post types. + * + * @since BuddyPress (2.4.0) + */ + public function register_post_types() { + + // Emails + if ( bp_is_root_blog() && ! is_network_admin() ) { + register_post_type( + bp_get_email_post_type(), + apply_filters( 'bp_register_email_post_type', array( + 'description' => _x( 'BuddyPress emails', 'email post type description', 'buddypress' ), + 'labels' => bp_get_email_post_type_labels(), + 'menu_icon' => 'dashicons-email', + 'public' => false, + 'publicly_queryable' => bp_current_user_can( 'bp_moderate' ), + 'query_var' => false, + 'rewrite' => false, + 'show_in_admin_bar' => false, + 'show_ui' => bp_current_user_can( 'bp_moderate' ), + 'supports' => bp_get_email_post_type_supports(), + ) ) + ); + } + + parent::register_post_types(); + } +} diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-customizer-control-range.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-customizer-control-range.php new file mode 100644 index 0000000000000000000000000000000000000000..c1252e95d8cf78a90a3a027bfc4756df5871a637 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-customizer-control-range.php @@ -0,0 +1,57 @@ +<?php +/** + * Core component class. + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * BuddyPress Customizer font size control. + * + * @since 2.5.0 + */ +class BP_Customizer_Control_Range extends WP_Customize_Control { + /** + * @var string + */ + public $type = 'range'; + + /** + * Enqueue scripts/styles for the color picker. + * + * @since 2.5.0 + */ + public function enqueue() { + wp_enqueue_script( 'bp-customizer-controls' ); + wp_enqueue_style( 'bp-customizer-controls' ); + } + + /** + * Render the control. + * + * @since 2.5.0 + */ + public function render_content() { + $id = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) ); + $class = 'customize-control customize-control-' . $this->type; + + ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>"> + <?php if ( $this->label ) : ?> + <label for="<?php echo esc_attr( "{$id}-range" ); ?>"> + <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> + </label> + <?php endif; ?> + + <input type="range" id="<?php echo esc_attr( "{$id}-range" ); ?>" <?php $this->link(); $this->input_attrs(); ?> value="<?php echo esc_attr( $this->value() ); ?>" /> + <output for="<?php echo esc_attr( "{$id}-range" ); ?>"><?php echo esc_html( $this->value() ); ?></output> + + <?php if ( $this->description ) : ?> + <p><span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span></p> + <?php endif; ?> + </li><?php + } +} 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 index 8ad883864127d00f5abbbc629de2fab77ab6138d..792fb222a0e462182d6046c620e93e273155f276 100644 --- 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 @@ -4,18 +4,20 @@ * * @package BuddyPress * @subpackage Core + * @since 2.1.0 */ -// Exit if accessed directly +// 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) + * @since 2.1.0 * * @param array $date_query { * Date query arguments. See first parameter of {@link WP_Date_Query::__construct()}. @@ -33,6 +35,9 @@ class BP_Date_Query extends WP_Date_Query { /** * Constructor. * + * @param array $date_query Date query arguments. + * @param string $column THe DB column to query against. + * * @see WP_Date_Query::__construct() */ public function __construct( $date_query, $column = '' ) { @@ -54,7 +59,7 @@ class BP_Date_Query extends WP_Date_Query { /** * Registers our date column with WP Date Query to pass validation. * - * @param array $retval Current DB columns + * @param array $retval Current DB columns. * @return array */ public function register_date_column( $retval = array() ) { @@ -62,4 +67,4 @@ class BP_Date_Query extends WP_Date_Query { return $retval; } } -endif; \ No newline at end of file +endif; diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-delivery.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-delivery.php new file mode 100644 index 0000000000000000000000000000000000000000..f96cd0172e2212a6595f6d601257425877109555 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-delivery.php @@ -0,0 +1,31 @@ +<?php +/** + * Core component classes. + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly +defined( 'ABSPATH' ) || exit; + +/** + * Email delivery implementation base class. + * + * When implementing support for an email delivery service into BuddyPress, + * you are required to create a class that implements this interface. + * + * @since 2.5.0 + */ +interface BP_Email_Delivery { + + /** + * Send email(s). + * + * @since 2.5.0 + * + * @param BP_Email $email Email to send. + * @return bool|WP_Error Returns true if email send, else a descriptive WP_Error. + */ + public function bp_email( BP_Email $email ); +} diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-recipient.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-recipient.php new file mode 100644 index 0000000000000000000000000000000000000000..02d8449e5b6be541fd421e85d059e9a50582815f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email-recipient.php @@ -0,0 +1,172 @@ +<?php +/** + * Core component classes. + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly +defined( 'ABSPATH' ) || exit; + +/** + * Represents a recipient that an email will be sent to. + * + * @since 2.5.0 + */ +class BP_Email_Recipient { + + /** + * Recipient's email address. + * + * @since 2.5.0 + * + * @var string + */ + protected $address = ''; + + /** + * Recipient's name. + * + * @since 2.5.0 + * + * @var string + */ + protected $name = ''; + + /** + * Optional. A `WP_User` object relating to this recipient. + * + * @since 2.5.0 + * + * @var WP_User + */ + protected $user_object = null; + + /** + * Constructor. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_or_user Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $email_or_user is a string, this is the recipient's name. + */ + public function __construct( $email_or_user, $name = '' ) { + $name = sanitize_text_field( $name ); + + // User ID, WP_User object. + if ( is_int( $email_or_user ) || is_object( $email_or_user ) ) { + $this->user_object = is_object( $email_or_user ) ? $email_or_user : get_user_by( 'id', $email_or_user ); + + if ( $this->user_object ) { + // This is escaped with esc_html in bp_core_get_user_displayname() + $name = wp_specialchars_decode( bp_core_get_user_displayname( $this->user_object->ID ), ENT_QUOTES ); + + $this->address = $this->user_object->user_email; + $this->name = sanitize_text_field( $name ); + } + + // Array, address, and name. + } else { + if ( ! is_array( $email_or_user ) ) { + $email_or_user = array( $email_or_user => $name ); + } + + // Handle numeric arrays. + if ( is_int( key( $email_or_user ) ) ) { + $address = current( $email_or_user ); + } else { + $address = key( $email_or_user ); + $name = current( $email_or_user ); + } + + if ( is_email( $address ) ) { + $this->address = sanitize_email( $address ); + } + + $this->name = $name; + } + + /** + * Fires inside __construct() method for BP_Email_Recipient class. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_or_user Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name If $email_or_user is a string, this is the recipient's name. + * @param BP_Email_Recipient $this Current instance of the email type class. + */ + do_action( 'bp_email_recipient', $email_or_user, $name, $this ); + } + + /** + * Get recipient's address. + * + * @since 2.5.0 + * + * @return string + */ + public function get_address() { + + /** + * Filters the recipient's address before it's returned. + * + * @since 2.5.0 + * + * @param string $address Recipient's address. + * @param BP_Email $recipient $this Current instance of the email recipient class. + */ + return apply_filters( 'bp_email_recipient_get_address', $this->address, $this ); + } + + /** + * Get recipient's name. + * + * @since 2.5.0 + * + * @return string + */ + public function get_name() { + + /** + * Filters the recipient's name before it's returned. + * + * @since 2.5.0 + * + * @param string $name Recipient's name. + * @param BP_Email $recipient $this Current instance of the email recipient class. + */ + return apply_filters( 'bp_email_recipient_get_name', $this->name, $this ); + } + + /** + * Get WP_User object for this recipient. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'search-email'. + * @return WP_User|null WP_User object, or null if not set. + */ + public function get_user( $transform = 'raw' ) { + + // If transform "search-email", find the WP_User if not already set. + if ( $transform === 'search-email' && ! $this->user_object && $this->address ) { + $this->user_object = get_user_by( 'email', $this->address ); + } + + /** + * Filters the WP_User object for this recipient before it's returned. + * + * @since 2.5.0 + * + * @param WP_User $name WP_User object for this recipient, or null if not set. + * @param string $transform Optional. How the return value was transformed. + * Accepts 'raw' (default) or 'search-email'. + * @param BP_Email $recipient $this Current instance of the email recipient class. + */ + return apply_filters( 'bp_email_recipient_get_user', $this->user_object, $transform, $this ); + } +} diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-email.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email.php new file mode 100644 index 0000000000000000000000000000000000000000..f4de900a1e1071c2da90908c5bdf77aa81ef0f08 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-email.php @@ -0,0 +1,963 @@ +<?php +/** + * Core component classes. + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly +defined( 'ABSPATH' ) || exit; + +/** + * Represents an email that will be sent to member(s). + * + * @since 2.5.0 + */ +class BP_Email { + /** + * Addressee details (BCC). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] BCC recipients. + */ + protected $bcc = array(); + + /** + * Addressee details (CC). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] CC recipients. + */ + protected $cc = array(); + + /** + * Email content (HTML). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_html = ''; + + /** + * Email content (plain text). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_plaintext = ''; + + /** + * The content type to send the email in ("html" or "plaintext"). + * + * @since 2.5.0 + * + * @var string + */ + protected $content_type = 'html'; + + /** + * Sender details. + * + * @since 2.5.0 + * + * @var BP_Email_Recipient Sender details. + */ + protected $from = null; + + /** + * Email headers. + * + * @since 2.5.0 + * + * @var string[] Associative pairing of email header name/value. + */ + protected $headers = array(); + + /** + * The Post object (the source of the email's content and subject). + * + * @since 2.5.0 + * + * @var WP_Post + */ + protected $post_object = null; + + /** + * Reply To details. + * + * @since 2.5.0 + * + * @var BP_Email_Recipient "Reply to" details. + */ + protected $reply_to = null; + + /** + * Email subject. + * + * @since 2.5.0 + * + * @var string + */ + protected $subject = ''; + + /** + * Email template (the HTML wrapper around the email content). + * + * @since 2.5.0 + * + * @var string + */ + protected $template = '{{{content}}}'; + + /** + * Addressee details (to). + * + * @since 2.5.0 + * + * @var BP_Email_Recipient[] Email recipients. + * } + */ + protected $to = array(); + + /** + * Unique identifier for this particular type of email. + * + * @since 2.5.0 + * + * @var string + */ + protected $type = ''; + + /** + * Token names and replacement values for this email. + * + * @since 2.5.0 + * + * @var string[] Associative pairing of token name (key) and replacement value (value). + */ + protected $tokens = array(); + + /** + * Constructor. + * + * Set the email type and default "from" and "reply to" name and address. + * + * @since 2.5.0 + * + * @param string $email_type Unique identifier for a particular type of email. + */ + public function __construct( $email_type ) { + $this->type = $email_type; + + // SERVER_NAME isn't always set (e.g CLI). + if ( ! empty( $_SERVER['SERVER_NAME'] ) ) { + $domain = strtolower( $_SERVER['SERVER_NAME'] ); + if ( substr( $domain, 0, 4 ) === 'www.' ) { + $domain = substr( $domain, 4 ); + } + + } elseif ( function_exists( 'gethostname' ) && gethostname() !== false ) { + $domain = gethostname(); + + } elseif ( php_uname( 'n' ) !== false ) { + $domain = php_uname( 'n' ); + + } else { + $domain = 'localhost.localdomain'; + } + + // This was escaped with esc_html on the way into the database in sanitize_option(). + $from_name = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES ); + $from_address = "wordpress@$domain"; + + /** This filter is documented in wp-includes/pluggable.php */ + $from_address = apply_filters( 'wp_mail_from', $from_address ); + + /** This filter is documented in wp-includes/pluggable.php */ + $from_name = apply_filters( 'wp_mail_from_name', $from_name ); + + $this->set_from( $from_address, $from_name ); + $this->set_reply_to( bp_get_option( 'admin_email' ), $from_name ); + + /** + * Fires inside __construct() method for BP_Email class. + * + * @since 2.5.0 + * + * @param string $email_type Unique identifier for this type of email. + * @param BP_Email $this Current instance of the email type class. + */ + do_action( 'bp_email', $email_type, $this ); + } + + + /* + * Setters/getters. + */ + + /** + * Getter function to expose object properties. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $property_name Property to access. + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return mixed Returns null if property does not exist, otherwise the value. + */ + public function get( $property_name, $transform = 'raw' ) { + + // "content" is replaced by HTML or plain text depending on $content_type. + if ( $property_name === 'content' ) { + $property_name = 'content_' . $this->get_content_type(); + + if ( ! in_array( $property_name, array( 'content_html', 'content_plaintext', ), true ) ) { + $property_name = 'content_html'; + } + } + + if ( ! property_exists( $this, $property_name ) ) { + return null; + } + + + /** + * Filters the value of the specified email property before transformation. + * + * This is a dynamic filter dependent on the specified key. + * + * @since 2.5.0 + * + * @param mixed $property_value Property value. + * @param string $property_name + * @param string $transform How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @param BP_Email $this Current instance of the email type class. + */ + $retval = apply_filters( "bp_email_get_{$property_name}", $this->$property_name, $property_name, $transform, $this ); + + switch ( $transform ) { + // Special-case to fill the $template with the email $content. + case 'add-content': + $retval = str_replace( '{{{content}}}', nl2br( $this->get_content( 'replace-tokens' ) ), $retval ); + // Fall through. + + case 'replace-tokens': + $retval = bp_core_replace_tokens_in_text( $retval, $this->get_tokens( 'raw' ) ); + // Fall through. + + case 'raw': + default: + // Do nothing. + } + + /** + * Filters the value of the specified email $property after transformation. + * + * @since 2.5.0 + * + * @param string $retval Property value. + * @param string $property_name + * @param string $transform How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @param BP_Email $this Current instance of the email type class. + */ + return apply_filters( 'bp_email_get_property', $retval, $property_name, $transform, $this ); + } + + /** + * Get email headers. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string[] Associative pairing of email header name/value. + */ + public function get_headers( $transform = 'raw' ) { + return $this->get( 'headers', $transform ); + } + + /** + * Get the email's "bcc" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[] BCC recipients. + */ + public function get_bcc( $transform = 'raw' ) { + return $this->get( 'bcc', $transform ); + } + + /** + * Get the email's "cc" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[] CC recipients. + */ + public function get_cc( $transform = 'raw' ) { + return $this->get( 'cc', $transform ); + } + + /** + * Get the email content. + * + * HTML or plaintext is returned, depending on the email's $content_type. + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string HTML or plaintext, depending on $content_type. + */ + public function get_content( $transform = 'raw' ) { + return $this->get( 'content', $transform ); + } + + /** + * Get the email content (in HTML). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string HTML email content. + */ + public function get_content_html( $transform = 'raw' ) { + return $this->get( 'content_html', $transform ); + } + + /** + * Get the email content (in plaintext). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Plain text email content. + */ + public function get_content_plaintext( $transform = 'raw' ) { + return $this->get( 'content_plaintext', $transform ); + } + + /** + * Get the email content type (HTML or plain text) that the email will be sent in. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Email content type ("html" or "plaintext"). + */ + public function get_content_type( $transform = 'raw' ) { + return $this->get( 'content_type', $transform ); + } + + /** + * Get the email's "from" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient "From" recipient. + */ + public function get_from( $transform = 'raw' ) { + return $this->get( 'from', $transform ); + } + + /** + * Get the Post associated with the email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @return WP_Post The post. + */ + public function get_post_object( $transform = 'raw' ) { + return $this->get( 'post_object', $transform ); + } + + /** + * Get the email's "reply to" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient "Reply to" recipient. + */ + public function get_reply_to( $transform = 'raw' ) { + return $this->get( 'reply_to', $transform ); + } + + /** + * Get the email subject. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Email subject. + */ + public function get_subject( $transform = 'raw' ) { + return $this->get( 'subject', $transform ); + } + + /** + * Get the email template (the HTML wrapper around the email content). + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string Email template. Assumed to be HTML. + */ + public function get_template( $transform = 'raw' ) { + return $this->get( 'template', $transform ); + } + + /** + * Get the email's "to" address and name. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return BP_Email_Recipient[] "To" recipients. + */ + public function get_to( $transform = 'raw' ) { + return $this->get( 'to', $transform ); + } + + /** + * Get token names and replacement values for this email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @param string $transform Optional. How to transform the return value. + * Accepts 'raw' (default) or 'replace-tokens'. + * @return string[] Associative pairing of token name (key) and replacement value (value). + */ + public function get_tokens( $transform = 'raw' ) { + return $this->get( 'tokens', $transform ); + } + + /** + * Set email headers. + * + * Does NOT let you override to/from, etc. Use the methods provided to set those. + * + * @since 2.5.0 + * + * @param string[] $headers Key/value pairs of header name/values (strings). + * @return BP_Email + */ + public function set_headers( array $headers ) { + $new_headers = array(); + + foreach ( $headers as $name => $content ) { + $content = str_replace( ':', '', $content ); + $name = str_replace( ':', '', $name ); + + $new_headers[ sanitize_key( $name ) ] = sanitize_text_field( $content ); + } + + /** + * Filters the new value of the email's "headers" property. + * + * @since 2.5.0 + * + * @param string[] $new_headers Key/value pairs of new header name/values (strings). + * @param BP_Email $this Current instance of the email type class. + */ + $this->headers = apply_filters( 'bp_email_set_headers', $new_headers, $this ); + + return $this; + } + + /** + * Set the email's "bcc" address and name. + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $bcc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $bcc_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_bcc( $bcc_address, $name = '', $operation = 'replace' ) { + $bcc = ( $operation !== 'replace' ) ? $this->bcc : array(); + + if ( is_array( $bcc_address ) ) { + foreach ( $bcc_address as $address ) { + $bcc[] = new BP_Email_Recipient( $address ); + } + + } else { + $bcc[] = new BP_Email_Recipient( $bcc_address, $name ); + } + + /** + * Filters the new value of the email's "BCC" property. + * + * @since 2.5.0 + * + * @param BP_Email_Recipient[] $bcc BCC recipients. + * @param string|array|int|WP_User $bcc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $bcc_address is a string, this is the recipient's name. + * @param string $operation If "replace", $to_address replaced previous recipients. If "add", + * $to_address was added to the array of recipients. + * @param BP_Email $this Current instance of the email type class. + */ + $this->bcc = apply_filters( 'bp_email_set_bcc', $bcc, $bcc_address, $name, $operation, $this ); + + return $this; + } + + /** + * Set the email's "cc" address and name. + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $cc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $cc_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_cc( $cc_address, $name = '', $operation = 'replace' ) { + $cc = ( $operation !== 'replace' ) ? $this->cc : array(); + + if ( is_array( $cc_address ) ) { + foreach ( $cc_address as $address ) { + $cc[] = new BP_Email_Recipient( $address ); + } + + } else { + $cc[] = new BP_Email_Recipient( $cc_address, $name ); + } + + /** + * Filters the new value of the email's "CC" property. + * + * @since 2.5.0 + * + * @param BP_Email_Recipient[] $cc CC recipients. + * @param string|array|int|WP_User $cc_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $cc_address is a string, this is the recipient's name. + * @param string $operation If "replace", $to_address replaced previous recipients. If "add", + * $to_address was added to the array of recipients. + * @param BP_Email $this Current instance of the email type class. + */ + $this->cc = apply_filters( 'bp_email_set_cc', $cc, $cc_address, $name, $operation, $this ); + + return $this; + } + + /** + * Set the email content (HTML). + * + * @since 2.5.0 + * + * @param string $content HTML email content. + * @return BP_Email + */ + public function set_content_html( $content ) { + + /** + * Filters the new value of the email's "content" property (HTML). + * + * @since 2.5.0 + * + * @param string $content HTML email content. + * @param BP_Email $this Current instance of the email type class. + */ + $this->content_html = apply_filters( 'bp_email_set_content_html', $content, $this ); + + return $this; + } + + /** + * Set the email content (plain text). + * + * @since 2.5.0 + * + * @param string $content Plain text email content. + * @return BP_Email + */ + public function set_content_plaintext( $content ) { + + /** + * Filters the new value of the email's "content" property (plain text). + * + * @since 2.5.0 + * + * @param string $content Plain text email content. + * @param BP_Email $this Current instance of the email type class. + */ + $this->content_plaintext = apply_filters( 'bp_email_set_content_plaintext', $content, $this ); + + return $this; + } + + /** + * Set the content type (HTML or plain text) to send the email in. + * + * @since 2.5.0 + * + * @param string $content_type Email content type ("html" or "plaintext"). + * @return BP_Email + */ + public function set_content_type( $content_type ) { + if ( ! in_array( $content_type, array( 'html', 'plaintext', ), true ) ) { + $class = get_class_vars( get_class() ); + $content_type = $class['content_type']; + } + + /** + * Filters the new value of the email's "content type" property. + * + * The content type (HTML or plain text) to send the email in. + * + * @since 2.5.0 + * + * @param string $content_type Email content type ("html" or "plaintext"). + * @param BP_Email $this Current instance of the email type class. + */ + $this->content_type = apply_filters( 'bp_email_set_content_type', $content_type, $this ); + + return $this; + } + + /** + * Set the email's "from" address and name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_address Either a email address, user ID, or WP_User object. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @return BP_Email + */ + public function set_from( $email_address, $name = '' ) { + $from = new BP_Email_Recipient( $email_address, $name ); + + /** + * Filters the new value of the email's "from" property. + * + * @since 2.5.0 + * + * @param BP_Email_Recipient $from Sender details. + * @param string|array|int|WP_User $email_address Either a email address, user ID, or WP_User object. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @param BP_Email $this Current instance of the email type class. + */ + $this->from = apply_filters( 'bp_email_set_from', $from, $email_address, $name, $this ); + + return $this; + } + + /** + * Set the Post object containing the email content template. + * + * Also sets the email's subject, content, and template from the Post, for convenience. + * + * @since 2.5.0 + * + * @param WP_Post $post + * @return BP_Email + */ + public function set_post_object( WP_Post $post ) { + + /** + * Filters the new value of the email's "post object" property. + * + * @since 2.5.0 + * + * @param WP_Post $post A Post. + * @param BP_Email $this Current instance of the email type class. + */ + $this->post_object = apply_filters( 'bp_email_set_post_object', $post, $this ); + + if ( is_a( $this->post_object, 'WP_Post' ) ) { + $this->set_subject( $this->post_object->post_title ) + ->set_content_html( $this->post_object->post_content ) + ->set_content_plaintext( $this->post_object->post_excerpt ); + + ob_start(); + + // Load the template. + add_filter( 'bp_locate_template_and_load', '__return_true' ); + + bp_locate_template( bp_email_get_template( $this->post_object ), true, false ); + + remove_filter( 'bp_locate_template_and_load', '__return_true' ); + + $this->set_template( ob_get_contents() ); + + ob_end_clean(); + } + + return $this; + } + + /** + * Set the email's "reply to" address and name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $email_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @return BP_Email + */ + public function set_reply_to( $email_address, $name = '' ) { + $reply_to = new BP_Email_Recipient( $email_address, $name ); + + /** + * Filters the new value of the email's "reply to" property. + * + * @since 2.5.0 + * + * @param BP_Email_Recipient $reply_to "Reply to" recipient. + * @param string|array|int|WP_User $email_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $email_address is a string, this is the recipient's name. + * @param BP_Email $this Current instance of the email type class. + */ + $this->reply_to = apply_filters( 'bp_email_set_reply_to', $reply_to, $email_address, $name, $this ); + + return $this; + } + + /** + * Set the email subject. + * + * @since 2.5.0 + * + * @param string $subject Email subject. + * @return BP_Email + */ + public function set_subject( $subject ) { + + /** + * Filters the new value of the subject email property. + * + * @since 2.5.0 + * + * @param string $subject Email subject. + * @param BP_Email $this Current instance of the email type class. + */ + $this->subject = apply_filters( 'bp_email_set_subject', $subject, $this ); + + return $this; + } + + /** + * Set the email template (the HTML wrapper around the email content). + * + * This needs to include the string "{{{content}}}" to have the post content added + * when the email template is rendered. + * + * @since 2.5.0 + * + * @param string $template Email template. Assumed to be HTML. + * @return BP_Email + */ + public function set_template( $template ) { + + /** + * Filters the new value of the template email property. + * + * @since 2.5.0 + * + * @param string $template Email template. Assumed to be HTML. + * @param BP_Email $this Current instance of the email type class. + */ + $this->template = apply_filters( 'bp_email_set_template', $template, $this ); + + return $this; + } + + /** + * Set the email's "to" address and name. + * + * IMPORTANT NOTE: the assumption with all emails sent by (and belonging to) BuddyPress itself + * is that there will only be a single `$to_address`. This is to simplify token and templating + * logic (for example, if multiple recipients, the "unsubscribe" link in the emails will all + * only link to the first recipient). + * + * To set a single address, the first parameter is the address and the second the name. + * You can also pass a user ID or a WP_User object. + * + * To set multiple addresses, for each array item, the key is the email address and + * the value is the name. + * + * @since 2.5.0 + * + * @param string|array|int|WP_User $to_address Either a email address, user ID, WP_User object, + * or an array containing any combination of the above. + * @param string $name Optional. If $to_address is a string, this is the recipient's name. + * @param string $operation Optional. If "replace", $to_address replaces current setting (default). + * If "add", $to_address is added to the current setting. + * @return BP_Email + */ + public function set_to( $to_address, $name = '', $operation = 'replace' ) { + $to = ( $operation !== 'replace' ) ? $this->to : array(); + + if ( is_array( $to_address ) ) { + foreach ( $to_address as $address ) { + $to[] = new BP_Email_Recipient( $address ); + } + + } else { + $to[] = new BP_Email_Recipient( $to_address, $name ); + } + + /** + * Filters the new value of the email's "to" property. + * + * @since 2.5.0 + * + * @param BP_Email_Recipient[] "To" recipients. + * @param string $to_address "To" address. + * @param string $name "To" name. + * @param string $operation If "replace", $to_address replaced previous recipients. If "add", + * $to_address was added to the array of recipients. + * @param BP_Email $this Current instance of the email type class. + */ + $this->to = apply_filters( 'bp_email_set_to', $to, $to_address, $name, $operation, $this ); + + return $this; + } + + /** + * Set token names and replacement values for this email. + * + * In templates, tokens are inserted with a Handlebars-like syntax, e.g. `{{token_name}}`. + * { and } are reserved characters. There's no need to specify these brackets in your token names. + * + * @since 2.5.0 + * + * @param string[] $tokens Associative array, contains key/value pairs of token name/value. + * Values are a string or a callable function. + * @return BP_Email + */ + public function set_tokens( array $tokens ) { + $formatted_tokens = array(); + + foreach ( $tokens as $name => $value ) { + $name = str_replace( array( '{', '}' ), '', sanitize_text_field( $name ) ); + $formatted_tokens[ $name ] = $value; + } + + /** + * Filters the new value of the email's "tokens" property. + * + * @since 2.5.0 + * + * @param string[] $formatted_tokens Associative pairing of token names (key) + * and replacement values (value). + * @param string[] $tokens Associative pairing of unformatted token + * names (key) and replacement values (value). + * @param BP_Email $this Current instance of the email type class. + */ + $this->tokens = apply_filters( 'bp_email_set_tokens', $formatted_tokens, $tokens, $this ); + + return $this; + } + + + /* + * Sanitisation and validation logic. + */ + + /** + * Check that we'd be able to send this email. + * + * Unlike most other methods in this class, this one is not chainable. + * + * @since 2.5.0 + * + * @return bool|WP_Error Returns true if validation succesful, else a descriptive WP_Error. + */ + public function validate() { + $retval = true; + + // BCC, CC, and token properties are optional. + if ( + ! $this->get_from() || + ! $this->get_to() || + ! $this->get_subject() || + ! $this->get_content() || + ! $this->get_template() + ) { + $retval = new WP_Error( 'missing_parameter', __CLASS__, $this ); + } + + /** + * Filters whether the email passes basic validation checks. + * + * @since 2.5.0 + * + * @param bool|WP_Error $retval Returns true if validation succesful, else a descriptive WP_Error. + * @param BP_Email $this Current instance of the email type class. + */ + return apply_filters( 'bp_email_validate', $retval, $this ); + } +} 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 index 5f51125236278666e4548ff7c15eed2a497d8a8a..7ae9ec3c30d9118f7220e58588109aea7eec2af2 100644 --- a/wp-content/plugins/buddypress/bp-core/classes/class-bp-embed.php +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-embed.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -14,7 +15,7 @@ defined( 'ABSPATH' ) || exit; * * Extends WP_Embed class for use with BuddyPress. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see WP_Embed */ @@ -31,7 +32,7 @@ class BP_Embed extends 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() + // Used in WP_Embed::shortcode(). $this->handlers = $wp_embed->handlers; if ( bp_use_embed_in_activity() ) { @@ -57,7 +58,7 @@ class BP_Embed extends WP_Embed { /** * Filters the BuddyPress Core oEmbed setup. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param BP_Embed $this Current instance of the BP_Embed. Passed by reference. */ @@ -80,8 +81,8 @@ class BP_Embed extends WP_Embed { * @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. + * @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 = '' ) { @@ -91,11 +92,11 @@ class BP_Embed extends WP_Embed { $rawattr = $attr; $attr = wp_parse_args( $attr, wp_embed_defaults() ); - // kses converts & into & and we need to undo this - // See https://core.trac.wordpress.org/ticket/11311 + // Use kses to convert & into & and we need to undo this + // See https://core.trac.wordpress.org/ticket/11311. $url = str_replace( '&', '&', $url ); - // Look for known internal handlers + // Look for known internal handlers. ksort( $this->handlers ); foreach ( $this->handlers as $priority => $handlers ) { foreach ( $handlers as $hid => $handler ) { @@ -105,7 +106,7 @@ class BP_Embed extends WP_Embed { /** * Filters the oEmbed handler result for the provided URL. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $return Handler callback for the oEmbed. * @param string $url URL attempting to be embedded. @@ -120,26 +121,37 @@ class BP_Embed extends WP_Embed { /** * Filters the embed object ID. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Value of zero. */ $id = apply_filters( 'embed_post_id', 0 ); + $unfiltered_html = current_user_can( 'unfiltered_html' ); + $default_discovery = false; + + // Since 4.4, WordPress is now an oEmbed provider. + if ( function_exists( 'wp_oembed_register_route' ) ) { + $unfiltered_html = true; + $default_discovery = true; + } + /** * Filters whether or not oEmbed discovery is on. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * @since 2.5.0 Default status of oEmbed discovery has been switched + * to true to apply changes introduced in WordPress 4.4 * - * @param bool $value Current status of oEmbed discovery. + * @param bool $default_discovery Current status of oEmbed discovery. */ - $attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', false ) && current_user_can( 'unfiltered_html' ) ); + $attr['discover'] = ( apply_filters( 'bp_embed_oembed_discover', $default_discovery ) && $unfiltered_html ); - // Set up a new WP oEmbed object to check URL with registered oEmbed providers + // 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 + // 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 ) { @@ -149,7 +161,7 @@ class BP_Embed extends WP_Embed { $is_oembed_link = true; } - // If url doesn't match a WP oEmbed provider, stop parsing + // If url doesn't match a WP oEmbed provider, stop parsing. if ( !$is_oembed_link ) return $this->maybe_make_link( $url ); } @@ -169,27 +181,27 @@ class BP_Embed extends WP_Embed { * @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()}. + * @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 + // Setup the cachekey. $cachekey = '_oembed_' . md5( $url . serialize( $attr ) ); - // Let components / plugins grab their cache + // Let components / plugins grab their cache. $cache = ''; /** * Filters the cache value to be used in the oEmbed, if exists. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $cache Empty initial cache value. * @param int $id ID that the caching is for. @@ -200,13 +212,13 @@ class BP_Embed extends WP_Embed { */ $cache = apply_filters( 'bp_embed_get_cache', $cache, $id, $cachekey, $url, $attr, $rawattr ); - // Grab cache and return it if available + // Grab cache and return it if available. if ( !empty( $cache ) ) { /** * Filters the found cache for the provided URL. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $cache Cached HTML markup for embed. * @param string $url The URL being embedded. @@ -215,7 +227,7 @@ class BP_Embed extends WP_Embed { */ return apply_filters( 'bp_embed_oembed_html', $cache, $url, $attr, $rawattr ); - // If no cache, ping the oEmbed provider and cache the result + // If no cache, ping the oEmbed provider and cache the result. } else { $html = wp_oembed_get( $url, $attr ); $cache = ( $html ) ? $html : $url; @@ -225,7 +237,7 @@ class BP_Embed extends WP_Embed { * * Lets components / plugins save their cache. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $cache Newly cached HTML markup for embed. * @param string $cachekey Key to use for the caching in the database. @@ -233,7 +245,7 @@ class BP_Embed extends WP_Embed { */ do_action( 'bp_embed_update_cache', $cache, $cachekey, $id ); - // If there was a result, return it + // If there was a result, return it. if ( $html ) { /** This filter is documented in bp-core/classes/class-bp-embed.php */ @@ -242,7 +254,7 @@ class BP_Embed extends WP_Embed { } } - // Still unknown + // 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 index ab40585bccfbb022c07d0a8ab6b7b22eb83073d2..56bd92ff373ea8dd0bc74f3c60818ee52ad599aa 100644 --- 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 @@ -4,23 +4,26 @@ * * @package BuddyPress * @subpackage Core + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Extracts media from text. Use {@link extract()}. * + * @since 2.3.0 + * * 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 + * If the Activity component is enabled, we use it to parse out any at-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 + * at-name, then it isn't extracted. + * If the Activity component is disabled, any at-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. @@ -34,13 +37,12 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 2.3.0 * @var int */ const ALL = 255; @@ -56,9 +58,11 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @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 @@ -73,7 +77,7 @@ class BP_Media_Extractor { * Array of extracted media. * * @type string $source Media source. Either "html" or "shortcodes". - * @type string $url Link to audio. + * @type string $url Link to audio. * } * @type array $embeds Extracted oEmbeds. { * Array of extracted media. @@ -83,11 +87,11 @@ class BP_Media_Extractor { * @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 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. @@ -97,25 +101,24 @@ class BP_Media_Extractor { * @type array $mentions Extracted mentions. { * Array of extracted media. * - * @type string $name @mention. + * @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 $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. + * @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(); @@ -167,12 +170,13 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_extract', $media, $richtext, $what_to_extract, $extra_args, $plaintext ); } @@ -187,9 +191,11 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @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 @@ -200,12 +206,11 @@ class BP_Media_Extractor { * @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' + // Matches: href="text" and href='text'. if ( stripos( $richtext, 'href=' ) !== false ) { preg_match_all( '#href=(["\'])([^"\']+)\1#i', $richtext, $matches ); @@ -227,11 +232,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_links', $data, $richtext, $plaintext, $extra_args ); } @@ -244,9 +250,11 @@ class BP_Media_Extractor { * * 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. + * @since 2.3.0 + * + * @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 @@ -254,11 +262,10 @@ class BP_Media_Extractor { * @type array $mentions Extracted mentions. { * Array of extracted media. * - * @type string $name @mention. + * @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() ); @@ -282,7 +289,7 @@ class BP_Media_Extractor { } } - // Build results + // Build results. foreach ( $mentions as $user_id => $mention_name ) { $mention = array( 'name' => strtolower( $mention_name ) ); @@ -299,11 +306,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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). */ return apply_filters( 'bp_media_extractor_mentions', $data, $richtext, $plaintext, $extra_args ); } @@ -313,9 +321,11 @@ class BP_Media_Extractor { * * 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). + * @since 2.3.0 + * + * @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 @@ -323,14 +333,13 @@ class BP_Media_Extractor { * @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 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() ); @@ -341,7 +350,7 @@ class BP_Media_Extractor { // `<img src>` tags. if ( stripos( $richtext, 'src=' ) !== false ) { - preg_match_all( '#src=(["\'])([^"\']+)\1#i', $richtext, $img_srcs ); // matches src="text" and src='text' + preg_match_all( '#src=(["\'])([^"\']+)\1#i', $richtext, $img_srcs ); // Matches src="text" and src='text'. // <img>. if ( ! empty( $img_srcs[2] ) ) { @@ -415,11 +424,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_images', $media, $richtext, $plaintext, $extra_args ); } @@ -430,9 +440,11 @@ class BP_Media_Extractor { * 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). + * @since 2.3.0 + * + * @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 @@ -440,20 +452,19 @@ class BP_Media_Extractor { * @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 $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 ); + preg_match_all( '/' . get_shortcode_regex() . '/s', $richtext, $matches ); if ( ! empty( $matches[2] ) ) { foreach ( $matches[2] as $i => $shortcode_name ) { @@ -461,10 +472,10 @@ class BP_Media_Extractor { $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 + $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; } @@ -476,11 +487,13 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_shortcodes', $data, $richtext, $plaintext, $extra_args ); } @@ -488,9 +501,11 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @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 @@ -501,7 +516,6 @@ class BP_Media_Extractor { * @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() ); @@ -551,11 +565,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_embeds', $data, $richtext, $plaintext, $extra_args ); } @@ -563,9 +578,13 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @see wp_get_audio_extensions() for supported audio formats. + * + * @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 @@ -574,12 +593,10 @@ class BP_Media_Extractor { * 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. + * @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() ); @@ -620,7 +637,7 @@ class BP_Media_Extractor { } } - // <a href="*.mp3"> tags + // <a href="*.mp3"> tags. foreach ( $audio_types as $extension ) { $extension = '.' . $extension; @@ -645,11 +662,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_audio', $data, $richtext, $plaintext, $extra_args ); } @@ -657,9 +675,13 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @see wp_get_video_extensions() for supported video formats. + * + * @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 @@ -668,11 +690,9 @@ class BP_Media_Extractor { * Array of extracted media. * * @type string $source Media source. Currently only "shortcodes". - * @type string $url Link to audio. + * @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() ); @@ -717,11 +737,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_videos', $data, $richtext, $plaintext, $extra_args ); } @@ -734,11 +755,12 @@ class BP_Media_Extractor { /** * 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). + * @since 2.3.0 + * + * @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' ) ) { @@ -750,7 +772,7 @@ class BP_Media_Extractor { // 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'] ) ) { @@ -763,7 +785,7 @@ class BP_Media_Extractor { 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". + $image_size = $extra_args['width']; // E.g. "thumb", "medium". } } else { @@ -819,11 +841,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_galleries', $galleries_data, $richtext, $plaintext, $extra_args ); } @@ -831,11 +854,12 @@ class BP_Media_Extractor { /** * 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. + * @since 2.3.0 + * + * @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(); @@ -856,7 +880,7 @@ class BP_Media_Extractor { 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". + $image_size = $extra_args['width']; // E.g. "thumb", "medium". } } else { $image_size = 'full'; @@ -868,11 +892,12 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @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. */ return apply_filters( 'bp_media_extractor_featured_images', $image, $richtext, $plaintext, $extra_args ); } @@ -882,9 +907,10 @@ class BP_Media_Extractor { * * HTML tags and shortcodes are removed, and HTML entities are decoded. * - * @param string $richtext + * @since 2.3.0 + * + * @param string $richtext Content to sanitize. * @return string - * @since BuddyPress (2.3.0) */ protected function strip_markup( $richtext ) { $plaintext = strip_shortcodes( html_entity_decode( strip_tags( $richtext ) ) ); @@ -892,10 +918,11 @@ class BP_Media_Extractor { /** * 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) + * @since 2.3.0 + * + * @param array $plaintext Generated plain text. + * @param string $richtext Original content. */ 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 index 8972ab3bf28d798cd871875efc6c5f2ea9c8e057..0edea59af5641734d1564b719932ff49ddc00736 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 2.1.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,19 +16,19 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 2.1.0 */ class BP_Members_Suggestions extends BP_Suggestions { /** * Default arguments for this suggestions service. * - * @since BuddyPress (2.1.0) + * @since 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. + * @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( @@ -41,8 +42,9 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Validate and sanitise the parameters for the suggestion service query. * + * @since 2.1.0 + * * @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']; @@ -50,7 +52,7 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Filters the members suggestions args for the current user. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $args Array of arguments for the member suggestions. * @param BP_Members_Suggestions $this Current BP_Members_Suggestions instance. @@ -65,7 +67,7 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Filters the validation status for the suggestion service query. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool|WP_Error $value Results of validation check. * @param BP_Members_Suggestions $this Current BP_Members_Suggestions instance. @@ -76,12 +78,13 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Find and return a list of username suggestions that match the query. * + * @since 2.1.0 + * * @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 + 'count_total' => '', // Prevents total count. 'populate_extras' => false, 'type' => 'alphabetical', @@ -99,7 +102,7 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Filters the members suggestions query args. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $user_query Array of query arguments. * @param BP_Members_Suggestions $this Current BP_Members_Suggestions instance. @@ -125,7 +128,7 @@ class BP_Members_Suggestions extends BP_Suggestions { /** * Filters the members suggestions results. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $results Array of users to suggest. * @param BP_Members_Suggestions $this Current BP_Members_Suggestions instance. diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-phpmailer.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-phpmailer.php new file mode 100644 index 0000000000000000000000000000000000000000..bfb2c7481519446ae1d497bf6b137f49df40b522 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-phpmailer.php @@ -0,0 +1,152 @@ +<?php +/** + * Core component classes. + * + * @package BuddyPress + * @subpackage Core + */ + +// Exit if accessed directly +defined( 'ABSPATH' ) || exit; + +/** + * Email delivery implementation using PHPMailer. + * + * @since 2.5.0 + */ +class BP_PHPMailer implements BP_Email_Delivery { + + /** + * Send email(s). + * + * @since 2.5.0 + * + * @param BP_Email $email Email to send. + * @return bool|WP_Error Returns true if email send, else a descriptive WP_Error. + */ + public function bp_email( BP_Email $email ) { + static $phpmailer = null; + + if ( $phpmailer === null ) { + if ( ! class_exists( 'PHPMailer' ) ) { + require_once ABSPATH . WPINC . '/class-phpmailer.php'; + require_once ABSPATH . WPINC . '/class-smtp.php'; + } + + $phpmailer = new PHPMailer( true ); + } + + + /* + * Resets. + */ + + $phpmailer->clearAllRecipients(); + $phpmailer->clearAttachments(); + $phpmailer->clearCustomHeaders(); + $phpmailer->clearReplyTos(); + $phpmailer->Sender = ''; + + + /* + * Set up. + */ + + $phpmailer->IsMail(); + $phpmailer->CharSet = bp_get_option( 'blog_charset' ); + + + /* + * Content. + */ + + $phpmailer->Subject = $email->get_subject( 'replace-tokens' ); + $content_plaintext = PHPMailer::normalizeBreaks( $email->get_content_plaintext( 'replace-tokens' ) ); + + if ( $email->get( 'content_type' ) === 'html' ) { + $phpmailer->msgHTML( $email->get_template( 'add-content' ) ); + $phpmailer->AltBody = $content_plaintext; + + } else { + $phpmailer->IsHTML( false ); + $phpmailer->Body = $content_plaintext; + } + + $recipient = $email->get_from(); + try { + $phpmailer->SetFrom( $recipient->get_address(), $recipient->get_name(), false ); + } catch ( phpmailerException $e ) { + } + + $recipient = $email->get_reply_to(); + try { + $phpmailer->addReplyTo( $recipient->get_address(), $recipient->get_name() ); + } catch ( phpmailerException $e ) { + } + + $recipients = $email->get_to(); + foreach ( $recipients as $recipient ) { + try { + $phpmailer->AddAddress( $recipient->get_address(), $recipient->get_name() ); + } catch ( phpmailerException $e ) { + } + } + + $recipients = $email->get_cc(); + foreach ( $recipients as $recipient ) { + try { + $phpmailer->AddCc( $recipient->get_address(), $recipient->get_name() ); + } catch ( phpmailerException $e ) { + } + } + + $recipients = $email->get_bcc(); + foreach ( $recipients as $recipient ) { + try { + $phpmailer->AddBcc( $recipient->get_address(), $recipient->get_name() ); + } catch ( phpmailerException $e ) { + } + } + + $headers = $email->get_headers(); + foreach ( $headers as $name => $content ) { + $phpmailer->AddCustomHeader( $name, $content ); + } + + + /** + * Fires after PHPMailer is initialised. + * + * @since 2.5.0 + * + * @param PHPMailer $phpmailer The PHPMailer instance. + */ + do_action( 'bp_phpmailer_init', $phpmailer ); + + /** This filter is documented in wp-includes/pluggable.php */ + do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); + + try { + return $phpmailer->Send(); + } catch ( phpmailerException $e ) { + return new WP_Error( $e->getCode(), $e->getMessage(), $email ); + } + } + + + /* + * Utility/helper functions. + */ + + /** + * Get an appropriate hostname for the email. Varies depending on site configuration. + * + * @since 2.5.0 + * @deprecated 2.5.3 No longer used. + * + * @return string + */ + public static function get_hostname() { + return ''; + } +} 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 index 7e45284f4f4f449f72fc022ca9e1ac3ba0c21d29..5a076d55e28132c43c753fa1fe42c0962a9cc0bd 100644 --- 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 @@ -4,23 +4,23 @@ * * @package BuddyPress * @subpackage Core + * @since 2.2.0 */ -// Exit if accessed directly +// 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) + * @since 2.2.0 */ abstract class BP_Recursive_Query { /** * Query arguments passed to the constructor. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * @var array */ public $queries = array(); @@ -34,11 +34,8 @@ abstract class BP_Recursive_Query { * 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 + * @since 2.2.0 * - * @param string $primary_table - * @param string $primary_id_column * @return array */ protected function get_sql_clauses() { @@ -60,8 +57,7 @@ abstract class BP_Recursive_Query { * Subclasses generally do not need to call this method. It is invoked * automatically from get_sql_clauses(). * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 * * @param array $query Query to parse. * @param int $depth Optional. Number of tree levels deep we @@ -140,10 +136,10 @@ abstract class BP_Recursive_Query { * * Extend this method if your class uses different sanitizing logic. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 + * + * @param array $queries Array of query clauses. * - * @param array $queries Array of query clauses. * @return array Sanitized array of query clauses. */ protected function sanitize_query( $queries ) { @@ -207,11 +203,11 @@ abstract class BP_Recursive_Query { * * Must be overridden in a subclass. * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 + * + * @param array $clause Array of arguments belonging to the clause. + * @param array $parent_query Parent query to which the clause belongs. * - * @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. @@ -224,11 +220,11 @@ abstract class BP_Recursive_Query { * * Must be overridden in a subclass. * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 + * + * @param array $query Clause to check. * - * @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 index 5c92b1abf101f365a88e247b2e9e90995f656112..c222ed7091fa1c29169cc418cf6b4fe1b38a05c3 100644 --- a/wp-content/plugins/buddypress/bp-core/classes/class-bp-suggestions.php +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-suggestions.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 2.1.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -23,7 +24,7 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 2.1.0 */ abstract class BP_Suggestions { @@ -32,7 +33,7 @@ abstract class BP_Suggestions { * * If your custom service requires further defaults, add them here. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * @var array */ protected $default_args = array( @@ -46,7 +47,7 @@ abstract class BP_Suggestions { * * This includes `$default_args`, as well as the user-supplied values. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * @var array */ protected $args = array( @@ -56,8 +57,9 @@ abstract class BP_Suggestions { /** * Constructor. * + * @since 2.1.0 + * * @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 ) ) { @@ -68,13 +70,14 @@ abstract class BP_Suggestions { /** * Set the parameters for the suggestions service query. * + * @since 2.1.0 + * * @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. + * @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 ); @@ -86,8 +89,9 @@ abstract class BP_Suggestions { * 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. * + * @since 2.1.0 + * * @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'] ); @@ -96,7 +100,7 @@ abstract class BP_Suggestions { /** * Filters the arguments to be validated for the BP_Suggestions query. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param BP_Suggestions $value Arguments to be validated. * @param BP_Suggestions $this Current BP_Suggestions instance. @@ -116,7 +120,7 @@ abstract class BP_Suggestions { /** * Filters the status of validation for the BP_Suggestions query. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $value Whether or not the values are valid. * @param BP_Suggestions $this Current BP_Suggestions instance. @@ -133,8 +137,9 @@ abstract class BP_Suggestions { * 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' } * + * @since 2.1.0 + * * @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-theme-compat.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..4c12621ff793a9632f411de2e22ae0ee95c5f3db --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-theme-compat.php @@ -0,0 +1,120 @@ +<?php +/** + * BuddyPress Core Theme Compatibility Base Class. + * + * @package BuddyPress + * @subpackage ThemeCompatibility + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Theme Compatibility base class. + * + * This is only intended to be extended, and is included here as a basic guide + * for future Theme Packs to use. {@link BP_Legacy} is a good example of + * extending this class. + * + * @since 1.7.0 + * + * @todo We should probably do something similar to BP_Component::start(). + * @todo If this is only intended to be extended, it should be abstract. + * + * @param array $properties { + * An array of properties describing the theme compat package. + * @type string $id ID of the package. Must be unique. + * @type string $name Name of the theme. This should match the name given + * in style.css. + * @type string $version Theme version. Used for busting script and style + * browser caches. + * @type string $dir Filesystem path of the theme. + * @type string $url Base URL of the theme. + * } + */ +class BP_Theme_Compat { + + /** + * Template package properties, as passed to the constructor. + * + * @since 1.7.0 + * @var array + */ + protected $_data = array(); + + /** + * Pass the $properties to the object on creation. + * + * @since 1.7.0 + * + * @param array $properties Array of properties for BP_Theme_Compat. + */ + public function __construct( Array $properties = array() ) { + $this->_data = $properties; + } + + /** + * Set up the BuddyPress-specific theme compat methods. + * + * Themes should use this method in their constructor. + * + * @since 1.7.0 + */ + protected function start() { + // Sanity check. + if ( ! bp_use_theme_compat_with_current_theme() ) { + return; + } + + // Setup methods. + $this->setup_globals(); + $this->setup_actions(); + } + + /** + * Set up global data for your template package. + * + * Meant to be overridden in your class. See + * {@link BP_Legacy::setup_globals()} for an example. + * + * @since 1.7.0 + */ + protected function setup_globals() {} + + /** + * Set up theme hooks for your template package. + * + * Meant to be overridden in your class. See + * {@link BP_Legacy::setup_actions()} for an example. + * + * @since 1.7.0 + */ + protected function setup_actions() {} + + /** + * Set a theme's property. + * + * @since 1.7.0 + * + * @param string $property Property name. + * @param mixed $value Property value. + * @return bool True on success, false on failure. + */ + public function __set( $property, $value ) { + return $this->_data[$property] = $value; + } + + /** + * Get a theme's property. + * + * @since 1.7.0 + * + * @param string $property Property name. + * @return mixed The value of the property if it exists, otherwise an + * empty string. + */ + public function __get( $property ) { + return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : ''; + } +} 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 index 87392666d31587d007fef686f984b9f6893941c1..15269e000243d96b529e6c357e5ace9df7c21c13 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage Core + * @since 1.7.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -15,43 +16,47 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 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. + * @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 array|string $member_type__in Array or comma-separated list of member types to limit results to. + * @type array|string $member_type__not_in Array or comma-separated list of member types that will be + * excluded from results. + * @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 { @@ -61,7 +66,7 @@ class BP_User_Query { /** * Unaltered params as passed to the constructor. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * @var array */ public $query_vars_raw = array(); @@ -69,7 +74,7 @@ class BP_User_Query { /** * Array of variables to query with. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var array */ public $query_vars = array(); @@ -77,8 +82,7 @@ class BP_User_Query { /** * List of found users and their respective data. * - * @access public To allow components to manipulate them. - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var array */ public $results = array(); @@ -86,8 +90,7 @@ class BP_User_Query { /** * Total number of found users for the current query. * - * @access public To allow components to manipulate it. - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var int */ public $total_users = 0; @@ -95,8 +98,7 @@ class BP_User_Query { /** * List of found user IDs. * - * @access public To allow components to manipulate it. - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var array */ public $user_ids = array(); @@ -104,8 +106,7 @@ class BP_User_Query { /** * SQL clauses for the user ID query. * - * @access public To allow components to manipulate it. - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var array */ public $uid_clauses = array(); @@ -113,8 +114,7 @@ class BP_User_Query { /** * SQL table where the user ID is being fetched from. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * @var string */ public $uid_table = ''; @@ -122,7 +122,7 @@ class BP_User_Query { /** * SQL database column name to order by. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var string */ public $uid_name = ''; @@ -130,8 +130,7 @@ class BP_User_Query { /** * Standard response when the query should not return any rows. * - * @access protected - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var string */ protected $no_results = array( 'join' => '', 'where' => '0 = 1' ); @@ -142,48 +141,50 @@ class BP_User_Query { /** * Constructor. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param string|array $query See {@link BP_User_Query}. + * @param string|array|null $query See {@link BP_User_Query}. */ public function __construct( $query = null ) { - // Store the raw query vars for later access + // Store the raw query vars for later access. $this->query_vars_raw = $query; - // Allow extending classes to register action/filter hooks + // 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' + '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' => '', + 'member_type__in' => '', + 'member_type__not_in' => '', + '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) + * @since 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 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 { @@ -192,15 +193,15 @@ class BP_User_Query { } } - // Bail if no user IDs were found + // Bail if no user IDs were found. if ( empty( $this->user_ids ) ) { return; } - // Fetch additional data. First, using WP_User_Query + // Fetch additional data. First, using WP_User_Query. $this->do_wp_user_query(); - // Get BuddyPress specific user data + // Get BuddyPress specific user data. $this->populate_extras(); } @@ -216,21 +217,21 @@ class BP_User_Query { * 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) + * @since 1.8.0 */ public function setup_hooks() {} /** * Prepare the query for user_ids. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function prepare_user_ids_query() { global $wpdb; $bp = buddypress(); - // Default query variables used here + // Default query variables used here. $type = ''; $per_page = 0; $page = 1; @@ -243,7 +244,7 @@ class BP_User_Query { extract( $this->query_vars ); - // Setup the main SQL query container + // Setup the main SQL query container. $sql = array( 'select' => '', 'where' => array(), @@ -252,15 +253,15 @@ class BP_User_Query { 'limit' => '' ); - /** TYPE **************************************************************/ + /* TYPE **************************************************************/ // Determines the sort order, which means it also determines where the - // user IDs are drawn from (the SELECT and WHERE statements) + // 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 + // number of minutes used as an interval. case 'online' : $this->uid_name = 'user_id'; $this->uid_table = $bp->members->table_name_last_activity; @@ -270,7 +271,7 @@ class BP_User_Query { /** * Filters the threshold for activity timestamp minutes since to indicate online status. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param int $value Amount of minutes for threshold. Default 15. */ @@ -281,7 +282,7 @@ class BP_User_Query { break; // 'active', 'newest', and 'random' queries - // all happen against the last_activity usermeta key + // all happen against the last_activity usermeta key. case 'active' : case 'newest' : case 'random' : @@ -302,7 +303,7 @@ class BP_User_Query { break; - // 'popular' sorts by the 'total_friend_count' usermeta + // 'popular' sorts by the 'total_friend_count' usermeta. case 'popular' : $this->uid_name = 'user_id'; $this->uid_table = $wpdb->usermeta; @@ -313,14 +314,14 @@ class BP_User_Query { break; - // 'alphabetical' sorts depend on the xprofile setup + // '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 + // @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; @@ -329,7 +330,7 @@ class BP_User_Query { $sql['order'] = "ASC"; // When profile sync is disabled, alphabetical sorts must happen against - // the xprofile table + // the xprofile table. } else { $this->uid_name = 'user_id'; $this->uid_table = $bp->profile->table_name_data; @@ -346,7 +347,7 @@ class BP_User_Query { break; - // Any other 'type' falls through + // Any other 'type' falls through. default : $this->uid_name = 'ID'; $this->uid_table = $wpdb->users; @@ -354,14 +355,13 @@ class BP_User_Query { // In this case, we assume that a plugin is // handling order, so we leave those clauses - // blank - + // blank. break; } - /** WHERE *************************************************************/ + /* WHERE *************************************************************/ - // 'include' - User ids to include in the results + // '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 ) ) { @@ -369,14 +369,14 @@ class BP_User_Query { $sql['where'][] = "u.{$this->uid_name} IN ({$include_ids})"; } - // 'exclude' - User ids to exclude from the results + // '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 + // @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 ) ); @@ -385,16 +385,16 @@ class BP_User_Query { $sql['where'][] = "u.{$this->uid_name} IN ({$friend_ids})"; // If the user has no friends, the query should always - // return no users + // return no users. } else { $sql['where'][] = $this->no_results['where']; } } - /** Search Terms ******************************************************/ + /* Search Terms ******************************************************/ // 'search_terms' searches user_login and user_nicename - // xprofile field matches happen in bp_xprofile_bp_user_query_search() + // 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 ) ); @@ -418,56 +418,26 @@ class BP_User_Query { ); } - // 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; - } + // Only use $member_type__in if $member_type is not set. + if ( empty( $member_type ) && ! empty( $member_type__in ) ) { + $member_type = $member_type__in; + } - $member_type_sql_clauses = $member_type_tq->get_sql( 'u', $this->uid_name ); + // Member types to exclude. Note that this takes precedence over inclusions. + if ( ! empty( $member_type__not_in ) ) { + $member_type_clause = $this->get_sql_clause_for_member_types( $member_type__not_in, 'NOT IN' ); - if ( $switched ) { - restore_current_blog(); - } + // Member types to include. + } elseif ( ! empty( $member_type ) ) { + $member_type_clause = $this->get_sql_clause_for_member_types( $member_type, 'IN' ); + } - // 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']; - } - } + if ( ! empty( $member_type_clause ) ) { + $sql['where']['member_type'] = $member_type_clause; } // 'meta_key', 'meta_value' allow usermeta search - // To avoid global joins, do a separate query + // 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 ); @@ -484,7 +454,7 @@ class BP_User_Query { } } - // 'per_page', 'page' - handles LIMIT + // '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 { @@ -494,14 +464,14 @@ class BP_User_Query { /** * Filters the clauses for the user query. * - * @since BuddyPress (2.0.0) + * @since 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 + // 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']; @@ -511,7 +481,7 @@ class BP_User_Query { /** * Fires before the BP_User_Query query is made. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param BP_User_Query $this Current BP_User_Query instance. Passed by reference. */ @@ -526,20 +496,20 @@ class BP_User_Query { * * Also used to quickly perform user total counts. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function do_user_ids_query() { global $wpdb; - // If counting using SQL_CALC_FOUND_ROWS, set it up here + // 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 + // 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 + // Get the total user count. if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) { /** @@ -549,7 +519,7 @@ class BP_User_Query { * then the value will be "SELECT FOUND_ROWS()". Otherwise it will * use a "SELECT COUNT()" query statement. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $value SQL statement to select FOUND_ROWS(). * @param BP_User_Query $this Current BP_User_Query instance. @@ -566,7 +536,7 @@ class BP_User_Query { /** * Use WP_User_Query() to pull data for the user IDs retrieved in the main query. * - * @since BuddyPress (1.7.0) + * @since 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' ); @@ -579,20 +549,20 @@ class BP_User_Query { /** * Filters the WP User Query arguments before passing into the class. * - * @since BuddyPress (1.7.0) + * @since 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 + // 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 + 'blog_id' => 0, // BP does not require blog roles. + 'count_total' => false // We already have a count. ), $this ) ); @@ -612,20 +582,24 @@ class BP_User_Query { $this->total_users = count( $wp_user_query->results ); } - // Reindex for easier matching + // 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 ) { + // Match up to the user ids from the main query. + foreach ( $this->user_ids as $key => $uid ) { if ( isset( $r[ $uid ] ) ) { $this->results[ $uid ] = $r[ $uid ]; // The BP template functions expect an 'id' - // (as opposed to 'ID') property + // (as opposed to 'ID') property. $this->results[ $uid ]->id = $uid; + + // Remove user ID from original user_ids property. + } else { + unset( $this->user_ids[ $key ] ); } } } @@ -640,12 +614,12 @@ class BP_User_Query { * ids passed to the class constructor. See {@link BP_Group_Member_Query} * for an example. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * - * @param array Sanitized array of user IDs, as passed to the 'include' - * parameter of the class constructor. + * @param array $include 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. + * limited. */ public function get_include_ids( $include = array() ) { return $include; @@ -657,21 +631,21 @@ class BP_User_Query { * Different components will hook into the 'bp_user_query_populate_extras' * action to loop in the things they want. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WPDB $wpdb Global WordPress database access object. */ public function populate_extras() { global $wpdb; - // Bail if no users + // 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 + // populate_extras to true, because we need the friend counts. if ( 'popular' == $this->query_vars['type'] ) { $this->query_vars['populate_extras'] = 1; } @@ -680,7 +654,7 @@ class BP_User_Query { return; } - // Turn user ID's into a query-usable, comma separated value + // Turn user ID's into a query-usable, comma separated value. $user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) ); /** @@ -696,17 +670,17 @@ class BP_User_Query { * @see bp_xprofile_filter_user_query_populate_extras() * @see bp_friends_filter_user_query_populate_extras() * - * @since BuddyPress (1.7.0) + * @since 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 + // 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 + // 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; @@ -715,17 +689,17 @@ class BP_User_Query { // Fetch usermeta data // We want the three following pieces of info from usermeta: // - friend count - // - latest update + // - 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 + // 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 + // 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 @@ -747,7 +721,7 @@ class BP_User_Query { } // When meta_key or meta_value have been passed to the query, - // fetch the resulting values for use in the template functions + // 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", @@ -774,4 +748,73 @@ class BP_User_Query { } } } + + /** + * Get a SQL clause representing member_type include/exclusion. + * + * @since 2.4.0 + * + * @param string|array $member_types Array or comma-separated list of member types. + * @param string $operator 'IN' or 'NOT IN'. + * @return string + */ + protected function get_sql_clause_for_member_types( $member_types, $operator ) { + global $wpdb; + + // Sanitize. + if ( 'NOT IN' !== $operator ) { + $operator = 'IN'; + } + + // Parse and sanitize types. + if ( ! is_array( $member_types ) ) { + $member_types = preg_split( '/[,\s+]/', $member_types ); + } + + $types = array(); + foreach ( $member_types as $mt ) { + if ( bp_get_member_type_object( $mt ) ) { + $types[] = $mt; + } + } + + $tax_query = new WP_Tax_Query( array( + array( + 'taxonomy' => 'bp_member_type', + 'field' => 'name', + 'operator' => $operator, + 'terms' => $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; + } + + $sql_clauses = $tax_query->get_sql( 'u', $this->uid_name ); + + if ( $switched ) { + restore_current_blog(); + } + + $clause = ''; + + // The no_results clauses are the same between IN and NOT IN. + if ( false !== strpos( $sql_clauses['where'], '0 = 1' ) ) { + $clause = $this->no_results['where']; + + // The tax_query clause generated for NOT IN can be used almost as-is. We just trim the leading 'AND'. + } elseif ( 'NOT IN' === $operator ) { + $clause = preg_replace( '/^\s*AND\s*/', '', $sql_clauses['where'] ); + + // IN clauses must be converted to a subquery. + } elseif ( preg_match( '/' . $wpdb->term_relationships . '\.term_taxonomy_id IN \([0-9, ]+\)/', $sql_clauses['where'], $matches ) ) { + $clause = "u.{$this->uid_name} IN ( SELECT object_id FROM $wpdb->term_relationships WHERE {$matches[0]} )"; + } + + return $clause; + } } diff --git a/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-category-checklist.php b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-category-checklist.php new file mode 100644 index 0000000000000000000000000000000000000000..7c495ca794f326c5b83f28ada8a95fd8f04e85df --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/classes/class-bp-walker-category-checklist.php @@ -0,0 +1,109 @@ +<?php +/** + * Walker class to output an unordered list of category checkbox input elements. + * + * A modification of WordPress 4.4.1's Walker_Category_Checklist class which prints term description + * instead of term name, and makes it work for non-hierarchical taxonomys. Some lines have undergone + * slight adjustment to meet modern coding standards, but any improvements should be contributed upstream. + * + * @since 2.5.0 + */ +class BP_Walker_Category_Checklist extends Walker { + public $tree_type = 'category'; + public $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' ); + + /** + * Starts the list before the elements are added. + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. + */ + public function start_lvl( &$output, $depth = 0, $args = array() ) { + $indent = str_repeat( "\t", $depth ); + $output .= "$indent<ul class='children'>\n"; + } + + /** + * Ends the list of after the elements are added. + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. + */ + public function end_lvl( &$output, $depth = 0, $args = array() ) { + $indent = str_repeat( "\t", $depth ); + $output .= "$indent</ul>\n"; + } + + /** + * Start the element output. + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. + * @param int $id ID of the current term. + */ + public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { + if ( empty( $args['taxonomy'] ) ) { + $taxonomy = 'category'; + } else { + $taxonomy = $args['taxonomy']; + } + + if ( $taxonomy == 'category' ) { + $name = 'post_category'; + } else { + $name = 'tax_input[' . $taxonomy . ']'; + } + + $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; + $class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : ''; + + $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; + + if ( ! empty( $args['list_only'] ) ) { + $aria_cheched = 'false'; + $inner_class = 'category'; + + if ( in_array( $category->term_id, $args['selected_cats'] ) ) { + $inner_class .= ' selected'; + $aria_cheched = 'true'; + } + + /** This filter is documented in wp-includes/category-template.php */ + $output .= "\n" . '<li' . $class . '>' . + '<div class="' . $inner_class . '" data-term-id=' . $category->term_id . + ' tabindex="0" role="checkbox" aria-checked="' . $aria_cheched . '">' . + esc_html( apply_filters( 'the_category', $category->description ) ) . '</div>'; + } else { + /** This filter is documented in wp-includes/category-template.php */ + $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . + '<label class="selectit"><input value="' . $category->slug . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . + checked( in_array( $category->term_id, $args['selected_cats'] ), true, false ) . + disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . + esc_html( apply_filters( 'the_category', $category->description ) ) . '</label>'; + } + } + + /** + * Ends the element output, if needed. + * + * @see Walker::end_el() + * + * @since 2.5.0 + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $category The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + */ + public function end_el( &$output, $category, $depth = 0, $args = array() ) { + $output .= "</li>\n"; + } +} 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 index 9a6d96dd81d5f90ac99feff3e030f210e413a2ec..545a6ddf079d540300e05b42fee40b47e86c167e 100644 --- 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 @@ -4,18 +4,19 @@ * * @package BuddyPress * @subpackage Core + * @since 1.9.0 */ -// Exit if accessed directly +// 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 + * to require an actual post type or taxonomy, and to force certain CSS classes. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { @@ -24,7 +25,7 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * * @see Walker_Nav_Menu::__construct() for a description of parameters. * - * @param array $fields See {@link Walker_Nav_Menu::__construct()}. + * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}. */ public function __construct( $fields = false ) { if ( $fields ) { @@ -38,8 +39,8 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * @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()}. + * @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 ); @@ -52,8 +53,8 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * @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()}. + * @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 ); @@ -65,12 +66,12 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * * @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()}. + * @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|array $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; @@ -102,7 +103,7 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $item->classes[] = 'bp-'. $item->post_excerpt .'-nav'; } - // Menu item hidden fields + // 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 ) .'" />'; @@ -114,4 +115,4 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $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 index 77c0fab4eeeb3fab5695af71e9621faee3df2f3a..d24ecdc6dde48a2aa0c942b6325949578c33e6ff 100644 --- 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 @@ -4,22 +4,23 @@ * * @package BuddyPress * @subpackage Core + * @since 1.7.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Create HTML list of BP nav items. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { /** * Description of fields indexes for building markup. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var array */ var $db_fields = array( 'id' => 'css_id', 'parent' => 'parent' ); @@ -27,7 +28,7 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { /** * Tree type. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @var string */ var $tree_type = array(); @@ -45,12 +46,12 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { * hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and * those have ID/post_parent. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see Walker::walk() * - * @param array $elements See {@link Walker::walk()}. - * @param int $max_depth See {@link 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 ) { @@ -59,15 +60,15 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { $args = array_slice( $func_args, 2 ); $output = ''; - if ( $max_depth < -1 ) // invalid parameter + if ( $max_depth < -1 ) // Invalid parameter. return $output; - if ( empty( $elements ) ) // nothing to walk + if ( empty( $elements ) ) // Nothing to walk. return $output; $parent_field = $this->db_fields['parent']; - // flat display + // Flat display. if ( -1 == $max_depth ) { $empty_array = array(); @@ -78,7 +79,7 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { } /* - * need to display in hierarchical order + * 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. @@ -95,8 +96,8 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { } /* - * when none of the elements is top level - * assume the first one must be root of the sub elements + * When none of the elements is top level + * assume the first one must be root of the sub elements. */ if ( empty( $top_level_elements ) ) { @@ -117,8 +118,8 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { $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 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(); @@ -134,26 +135,26 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { /** * Display the current <li> that we are on. * - * @see Walker::start_el() for complete description of parameters . + * @see Walker::start_el() for complete description of parameters. * - * @since BuddyPress (1.7.0) + * @since 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. + * 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 $id 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 + // 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) + * @since 1.7.0 * * @param array $value Array of classes to be added. * @param object $item Menu item data object. @@ -163,12 +164,12 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { $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 = 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) + * @since 1.7.0 * * @param string $id ID attribute to be added to the menu item. * @param object $item Menu item data object. @@ -180,17 +181,17 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { // Opening tag; closing tag is handled in Walker_Nav_Menu::end_el(). $output .= $indent . '<li' . $id . $class_names . '>'; - // Add href attribute + // Add href attribute. $attributes = ! empty( $item->link ) ? ' href="' . esc_url( $item->link ) . '"' : ''; - // Construct the 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) + * @since 1.7.0 * * @param string $name Item text to be applied. * @param int $value Post ID the title is for. @@ -202,7 +203,7 @@ class BP_Walker_Nav_Menu extends Walker_Nav_Menu { /** * Filters the final result for the menu item. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $item_output Constructed output for the menu item to append to output. * @param object $item Menu item data object. diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css index b6a7dafa1526dd29fe262dd798da39857001d149..2e4f0f9556cc2302ecf3737a8d1dde039c24a102 100644 --- a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css @@ -17,7 +17,7 @@ right: 0; } #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul { - right: 0; + right: 0; } /* Notifications */ diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css index 468896b0d2f0cde2a6147edae7fabdea497d1c40..9c2af6a56ae2472ffe8ca12b19f479d46971603f 100644 --- a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css @@ -17,7 +17,7 @@ left: 0; } #wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul { - left: 0; + left: 0; } /* Notifications */ diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css index 04a3223999f5a36516ba7e4e8b5b72cb62abdd3e..5cb9de7e7908860e188a6cb7379045aacf656e0d 100644 --- a/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css +++ b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.css @@ -1,26 +1,31 @@ -div.bp-avatar-status { +div.bp-avatar-status, +div.bp-cover-image-status { clear: both; margin: 1em 0; } -div.bp-avatar-status p.updated { +div.bp-avatar-status p.updated, +div.bp-cover-image-status p.updated { display: block; padding: 10px 15px; } -div.bp-avatar-status p.success { +div.bp-avatar-status p.success, +div.bp-cover-image-status p.success { background-color: #efc; border: 1px solid #591; color: #250; } -div.bp-avatar-status p.error { +div.bp-avatar-status p.error, +div.bp-cover-image-status p.error { background-color: #fdc; border: 1px solid #a00; color: #800; } -div.bp-avatar-status .bp-progress { +div.bp-avatar-status .bp-progress, +div.bp-cover-image-status .bp-progress { background: none; border: 1px solid #d1d1d1; float: left; @@ -33,7 +38,8 @@ div.bp-avatar-status .bp-progress { width: 200px; } -div.bp-avatar-status .bp-bar { +div.bp-avatar-status .bp-bar, +div.bp-cover-image-status .bp-bar { background-color: #c3ff88; width: 0; height: 100%; @@ -49,7 +55,9 @@ div.bp-avatar-status .bp-bar { padding: 10px 15px; } -#bp-uploader-warning, #bp-webcam-message p.warning { +#buddypress p.warning, +body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning, +body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning { background-color: #ffd; border: 1px solid #cb2; color: #440; @@ -138,6 +146,7 @@ div.bp-avatar-nav { } .drag-drop #drag-drop-area { + box-sizing: border-box; display: table; height: 100%; width: 100%; @@ -162,7 +171,15 @@ div.bp-avatar-nav { text-align: center; } -.drag-drop-inside p.drag-drop-info {margin-top: 0;} +.drag-drop-inside p.drag-drop-info { + margin-top: 0; +} + +@supports (-ms-accelerator:true) { + .drag-drop-inside p.drag-drop-info { + display: block; + } +} #avatar-to-crop { margin: 0 auto 20px ; 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 index fe6cd24b3ffb91ad85ff8ab8f88f394a0f0e269c..7351369e5209357a32b7757f90d6b754b691db10 100644 --- a/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.min.css +++ b/wp-content/plugins/buddypress/bp-core/css/avatar-rtl.min.css @@ -1 +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 +div.bp-avatar-status,div.bp-cover-image-status{clear:both;margin:1em 0}div.bp-avatar-status p.updated,div.bp-cover-image-status p.updated{display:block;padding:10px 15px}div.bp-avatar-status p.success,div.bp-cover-image-status p.success{background-color:#efc;border:1px solid #591;color:#250}div.bp-avatar-status p.error,div.bp-cover-image-status p.error{background-color:#fdc;border:1px solid #a00;color:#800}div.bp-avatar-status .bp-progress,div.bp-cover-image-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,div.bp-cover-image-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}#buddypress p.warning,body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent 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{box-sizing:border-box;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}@supports (-ms-accelerator:true){.drag-drop-inside p.drag-drop-info{display:block}}#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 index d3434e46e43dd5f7ecfd580e1bd6510b80f7d85f..1187eba39d3328eac10018194ddbaf32d765d7c2 100644 --- a/wp-content/plugins/buddypress/bp-core/css/avatar.css +++ b/wp-content/plugins/buddypress/bp-core/css/avatar.css @@ -1,26 +1,31 @@ -div.bp-avatar-status { +div.bp-avatar-status, +div.bp-cover-image-status { clear: both; margin: 1em 0; } -div.bp-avatar-status p.updated { +div.bp-avatar-status p.updated, +div.bp-cover-image-status p.updated { display: block; padding: 10px 15px; } -div.bp-avatar-status p.success { +div.bp-avatar-status p.success, +div.bp-cover-image-status p.success { background-color: #efc; border: 1px solid #591; color: #250; } -div.bp-avatar-status p.error { +div.bp-avatar-status p.error, +div.bp-cover-image-status p.error { background-color: #fdc; border: 1px solid #a00; color: #800; } -div.bp-avatar-status .bp-progress { +div.bp-avatar-status .bp-progress, +div.bp-cover-image-status .bp-progress { background: none; border: 1px solid #d1d1d1; float: right; @@ -33,7 +38,8 @@ div.bp-avatar-status .bp-progress { width: 200px; } -div.bp-avatar-status .bp-bar { +div.bp-avatar-status .bp-bar, +div.bp-cover-image-status .bp-bar { background-color: #c3ff88; width: 0; height: 100%; @@ -49,7 +55,9 @@ div.bp-avatar-status .bp-bar { padding: 10px 15px; } -#bp-uploader-warning, #bp-webcam-message p.warning { +#buddypress p.warning, +body.users_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning, +body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning { background-color: #ffd; border: 1px solid #cb2; color: #440; @@ -138,6 +146,7 @@ div.bp-avatar-nav { } .drag-drop #drag-drop-area { + box-sizing: border-box; display: table; height: 100%; width: 100%; @@ -162,7 +171,15 @@ div.bp-avatar-nav { text-align: center; } -.drag-drop-inside p.drag-drop-info {margin-top: 0;} +.drag-drop-inside p.drag-drop-info { + margin-top: 0; +} + +@supports (-ms-accelerator:true) { + .drag-drop-inside p.drag-drop-info { + display: block; + } +} #avatar-to-crop { margin: 0 auto 20px ; diff --git a/wp-content/plugins/buddypress/bp-core/css/avatar.min.css b/wp-content/plugins/buddypress/bp-core/css/avatar.min.css index 3ddbbd4568c5f9a158bc9830aac184d48722525e..5210a9a782f60ad8140e68c2feaa2e73c024bde4 100644 --- a/wp-content/plugins/buddypress/bp-core/css/avatar.min.css +++ b/wp-content/plugins/buddypress/bp-core/css/avatar.min.css @@ -1 +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 +div.bp-avatar-status,div.bp-cover-image-status{clear:both;margin:1em 0}div.bp-avatar-status p.updated,div.bp-cover-image-status p.updated{display:block;padding:10px 15px}div.bp-avatar-status p.success,div.bp-cover-image-status p.success{background-color:#efc;border:1px solid #591;color:#250}div.bp-avatar-status p.error,div.bp-cover-image-status p.error{background-color:#fdc;border:1px solid #a00;color:#800}div.bp-avatar-status .bp-progress,div.bp-cover-image-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,div.bp-cover-image-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}#buddypress p.warning,body.profile_page_bp-profile-edit.modal-open #TB_ajaxContent p.warning,body.users_page_bp-profile-edit.modal-open #TB_ajaxContent 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{box-sizing:border-box;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}@supports (-ms-accelerator:true){.drag-drop-inside p.drag-drop-info{display:block}}#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/deprecated/1.2.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.2.php index e9dc50a2e6ddf8913a84c9aa7bcf6ec74b68257f..bfd2a3df4ff7351b4e6906a10c808eda056d5eb6 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.2.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.2.php @@ -11,8 +11,8 @@ * * You should use bp_activity_get() instead * - * @since BuddyPress (1.0) - * @deprecated BuddyPress (1.2) + * @since 1.0.0 + * @deprecated 1.2.0 * * @param array $args * 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 5c2471f2df79f1fe51c596210b5ff99dd3218afc..c144d21343773ec9426365e6e0a2ae2f29b9341a 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php @@ -4,7 +4,7 @@ * * @package BuddyPress * @subpackage Core - * @deprecated Since 1.5 + * @deprecated Since 1.5.0 */ // Exit if accessed directly @@ -13,7 +13,7 @@ defined( 'ABSPATH' ) || exit; /** Loader ********************************************************************/ /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_setup_root_components() { do_action( 'bp_setup_root_components' ); @@ -28,8 +28,10 @@ add_action( 'bp_init', 'bp_setup_root_components', 6 ); * This function originally served as a wrapper when WordPress and WordPress MU were separate entities. * Use is_multisite() instead. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use is_multisite() + * + * @return bool */ function bp_core_is_multisite() { _deprecated_function( __FUNCTION__, '1.5', 'is_multisite()' ); @@ -41,27 +43,27 @@ function bp_core_is_multisite() { * * Checks if current blog is root blog of site. Deprecated in 1.5. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use is_main_site() * @package BuddyPress - * @param int $blog_id optional blog id to test (default current blog) + * @param int|string $blog_id optional blog id to test (default current blog) * @return bool True if not multisite or $blog_id is main site - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ function bp_core_is_main_site( $blog_id = '' ) { _deprecated_function( __FUNCTION__, '1.5', 'is_main_site()' ); return is_main_site( $blog_id ); } -/** - * WPMU version of is_super_admin() - * - * @deprecated BuddyPress (1.5) - * @deprecated Use is_super_admin() - * @param int $user_id Optional. Defaults to logged-in user - * @return bool True if is super admin - */ if ( !function_exists( 'is_site_admin' ) ) { + /** + * WPMU version of is_super_admin() + * + * @deprecated 1.5.0 + * @deprecated Use is_super_admin() + * @param int|bool $user_id Optional. Defaults to logged-in user + * @return bool True if is super admin + */ function is_site_admin( $user_id = false ) { _deprecated_function( __FUNCTION__, '1.5', 'is_super_admin()' ); return is_super_admin( $user_id ); @@ -74,9 +76,11 @@ if ( !function_exists( 'is_site_admin' ) ) { * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page() * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use add_menu_page(). - * @since BuddyPress (1.1) + * @since 1.1.0 + * + * @return string */ function bp_core_add_admin_menu_page( $args = '' ) { global $_registered_pages, $admin_page_hooks, $menu; @@ -121,7 +125,7 @@ function bp_core_add_admin_menu_page( $args = '' ) { /** Activity ******************************************************************/ /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_is_activity_permalink() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' ); @@ -131,7 +135,7 @@ function bp_is_activity_permalink() { /** Core **********************************************************************/ /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_core_get_wp_profile() { _deprecated_function( __FUNCTION__, '1.5' ); @@ -204,7 +208,7 @@ function bp_core_get_wp_profile() { } /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use bp_is_my_profile() */ function bp_is_home() { @@ -215,7 +219,7 @@ function bp_is_home() { /** * Is the user on the front page of the site? * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use is_front_page() * @return bool */ @@ -227,7 +231,7 @@ function bp_is_front_page() { /** * Is the front page of the site set to the Activity component? * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use bp_is_component_front_page( 'activity' ) * @return bool */ @@ -237,7 +241,7 @@ function bp_is_activity_front_page() { } /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated use bp_is_user() */ function bp_is_member() { @@ -246,7 +250,7 @@ function bp_is_member() { } /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated use bp_loggedin_user_link() */ function bp_loggedinuser_link() { @@ -258,7 +262,7 @@ function bp_loggedinuser_link() { * Only show the search form if there are available objects to search for. * Deprecated in 1.5; not used anymore. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @return bool */ function bp_search_form_enabled() { @@ -269,9 +273,9 @@ function bp_search_form_enabled() { /** * Template tag version of bp_get_page_title() * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use wp_title() - * @since BuddyPress (1.0) + * @since 1.0.0 */ function bp_page_title() { echo bp_get_page_title(); @@ -280,9 +284,11 @@ function bp_page_title() { * Prior to BuddyPress 1.5, this was used to generate the page's <title> text. * Now, just simply use wp_title(). * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use wp_title() - * @since BuddyPress (1.0) + * @since 1.0.0 + * + * @return string */ function bp_get_page_title() { _deprecated_function( __FUNCTION__, '1.5', 'wp_title()' ); @@ -297,9 +303,9 @@ function bp_page_title() { /** * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url(). * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Use wp_logout_url() - * @since BuddyPress (1.0) + * @since 1.0.0 */ function bp_log_out_link() { _deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' ); @@ -311,7 +317,7 @@ function bp_log_out_link() { /** * Send an email and a BP notification on receipt of an @-mention in a group * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification() */ function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) { @@ -361,8 +367,6 @@ To view and respond to the message, log in and visit: %4$s --------------------- ', 'buddypress' ), $poster_name, $group->name, $content, $message_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); - /* Send the message */ $to = apply_filters( 'groups_at_message_notification_to', $to ); $subject = apply_filters( 'groups_at_message_notification_subject', $subject, $group, $poster_name ); @@ -377,13 +381,18 @@ To view and respond to the message, log in and visit: %4$s /** * BP 1.5 simplified notification functions a bit - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 + * + * @return mixed */ function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) { _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_type()' ); return BP_Core_Notification::delete_for_user_by_type( $user_id, $component_name, $component_action ); } +/** + * @return mixed + */ function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) { _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_item_id()' ); return BP_Core_Notification::delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id ); @@ -391,7 +400,7 @@ function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $ /** * In BP 1.5, these functions were renamed for greater consistency - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_forum_directory_permalink() { _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' ); @@ -404,7 +413,7 @@ function bp_forum_directory_permalink() { /** * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template. - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_search_form() { _deprecated_function( __FUNCTION__, '1.1', 'No longer required.' ); @@ -424,7 +433,7 @@ function bp_search_form() { /** * Some _is_ function had their names normalized - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_is_profile_edit() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_profile_edit()' ); @@ -432,7 +441,7 @@ function bp_is_profile_edit() { } /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_is_change_avatar() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' ); @@ -440,7 +449,7 @@ function bp_is_change_avatar() { } /** - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 */ function bp_is_friend_requests() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' ); @@ -452,7 +461,7 @@ function bp_is_friend_requests() { * 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) + * @deprecated 1.5.0 * @deprecated bp_is_root_component() * @return bool True if root component, else false. */ @@ -467,8 +476,8 @@ function bp_core_is_root_component( $component_name ) { * Contains functions which were moved out of BP-Default's functions.php * in BuddyPress 1.5. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.5) + * @deprecated 1.5.0 + * @since 1.5.0 */ function bp_dtheme_deprecated() { if ( !function_exists( 'bp_dtheme_wp_pages_filter' ) ) : @@ -477,12 +486,12 @@ function bp_dtheme_deprecated() { * Settings > Reading screen for selecting the page to show on front to * include "Activity Stream." As of 1.5.x, it is no longer required. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated No longer required. * @param string $page_html A list of pages as a dropdown (select list) * @return string * @see wp_dropdown_pages() - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_dtheme_wp_pages_filter( $page_html ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -495,12 +504,12 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this function hijacked the saving of page on front setting to save the activity stream setting. * As of 1.5.x, it is no longer required. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated No longer required. * @param string $oldvalue Previous value of get_option( 'page_on_front' ) * @param string $oldvalue New value of get_option( 'page_on_front' ) - * @return string - * @since BuddyPress (1.2) + * @return bool|string + * @since 1.2.0 */ function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -516,11 +525,11 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this function loaded the activity stream template if the front page display settings allow. * As of 1.5.x, it is no longer required. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated No longer required. * @param string $template Absolute path to the page template * @return string - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_dtheme_page_on_front_template( $template ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -533,9 +542,9 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this forced the page ID as a string to stop the get_posts query from kicking up a fuss. * As of 1.5.x, it is no longer required. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated No longer required. - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_dtheme_fix_get_posts_on_activity_front() { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -547,11 +556,11 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this was used as part of the code that set the activity stream to be on the front page. * As of 1.5.x, it is no longer required. * - * @deprecated BuddyPress (1.5) + * @deprecated 1.5.0 * @deprecated No longer required. * @param array $posts Posts as retrieved by WP_Query * @return array - * @since BuddyPress (1.2.5) + * @since 1.2.5 */ function bp_dtheme_fix_the_posts_on_activity_front( $posts ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -564,9 +573,9 @@ function bp_dtheme_deprecated() { * 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 1.5.0 * @deprecated Enqueue the comment-reply script in your theme's header.php. - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_dtheme_add_blog_comments_js() { _deprecated_function( __FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php." ); @@ -582,8 +591,8 @@ add_action( 'after_setup_theme', 'bp_dtheme_deprecated', 15 ); * components, and moved into a new Settings component. This function is no * longer needed as the nav structure is set up by the {@link BP_Component} class. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_add_settings_nav() { _deprecated_function( __FUNCTION__, '1.5' ); @@ -595,8 +604,8 @@ function bp_core_add_settings_nav() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_general_settings() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -608,8 +617,8 @@ function bp_core_screen_general_settings() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_general_settings_title() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -621,8 +630,8 @@ function bp_core_screen_general_settings_title() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_general_settings_content() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -634,8 +643,8 @@ function bp_core_screen_general_settings_content() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_notification_settings() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -647,8 +656,8 @@ function bp_core_screen_notification_settings() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_notification_settings_title() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -660,8 +669,8 @@ function bp_core_screen_notification_settings_title() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_notification_settings_content() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -673,8 +682,8 @@ function bp_core_screen_notification_settings_content() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_delete_account() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -686,8 +695,8 @@ function bp_core_screen_delete_account() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_delete_account_title() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); @@ -699,8 +708,8 @@ function bp_core_screen_delete_account_title() { * longer needed as new template files for the Settings component were * introduced. * - * @deprecated BuddyPress (1.5) - * @since BuddyPress (1.6) + * @deprecated 1.5.0 + * @since 1.6.0 */ function bp_core_screen_delete_account_content() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); 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 8b5a5f04a3d3f98001196839a551bd6541f66920..c5550b6dd48088d54b540c56a2af1dedc2d2502d 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php @@ -1,11 +1,10 @@ <?php - /** * Deprecated Functions * * @package BuddyPress * @subpackage Core - * @deprecated Since 1.6 + * @deprecated 1.6.0 */ // Exit if accessed directly @@ -14,56 +13,56 @@ defined( 'ABSPATH' ) || exit; /** Toolbar functions *********************************************************/ /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_remove_wp_menus() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_root_site() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_my_sites_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_comments_menu( $wp_admin_bar = '' ) { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_appearance_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_admin_bar_updates_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_members_admin_bar_my_account_logout() { _deprecated_function( __FUNCTION__, '1.6' ); } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_core_is_user_deleted( $user_id = 0 ) { _deprecated_function( __FUNCTION__, '1.6' ); @@ -71,7 +70,7 @@ function bp_core_is_user_deleted( $user_id = 0 ) { } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_core_is_user_spammer( $user_id = 0 ) { _deprecated_function( __FUNCTION__, '1.6' ); @@ -84,8 +83,8 @@ function bp_core_is_user_spammer( $user_id = 0 ) { */ /** - * @deprecated BuddyPress (1.6) - * @deprecated No longer used; see bp_blogs_transition_activity_status() + * @deprecated 1.6.0 + * @deprecated No longer used; see bp_activity_transition_post_type_comment_status() */ function bp_blogs_manage_comment( $comment_id, $comment_status ) { _deprecated_function( __FUNCTION__, '1.6', 'No longer used' ); @@ -96,7 +95,7 @@ function bp_blogs_manage_comment( $comment_id, $comment_status ) { */ /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @deprecated No longer used; see BP_Admin::admin_menus() */ function bp_core_add_admin_menu() { @@ -104,7 +103,7 @@ function bp_core_add_admin_menu() { } /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @deprecated No longer used. We do ajax properly now. */ function bp_core_add_ajax_hook() { @@ -118,7 +117,7 @@ function bp_core_add_ajax_hook() { /** * Displays Friends header tabs * - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @deprecated No longer used */ function bp_friends_header_tabs() { @@ -136,7 +135,7 @@ function bp_friends_header_tabs() { /** * Filters the title for the Friends component * - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @deprecated No longer used */ function bp_friends_filter_title() { @@ -161,7 +160,7 @@ function bp_friends_filter_title() { /** Groups functions **********************************************************/ /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @deprecated Renamed to groups_get_id() for greater consistency */ function groups_check_group_exists( $group_slug ) { @@ -174,7 +173,7 @@ function groups_check_group_exists( $group_slug ) { /** * Loads admin panel styles and scripts. * - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function bp_core_add_admin_menu_styles() { _deprecated_function( __FUNCTION__, '1.6' ); @@ -183,7 +182,7 @@ function bp_core_add_admin_menu_styles() { /** Activity functions ********************************************************/ /** - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ function updates_register_activity_actions() { _deprecated_function( __FUNCTION__, '1.6' ); @@ -192,7 +191,7 @@ function updates_register_activity_actions() { /** * Sets the "From" address in emails sent * - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 * @return string email address */ function bp_core_email_from_address_filter() { @@ -219,7 +218,7 @@ function bp_core_email_from_address_filter() { * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this * function was introduced in BP 1.6 for related backward compatibility reasons). * - * @deprecated BuddyPress (1.6) + * @deprecated 1.6.0 */ if ( !function_exists( 'bp_dtheme_register_actions' ) ) : function bp_die_legacy_ajax_callbacks() { 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 34cac6b39137dac918fc96848503cc8b7a3eed0a..3fb6b32ebf309c0a0c95a931f902ce230247aa51 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php @@ -4,7 +4,7 @@ * * @package BuddyPress * @subpackage Core - * @deprecated Since 1.7 + * @deprecated Since 1.7.0 */ // Exit if accessed directly @@ -13,8 +13,8 @@ defined( 'ABSPATH' ) || exit; /** * Output the BuddyPress maintenance mode * - * @since BuddyPress (1.6) - * @deprecated BuddyPress (1.7) + * @since 1.6.0 + * @deprecated 1.7.0 * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode */ function bp_maintenance_mode() { @@ -23,8 +23,8 @@ function bp_maintenance_mode() { /** * Return the BuddyPress maintenance mode * - * @since BuddyPress (1.6) - * @deprecated BuddyPress (1.7) + * @since 1.6.0 + * @deprecated 1.7.0 * @return string The BuddyPress maintenance mode */ function bp_get_maintenance_mode() { @@ -32,7 +32,7 @@ function bp_maintenance_mode() { } /** - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 */ function xprofile_get_profile() { _deprecated_function( __FUNCTION__, '1.7' ); @@ -40,7 +40,7 @@ function xprofile_get_profile() { } /** - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 */ function bp_get_profile_header() { _deprecated_function( __FUNCTION__, '1.7' ); @@ -48,7 +48,7 @@ function bp_get_profile_header() { } /** - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 * @param string $component_name * @return boolean */ @@ -61,7 +61,7 @@ function bp_exists( $component_name ) { } /** - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 */ function bp_get_plugin_sidebar() { _deprecated_function( __FUNCTION__, '1.7' ); @@ -74,7 +74,7 @@ function bp_get_plugin_sidebar() { * bundled themes show up on the root blog selection screen and bypass this * step. It also means that the themes won't show for selection on other blogs. * - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 * @package BuddyPress Core */ function bp_core_allow_default_theme( $themes ) { @@ -97,7 +97,7 @@ function bp_core_allow_default_theme( $themes ) { /** * No longer used by BuddyPress core * - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 * @param string $page * @return boolean True if is BuddyPress page */ @@ -119,7 +119,7 @@ function bp_is_page( $page = '' ) { * This function was originally used to update pre-1.1 schemas, but that was * before we had a legitimate update process. * - * @deprecated BuddyPress (1.7) + * @deprecated 1.7.0 * @global WPDB $wpdb */ function bp_update_db_stuff() { 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 d2c0f42f8827b2b454b27bf1e41f9db6c2942f4a..369089a163086c00eb2fa029c60f383bf3757fae 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Notifications * @@ -19,7 +18,7 @@ defined( 'ABSPATH' ) || exit; * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_add_notification() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param string $item_id * @param int $user_id * @param string $component_name @@ -62,7 +61,7 @@ function bp_core_add_notification( $item_id, $user_id, $component_name, $compone * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_notification() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $id ID of notification. * @return boolean True on success, false on failure. */ @@ -85,7 +84,7 @@ function bp_core_delete_notification( $id ) { * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_get_notification() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $id ID of notification. * @return BP_Core_Notification */ @@ -108,7 +107,7 @@ function bp_core_get_notification( $id ) { * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_get_notifications_for_user() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id ID of user. * @param string $format * @return boolean Object or array on success, false on failure. @@ -137,7 +136,7 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'string' ) { * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_notifications_by_type() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id * @param string $component_name * @param string $component_action @@ -165,7 +164,7 @@ function bp_core_delete_notifications_by_type( $user_id, $component_name, $compo * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_notifications_by_item_id() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id * @param string $component_name * @param string $component_action @@ -190,7 +189,7 @@ function bp_core_delete_notifications_by_item_id( $user_id, $item_id, $component * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_all_notifications_by_type() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id * @param string $component_name * @param string $component_action @@ -217,7 +216,7 @@ function bp_core_delete_all_notifications_by_type( $item_id, $component_name, $c * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_delete_notifications_from_user() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id * @param string $component_name * @param string $component_action @@ -246,7 +245,7 @@ function bp_core_delete_notifications_from_user( $user_id, $component_name, $com * @deprecated Deprecated since BuddyPress 1.9.0. Use * bp_notifications_check_notification_access() instead. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @param int $user_id * @param int $notification_id * @return boolean True on success, false on failure. 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 32cebede11b0d750c36cf6c2bb968ba2f3c5946b..1b0e426876e6b61f0ccd09b4a5bedfcef9a1e726 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.0.php @@ -11,21 +11,21 @@ defined( 'ABSPATH' ) || exit; /** - * @deprecated BuddyPress (2.0.0) + * @deprecated 2.0.0 */ function bp_activity_clear_meta_cache_for_activity() { _deprecated_function( __FUNCTION__, '2.0.0', 'Use WP metadata API instead' ); } /** - * @deprecated BuddyPress (2.0.0) + * @deprecated 2.0.0 */ function bp_blogs_catch_published_post() { _deprecated_function( __FUNCTION__, '2.0', 'bp_blogs_catch_transition_post_status()' ); } /** - * @deprecated BuddyPress (2.0.0) + * @deprecated 2.0.0 */ function bp_messages_screen_inbox_mark_notifications() { _deprecated_function( __FUNCTION__, '2.0', 'bp_messages_screen_conversation_mark_notifications()' ); 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 edc12d5efb1c6d4d2a96165eb2343c3385d77221..221f50ac6c6f933f2d063df51b5ec93f6caeaf59 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.1.php @@ -13,77 +13,28 @@ defined( 'ABSPATH' ) || exit; /** * Register (not enqueue) scripts that used to be used by BuddyPress. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_core_register_deprecated_scripts() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - $url = buddypress()->plugin_url . 'bp-core/deprecated/js/'; - - $scripts = apply_filters( 'bp_core_register_deprecated_scripts', array( - - // Messages - 'bp-jquery-autocomplete' => array( - 'file' => "{$url}autocomplete/jquery.autocomplete{$min}.js", - 'dependencies' => array( 'jquery' ), - ), - - 'bp-jquery-autocomplete-fb' => array( - 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.js", - 'dependencies' => array( 'jquery' ), - ), - - 'bp-jquery-bgiframe' => array( - 'file' => "{$url}autocomplete/jquery.bgiframe{$min}.js", - 'dependencies' => array( 'jquery' ), - ), - - 'bp-jquery-dimensions' => array( - 'file' => "{$url}autocomplete/jquery.dimensions{$min}.js", - 'dependencies' => array( 'jquery' ), - ), - ) ); - - foreach ( $scripts as $id => $script ) { - wp_register_script( $id, $script['file'], $script['dependencies'], bp_get_version(), true ); - } + // Scripts undeprecated as of 2.5.0. } -add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_scripts', 1 ); /** * Register (not enqueue) styles that used to be used by BuddyPress. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_core_register_deprecated_styles() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - $url = buddypress()->plugin_url . 'bp-core/deprecated/css/'; - - $styles = apply_filters( 'bp_core_register_deprecated_styles', array( - // Messages - 'bp-messages-autocomplete' => array( - 'file' => "{$url}autocomplete/jquery.autocompletefb{$min}.css", - 'dependencies' => array(), - ) - ) ); - - foreach ( $styles as $id => $style ) { - wp_register_style( $id, $style['file'], $style['dependencies'], bp_get_version() ); - - wp_style_add_data( $id, 'rtl', true ); - if ( $min ) { - wp_style_add_data( $id, 'suffix', $min ); - } - } + // Scripts undeprecated as of 2.5.0. } -add_action( 'bp_enqueue_scripts', 'bp_core_register_deprecated_styles', 1 ); /** BuddyBar *****************************************************************/ /** * Add a Sites menu to the BuddyBar. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (2.1.0) + * @since 1.0.0 + * @deprecated 2.1.0 * * @return bool|null Returns false on failure. Otherwise echoes the menu item. */ @@ -149,8 +100,8 @@ function bp_adminbar_blogs_menu() { * If user has upgraded to 1.6 and chose to retain their BuddyBar, offer then a switch to change over * to the WP Toolbar. * - * @since BuddyPress (1.6) - * @deprecated BuddyPress (2.1.0) + * @since 1.6.0 + * @deprecated 2.1.0 */ function bp_admin_setting_callback_force_buddybar() { ?> @@ -169,8 +120,8 @@ function bp_admin_setting_callback_force_buddybar() { * the WP Toolbar. The option we store is 1 if the BuddyBar is forced on, so we use this function * to flip the boolean before saving the intval. * - * @since BuddyPress (1.6) - * @deprecated BuddyPress (2.1.0) + * @since 1.6.0 + * @deprecated 2.1.0 * @access Private */ function bp_admin_sanitize_callback_force_buddybar( $value = false ) { @@ -181,7 +132,7 @@ function bp_admin_sanitize_callback_force_buddybar( $value = false ) { * Wrapper function for rendering the BuddyBar. * * @return bool|null Returns false if the BuddyBar is disabled. - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_core_admin_bar() { $bp = buddypress(); @@ -215,7 +166,7 @@ function bp_core_admin_bar() { /** * Output the BuddyBar logo. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_adminbar_logo() { echo '<a href="' . bp_get_root_domain() . '" id="admin-bar-logo">' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . '</a>'; @@ -226,7 +177,7 @@ function bp_adminbar_logo() { * * Visible only to visitors who are not logged in. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 * * @return bool|null Returns false if the current user is logged in. */ @@ -247,7 +198,7 @@ function bp_adminbar_login_menu() { /** * Output the My Account BuddyBar menu. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 * * @return bool|null Returns false on failure. */ @@ -332,7 +283,7 @@ function bp_adminbar_thisblog_menu() { * * Not visible for logged-in users. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_adminbar_random_menu() { ?> @@ -365,7 +316,7 @@ function bp_adminbar_random_menu() { /** * Enqueue the BuddyBar CSS. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_core_load_buddybar_css() { @@ -373,7 +324,7 @@ function bp_core_load_buddybar_css() { return; } - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) { // Backwards compatibility $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css'; @@ -393,9 +344,9 @@ add_action( 'bp_init', 'bp_core_load_buddybar_css' ); /** * Add menu items to the BuddyBar. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_groups_adminbar_admin_menu() { $bp = buddypress(); @@ -451,7 +402,7 @@ add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 ); /** * Add the Notifications menu to the BuddyBar. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_adminbar_notifications_menu() { @@ -467,7 +418,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 ); /** * Add the Blog Authors menu to the BuddyBar (visible when not logged in). * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_adminbar_authors_menu() { global $wpdb; @@ -507,7 +458,7 @@ function bp_adminbar_authors_menu() { 'height' => 15, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $author->display_name ) ) ); - echo ' ' . $author->display_name . '</a>'; + echo ' ' . $author->display_name . '</a>'; echo '<div class="admin-bar-clear"></div>'; echo '</li>'; } @@ -523,7 +474,7 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 ); * Adds an Toolbar menu to any profile page providing site moderator actions * that allow capable users to clean up a users account. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_members_adminbar_admin_menu() { @@ -566,8 +517,8 @@ add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 ); /** * Create the Notifications menu for the BuddyBar. * - * @since BuddyPress (1.9.0) - * @deprecated BuddyPress (2.1.0) + * @since 1.9.0 + * @deprecated 2.1.0 */ function bp_notifications_buddybar_menu() { @@ -613,9 +564,9 @@ add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 ); /** * Output the base URL for subdomain installations of WordPress Multisite. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_blogs_subdomain_base() { _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_subdomain_base()' ); @@ -625,11 +576,11 @@ function bp_blogs_subdomain_base() { /** * Return the base URL for subdomain installations of WordPress Multisite. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com. * - * @deprecated BuddyPress (2.1.0) + * @deprecated 2.1.0 */ function bp_blogs_get_subdomain_base() { _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_get_subdomain_base()' ); @@ -639,8 +590,8 @@ function bp_blogs_get_subdomain_base() { /** * Allegedly output an avatar upload form, but it hasn't done that since 2009. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (2.1.0) + * @since 1.0.0 + * @deprecated 2.1.0 */ function bp_avatar_upload_form() { _deprecated_function(__FUNCTION__, '2.1', 'No longer used' ); diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php index 6adc75d734abdc903eb09cfe0e730f74742fc041..bbb00602e4ff2eb8b44078b1087dcc67b487883e 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.2.php @@ -19,8 +19,8 @@ defined( 'ABSPATH' ) || exit; * * See #4090, #3746, #2546 for background. * - * @since BuddyPress (2.0.0) - * @deprecated BuddyPress (2.2.0) + * @since 2.0.0 + * @deprecated 2.2.0 * * @todo Support untrashing better * @@ -36,7 +36,7 @@ function bp_blogs_catch_transition_post_status( $new_status, $old_status, $post /** * Record a new blog post in the BuddyPress activity stream. * - * @deprecated BuddyPress (2.2.0) + * @deprecated 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. @@ -52,8 +52,8 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) { /** * Updates a blog post's corresponding activity entry during a post edit. * - * @since BuddyPress (2.0.0) - * @deprecated BuddyPress (2.2.0) + * @since 2.0.0 + * @deprecated 2.2.0 * * @see bp_blogs_catch_transition_post_status() * @@ -67,8 +67,8 @@ function bp_blogs_update_post( $post ) { /** * Clear cache when a new blog is created. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (2.2.0) + * @since 1.0.0 + * @deprecated 2.2.0 * * @param BP_Blogs_Blog $recorded_blog_obj The recorded blog, passed by * 'bp_blogs_new_blog'. @@ -81,8 +81,8 @@ function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) { /** * Format 'new_member' activity actions. * - * @since BuddyPress (2.0.0) - * @deprecated BuddyPress (2.2.0) + * @since 2.0.0 + * @deprecated 2.2.0 * * @param string $action Static activity action. * @param object $activity Activity object. @@ -98,8 +98,8 @@ function bp_xprofile_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) + * @since 1.1.0 + * @deprecated 2.2.0 */ function bp_core_add_global_group() { _deprecated_function( __FUNCTION__, '2.2', 'This function has no replacement' ); @@ -108,7 +108,7 @@ function bp_core_add_global_group() { /** * Add a piece of message metadata. * - * @deprecated BuddyPress (2.2.2) + * @deprecated 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()' ); diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php index 70854494c557a9c5ec451b65c42b764613d3cc74..5b8dc2e3b34d4a89843840468fd07e28a509d5d0 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.3.php @@ -11,7 +11,7 @@ defined( 'ABSPATH' ) || exit; /** * Return the referrer URL without the http(s):// * - * @deprecated BuddyPress (2.3.0) + * @deprecated 2.3.0 * * @return string The referrer URL. */ diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.4.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.4.php new file mode 100644 index 0000000000000000000000000000000000000000..e9ecf64bba672ee503a60ce9f0540977d42fcfc9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.4.php @@ -0,0 +1,25 @@ +<?php +/** + * Deprecated functions. + * + * @deprecated 2.4.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * @deprecated 2.4.0 + */ +function bp_group_avatar_edit_form() { + _deprecated_function( __FUNCTION__, '2.4' ); +} + +/** + * @deprecated 2.4.0 + * + * @param bool $deprecated Param deprecated 1.1.0 + */ +function groups_avatar_upload( $deprecated = true ) { + _deprecated_function( __FUNCTION__, '2.4' ); +} diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/2.5.php b/wp-content/plugins/buddypress/bp-core/deprecated/2.5.php new file mode 100644 index 0000000000000000000000000000000000000000..8656353ed43a5ad18c666372b33a76797059e2da --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/deprecated/2.5.php @@ -0,0 +1,934 @@ +<?php +/** + * Deprecated functions. + * + * @deprecated 2.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Set "From" name in outgoing email to the site name. + * + * @since 1.0.0 + * @deprecated 2.5.0 Not used. Was hooked to WordPress' "wp_mail_from_name" action. + * Use the "bp_email_get_from" action instead. + * + * @return string The blog name for the root blog. + */ +function bp_core_email_from_name_filter() { + _deprecated_function( __FUNCTION__, '2.5' ); + + /** + * Filters the "From" name in outgoing email to the site name. + * + * @since 1.2.0 + * @deprecated 2.5.0 Not used. + * + * @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 support for pre-2.5 email filters. + * + * @since 2.5.0 + * + * @param mixed $value + * @param string $property Name of property. + * @param string $transform Return value transformation. Unused. + * @param BP_Email $email Email object reference. + * @return mixed + */ +function bp_core_deprecated_email_filters( $value, $property, $transform, $email ) { + $pre_2_5_emails = array( + 'activity-at-message', + 'activity-comment', + 'activity-comment-author', + 'core-user-registration', + 'core-user-registration-with-blog', + 'friends-request', + 'friends-request-accepted', + 'groups-at-message', + 'groups-details-updated', + 'groups-invitation', + 'groups-member-promoted', + 'groups-membership-request', + 'groups-membership-request-accepted', + 'groups-membership-request-rejected', + 'messages-unread', + 'settings-verify-email-change', + ); + + remove_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20, 4 ); + $email_type = $email->get( 'type' ); + $tokens = $email->get( 'tokens' ); + add_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20, 4 ); + + // Backpat for pre-2.5 emails only. + if ( ! in_array( $email_type, $pre_2_5_emails, true ) ) { + return $value; + } + + $original_value = $value; + $to_changed = false; + + if ( $property === 'to' && $original_value ) { + $to_changed = true; + + $value = array_shift( $original_value ); + $recipient_name = $value->get_name(); // Value - name + $value = $value->get_address(); // Key - email + } + + if ( $email_type === 'activity-comment' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the new comment notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value + */ + $value = apply_filters( 'bp_activity_new_comment_notification_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the new comment notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Email notification subject text. + * @param string $poster_name Name of the person who made the comment. + */ + $value = apply_filters( 'bp_activity_new_comment_notification_subject', $value, $tokens['poster.name'] ); + + } elseif ( $property === 'content' ) { + /** + * Filters the new comment notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 $deprecated Removed in 2.5; now an empty string. + */ + $value = apply_filters( 'bp_activity_new_comment_notification_message', $value, $tokens['poster.name'], $tokens['content'], $tokens['thread.url'], '' ); + } + + } elseif ( $email_type === 'activity-comment-author' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the new comment reply notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value + */ + $value = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the new comment reply notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Email notification subject text. + * @param string $poster_name Name of the person who made the comment. + */ + $value = apply_filters( 'bp_activity_new_comment_notification_comment_author_subject', $value, $tokens['poster.name'] ); + + } elseif ( $property === 'content' ) { + /** + * Filters the new comment reply notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 $deprecated Removed in 2.5; now an empty string. + * @param string $thread_link URL permalink for the activity thread. + */ + $value = apply_filters( 'bp_activity_new_comment_notification_comment_author_message', $value, $tokens['poster.name'], $tokens['content'], '', $tokens['thread.url'] ); + } + + } elseif ( $email_type === 'activity-at-message' || $email_type === 'groups-at-message' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the @mention notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value + */ + $value = apply_filters( 'bp_activity_at_message_notification_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the @mention notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Email notification subject text. + * @param string $poster_name Name of the person who made the @mention. + */ + $value = apply_filters( 'bp_activity_at_message_notification_subject', $value, $tokens['poster.name'] ); + + } elseif ( $property === 'content' ) { + /** + * Filters the @mention notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @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 $deprecated Removed in 2.5; now an empty string. + */ + $value = apply_filters( 'bp_activity_at_message_notification_message', $value, $tokens['poster.name'], $tokens['content'], $tokens['mentioned.url'], '' ); + } + + } elseif ( $email_type === 'core-user-registration' ) { + // Filters are different according to the WordPress config. + if ( is_multisite() ) { + $registration_filters = array( + 'to' => 'bp_core_activation_signup_user_notification_to', + 'subject' => 'bp_core_activation_signup_user_notification_subject', + 'content' => 'bp_core_activation_signup_user_notification_message', + ); + } else { + $registration_filters = array( + 'to' => 'bp_core_signup_send_validation_email_to', + 'subject' => 'bp_core_signup_send_validation_email_subject', + 'content' => 'bp_core_signup_send_validation_email_message', + ); + } + + if ( $property === 'to' ) { + /** + * Filters the email that the notification is going to upon successful registration without blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value User email the notification is being sent to. + * @param string $recipient_username The user's login name. + * @param array $value User email the notification is being sent to (again). + * Array key is email address, value is the name. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( $registration_filters['to'], $value, $tokens['recipient.username'], $value, $tokens['key'], array() ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the subject that the notification uses upon successful registration without blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value Email notification subject text. + * @param string $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( $registration_filters['subject'], $value, $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key'], array() ); + + } elseif ( $property === 'content' ) { + /** + * Filters the message that the notification uses upon successful registration without blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value The message to use. + * @param string $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( $registration_filters['content'], $value, $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key'], array() ); + } + + } elseif ( $email_type === 'core-user-registration-with-blog' ) { + if ( $property === 'to' ) { + /** + * Filters the email that the notification is going to upon successful registration with blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value User email the notification is being sent to. + * @param string $domain The new blog domain. + * @param string $path The new blog path. + * @param string $title The site title. + * @param string $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( 'bp_core_activation_signup_blog_notification_to', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the subject that the notification uses upon successful registration with blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value 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 $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( 'bp_core_activation_signup_blog_notification_subject', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); + + } elseif ( $property === 'content' ) { + /** + * Filters the message that the notification uses upon successful registration with blog. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $value 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 $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + $value = apply_filters( 'bp_core_activation_signup_blog_notification_message', $value, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); + } + + } elseif ( $email_type === 'friends-request' ) { + if ( $property === 'to' ) { + /** + * Filters the email address for who is getting the friend request. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value + */ + $value = apply_filters( 'friends_notification_new_request_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the subject for the friend request email. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Subject line to be used in friend request email. + * @param string $initiator_name Name of the person requesting friendship. + */ + $value = apply_filters( 'friends_notification_new_request_subject', $value, $tokens['initiator.name'] ); + + } elseif ( $property === 'content' ) { + /** + * Filters the message for the friend request email. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 Removed in 2.5; now an empty string. + */ + $value = apply_filters( 'friends_notification_new_request_message', $value, $tokens['initiator.name'], $tokens['initiator.url'], $tokens['friend-requests.url'], '' ); + } + + } elseif ( $email_type === 'friends-request-accepted' ) { + if ( $property === 'to' ) { + /** + * Filters the email address for whose friend request got accepted. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Email address for whose friend request got accepted. + */ + $value = apply_filters( 'friends_notification_accepted_request_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the subject for the friend request accepted email. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Subject line to be used in friend request accepted email. + * @param string $friend_name Name of the person who accepted the friendship request. + */ + $value = apply_filters( 'friends_notification_accepted_request_subject', $value, $tokens['friend.name'] ); + + } elseif ( $property === 'content' ) { + /** + * Filters the message for the friend request accepted email. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 Removed in 2.5; now an empty string. + */ + $value = apply_filters( 'friends_notification_accepted_request_message', $value, $tokens['friend.name'], $tokens['friendship.url'], '' ); + } + + } elseif ( $email_type === 'groups-details-updated' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the group update notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value User email the notification is being sent to. + */ + $value = apply_filters( 'groups_notification_group_updated_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the group update notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Email notification subject text. + * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. + */ + $value = apply_filters_ref_array( 'groups_notification_group_updated_subject', array( $value, &$tokens['group'] ) ); + + } elseif ( $property === 'content' ) { + /** + * Filters the group update notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 Removed in 2.5; now an empty string. + */ + $value = apply_filters_ref_array( 'groups_notification_group_updated_message', array( $value, &$tokens['group'], $tokens['group.url'], '' ) ); + } + + } elseif ( $email_type === 'groups-invitation' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the group invite notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value User email the invite notification is being sent to. + */ + $value = apply_filters( 'groups_notification_group_invites_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the group invite notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Invite notification email subject text. + * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. + */ + $value = apply_filters_ref_array( 'groups_notification_group_invites_subject', array( $value, &$tokens['group'] ) ); + + } elseif ( $property === 'content' ) { + /** + * Filters the group invite notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 Removed in 2.5; now an empty string. + */ + $value = apply_filters_ref_array( 'groups_notification_group_invites_message', array( $value, &$tokens['group'], $tokens['inviter.name'], $tokens['inviter.url'], $tokens['invites.url'], $tokens['group.url'], '' ) ); + } + + } elseif ( $email_type === 'groups-member-promoted' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the group promotion notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value User email the promotion notification is being sent to. + */ + $value = apply_filters( 'groups_notification_promoted_member_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the group promotion notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Promotion notification email subject text. + * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. + */ + $value = apply_filters_ref_array( 'groups_notification_promoted_member_subject', array( $value, &$tokens['group'] ) ); + + } elseif ( $property === 'content' ) { + /** + * Filters the group promotion notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 Removed in 2.5; now an empty string. + */ + $value = apply_filters_ref_array( 'groups_notification_promoted_member_message', array( $value, &$tokens['group'], $tokens['promoted_to'], $tokens['group.url'], '' ) ); + } + + } elseif ( $email_type === 'groups-membership-request' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the group membership request will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value User email the request is being sent to. + */ + $value = apply_filters( 'groups_notification_new_membership_request_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the group membership request subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Membership request email subject text. + * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. + */ + $value = apply_filters_ref_array( 'groups_notification_new_membership_request_subject', array( $value, &$tokens['group'] ) ); + + } elseif ( $property === 'content' ) { + /** + * Filters the group membership request message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 $deprecated Removed in 2.5; now an empty string. + */ + $value = apply_filters_ref_array( 'groups_notification_new_membership_request_message', array( $value, &$tokens['group'], $tokens['requesting-user.name'], $tokens['profile.url'], $tokens['group-requests.url'], '' ) ); + } + + } elseif ( $email_type === 'groups-membership-request-accepted' || $email_type === 'groups-membership-request-rejected' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the group membership request result will be sent to. + * + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value User email the request is being sent to. + */ + $value = apply_filters( 'groups_notification_membership_request_completed_to', $value ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the group membership request result subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param string $value Membership request result email subject text. + * @param BP_Groups_Group $group Object holding the current group instance. Passed by reference. + */ + $value = apply_filters_ref_array( 'groups_notification_membership_request_completed_subject', array( $value, &$tokens['group'] ) ); + + } elseif ( $property === 'content' ) { + /** + * Filters the group membership request result message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $settings_link argument unset and deprecated. + * + * @param string $value 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 $deprecated Removed in 2.5; now an empty string. + */ + $value = apply_filters_ref_array( 'groups_notification_membership_request_completed_message', array( $value, &$tokens['group'], $tokens['group.url'], '' ) ); + } + + } elseif ( $email_type === 'messages-unread' ) { + if ( $property === 'to' ) { + /** + * Filters the user email that the message notification will be sent to. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $ud argument unset and deprecated. + * + * @param string $value User email the message notification is being sent to. + * @param bool $deprecated Removed in 2.5; now a bool (false). + */ + $value = apply_filters( 'messages_notification_new_message_to', $value, false ); + + } elseif ( $property === 'subject' ) { + /** + * Filters the message notification subject that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $ud argument unset and deprecated. + * + * @param string $value Email notification subject text. + * @param string $sender_name Name of the person who sent the message. + * @param bool $deprecated Removed in 2.5; now a bool (false). + */ + $value = apply_filters( 'messages_notification_new_message_subject', $value, $tokens['sender.name'], false ); + + } elseif ( $property === 'content' ) { + /** + * Filters the message notification message that will be sent to user. + * + * @since 1.2.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * $settings_link and $ud arguments unset and deprecated. + * + * @param string $value Email notification message text. + * @param string $sender_name Name of the person who sent the message. + * @param string $usersubjec Email notification subject text. + * @param string $content Content of the message. + * @param string $message_link URL permalink for the message. + * @param string $deprecated Removed in 2.5; now an empty string. + * @param bool $deprecated Removed in 2.5; now a bool (false). + */ + $value = apply_filters( 'messages_notification_new_message_message', $value, $tokens['sender.name'], $tokens['usersubject'], $tokens['content'], $tokens['message.url'], '', false ); + } + + } elseif ( $email_type === 'settings-verify-email-change' ) { + if ( $property === 'content' ) { + /** + * Filter the email text sent when a user changes emails. + * + * @since 2.1.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $update_user argument unset and deprecated. + * + * @param string $value Text of the email. + * @param string $recipient_email New user email that the current user has changed to. + * @param string $old_user_email Existing email address for the current user. + * @param bool $deprecated Removed in 2.5; now a bool (false). + */ + $value = apply_filters( 'bp_new_user_email_content', $value, $tokens['recipient.email'], $tokens['old-user.email'], false ); + } + } + + if ( $property === 'to' && $to_changed ) { + // We normally apart $to, so we often need to rebuild it. + array_unshift( $original_value, new BP_Email_Recipient( $value, $recipient_name ) ); + $value = $original_value; + } + + return $value; +} +add_filter( 'bp_email_get_property', 'bp_core_deprecated_email_filters', 20, 4 ); + +/** + * Add support for pre-2.5 email actions. + * + * @since 2.5.0 + * + * @param bool|WP_Error $delivery_status Bool if the email was sent or not. + * If a WP_Error, there was a failure. + * @param BP_Email $email Email object reference. + * @return mixed + */ +function bp_core_deprecated_email_actions( $delivery_status, $email ) { + $pre_2_5_emails = array( + 'activity-comment', + 'activity-comment-author', + 'core-user-registration', + 'core-user-registration-with-blog', + 'friends-request', + 'friends-request-accepted', + 'groups-details-updated', + 'groups-invitation', + 'groups-member-promoted', + 'groups-membership-request', + 'groups-membership-request-accepted', + 'groups-membership-request-rejected', + 'messages-unread', + 'settings-verify-email-change', + ); + + remove_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 ); + $email_content = $email->get( 'content' ); + $email_subject = $email->get( 'subject' ); + $email_type = $email->get( 'type' ); + $tokens = $email->get( 'tokens' ); + add_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 ); + + // Backpat for pre-2.5 emails only. + if ( ! in_array( $email_type, $pre_2_5_emails, true ) ) { + return; + } + + if ( $email_type === 'activity-comment' ) { + /** + * Fires after the sending of a reply to an update email notification. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $params argument unset and deprecated. + * + * @param int $user_id ID of the original activity item author. + * @param string $email_subject Email notification subject text. + * @param string $email_content 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 $deprecated Removed in 2.5; now an empty array. + */ + do_action( 'bp_activity_sent_reply_to_update_email', $tokens['original_activity.user_id'], $email_subject, $email_content, $tokens['comment.id'], $tokens['commenter.id'], array() ); + + } elseif ( $email_type === 'activity-comment-author' ) { + /** + * Fires after the sending of a reply to a reply email notification. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $params argument unset and deprecated. + * + * @param int $user_id ID of the parent activity item author. + * @param string $email_subject Email notification subject text. + * @param string $email_content 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 $deprecated Removed in 2.5; now an empty array. + */ + do_action( 'bp_activity_sent_reply_to_reply_email', $tokens['parent-comment-user.id'], $email_subject, $email_content, $tokens['comment.id'], $tokens['commenter.id'], array() ); + + } elseif ( $email_type === 'core-user-registration' ) { + if ( ! empty( $tokens['user.id'] ) ) { + /** + * Fires after the sending of activation email to a newly registered user. + * + * @since 1.5.0 + * + * @param string $email_subject Subject for the sent email. + * @param string $email_content Message for the sent email. + * @param int $user_id ID of the new user. + * @param string $recipient_email Email address of the new user. + * @param string $key Activation key. + */ + do_action( 'bp_core_sent_user_validation_email', $email_subject, $email_content, $tokens['user.id'], $tokens['recipient.email'], $tokens['key'] ); + + } else { + /** + * Fires after the sending of the notification to new users for successful registration without blog. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $admin_email Admin Email address for the site. + * @param string $email_subject Subject used in the notification email. + * @param string $email_content Message used in the notification email. + * @param string $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + do_action( 'bp_core_sent_user_signup_email', bp_get_option( 'admin_email' ), $email_subject, $email_content, $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key'], array() ); + } + + } elseif ( $email_type === 'core-user-registration-with-blog' ) { + /** + * Fires after the sending of the notification to new users for successful registration with blog. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. $meta argument unset and deprecated. + * + * @param string $admin_email Admin Email address for the site. + * @param string $email_subject Subject used in the notification email. + * @param string $email_content 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 $recipient_username The user's login name. + * @param string $recipient_email The user's email address. + * @param string $key The activation key created in wpmu_signup_blog(). + * @param array $meta Removed in 2.5; now an empty array. + */ + do_action( 'bp_core_sent_blog_signup_email', bp_get_option( 'admin_email' ), $email_subject, $email_content, $tokens['domain'], $tokens['path'], $tokens['title'], $tokens['recipient.username'], $tokens['recipient.email'], $tokens['key_blog'], array() ); + + } elseif ( $email_type === 'friends-request' ) { + /** + * Fires after the new friend request email is sent. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $friend_id ID of the request recipient. + * @param string $email_subject Text for the friend request subject field. + * @param string $email_content 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', $tokens['friend.id'], $email_subject, $email_content, $tokens['friendship.id'], $tokens['initiator.id'] ); + + } elseif ( $email_type === 'friends-request-accepted' ) { + /** + * Fires after the friend request accepted email is sent. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $initiator_id ID of the friendship requester. + * @param string $email_subject Text for the friend request subject field. + * @param string $email_content 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', $tokens['initiator.id'], $email_subject, $email_content, $tokens['friendship.id'], $tokens['friend.id'] ); + + } elseif ( $email_type === 'groups-invitation' ) { + /** + * Fires after the notification is sent that a member has been invited to a group. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $invited_user_id ID of the user who was invited. + * @param string $email_subject Email notification subject text. + * @param string $email_content Email notification message text. + * @param BP_Groups_Group $group Group object. + */ + do_action( 'bp_groups_sent_invited_email', $tokens['inviter.id'], $email_subject, $email_content, $tokens['group'] ); + + } elseif ( $email_type === 'groups-member-promoted' ) { + /** + * Fires after the notification is sent that a member has been promoted. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $user_id ID of the user who was promoted. + * @param string $email_subject Email notification subject text. + * @param string $email_content 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', $tokens['user.id'], $email_subject, $email_content, $tokens['group.id'] ); + + } elseif ( $email_type === 'groups-membership-request' ) { + /** + * Fires after the notification is sent that a member has requested group membership. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $admin_id ID of the group administrator. + * @param string $email_subject Email notification subject text. + * @param string $email_content 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', $tokens['admin.id'], $email_subject, $email_content, $tokens['requesting-user.id'], $tokens['group.id'], $tokens['membership.id'] ); + + } elseif ( $email_type === 'groups-membership-request-accepted' || $email_type === 'groups-membership-request-rejected' ) { + /** + * Fires after the notification is sent that a membership has been approved. + * + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * + * @param int $requesting_user_id ID of the user whose membership was approved. + * @param string $email_subject Email notification subject text. + * @param string $email_content Email notification message text. + * @param int $group_id ID of the group that was joined. + */ + do_action( 'bp_groups_sent_membership_approved_email', $tokens['requesting-user.id'], $email_subject, $email_content, $tokens['group.id'] ); + } +} +add_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 ); + +/** + * When a blog comment status transition occurs, update the relevant activity's status. + * + * @since 1.6.0 + * @deprecated 2.5.0 + * + * @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 ) { + _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_transition_post_type_comment_status()' ); + bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment ); +} + +/** + * Record a new blog comment in the BuddyPress activity stream. + * + * Only posts the item if blog is public and post is not password-protected. + * + * @deprecated 2.5.0 + * + * @param int $comment_id ID of the comment being recorded. + * @param bool|string $is_approved Optional. The $is_approved value passed to + * the 'comment_post' action. Default: true. + * @return bool|object Returns false on failure, the comment object on success. + */ +function bp_blogs_record_comment( $comment_id, $is_approved = true ) { + _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_post_type_comment()' ); + bp_activity_post_type_comment( $comment_id, $is_approved ); +} + +/** + * Remove a blog comment activity item from the activity stream. + * + * @deprecated 2.5.0 + * + * @param int $comment_id ID of the comment to be removed. + */ +function bp_blogs_remove_comment( $comment_id ) { + _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_post_type_remove_comment()' ); + bp_activity_post_type_remove_comment( $comment_id ); +} diff --git a/wp-content/plugins/buddypress/bp-core/js/avatar.js b/wp-content/plugins/buddypress/bp-core/js/avatar.js index dc887a7d360ec98e0ded723b4507a8fe5e69ac19..b27bc219ca35557e13fc44809523bf15778bc4d9 100644 --- a/wp-content/plugins/buddypress/bp-core/js/avatar.js +++ b/wp-content/plugins/buddypress/bp-core/js/avatar.js @@ -1,4 +1,4 @@ -/* globals bp, BP_Uploader, _, Backbone */ +/* global bp, BP_Uploader, _, Backbone */ window.bp = window.bp || {}; @@ -15,6 +15,8 @@ window.bp = window.bp || {}; bp.Avatar = { start: function() { + var self = this; + /** * Remove the bp-legacy UI * @@ -34,25 +36,22 @@ window.bp = window.bp || {}; // Avatars are uploaded files this.avatars = bp.Uploader.filesUploaded; + // The Avatar Attachment object. + this.Attachment = new Backbone.Model(); + // 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 + * We need to make sure to reset the views if it's closed or opened */ $( '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 } ); - } - } ); + self.resetViews(); + } ); + + $( 'body.wp-admin' ).on( 'click', '.bp-xprofile-avatar-user-edit', function() { + self.resetViews(); } ); }, @@ -119,6 +118,20 @@ window.bp = window.bp || {}; } }, + resetViews: function() { + // Reset to the uploader view + this.nav.trigger( 'bp-avatar-view:changed', 'upload' ); + + // Reset to the uploader nav + _.each( this.navItems.models, function( model ) { + if ( model.id === 'upload' ) { + model.set( { active: 1 } ); + } else { + model.set( { active: 0 } ); + } + } ); + }, + setupNav: function() { var self = this, initView, activeView; @@ -182,7 +195,7 @@ window.bp = window.bp || {}; } // Display it - avatarStatus.inject( '.bp-avatar-status' ); + avatarStatus.inject( '.bp-avatar-status' ); }, cropView: function() { @@ -256,6 +269,20 @@ window.bp = window.bp || {}; // Inject the Delete nav bp.Avatar.navItems.get( 'delete' ).set( { hide: 0 } ); + /** + * Set the Attachment object + * + * You can run extra actions once the avatar is set using: + * bp.Avatar.Attachment.on( 'change:url', function( data ) { your code } ); + * + * In this case data.attributes will include the url to the newly + * uploaded avatar, the object and the item_id concerned. + */ + self.Attachment.set( _.extend( + _.pick( avatar.attributes, ['object', 'item_id'] ), + { url: response.avatar, action: 'uploaded' } + ) ); + } ).fail( function( response ) { var feedback = BP_Uploader.strings.default_error; if ( ! _.isUndefined( response ) ) { @@ -329,8 +356,22 @@ window.bp = window.bp || {}; $( this ).prop( 'src', response.avatar ); } ); - // Remove the Delete nav - bp.Avatar.navItems.get( 'delete' ).set( { active: 0, hide: 1 } ); + // Remove the Delete nav + bp.Avatar.navItems.get( 'delete' ).set( { active: 0, hide: 1 } ); + + /** + * Reset the Attachment object + * + * You can run extra actions once the avatar is set using: + * bp.Avatar.Attachment.on( 'change:url', function( data ) { your code } ); + * + * In this case data.attributes will include the url to the gravatar, + * the object and the item_id concerned. + */ + self.Attachment.set( _.extend( + _.pick( model.attributes, ['object', 'item_id'] ), + { url: response.avatar, action: 'deleted' } + ) ); } ).fail( function( response ) { var feedback = BP_Uploader.strings.default_error; diff --git a/wp-content/plugins/buddypress/bp-core/js/avatar.min.js b/wp-content/plugins/buddypress/bp-core/js/avatar.min.js index bdde52f7240245a4d1238ebb94e2189a52f05506..0e85f854e83d5a6e3befc61c9de56094e24f80f0 100644 --- a/wp-content/plugins/buddypress/bp-core/js/avatar.min.js +++ b/wp-content/plugins/buddypress/bp-core/js/avatar.min.js @@ -1,2 +1,2 @@ -/*! buddypress - v2.3.5 - 2015-11-11 5:23:00 AM 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_w/this.options.full_h),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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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(){var a=this;this.removeLegacyUI(),this.views=new Backbone.Collection,this.jcropapi={},this.warning=null,this.setupNav(),this.avatars=bp.Uploader.filesUploaded,this.Attachment=new Backbone.Model,bp.Uploader.filesQueue.on("reset",this.cropView,this),b("body.wp-admin").on("tb_unload","#TB_window",function(){a.resetViews()}),b("body.wp-admin").on("click",".bp-xprofile-avatar-user-edit",function(){a.resetViews()})},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()}},resetViews:function(){this.nav.trigger("bp-avatar-view:changed","upload"),_.each(this.navItems.models,function(a){"upload"===a.id?a.set({active:1}):a.set({active:0})})},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}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"uploaded"}))}).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}),d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.avatar,action:"deleted"}))}).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_w/this.options.full_h),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 index 1e9150bb92a7f43936ae2a736d29155408885fac..0a9507fc5be74bb18aa9497532dedaacfecfbae9 100644 --- a/wp-content/plugins/buddypress/bp-core/js/bp-plupload.js +++ b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.js @@ -1,4 +1,4 @@ -/* globals bp, plupload, BP_Uploader, _, JSON, Backbone */ +/* global bp, plupload, BP_Uploader, _, JSON, Backbone */ window.wp = window.wp || {}; window.bp = window.bp || {}; @@ -10,8 +10,12 @@ window.bp = window.bp || {}; return; } - // Set the bp global by only getting what we need from the wp one. - window.bp = _.pick( window.wp, 'Backbone', 'ajax', 'template' ); + /** + * Extend the bp global with what we need from the wp one. + * and make sure previously defined BuddyPress attributes + * are not removed (eg: bp.mentions) + */ + _.extend( bp, _.pick( wp, 'Backbone', 'ajax', 'template' ) ); // Init Models, Collections, Views and the BuddyPress Uploader bp.Models = bp.Models || {}; @@ -60,13 +64,25 @@ window.bp = window.bp || {}; * @param {plupload.Uploader} uploader Uploader instance. */ this.uploader.bind( 'Init', function( uploader ) { - var container = $( '#' + self.params.defaults.container ), + var container = $( '#' + self.params.defaults.container ), drop_element = $( '#' + self.params.defaults.drop_element ); if ( 'html4' === uploader.runtime ) { uploader.settings.multipart_params.html4 = true; } + /** + * Avatars need to be cropped, by default we are using an original + * max width of 450px, but there can be cases when this max width + * is larger than the one of the Avatar UI (eg: on mobile). To avoid any + * difficulties, we're adding a ui_available_width argument to the bp_params + * object and set it according to the container width. This value will be + * checked during the upload process to eventually adapt the resized avatar. + */ + if ( 'bp_avatar_upload' === uploader.settings.multipart_params.action ) { + uploader.settings.multipart_params.bp_params.ui_available_width = container.width(); + } + if ( uploader.features.dragdrop && ! self.params.browser.mobile ) { container.addClass( 'drag-drop' ); drop_element.bind( 'dragover.wp-uploader', function() { @@ -307,8 +323,8 @@ window.bp = window.bp || {}; defaults: _.pick( BP_Uploader.settings.defaults, 'container', 'drop_element', 'browse_button' ), initialize: function() { - this.warning = null; - this.model = new Backbone.Model( this.defaults ); + this.warnings = []; + this.model = new Backbone.Model( this.defaults ); this.on( 'ready', this.initUploader ); }, @@ -323,20 +339,27 @@ window.bp = window.bp || {}; return; } - this.warning = new bp.Views.uploaderWarning( { + var warning = new bp.Views.uploaderWarning( { value: message } ).render(); - this.$el.after( this.warning.el ); + this.warnings.push( warning ); + + this.$el.after( warning.el ); }, resetWarning: function() { - if ( _.isNull( this.warning ) ) { + if ( 0 === this.warnings.length ) { return; } - this.warning.remove(); - this.warning = null; + // Remove all warning views + _.each( this.warnings, function( view ) { + view.remove(); + } ); + + // Reset Warnings + this.warnings = []; } } ); @@ -344,7 +367,6 @@ window.bp = window.bp || {}; bp.Views.uploaderWarning = bp.View.extend( { tagName: 'p', className: 'warning', - id: 'bp-uploader-warning', initialize: function() { this.value = this.options.value; 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 index 2681b78d04c4f43c04ac52b9839306abd6668a6a..55e58db0190b512812b8aa2c45dcb61b1baff83a 100644 --- a/wp-content/plugins/buddypress/bp-core/js/bp-plupload.min.js +++ b/wp-content/plugins/buddypress/bp-core/js/bp-plupload.min.js @@ -1,2 +1,2 @@ -/*! buddypress - v2.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ -window.wp=window.wp||{},window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(window.bp=_.pick(window.wp,"Backbone","ajax","template"),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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */ +window.wp=window.wp||{},window.bp=window.bp||{},function(a,b){"undefined"!=typeof BP_Uploader&&(_.extend(bp,_.pick(wp,"Backbone","ajax","template")),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),"bp_avatar_upload"===c.settings.multipart_params.action&&(c.settings.multipart_params.bp_params.ui_available_width=d.width()),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.warnings=[],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){if(!_.isUndefined(b)){var c=new bp.Views.uploaderWarning({value:b}).render();this.warnings.push(c),this.$el.after(c.el)}},resetWarning:function(){0!==this.warnings.length&&(_.each(this.warnings,function(a){a.remove()}),this.warnings=[])}}),bp.Views.uploaderWarning=bp.View.extend({tagName:"p",className:"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 db4010a3cf0284b1421eddde0a80241826077c56..bd8dd6139ca7b202e2fa705eaa4403f3385b7368 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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/cover-image.js b/wp-content/plugins/buddypress/bp-core/js/cover-image.js new file mode 100644 index 0000000000000000000000000000000000000000..07b2259d30a82d304be6f0c44f7be81ff28d5d91 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/js/cover-image.js @@ -0,0 +1,277 @@ +/* global 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.CoverImage = { + start: function() { + + // Init some vars + this.views = new Backbone.Collection(); + this.warning = null; + + // The Cover Image Attachment object. + this.Attachment = new Backbone.Model(); + + // Set up views + this.uploaderView(); + + // Inform about the needed dimensions + this.displayWarning( BP_Uploader.strings.cover_image_warnings.dimensions ); + + // Set up the delete view if needed + if ( true === BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image ) { + this.deleteView(); + } + }, + + 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-cover-image' ); + }, + + uploadProgress: function() { + // Create the Uploader status view + var coverImageUploadProgress = new bp.Views.coverImageUploadProgress( { collection: bp.Uploader.filesQueue } ); + + if ( ! _.isUndefined( this.views.get( 'status' ) ) ) { + this.views.set( { id: 'status', view: coverImageUploadProgress } ); + } else { + this.views.add( { id: 'status', view: coverImageUploadProgress } ); + } + + // Display it + coverImageUploadProgress.inject( '.bp-cover-image-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'] + ) ); + + // Do not add it if already there! + if ( ! _.isUndefined( this.views.get( 'delete' ) ) ) { + return; + } + + // Create the delete view + var deleteView = new bp.Views.DeleteCoverImage( { model: delete_model } ); + + // Add it to views + this.views.add( { id: 'delete', view: deleteView } ); + + // Display it + deleteView.inject( '.bp-cover-image-manage' ); + }, + + deleteCoverImage: 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 cover image ! + bp.ajax.post( 'bp_cover_image_delete', { + json: true, + item_id: model.get( 'item_id' ), + object: model.get( 'object' ), + nonce: model.get( 'nonces' ).remove + } ).done( function( response ) { + var coverImageStatus = new bp.Views.CoverImageStatus( { + value : BP_Uploader.strings.feedback_messages[ response.feedback_code ], + type : 'success' + } ); + + self.views.add( { + id : 'status', + view : coverImageStatus + } ); + + coverImageStatus.inject( '.bp-cover-image-status' ); + + // Reset the header of the page + if ( '' === response.reset_url ) { + $( '#header-cover-image' ).css( { + 'background-image': 'none' + } ); + } else { + $( '#header-cover-image' ).css( { + 'background-image': 'url( ' + response.reset_url + ' )' + } ); + } + + // Reset the has_cover_image bp_param + BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image = false; + + /** + * Reset the Attachment object + * + * You can run extra actions once the cover image is set using: + * bp.CoverImage.Attachment.on( 'change:url', function( data ) { your code } ); + * + * In this case data.attributes will include the default url for the + * cover image (most of the time: ''), the object and the item_id concerned. + */ + self.Attachment.set( _.extend( + _.pick( model.attributes, ['object', 'item_id'] ), + { url: response.reset_url, action: 'deleted' } + ) ); + + } ).fail( function( response ) { + var feedback = BP_Uploader.strings.default_error; + if ( ! _.isUndefined( response ) ) { + feedback = BP_Uploader.strings.feedback_messages[ response.feedback_code ]; + } + + var coverImageStatus = new bp.Views.CoverImageStatus( { + value : feedback, + type : 'error' + } ); + + self.views.add( { + id : 'status', + view : coverImageStatus + } ); + + coverImageStatus.inject( '.bp-cover-image-status' ); + + // Put back the delete view + bp.CoverImage.deleteView(); + } ); + }, + + 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-cover-image-status' ); + } + }; + + // Custom Uploader Files view + bp.Views.coverImageUploadProgress = bp.Views.uploaderStatus.extend( { + className: 'files', + + initialize: function() { + bp.Views.uploaderStatus.prototype.initialize.apply( this, arguments ); + + this.collection.on( 'change:url', this.uploadResult, this ); + }, + + uploadResult: function( model ) { + var message, type; + + if ( ! _.isUndefined( model.get( 'url' ) ) ) { + + // Image is too small + if ( 0 === model.get( 'feedback_code' ) ) { + message = BP_Uploader.strings.cover_image_warnings.dimensions; + type = 'warning'; + + // Success, Rock n roll! + } else { + message = BP_Uploader.strings.feedback_messages[ model.get( 'feedback_code' ) ]; + type = 'success'; + } + + this.views.set( '.bp-uploader-progress', new bp.Views.CoverImageStatus( { + value : message, + type : type + } ) ); + + // Update the header of the page + $( '#header-cover-image' ).css( { + 'background-image': 'url( ' + model.get( 'url' ) + ' )' + } ); + + // Add the delete view + bp.CoverImage.deleteView(); + + /** + * Set the Attachment object + * + * You can run extra actions once the cover image is set using: + * bp.CoverImage.Attachment.on( 'change:url', function( data ) { your code } ); + * + * In this case data.attributes will include the url to the newly + * uploaded cover image, the object and the item_id concerned. + */ + bp.CoverImage.Attachment.set( _.extend( + _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params, ['object', 'item_id'] ), + { url: model.get( 'url' ), action: 'uploaded' } + ) ); + } + } + } ); + + // BuddyPress Cover Image Feedback view + bp.Views.CoverImageStatus = bp.View.extend( { + tagName: 'p', + className: 'updated', + id: 'bp-cover-image-feedback', + + initialize: function() { + this.el.className += ' ' + this.options.type; + this.value = this.options.value; + }, + + render: function() { + this.$el.html( this.value ); + return this; + } + } ); + + // BuddyPress Cover Image Delete view + bp.Views.DeleteCoverImage = bp.View.extend( { + tagName: 'div', + id: 'bp-delete-cover-image-container', + template: bp.template( 'bp-cover-image-delete' ), + + events: { + 'click #bp-delete-cover-image': 'deleteCoverImage' + }, + + deleteCoverImage: function( event ) { + event.preventDefault(); + + bp.CoverImage.deleteCoverImage( this.model ); + } + } ); + + bp.CoverImage.start(); + +})( bp, jQuery ); diff --git a/wp-content/plugins/buddypress/bp-core/js/cover-image.min.js b/wp-content/plugins/buddypress/bp-core/js/cover-image.min.js new file mode 100644 index 0000000000000000000000000000000000000000..861fbe0a6dfa348b5c830e985e4dbf6e382f1511 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/js/cover-image.min.js @@ -0,0 +1,2 @@ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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.CoverImage={start:function(){this.views=new Backbone.Collection,this.warning=null,this.Attachment=new Backbone.Model,this.uploaderView(),this.displayWarning(BP_Uploader.strings.cover_image_warnings.dimensions),!0===BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image&&this.deleteView()},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-cover-image")},uploadProgress:function(){var a=new bp.Views.coverImageUploadProgress({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-cover-image-status")},deleteView:function(){var a=new Backbone.Model(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id","nonces"]));if(_.isUndefined(this.views.get("delete"))){var b=new bp.Views.DeleteCoverImage({model:a});this.views.add({id:"delete",view:b}),b.inject(".bp-cover-image-manage")}},deleteCoverImage: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_cover_image_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.CoverImageStatus({value:BP_Uploader.strings.feedback_messages[c.feedback_code],type:"success"});d.views.add({id:"status",view:e}),e.inject(".bp-cover-image-status"),""===c.reset_url?b("#header-cover-image").css({"background-image":"none"}):b("#header-cover-image").css({"background-image":"url( "+c.reset_url+" )"}),BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image=!1,d.Attachment.set(_.extend(_.pick(a.attributes,["object","item_id"]),{url:c.reset_url,action:"deleted"}))}).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.CoverImageStatus({value:b,type:"error"});d.views.add({id:"status",view:c}),c.inject(".bp-cover-image-status"),bp.CoverImage.deleteView()})},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-cover-image-status")}},bp.Views.coverImageUploadProgress=bp.Views.uploaderStatus.extend({className:"files",initialize:function(){bp.Views.uploaderStatus.prototype.initialize.apply(this,arguments),this.collection.on("change:url",this.uploadResult,this)},uploadResult:function(a){var c,d;_.isUndefined(a.get("url"))||(0===a.get("feedback_code")?(c=BP_Uploader.strings.cover_image_warnings.dimensions,d="warning"):(c=BP_Uploader.strings.feedback_messages[a.get("feedback_code")],d="success"),this.views.set(".bp-uploader-progress",new bp.Views.CoverImageStatus({value:c,type:d})),b("#header-cover-image").css({"background-image":"url( "+a.get("url")+" )"}),bp.CoverImage.deleteView(),bp.CoverImage.Attachment.set(_.extend(_.pick(BP_Uploader.settings.defaults.multipart_params.bp_params,["object","item_id"]),{url:a.get("url"),action:"uploaded"})))}}),bp.Views.CoverImageStatus=bp.View.extend({tagName:"p",className:"updated",id:"bp-cover-image-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.DeleteCoverImage=bp.View.extend({tagName:"div",id:"bp-delete-cover-image-container",template:bp.template("bp-cover-image-delete"),events:{"click #bp-delete-cover-image":"deleteCoverImage"},deleteCoverImage:function(a){a.preventDefault(),bp.CoverImage.deleteCoverImage(this.model)}}),bp.CoverImage.start())}(bp,jQuery); \ 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 09f2605299d3cfa699ce26a2767f026e6e3bf286..307b6c7354a29a39a419adca5f9b94438a8c3f6e 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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 87331818e0204aebb63739cac283fcf83ad3452a..3cd3bad8ec52fa3dcffbfb7d9d52cddd72f3385b 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery-scroll-to.min.js index a8b420d08621d066dad924e0a8cf4592b049e525..e64a84b8a3f04128fc515240a9d7ccf5ca99fc4e 100644 --- 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 @@ -1,2 +1,2 @@ -/*! buddypress - v2.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery.atwho.min.js index 83dfb8580c6bbeee7c126c5945ecd765b25d8b93..d6a5b5fb01e977662359f6e6f8a67e3a551caf18 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.3.5 - 2015-11-11 5:23:00 AM 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?" ":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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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(b){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,b){var c;try{return this.setting[a]}catch(d){return c=d,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,c){var d,e,f,g,h,i,j,k,l,m,n,o;if(d=this.$inputor,l=this.callbacks("inserting_wrapper").call(this,d,b,this.get_opt("suffix")),d.is("textarea, input"))i=d.val(),j=i.slice(0,Math.max(this.query.head_pos-this.at.length,0)),k=""+j+l+i.slice(this.query.end_pos||0),d.val(k),d.caret("pos",j.length+l.length,{iframe:this.app.iframe});else if(g=this.range){for(f=g.startOffset-(this.query.end_pos-this.query.head_pos)-this.at.length,g.setStart(g.endContainer,Math.max(f,0)),g.setEnd(g.endContainer,g.endOffset),g.deleteContents(),o=a(l,this.app.document),m=0,n=o.length;n>m;m++)e=o[m],g.insertNode(e),g.setEndAfter(e),g.collapse(!1);h=this.app.window.getSelection(),h.removeAllRanges(),h.addRange(g)}else(g=this.ie8_range)&&(g.moveStart("character",this.query.end_pos-this.query.head_pos-this.at.length),g.pasteHTML(l),g.collapse(!1),g.select());return d.is(":focus")||d.focus(),d.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],a.isPlainObject(c)?f.push(c):f.push({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,d){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,b){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?" ":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.min.js b/wp-content/plugins/buddypress/bp-core/js/jquery.caret.min.js index b5ca927349de16669ad4035ade585037605a286b..c2fe1809f0146de4e65330f7b0e34677534de5e6 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.3.5 - 2015-11-11 5:23:00 AM 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," ")),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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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(a){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(b){var c,d,e,f,g;return j.getSelection&&(e=this.range())?(e.endOffset-1>0&&e.endContainer===!this.domInputor&&(c=e.cloneRange(),c.setStart(e.endContainer,e.endOffset-1),c.setEnd(e.endContainer,e.endOffset),f=c.getBoundingClientRect(),d={height:f.height,left:f.left+f.width,top:f.top},c.detach()),d&&0!==(null!=d?d.height:void 0)||(c=e.cloneRange(),g=a(h.createTextNode("|")),c.insertNode(g[0]),c.selectNode(g[0]),f=c.getBoundingClientRect(),d={height:f.height,left:f.left,top:f.top},g.remove(),c.detach())):h.selection&&(d=this.getOldIEOffset()),d&&(d.top+=a(j).scrollTop(),d.left+=a(j).scrollLeft()),d},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," ")),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 index 2584465f03ae8b3c62cbf9cbe0daf983ddcca652..16ff039c270c78175dfd3139ea9c981338510438 100644 --- a/wp-content/plugins/buddypress/bp-core/js/webcam.js +++ b/wp-content/plugins/buddypress/bp-core/js/webcam.js @@ -1,4 +1,4 @@ -/* globals bp, BP_Uploader, _, Backbone */ +/* global bp, BP_Uploader, _, Backbone */ window.bp = window.bp || {}; @@ -89,6 +89,8 @@ window.bp = window.bp || {}; } else if ( navigator.mozGetUserMedia ) { video.src = stream; video.play(); + } else if ( video.srcObject !== undefined ) { + video.srcObject = stream; } else if ( window.URL ) { video.src = window.URL.createObjectURL( stream ); } else { @@ -212,7 +214,7 @@ window.bp = window.bp || {}; bp.WebCam.displayWarning( 'requesting' ); if ( navigator.getUserMedia ) { - navigator.getUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCams.noStream ); + navigator.getUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCam.noStream ); } else if ( navigator.oGetUserMedia ) { navigator.oGetUserMedia( { video:true }, bp.WebCam.gotStream, bp.WebCam.noStream ); } else if ( navigator.mozGetUserMedia ) { diff --git a/wp-content/plugins/buddypress/bp-core/js/webcam.min.js b/wp-content/plugins/buddypress/bp-core/js/webcam.min.js index 9cf0950cbf3ec798c0e20370b9d837d867dbbfeb..952849610fd571d35450170622d9ad5d2bd062bd 100644 --- a/wp-content/plugins/buddypress/bp-core/js/webcam.min.js +++ b/wp-content/plugins/buddypress/bp-core/js/webcam.min.js @@ -1,2 +1,2 @@ -/*! buddypress - v2.3.5 - 2015-11-11 5:23:00 AM 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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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()):void 0!==b.srcObject?b.srcObject=a:window.URL?b.src=window.URL.createObjectURL(a):b.src=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.WebCam.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.min.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js index dd51f85c0977578f63ee17c8b74b72a48b8a948b..f7c9082e86d9bff51e1d53ff3878a190f459c057 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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/bb-config.php b/wp-content/plugins/buddypress/bp-forums/bb-config.php index 70efbe81b2b73136c523afb889a7b3bf8cd7747c..22f81092225f05717a5938cef5ff0fe0009febc1 100644 --- a/wp-content/plugins/buddypress/bp-forums/bb-config.php +++ b/wp-content/plugins/buddypress/bp-forums/bb-config.php @@ -1,10 +1,14 @@ <?php -/*** +/** * *** IMPORTANT **** * This file will stop people from accessing your bbPress installation directly. * It is very important from a security standpoint that this file is not moved. * Your actual bb-config.php file will be installed in the root of your WordPress * installation once you have set up the forums component in BuddyPress. + * + * @package BuddyPress + * @subpackage ForumsbbPressConfig + * @since 1.1.0 */ header("HTTP/1.0 403 Forbidden"); die; 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 4bb00b8a2073432326dbbca813fd84972bee889e..a7921c2772183ac517e56acbc51f18ba284a8d00 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php @@ -3,8 +3,9 @@ * BuddyPress Forums Actions. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. 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 e977fe653c1ae8238bc382eaf06e97dd2ba5c656..e1682ffea03a64bb6cc267273c90f7fe94ff1727 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 @@ -3,10 +3,11 @@ * BuddyPress bbPress 1.x integration. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsbbPress + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -55,10 +56,10 @@ function bp_forums_load_bbpress() { $bb = new stdClass(); require( bp_get_option( 'bb-config-location' ) ); - // Setup the global database connection + // Setup the global database connection. $bbdb = new BPDB ( BBDB_USER, BBDB_PASSWORD, BBDB_NAME, BBDB_HOST ); - // Set the table names + // Set the table names. $bbdb->forums = $bb_table_prefix . 'forums'; $bbdb->meta = $bb_table_prefix . 'meta'; $bbdb->posts = $bb_table_prefix . 'posts'; @@ -89,21 +90,21 @@ function bp_forums_load_bbpress() { /** * Fires during the bootstrap setup for bbPress 1.x. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bb_got_roles' ); /** * Fires during the bootstrap setup for bbPress 1.x. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bb_init' ); /** * Fires during the bootstrap setup for bbPress 1.x. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'init_roles' ); @@ -115,11 +116,11 @@ function bp_forums_load_bbpress() { $wp_taxonomy_object->register_taxonomy( 'bb_topic_tag', 'bb_topic' ); - // Set a site id if there isn't one already + // Set a site id if there isn't one already. if ( !isset( $bb->site_id ) ) $bb->site_id = bp_get_root_blog_id(); - // Check if the tables are installed, if not, install them + // Check if the tables are installed, if not, install them. if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) ) { require( BB_PATH . 'bb-admin/includes/defaults.bb-schema.php' ); @@ -129,7 +130,7 @@ function bp_forums_load_bbpress() { require( BB_PATH . 'bb-admin/includes/functions.bb-upgrade.php' ); bb_update_db_version(); - // Set the site admins as the keymasters + // Set the site admins as the keymasters. $site_admins = get_site_option( 'site_admins', array('admin') ); foreach ( (array) $site_admins as $site_admin ) bp_update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) ); @@ -137,14 +138,14 @@ function bp_forums_load_bbpress() { // Create the first forum. bb_new_forum( array( 'forum_name' => 'Default Forum' ) ); - // Set the site URI + // Set the site URI. bb_update_option( 'uri', BB_URL ); } /** * Fires inside an anonymous function that is run on bbPress shutdown. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) ); } @@ -172,12 +173,12 @@ function bb_get_user( $user_id ) { return get_userdata( $user_id ); } * * Noop. * - * @param array $users + * @param array $users Array of users. */ function bb_cache_users( $users ) {} /** - * bbPress needs this class for its usermeta manipulation. + * The bbPress plugin needs this class for its usermeta manipulation. */ class BP_Forums_BB_Auth { function update_meta( $args = '' ) { @@ -190,7 +191,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 bbPress plugin 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 ShareDB) can provide their own versions @@ -201,7 +202,7 @@ if ( ! class_exists( 'BPDB' ) ) : var $db_servers = array(); /** - * Constructor + * Constructor. * * @see WPDB::__construct() for description of parameters. */ @@ -246,6 +247,9 @@ if ( ! class_exists( 'BPDB' ) ) : * from the 1.0 branch of bbPress. * * @see BBDB::__construct() for a description of params. + * + * @param array $args Array of args to parse. + * @return array $args. */ function init( $args ) { if ( 4 == func_num_args() ) { @@ -285,12 +289,12 @@ if ( ! class_exists( 'BPDB' ) ) : return $this->escape( $data ); } } -endif; // class_exists( 'BPDB' ) +endif; // End class_exists( 'BPDB' ). /** * Convert object to given output format. * - * bbPress needs this to convert vars. + * The bbPress plugin needs this to convert vars. * * @param object $object Object to convert. * @param string $output Type of object to return. OBJECT, ARRAY_A, or ARRAY_N. @@ -317,23 +321,23 @@ function backpress_convert_object( &$object, $output ) { * @see dbDelta() for a description of parameters and return value. * * @param array $queries See {@link dbDelta()}. - * @param bool $execute See {@link dbDelta()}. + * @param bool $execute See {@link dbDelta()}. * @return array See {@link dbDelta()}. */ function bp_bb_dbDelta($queries, $execute = true) { global $wpdb; - // Separate individual queries into an array + // Separate individual queries into an array. if ( !is_array($queries) ) { $queries = explode( ';', $queries ); if ('' == $queries[count($queries) - 1]) array_pop($queries); } - $cqueries = array(); // Creation Queries - $iqueries = array(); // Insertion Queries + $cqueries = array(); // Creation Queries. + $iqueries = array(); // Insertion Queries. $for_update = array(); - // Create a tablename index for an array ($cqueries) of queries + // Create a tablename index for an array ($cqueries) of queries. foreach($queries as $qry) { if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) { $cqueries[trim( strtolower($matches[1]), '`' )] = $qry; @@ -345,13 +349,13 @@ function bp_bb_dbDelta($queries, $execute = true) { } else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) { $iqueries[] = $qry; } else { - // Unrecognized query type + // Unrecognized query type. } } - // Check to see which tables and fields exist + // Check to see which tables and fields exist. if ($tables = $wpdb->get_col('SHOW TABLES;')) { - // For every table in the database + // For every table in the database. foreach ($tables as $table) { // Upgrade global tables only for the main site. Don't upgrade at all if DO_NOT_UPGRADE_GLOBAL_TABLES is defined. if ( in_array($table, $wpdb->tables('global')) && ( !is_main_site() || defined('DO_NOT_UPGRADE_GLOBAL_TABLES') ) ) @@ -359,24 +363,24 @@ function bp_bb_dbDelta($queries, $execute = true) { // If a table query exists for the database table... if ( array_key_exists(strtolower($table), $cqueries) ) { - // Clear the field and index arrays + // Clear the field and index arrays. $cfields = $indices = array(); - // Get all of the field names in the query from between the parents + // Get all of the field names in the query from between the parents. preg_match("|\((.*)\)|ms", $cqueries[strtolower($table)], $match2); $qryline = trim($match2[1]); - // Separate field lines into an array + // Separate field lines into an array. $flds = explode("\n", $qryline); //echo "<hr/><pre>\n".print_r(strtolower($table), true).":\n".print_r($cqueries, true)."</pre><hr/>"; - // For every field line specified in the query + // For every field line specified in the query. foreach ($flds as $fld) { - // Extract the field name + // Extract the field name. preg_match("|^([^ ]*)|", trim($fld), $fvals); $fieldname = trim( $fvals[1], '`' ); - // Verify the found field name + // Verify the found field name. $validfield = true; switch (strtolower($fieldname)) { case '': @@ -391,74 +395,74 @@ function bp_bb_dbDelta($queries, $execute = true) { } $fld = trim($fld); - // If it's a valid field, add it to the field array + // If it's a valid field, add it to the field array. if ($validfield) { $cfields[strtolower($fieldname)] = trim($fld, ", \n"); } } - // Fetch the table column structure from the database + // Fetch the table column structure from the database. $tablefields = $wpdb->get_results("DESCRIBE {$table};"); - // For every field in the table + // For every field in the table. foreach ($tablefields as $tablefield) { // If the table field exists in the field array... if (array_key_exists(strtolower($tablefield->Field), $cfields)) { - // Get the field type from the query + // Get the field type from the query. preg_match("|".$tablefield->Field." ([^ ]*( unsigned)?)|i", $cfields[strtolower($tablefield->Field)], $matches); $fieldtype = $matches[1]; // Is actual field type different from the field type in query? if ($tablefield->Type != $fieldtype) { - // Add a query to change the column type + // Add a query to change the column type. $cqueries[] = "ALTER TABLE {$table} CHANGE COLUMN {$tablefield->Field} " . $cfields[strtolower($tablefield->Field)]; $for_update[$table.'.'.$tablefield->Field] = "Changed type of {$table}.{$tablefield->Field} from {$tablefield->Type} to {$fieldtype}"; } - // Get the default value from the array + // Get the default value from the array. //echo "{$cfields[strtolower($tablefield->Field)]}<br>"; if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) { $default_value = $matches[1]; if ($tablefield->Default != $default_value) { - // Add a query to change the column's default value + // Add a query to change the column's default value. $cqueries[] = "ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT '{$default_value}'"; $for_update[$table.'.'.$tablefield->Field] = "Changed default value of {$table}.{$tablefield->Field} from {$tablefield->Default} to {$default_value}"; } } - // Remove the field from the array (so it's not added) + // Remove the field from the array (so it's not added). unset($cfields[strtolower($tablefield->Field)]); } else { // This field exists in the table, but not in the creation queries? } } - // For every remaining field specified for the table + // For every remaining field specified for the table. foreach ($cfields as $fieldname => $fielddef) { - // Push a query line into $cqueries that adds the field to that table + // Push a query line into $cqueries that adds the field to that table. $cqueries[] = "ALTER TABLE {$table} ADD COLUMN $fielddef"; $for_update[$table.'.'.$fieldname] = 'Added column '.$table.'.'.$fieldname; } // Index stuff goes here - // Fetch the table index structure from the database + // Fetch the table index structure from the database. $tableindices = $wpdb->get_results("SHOW INDEX FROM {$table};"); if ($tableindices) { - // Clear the index array + // Clear the index array. unset($index_ary); - // For every index in the table + // For every index in the table. foreach ($tableindices as $tableindex) { - // Add the index to the index data array + // Add the index to the index data array. $keyname = $tableindex->Key_name; $index_ary[$keyname]['columns'][] = array('fieldname' => $tableindex->Column_name, 'subpart' => $tableindex->Sub_part); $index_ary[$keyname]['unique'] = ($tableindex->Non_unique == 0)?true:false; } - // For each actual index in the index array + // For each actual index in the index array. foreach ($index_ary as $index_name => $index_data) { - // Build a create string to compare to the query + // Build a create string to compare to the query. $index_string = ''; if ($index_name == 'PRIMARY') { $index_string .= 'PRIMARY '; @@ -470,16 +474,16 @@ function bp_bb_dbDelta($queries, $execute = true) { $index_string .= $index_name; } $index_columns = ''; - // For each column in the index + // For each column in the index. foreach ($index_data['columns'] as $column_data) { if ($index_columns != '') $index_columns .= ','; - // Add the field to the column list string + // Add the field to the column list string. $index_columns .= $column_data['fieldname']; if ($column_data['subpart'] != '') { $index_columns .= '('.$column_data['subpart'].')'; } } - // Add the column list to the index create string + // Add the column list to the index create string. $index_string .= ' ('.$index_columns.')'; if (!(($aindex = array_search($index_string, $indices)) === false)) { unset($indices[$aindex]); @@ -489,14 +493,14 @@ function bp_bb_dbDelta($queries, $execute = true) { } } - // For every remaining index specified for the table + // For every remaining index specified for the table. foreach ( (array) $indices as $index ) { - // Push a query line into $cqueries that adds the index to that table + // Push a query line into $cqueries that adds the index to that table. $cqueries[] = "ALTER TABLE {$table} ADD $index"; $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index; } - // Remove the original table creation query from processing + // Remove the original table creation query from processing. unset($cqueries[strtolower($table)]); unset($for_update[strtolower($table)]); } else { 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 d922a21942ebb027e09dde45cebe91d24a5d1afa..d86e8010ef9836073364bfa48b6430dd1809b2e8 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php @@ -1,7 +1,11 @@ <?php /** - * Placeholder for bbPress plugin bridge + * Placeholder for bbPress plugin bridge. + * + * @package BuddyPress + * @subpackage ForumsbbPress + * @since 1.1.0 */ -// Exit if accessed directly +// Exit if accessed directly. 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 63114394015c8aa05a607b9689f00e0e040f4b2c..d02f4801d837b4a31c55e8721bebd6bcd0dc4152 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php @@ -3,10 +3,11 @@ * BuddyPress Forums Filters. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsFilters + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /* Apply WordPress defined filters */ @@ -86,7 +87,7 @@ function bp_forums_filter_kses( $content ) { /** * Filters the allowed HTML tags for forum posts. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $forums_allowedtags Array of allowed HTML tags. */ @@ -97,9 +98,9 @@ function bp_forums_filter_kses( $content ) { /** * Get a link for a forum topic tags directory. * - * @param string $link Link passed from filter. - * @param string $tag Name of the tag. - * @param string $page Page number, passed from the filter. + * @param string $link Link passed from filter. + * @param string $tag Name of the tag. + * @param string $page Page number, passed from the filter. * @param string $context Passed from the filter but unused here. * @return string Link of the form http://example.com/forums/tag/tagname/. */ @@ -107,7 +108,7 @@ function bp_forums_filter_tag_link( $link, $tag, $page, $context ) { /** * Filters the link for a forum topic tags directory. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Link for the forum topic tag directory. */ @@ -141,10 +142,10 @@ function bp_forums_make_nofollow_filter( $text ) { * * @see bp_modify_page_title() * - * @param string $title New page title; see {@link bp_modify_page_title()}. + * @param string $title New page title; see {@link bp_modify_page_title()}. * @param string $original_title Original page title. - * @param string $sep How to separate the various items within the page title. - * @param string $seplocation Direction to display title. + * @param string $sep How to separate the various items within the page title. + * @param string $seplocation Direction to display title. * @return string Page title with forum topic title appended. */ function bp_forums_add_forum_topic_to_page_title( $title, $original_title, $sep, $seplocation ) { @@ -183,7 +184,7 @@ add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post * * This filter is added in bp_has_forum_topics(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $sql SQL fragment. * @return string $sql SQL fragment of the form "DISTINCT t.topic_id, ". @@ -199,7 +200,7 @@ function bp_forums_add_replied_distinct_sql( $sql ) { * * This filter is added in bp_has_forum_topics(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $bbdb The bbPress database global. * @@ -219,7 +220,7 @@ function bp_forums_add_replied_join_sql( $sql ) { * * This filter is added in bp_has_forum_topics(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $wpdb The WordPress database global. * @@ -231,7 +232,7 @@ function bp_forums_add_replied_where_sql( $sql ) { $sql .= $wpdb->prepare( " AND p.poster_id = %s ", bp_displayed_user_id() ); - // Remove any topic_author information + // Remove any topic_author information. $sql = str_replace( " AND t.topic_poster = '" . bp_displayed_user_id() . "'", '', $sql ); return $sql; 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 05fbedac1f4038346504cdbb276469db685148b9..59db54b6c81be31d12eec7a32cf2bac68894f11e 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php @@ -3,10 +3,11 @@ * BuddyPress Forums Functions. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** bbPress 2.x ***************************************************************/ @@ -14,21 +15,21 @@ defined( 'ABSPATH' ) || exit; /** * Is see bbPress 2.x is installed and active? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @return boolean True if bbPress 2.x is active, false if not. */ function bp_forums_is_bbpress_active() { - // Single site + // Single site. if ( is_plugin_active( 'bbpress/bbpress.php' ) ) return true; - // Network active + // Network active. if ( is_plugin_active_for_network( 'bbpress/bbpress.php' ) ) return true; - // Nope + // Nope. return false; } @@ -40,7 +41,7 @@ function bp_forums_is_bbpress_active() { * "Installed correctly" means that the bb-config-location option is set, and * the referenced file exists. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @return boolean True if option exists, false if not. */ @@ -56,9 +57,9 @@ function bp_forums_is_installed_correctly() { /** * Does the forums component have a directory page registered? * - * Checks $bp pages global and looks for directory page + * Checks $bp pages global and looks for directory page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global BuddyPress $bp The one true BuddyPress instance. * @@ -80,7 +81,7 @@ function bp_forums_has_directory() { */ function bp_forums_get_forum( $forum_id ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); return bb_get_forum( $forum_id ); } @@ -90,20 +91,20 @@ function bp_forums_get_forum( $forum_id ) { * * Wrapper for {@link bb_new_forum()}. * - * @param array $args { + * @param array|string $args { * Forum setup arguments. - * @type string $forum_name Name of the forum. - * @type string $forum_desc Description of the forum. - * @type int $forum_parent_id ID of the forum parent. Default: value of - * {@link bp_forums_parent_forums_id()}. - * @type bool $forum_order Order. - * @type int $forum_is_category Whether the forum is a category. Default: 0. + * @type string $forum_name Name of the forum. + * @type string $forum_desc Description of the forum. + * @type int $forum_parent_id ID of the forum parent. Default: value of + * {@link bp_forums_parent_forums_id()}. + * @type bool $forum_order Order. + * @type int $forum_is_category Whether the forum is a category. Default: 0. * } * @return int ID of the newly created forum. */ function bp_forums_new_forum( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -123,21 +124,21 @@ function bp_forums_new_forum( $args = '' ) { * * Wrapper for {@link bb_update_forum(}. * - * @param array $args { + * @param array|string $args { * Forum setup arguments. - * @type int $forum_id ID of the forum to be updated. - * @type string $forum_name Name of the forum. - * @type string $forum_desc Description of the forum. - * @type int $forum_parent_id ID of the forum parent. Default: value of - * {@link bp_forums_parent_forums_id()}. - * @type bool $forum_order Order. - * @type int $forum_is_category Whether the forum is a category. Default: 0. + * @type int $forum_id ID of the forum to be updated. + * @type string $forum_name Name of the forum. + * @type string $forum_desc Description of the forum. + * @type int $forum_parent_id ID of the forum parent. Default: value of + * {@link bp_forums_parent_forums_id()}. + * @type bool $forum_order Order. + * @type int $forum_is_category Whether the forum is a category. Default: 0. * } * @return bool True on success, false on failure. */ function bp_forums_update_forum( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -164,7 +165,7 @@ function bp_forums_delete_group_forum( $group_id ) { if ( !empty( $forum_id ) && is_int( $forum_id ) ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); bb_delete_forum( $forum_id ); } @@ -176,28 +177,28 @@ add_action( 'groups_delete_group', 'bp_forums_delete_group_forum' ); /** * Fetch a set of forum topics. * - * @param array $args { - * @type string @type Order or filter type. Default: 'newest'. - * @type int $forum_id Optional. Pass a forum ID to limit results to topics - * associated with that forum. - * @type int $user_id Optional. Pass a user ID to limit results to topics - * belonging to that user. - * @type int $page Optional. Number of the results page to return. - * Default: 1. - * @type int $per_page Optional. Number of results to return per page. - * Default: 15. - * @type int $offset Optional. Numeric offset for results. - * @type int $number - * @type array $exclude Optional. Topic IDs to exclude. + * @param array|string $args { + * @type string $type Order or filter type. Default: 'newest'. + * @type int $forum_id Optional. Pass a forum ID to limit results to topics + * associated with that forum. + * @type int $user_id Optional. Pass a user ID to limit results to topics + * belonging to that user. + * @type int $page Optional. Number of the results page to return. + * Default: 1. + * @type int $per_page Optional. Number of results to return per page. + * Default: 15. + * @type int $offset Optional. Numeric offset for results. + * @type int $number Amount to query for. + * @type array $exclude Optional. Topic IDs to exclude. * @type string $show_stickies Whether to show sticky topics. - * @type mixed $filter If $type = 'tag', filter is the tag name. Otherwise, - * $filter is terms to search on. + * @type mixed $filter If $type = 'tag', filter is the tag name. Otherwise, + * $filter is terms to search on. * } * @return array Found topics. */ function bp_forums_get_forum_topics( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -210,7 +211,7 @@ function bp_forums_get_forum_topics( $args = '' ) { 'number' => false, 'exclude' => false, 'show_stickies' => 'all', - 'filter' => false // if $type = tag then filter is the tag name, otherwise it's terms to search on. + 'filter' => false // If $type = tag then filter is the tag name, otherwise it's terms to search on. ) ); extract( $r, EXTR_SKIP ); @@ -243,7 +244,7 @@ function bp_forums_get_forum_topics( $args = '' ) { /** * Filters the found forum topics for provided arguments. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -259,7 +260,7 @@ function bp_forums_get_forum_topics( $args = '' ) { */ function bp_forums_get_topic_details( $topic_id ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $query = new BB_Query( 'topic', 'topic_id=' . $topic_id . '&page=1' /* Page override so bbPress doesn't use the URI */ ); @@ -277,7 +278,7 @@ function bp_forums_get_topic_details( $topic_id ) { */ function bp_forums_get_topic_id_from_slug( $topic_slug ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); if ( empty( $topic_slug ) ) @@ -289,50 +290,50 @@ function bp_forums_get_topic_id_from_slug( $topic_slug ) { /** * Create a new forum topic. * - * @param array $args { - * @type string $topic_title Title of the new topic. - * @type string $topic_slug Slug of the new topic. - * @type string $topic_text Text of the new topic. - * @type int $topic_poster ID of the user posting the topic. Default: ID of - * the logged-in user. - * @type string $topic_poster_name Display name of the user posting the - * topic. Default: 'fullname' of the logged-in user. - * @type id $topic_last_poster ID of the user who last posted to the topic. - * Default: ID of the logged-in user. - * @type string $topic_last_poster_name Display name of the user who last - * posted to the topic. Default: 'fullname' of the logged-in user. - * @type string $topic_start_time Date/time when the topic was created. - * Default: the current time, as reported by bp_core_current_time(). - * @type string $topic_time Date/time when the topic was created. - * Default: the current time, as reported by bp_core_current_time(). - * @type int $topic_open Whether the topic is open. Default: 1 (open). - * @type array|string|bool $topic_tags Array or comma-separated list of - * topic tags. False to leave empty. Default: false. - * @type int $forum_id ID of the forum to which the topic belongs. - * Default: 0. + * @param array|string $args { + * @type string $topic_title Title of the new topic. + * @type string $topic_slug Slug of the new topic. + * @type string $topic_text Text of the new topic. + * @type int $topic_poster ID of the user posting the topic. Default: ID of + * the logged-in user. + * @type string $topic_poster_name Display name of the user posting the + * topic. Default: 'fullname' of the logged-in user. + * @type int $topic_last_poster ID of the user who last posted to the topic. + * Default: ID of the logged-in user. + * @type string $topic_last_poster_name Display name of the user who last + * posted to the topic. Default: 'fullname' of the logged-in user. + * @type string $topic_start_time Date/time when the topic was created. + * Default: the current time, as reported by bp_core_current_time(). + * @type string $topic_time Date/time when the topic was created. + * Default: the current time, as reported by bp_core_current_time(). + * @type int $topic_open Whether the topic is open. Default: 1 (open). + * @type array|string|bool $topic_tags Array or comma-separated list of + * topic tags. False to leave empty. Default: false. + * @type int $forum_id ID of the forum to which the topic belongs. + * Default: 0. * } * @return object Details about the new topic, as returned by - * {@link bp_forums_get_topic_details()}. + * {@link bp_forums_get_topic_details()}. */ function bp_forums_new_topic( $args = '' ) { $bp = buddypress(); - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( 'topic_title' => '', 'topic_slug' => '', 'topic_text' => '', - 'topic_poster' => bp_loggedin_user_id(), // accepts ids - 'topic_poster_name' => $bp->loggedin_user->fullname, // accept names - 'topic_last_poster' => bp_loggedin_user_id(), // accepts ids - 'topic_last_poster_name' => $bp->loggedin_user->fullname, // accept names + 'topic_poster' => bp_loggedin_user_id(), // Accepts ids. + 'topic_poster_name' => $bp->loggedin_user->fullname, // Accept names. + 'topic_last_poster' => bp_loggedin_user_id(), // Accepts ids. + 'topic_last_poster_name' => $bp->loggedin_user->fullname, // Accept names. 'topic_start_time' => bp_core_current_time(), 'topic_time' => bp_core_current_time(), 'topic_open' => 1, - 'topic_tags' => false, // accepts array or comma delimited - 'forum_id' => 0 // accepts ids or slugs + 'topic_tags' => false, // Accepts array or comma delimited. + 'forum_id' => 0 // Accepts ids or slugs. ) ); extract( $r, EXTR_SKIP ); @@ -360,7 +361,7 @@ function bp_forums_new_topic( $args = '' ) { /** * Fires after a new forum topic has been created. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $topic_id ID of the newly created topic post. */ @@ -372,20 +373,21 @@ function bp_forums_new_topic( $args = '' ) { /** * Update a topic's details. * - * @param array $args { + * @param array|string $args { * Array of arguments. - * @type int $topic_id ID of the topic being updated. - * @type string $topic_title Updated title of the topic. - * @type string $topic_title Updated text of the topic. - * @type array|string|bool $topic_tags Array or comma-separated list of - * topic tags. False to leave empty. Default: false. + * @type int $topic_id ID of the topic being updated. + * @type string $topic_title Updated title of the topic. + * @type string $topic_text Updated text of the topic. + * @type array|string|bool $topic_tags Array or comma-separated list of + * topic tags. False to leave empty. + * Default false. * } * @return object Details about the new topic, as returned by - * {@link bp_forums_get_topic_details()}. + * {@link bp_forums_get_topic_details()}. */ function bp_forums_update_topic( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -396,11 +398,11 @@ function bp_forums_update_topic( $args = '' ) { ) ); extract( $r, EXTR_SKIP ); - // Check if the user is a spammer + // Check if the user is a spammer. if ( bp_is_user_inactive( bp_loggedin_user_id() ) ) return false; - // bb_insert_topic() will append tags, but not remove them. So we remove all existing tags. + // The bb_insert_topic() function will append tags, but not remove them. So we remove all existing tags. bb_remove_topic_tags( $topic_id ); if ( !$topic_id = bb_insert_topic( array( 'topic_id' => $topic_id, 'topic_title' => stripslashes( $topic_title ), 'tags' => $topic_tags ) ) ) @@ -409,7 +411,7 @@ function bp_forums_update_topic( $args = '' ) { if ( !$post = bb_get_first_post( $topic_id ) ) return false; - // Update the first post + // Update the first post. if ( !$post = bp_forums_insert_post( array( 'post_id' => $post->post_id, 'topic_id' => $topic_id, 'post_text' => $topic_text, 'post_time' => $post->post_time, 'poster_id' => $post->poster_id, 'poster_ip' => $post->poster_ip, 'post_status' => $post->post_status, 'post_position' => $post->post_position ) ) ) return false; @@ -418,12 +420,12 @@ function bp_forums_update_topic( $args = '' ) { function bp_forums_sticky_topic( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( 'topic_id' => false, - 'mode' => 'stick' // stick/unstick + 'mode' => 'stick' // Stick/unstick. ) ); extract( $r, EXTR_SKIP ); @@ -438,21 +440,21 @@ function bp_forums_sticky_topic( $args = '' ) { /** * Set a topic's open/closed status. * - * @param array $args { - * @type int $topic_id ID of the topic whose status is being changed. - * @type string $mode New status of the topic. 'open' or 'close'. - * Default: 'close'. + * @param array|string $args { + * @type int $topic_id ID of the topic whose status is being changed. + * @type string $mode New status of the topic. 'open' or 'close'. + * Default: 'close'. * } * @return bool True on success, false on failure. */ function bp_forums_openclose_topic( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( 'topic_id' => false, - 'mode' => 'close' // stick/unstick + 'mode' => 'close' // Stick/unstick. ) ); extract( $r, EXTR_SKIP ); @@ -467,14 +469,14 @@ function bp_forums_openclose_topic( $args = '' ) { /** * Delete a topic. * - * @param array $args { + * @param array|string $args { * @type int $topic_id ID of the topic being deleted. * } * @return bool True on success, false on failure. */ function bp_forums_delete_topic( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -493,7 +495,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 */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); if ( isset( $bbdb ) ) { @@ -513,7 +515,7 @@ function bp_forums_total_topic_count() { /** * Filters the total topic count for the site. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $count Total topic count. */ @@ -525,11 +527,11 @@ function bp_forums_total_topic_count() { * * Used to prevent dupes. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param string $text The text of the comment. - * @param int $topic_id The topic id. - * @param int $user_id The user id. + * @param string $text The text of the comment. + * @param int $topic_id The topic id. + * @param int $user_id The user id. * @return bool True if a duplicate reply exists, otherwise false. */ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { @@ -538,7 +540,7 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { if ( $text && $topic_id && $user_id ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $args = array( @@ -546,15 +548,15 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { 'topic_id' => $topic_id ); - // Set the reply_exists_text so we can check it in the filter below + // Set the reply_exists_text so we can check it in the filter below. buddypress()->forums->reply_exists_text = $text; - // BB_Query's post_text parameter does a MATCH, while we need exact matches + // BB_Query's post_text parameter does a MATCH, while we need exact matches. add_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' ); $query = new BB_Query( 'post', $args ); remove_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' ); - // Cleanup + // Cleanup. unset( buddypress()->forums->reply_exists_text ); $reply_exists = (bool) !empty( $query->results ); @@ -563,7 +565,7 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { /** * Filters whether a user has already left this particular reply on a given post. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $reply_exists Whether or not a reply exists. * @param string $text The text of the comment. @@ -573,10 +575,10 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id ); } /** - * Private one-time-use function used in conjunction with bp_forums_reply_exists() + * Private one-time-use function used in conjunction with bp_forums_reply_exists(). * * @access private - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WPDB $wpdb WordPress database access object. * @@ -590,15 +592,15 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { /** * Get a total "Topics Started" count for a given user. * - * @param int $user_id ID of the user being queried. Falls back on displayed - * user, then loggedin. - * @param string $type The current filter/sort type. 'active', 'popular', - * 'unreplied'. + * @param int $user_id ID of the user being queried. Falls back on displayed + * user, then loggedin. + * @param string $type The current filter/sort type. 'active', 'popular', + * 'unreplied'. * @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 */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); if ( !$user_id ) @@ -631,15 +633,16 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) * Uses an unfortunate technique to count unique topics, due to limitations in * BB_Query. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param int $user_id ID of the user whose replied topics are being counted. - * Defaults to displayed user, then to logged-in user. + * @param int $user_id ID of the user whose replied topics are being counted. + * Defaults to displayed user, then to logged-in user. + * @param string $type Forum thread type. * @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 */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); if ( !$user_id ) @@ -651,14 +654,14 @@ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' if ( class_exists( 'BB_Query' ) ) { $query = new BB_Query( 'post', array( 'post_author_id' => $user_id, 'page' => 1, 'per_page' => -1, 'count' => true ) ); - // Count the unique topics. No better way to do this in the bbPress query API + // Count the unique topics. No better way to do this in the bbPress query API. $topics = array(); foreach( $query->results as $result ) { if ( !in_array( $result->topic_id, $topics ) ) $topics[] = $result->topic_id; } - // Even more unfortunate. If this is filtered by 'unreplied', we have to requery + // Even more unfortunate. If this is filtered by 'unreplied', we have to requery. if ( 'unreplied' == $type ) { $topic_ids = implode( ',', $topics ); $topics_query = new BB_Query( 'topic', array( 'topic_id' => $topic_ids, 'page' => 1, 'per_page' => -1, 'post_count' => 1 ) ); @@ -674,7 +677,7 @@ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' /** * Filters the total number of topics replied to by a given user. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $count Total number of topics replied to by a given user. * @param int $user_id The user ID. @@ -701,11 +704,11 @@ function bp_forums_get_topic_extras( $topics ) { $bp = buddypress(); - // Get the topic ids + // Get the topic ids. foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id; $topic_ids = implode( ',', wp_parse_id_list( $topic_ids ) ); - // Fetch the topic's last poster details + // Fetch the topic's last poster details. $poster_details = $wpdb->get_results( "SELECT t.topic_id, t.topic_last_poster, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u, {$bbdb->topics} t WHERE u.ID = t.topic_last_poster AND t.topic_id IN ( {$topic_ids} )" ); for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { foreach ( (array) $poster_details as $poster ) { @@ -718,7 +721,7 @@ function bp_forums_get_topic_extras( $topics ) { } } - // Fetch fullname for the topic's last poster + // Fetch fullname for the topic's last poster. if ( bp_is_active( 'xprofile' ) ) { $poster_names = $wpdb->get_results( "SELECT t.topic_id, pd.value FROM {$bp->profile->table_name_data} pd, {$bbdb->topics} t WHERE pd.user_id = t.topic_last_poster AND pd.field_id = 1 AND t.topic_id IN ( {$topic_ids} )" ); for ( $i = 0, $count = count( $topics ); $i < $count; ++$i ) { @@ -730,7 +733,7 @@ function bp_forums_get_topic_extras( $topics ) { } // Loop through to make sure that each topic has the proper values set. This covers the - // case of deleted users + // case of deleted users. foreach ( (array) $topics as $key => $topic ) { if ( !isset( $topic->topic_last_poster_email ) ) $topics[$key]->topic_last_poster_email = ''; @@ -753,18 +756,18 @@ function bp_forums_get_topic_extras( $topics ) { /** * Get the posts belonging to a topic. * - * @param array $args { - * @type int $topic_id ID of the topic for which posts are being fetched. - * @type int $page Optional. Page of results to return. Default: 1. - * @type int $page Optional. Number of results to return per page. - * Default: 15. - * @type string $order 'ASC' or 'DESC'. Default: 'ASC'. + * @param array|string $args { + * @type int $topic_id ID of the topic for which posts are being fetched. + * @type int $page Optional. Page of results to return. Default: 1. + * @type int $page Optional. Number of results to return per page. + * Default: 15. + * @type string $order 'ASC' or 'DESC'. Default: 'ASC'. * } * @return array List of posts. */ function bp_forums_get_topic_posts( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $defaults = array( @@ -790,7 +793,7 @@ function bp_forums_get_topic_posts( $args = '' ) { */ function bp_forums_get_post( $post_id ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); return bb_get_post( $post_id ); } @@ -800,14 +803,14 @@ function bp_forums_get_post( $post_id ) { * * Wrapper for {@link bb_delete_post()}. * - * @param array $args { + * @param array|string $args { * @type int $post_id ID of the post being deleted. * } * @return bool True on success, false on failure. */ function bp_forums_delete_post( $args = '' ) { - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $r = wp_parse_args( $args, array( @@ -822,25 +825,25 @@ function bp_forums_delete_post( $args = '' ) { /** * Create a new post. * - * @param array $args { - * @type int $post_id Optional. ID of an existing post, if you want to - * update rather than create. Default: false. - * @type int $topic_id ID of the topic to which the post belongs. - * @type string $post_text Contents of the post. - * @type string $post_time Optional. Time when the post was recorded. - * Default: current time, as reported by {@link bp_core_current_time()}. - * @type int $poster_id Optional. ID of the user creating the post. - * Default: ID of the logged-in user. - * @type string $poster_ip Optional. IP address of the user creating the - * post. Default: the IP address found in $_SERVER['REMOTE_ADDR']. - * @type int $post_status Post status. Default: 0. - * @type int $post_position Optional. Default: false (auto). + * @param array|string $args { + * @type int $post_id Optional. ID of an existing post, if you want to + * update rather than create. Default: false. + * @type int $topic_id ID of the topic to which the post belongs. + * @type string $post_text Contents of the post. + * @type string $post_time Optional. Time when the post was recorded. + * Default: current time, as reported by {@link bp_core_current_time()}. + * @type int $poster_id Optional. ID of the user creating the post. + * Default: ID of the logged-in user. + * @type string $poster_ip Optional. IP address of the user creating the + * post. Default: the IP address found in $_SERVER['REMOTE_ADDR']. + * @type int $post_status Post status. Default: 0. + * @type int $post_position Optional. Default: false (auto). * } * @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 */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); $defaults = array( @@ -848,9 +851,9 @@ function bp_forums_insert_post( $args = '' ) { 'topic_id' => false, 'post_text' => '', 'post_time' => bp_core_current_time(), - 'poster_id' => bp_loggedin_user_id(), // accepts ids or names + 'poster_id' => bp_loggedin_user_id(), // Accepts ids or names. 'poster_ip' => $_SERVER['REMOTE_ADDR'], - 'post_status' => 0, // use bb_delete_post() instead + 'post_status' => 0, // Use bb_delete_post() instead. 'post_position' => false ); @@ -885,7 +888,7 @@ function bp_forums_insert_post( $args = '' ) { /** * Fires if there was a new post created. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $post_id ID of the newly created forum post. */ @@ -913,11 +916,11 @@ function bp_forums_get_post_extras( $posts ) { $bp = buddypress(); - // Get the user ids + // Get the user ids. foreach ( (array) $posts as $post ) $user_ids[] = $post->poster_id; $user_ids = implode( ',', wp_parse_id_list( $user_ids ) ); - // Fetch the poster's user_email, user_nicename and user_login + // Fetch the poster's user_email, user_nicename and user_login. $poster_details = $wpdb->get_results( "SELECT u.ID as user_id, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$wpdb->users} u WHERE u.ID IN ( {$user_ids} )" ); for ( $i = 0, $count = count( $posts ); $i < $count; ++$i ) { @@ -945,7 +948,7 @@ function bp_forums_get_post_extras( $posts ) { /** * Filters BP-specific details about a set of posts. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $posts Array of posts holding BP-specific details. */ @@ -957,15 +960,15 @@ function bp_forums_get_post_extras( $posts ) { * * @param int $forum_id ID of the forum. * @return object Object with properties $topics (topic count) and $posts - * (post count). + * (post count). */ function bp_forums_get_forum_topicpost_count( $forum_id ) { global $wpdb, $bbdb; - /** This action is documented in bp-forums/bp-forums-screens */ + /** This action is documented in bp-forums/bp-forums-screens.php */ do_action( 'bbpress_init' ); - // Need to find a bbPress function that does this + // Need to find a bbPress function that does this. return $wpdb->get_results( $wpdb->prepare( "SELECT topics, posts from {$bbdb->forums} WHERE forum_id = %d", $forum_id ) ); } @@ -997,7 +1000,7 @@ add_filter( 'user_has_cap', 'bp_forums_filter_caps' ); /** * Return the parent forum ID for the bbPress abstraction layer. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return int Forum ID. */ @@ -1006,7 +1009,7 @@ function bp_forums_parent_forum_id() { /** * Filters the parent forum ID for the bbPress abstraction layer. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int BP_FORUMS_PARENT_FORUM_ID The Parent forum ID constant. */ @@ -1019,17 +1022,17 @@ function bp_forums_parent_forum_id() { * Defaults to false. Define BP_FORUMS_ENABLE_GLOBAL_DIRECTORY_STICKIES, or * filter 'bp_forums_enable_global_directory_stickies', to change this behavior. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if stickies should be displayed at the top of the global - * directory, otherwise false. + * 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) + * @since 1.5.0 * * @param bool $value Whether or not to break out of topic order. */ @@ -1044,7 +1047,7 @@ function bp_forums_enable_global_directory_stickies() { * actions throughout BuddyPress. */ -// List actions to clear super cached pages on, if super cache is installed +// List actions to clear super cached pages on, if super cache is installed. add_action( 'bp_forums_new_forum', 'bp_core_clear_cache' ); add_action( 'bp_forums_new_topic', 'bp_core_clear_cache' ); add_action( 'bp_forums_new_post', 'bp_core_clear_cache' ); @@ -1058,7 +1061,7 @@ add_action( 'bp_forums_new_post', 'bp_core_clear_cache' ); * Grabs the topic post ID and attempts to retrieve the oEmbed cache (if it exists) * during the forum topic loop. If no cache and link is embeddable, cache it. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed * @see bp_embed_forum_cache() @@ -1076,8 +1079,11 @@ add_action( 'topic_loop_start', 'bp_forums_embed' ); * * Wrapper function for {@link bb_get_postmeta()}. * - * @package BuddyPress_Forums - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * + * @param object $cache Cache object. + * @param int $id ID of the forum being cached. + * @param string $cachekey Key to use with forum embed cache. */ function bp_embed_forum_cache( $cache, $id, $cachekey ) { return bb_get_postmeta( $id, $cachekey ); @@ -1088,7 +1094,11 @@ function bp_embed_forum_cache( $cache, $id, $cachekey ) { * * Wrapper function for {@link bb_update_postmeta()}. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * + * @param object $cache Cache object. + * @param string $cachekey Key to use with forum embed cache. + * @param int $id ID of the forum being cached. */ function bp_embed_forum_save_cache( $cache, $cachekey, $id ) { bb_update_postmeta( $id, $cachekey, $cache ); 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 dbb32eee8053a5786480047b49313abe94a49543..e6f3bc7c71c60ad9858f6c5a93fd0ea0d5efc9cf 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Forums Loader + * BuddyPress Forums Loader. * * A discussion forums component. Comes bundled with bbPress stand-alone. * @@ -9,10 +8,11 @@ * plugin instead. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsLoader + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; class BP_Forums_Component extends BP_Component { @@ -20,7 +20,7 @@ class BP_Forums_Component extends BP_Component { /** * Start the forums component creation process. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ public function __construct() { parent::start( @@ -39,7 +39,7 @@ class BP_Forums_Component extends BP_Component { * The BP_FORUMS_SLUG constant is deprecated, and only used here for * backwards compatibility. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Component::setup_globals() for description of parameters. * @@ -48,18 +48,21 @@ class BP_Forums_Component extends BP_Component { public function setup_globals( $args = array() ) { $bp = buddypress(); - // Define the parent forum ID - if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) + // Define the parent forum ID. + if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); + } - // Define a slug, if necessary - if ( !defined( 'BP_FORUMS_SLUG' ) ) + // Define a slug, if necessary. + if ( ! defined( 'BP_FORUMS_SLUG' ) ) { define( 'BP_FORUMS_SLUG', $this->id ); + } - // The location of the bbPress stand-alone config file + // The location of the bbPress stand-alone config file. $bbconfig = bp_core_get_root_option( 'bb-config-location' ); - if ( '' !== $bbconfig ) + if ( '' !== $bbconfig ) { $this->bbconfig = $bbconfig; + } // All globals for messaging component. // Note that global_tables is included in this array. @@ -83,7 +86,7 @@ class BP_Forums_Component extends BP_Component { */ public function includes( $includes = array() ) { - // Files to include + // Files to include. $includes = array( 'actions', 'screens', @@ -93,11 +96,12 @@ class BP_Forums_Component extends BP_Component { 'functions', ); - // bbPress stand-alone - if ( !defined( 'BB_PATH' ) ) + // bbPress stand-alone. + if ( ! defined( 'BB_PATH' ) ) { $includes[] = 'bbpress-sa'; + } - // Admin-specific code + // Admin-specific code. if ( is_admin() ) { $includes[] = 'deprecated/1.6'; $includes[] = 'deprecated/1.7'; @@ -109,36 +113,28 @@ class BP_Forums_Component extends BP_Component { /** * Set up component navigation. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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() ) { - // Stop if forums haven't been set up yet - if ( !bp_forums_is_installed_correctly() ) + // Stop if forums haven't been set up yet. + if ( ! bp_forums_is_installed_correctly() ) { return; + } - // Stop if there is no user displayed or logged in - if ( !is_user_logged_in() && !bp_displayed_user_id() ) + // Stop if there is no user displayed or logged in. + if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { return; + } - // Add 'Forums' to the main navigation - $main_nav = array( - 'name' => __( 'Forums', 'buddypress' ), - 'slug' => $this->slug, - 'position' => 80, - 'screen_function' => 'bp_member_forums_screen_topics', - 'default_subnav_slug' => 'topics', - 'item_css_id' => $this->id - ); - - // Determine user to use + // Determine user to use. if ( bp_displayed_user_domain() ) { $user_domain = bp_displayed_user_domain(); } elseif ( bp_loggedin_user_domain() ) { @@ -147,26 +143,37 @@ class BP_Forums_Component extends BP_Component { return; } - // User link - $forums_link = trailingslashit( $user_domain . $this->slug ); + // User link. + $slug = bp_get_forums_slug(); + $forums_link = trailingslashit( $user_domain . $slug ); + + // Add 'Forums' to the main navigation. + $main_nav = array( + 'name' => __( 'Forums', 'buddypress' ), + 'slug' => $slug, + 'position' => 80, + 'screen_function' => 'bp_member_forums_screen_topics', + 'default_subnav_slug' => 'topics', + 'item_css_id' => $this->id + ); - // Additional menu if friends is active + // Topics started. $sub_nav[] = array( 'name' => __( 'Topics Started', 'buddypress' ), 'slug' => 'topics', 'parent_url' => $forums_link, - 'parent_slug' => $this->slug, + 'parent_slug' => $slug, 'screen_function' => 'bp_member_forums_screen_topics', 'position' => 20, 'item_css_id' => 'topics' ); - // Additional menu if friends is active + // Topics replied to. $sub_nav[] = array( 'name' => __( 'Replied To', 'buddypress' ), 'slug' => 'replies', 'parent_url' => $forums_link, - 'parent_slug' => $this->slug, + 'parent_slug' => $slug, 'screen_function' => 'bp_member_forums_screen_replies', 'position' => 40, 'item_css_id' => 'replies' @@ -178,38 +185,38 @@ class BP_Forums_Component extends BP_Component { /** * Set up bp-forums integration with the WordPress admin bar. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Component::setup_admin_bar() for a description of arguments. * * @param array $wp_admin_nav See BP_Component::setup_admin_bar() - * for description. + * for description. */ public function setup_admin_bar( $wp_admin_nav = array() ) { - // Menus for logged in user + // Menus for logged in user. if ( is_user_logged_in() ) { - // Setup the logged in user variables - $forums_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); + // Setup the logged in user variables. + $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); - // Add the "My Account" sub menus + // Add the "My Account" sub menus. $wp_admin_nav[] = array( 'parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __( 'Forums', 'buddypress' ), - 'href' => trailingslashit( $forums_link ) + 'href' => $forums_link ); - // Topics + // Topics. $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-topics-started', 'title' => __( 'Topics Started', 'buddypress' ), - 'href' => trailingslashit( $forums_link . 'topics' ) + 'href' => $forums_link ); - // Replies + // Replies. $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-replies', @@ -217,7 +224,7 @@ class BP_Forums_Component extends BP_Component { 'href' => trailingslashit( $forums_link . 'replies' ) ); - // Favorites + // Favorites. $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-favorite-topics', @@ -233,10 +240,11 @@ class BP_Forums_Component extends BP_Component { * Set up the title for pages and the <title> element. */ public function setup_title() { - $bp = buddypress(); - // Adjust title based on view + // Adjust title based on view. if ( bp_is_forums_component() ) { + $bp = buddypress(); + if ( bp_is_my_profile() ) { $bp->bp_options_title = __( 'Forums', 'buddypress' ); } else { 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 6778edc7bf2e618abd1176ce41e342c04c91f2fa..a4657dabc4ff6fef9e3e906be41a88f5743e3807 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php @@ -3,10 +3,11 @@ * BuddyPress Forums Screen Functions. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -14,7 +15,7 @@ defined( 'ABSPATH' ) || exit; */ function bp_forums_directory_forums_setup() { - // Get BuddyPress once + // Get BuddyPress once. $bp = buddypress(); if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) { @@ -31,7 +32,7 @@ function bp_forums_directory_forums_setup() { /** * Fires early in the initialization of bbPress-based areas of BuddyPress. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bbpress_init' ); @@ -41,7 +42,7 @@ function bp_forums_directory_forums_setup() { $bp->groups->current_group = groups_get_group( array( 'group_id' => $_POST['topic_group_id'] ) ); if ( !empty( $bp->groups->current_group->id ) ) { - // Auto join this user if they are not yet a member of this group + // Auto join this user if they are not yet a member of this group. if ( !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) groups_join_group( $bp->groups->current_group->id ); @@ -74,7 +75,7 @@ function bp_forums_directory_forums_setup() { bp_core_redirect( add_query_arg( 'new', '', bp_get_forums_directory_permalink() ) ); } - } else { + } else { bp_core_add_message( __( 'Please pick the group forum where you would like to post this topic.', 'buddypress' ), 'error' ); bp_core_redirect( add_query_arg( 'new', '', bp_get_forums_directory_permalink() ) ); } @@ -83,14 +84,14 @@ function bp_forums_directory_forums_setup() { /** * Fires right before the loading of the forums directory screen template file. * - * @since BuddyPress (1.1.0) + * @since 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) + * @since 1.1.0 * * @param string $template Path to the forums template to load. */ @@ -107,14 +108,14 @@ function bp_member_forums_screen_topics() { /** * Fires right before the loading of the forums topics started screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the forums topics started template to load. */ @@ -129,14 +130,14 @@ function bp_member_forums_screen_replies() { /** * Fires right before the loading of the forums replied to screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the forums replied to template to load. */ @@ -153,14 +154,14 @@ function bp_member_forums_screen_favorites() { /** * Fires right before the loading of the forums favorites screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the forums favorites template to load. */ @@ -178,14 +179,14 @@ function bp_forums_screen_single_forum() { /** * Fires right before the loading of the forums single forum screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the forums single forum template to load. */ @@ -204,14 +205,14 @@ function bp_forums_screen_single_topic() { /** * Fires right before the loading of the forums single topic screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the forums single topic template to load. */ @@ -228,14 +229,14 @@ add_action( 'bp_screens', 'bp_forums_screen_single_topic' ); * 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) + * @since 1.7.0 */ class BP_Forum_Legacy_Theme_Compat { /** * Set up theme compatibility for the legacy forums component. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function __construct() { add_action( 'bp_setup_theme_compat', array( $this, 'is_legacy_forum' ) ); @@ -244,15 +245,15 @@ class BP_Forum_Legacy_Theme_Compat { /** * Are we looking at something that needs old forum theme compatibility? * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function is_legacy_forum() { - // Bail if not looking at a group + // Bail if not looking at a group. if ( ! bp_is_forums_component() ) return; - // forum Directory + // Forum Directory. if ( ( ! bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && ! bp_current_item() ) { if ( ! bp_forums_has_directory() ) @@ -279,11 +280,11 @@ class BP_Forum_Legacy_Theme_Compat { /** * Update the global $post with directory data. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function directory_dummy_post() { - // Title based on ability to create groups + // Title based on ability to create groups. if ( is_user_logged_in() ) { $title = __( 'Forums', 'buddypress' ) . ' <a class="button show-hide-new bp-title-button" href="#new-topic" id="new-topic-button">' . __( 'New Topic', 'buddypress' ) . '</a>'; } else { @@ -306,7 +307,7 @@ class BP_Forum_Legacy_Theme_Compat { /** * Filter the_content with the old forum index template part. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function directory_content() { return bp_buffer_template_part( 'forums/index', null, false ); 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 93f3f7841a4354c46607dec6362d9a34b45830fc..75529a6b5a00fa5f7ab1775138e42e52f9ec92ce 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php @@ -3,16 +3,17 @@ * BuddyPress Forums Template Tags. * * @package BuddyPress - * @subpackage Forums + * @subpackage ForumsTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Output the forums component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_forums_slug() */ @@ -22,7 +23,7 @@ function bp_forums_slug() { /** * Return the forums component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string Slug for the forums component. */ @@ -30,7 +31,7 @@ function bp_forums_slug() { /** * Filters the forums component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Forums component slug. */ @@ -40,7 +41,7 @@ function bp_forums_slug() { /** * Output the forums component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_forums_root_slug() */ @@ -50,7 +51,7 @@ function bp_forums_root_slug() { /** * Return the forums component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string Root slug for the forums component. */ @@ -58,7 +59,7 @@ function bp_forums_root_slug() { /** * Filters the forums component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Forums component root slug. */ @@ -68,7 +69,7 @@ function bp_forums_root_slug() { /** * Output permalink for the forum directory. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_forums_directory_permalink() */ @@ -78,7 +79,7 @@ function bp_forums_directory_permalink() { /** * Return permalink for the forum directory. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() * @uses trailingslashit() @@ -92,7 +93,7 @@ function bp_forums_directory_permalink() { /** * Filters the permalink for the forum directory. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Permalink for the forum directory. */ @@ -108,7 +109,6 @@ class BP_Forums_Template_Forum { /** * The loop iterator. * - * @access public * @var int */ public $current_topic = -1; @@ -116,7 +116,6 @@ class BP_Forums_Template_Forum { /** * The number of topics returned by the paged query. * - * @access public * @var int */ public $topic_count; @@ -124,7 +123,6 @@ class BP_Forums_Template_Forum { /** * Array of topics located by the query. * - * @access public * @var array */ public $topics; @@ -132,7 +130,6 @@ class BP_Forums_Template_Forum { /** * The topic object currently being iterated on. * - * @access public * @var object */ public $topic; @@ -140,7 +137,6 @@ class BP_Forums_Template_Forum { /** * The ID of the forum whose topics are being queried. * - * @access public * @var int */ public $forum_id; @@ -148,7 +144,6 @@ class BP_Forums_Template_Forum { /** * A flag for whether the loop is currently being iterated. * - * @access public * @var bool */ public $in_the_loop; @@ -156,7 +151,6 @@ class BP_Forums_Template_Forum { /** * The page number being requested. * - * @access public * @var int */ public $pag_page; @@ -164,7 +158,6 @@ class BP_Forums_Template_Forum { /** * The number of items being requested per page. * - * @access public * @var int */ public $pag_num; @@ -172,7 +165,6 @@ class BP_Forums_Template_Forum { /** * An HTML string containing pagination links. * - * @access public * @var string */ public $pag_links; @@ -180,7 +172,6 @@ class BP_Forums_Template_Forum { /** * The total number of topics matching the query parameters. * - * @access public * @var int */ public $total_topic_count; @@ -188,7 +179,6 @@ class BP_Forums_Template_Forum { /** * Whether requesting a single topic. Not currently used. * - * @access public * @var bool */ public $single_topic = false; @@ -196,7 +186,6 @@ class BP_Forums_Template_Forum { /** * Term to sort by. Not currently used. * - * @access public * @var string */ public $sort_by; @@ -204,7 +193,6 @@ class BP_Forums_Template_Forum { /** * Sort order. Not currently used. * - * @access public * @var string */ public $order; @@ -212,18 +200,19 @@ class BP_Forums_Template_Forum { /** * Constructor method. * - * @param string $type The 'type' is the sort order/kind. 'newest', - * 'popular', 'unreplied', 'tags'. - * @param int $forum_id The ID of the forum for which topics are being - * queried. - * @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 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. + * @param string $type The 'type' is the sort order/kind. 'newest', + * 'popular', 'unreplied', 'tags'. + * @param int $forum_id The ID of the forum for which topics are being + * queried. + * @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 per page. + * @param int $max Max amount to retrieve. + * @param string $no_stickies Requested sticky format. + * @param string $search_terms Filter results by a string. + * @param int|bool $offset Optional. Offset results by a given numeric value. + * @param int|bool $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 ) { $bp = buddypress(); @@ -257,7 +246,7 @@ class BP_Forums_Template_Forum { /** * Filters the forums template topics. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $topics Array of topics being set for display. * @param string $type The sort order/kind. 'newest', @@ -274,26 +263,26 @@ class BP_Forums_Template_Forum { $this->total_topic_count = 0; } else { // Get a total topic count, for use in pagination. This value will differ - // depending on scope + // depending on scope. if ( !empty( $forum_id ) ) { - // Group forums + // Group forums. $topic_count = bp_forums_get_forum( $forum_id ); $topic_count = (int) $topic_count->topics; } else if ( !empty( $bp->groups->current_group ) ) { $topic_count = (int)groups_total_public_forum_topic_count( $type ); } else if ( bp_is_user_forums_started() || ( bp_is_directory() && $user_id ) ) { // This covers the case of Profile > Forums > Topics Started, as - // well as Forum Directory > My Topics + // well as Forum Directory > My Topics. $topic_count = bp_forums_total_topic_count_for_user( bp_displayed_user_id(), $type ); } else if ( bp_is_user_forums_replied_to() ) { - // Profile > Forums > Replied To + // Profile > Forums > Replied To. $topic_count = bp_forums_total_replied_count_for_user( bp_displayed_user_id(), $type ); } else if ( 'tags' == $type ) { $tag = bb_get_tag( $search_terms ); $topic_count = $tag->count; } else { // For forum directories (All Topics), get a true count - $status = bp_current_user_can( 'bp_moderate' ) ? 'all' : 'public'; // todo: member-of + $status = bp_current_user_can( 'bp_moderate' ) ? 'all' : 'public'; // @todo: member-of. $topic_count = (int)groups_total_forum_topic_count( $status, $search_terms ); } @@ -317,7 +306,7 @@ class BP_Forums_Template_Forum { /** * Filters the topic count for the forum being displayed. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_count Topic count to be displayed. * @param array $topics Array of topics to be displayed. @@ -333,7 +322,7 @@ class BP_Forums_Template_Forum { /** * Filters the total topic count for the forum being displayed. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $total_topic_count Total topic count found. * @param int $topic_count Topic count to be displayed. @@ -347,7 +336,7 @@ class BP_Forums_Template_Forum { */ $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 + // Fetch extra information for topics, so we don't have to query inside the loop. $this->topics = bp_forums_get_topic_extras( $this->topics ); if ( (int) $this->total_topic_count && (int) $this->pag_num ) { @@ -372,8 +361,9 @@ class BP_Forums_Template_Forum { * @return bool True if there are items in the loop, otherwise false. */ function has_topics() { - if ( $this->topic_count ) + if ( $this->topic_count ) { return true; + } return false; } @@ -419,10 +409,10 @@ class BP_Forums_Template_Forum { /** * Fires right before the rewinding of user topics. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action('forum_loop_end'); - // Do some cleaning up after the loop + // Do some cleaning up after the loop. $this->rewind_topics(); } @@ -447,7 +437,7 @@ class BP_Forums_Template_Forum { /** * Fires if the current topic item is the first in the topic loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'forum_loop_start' ); } @@ -465,30 +455,30 @@ class BP_Forums_Template_Forum { * $forums_template global before it's rendered, or to modify the value * of has_topics(). * - * @param array $args { + * @param array|string $args { * Arguments for limiting the contents of the forum topics loop. * - * @type string $type The 'type' is the sort order/kind. 'newest', - * 'popular', 'unreplied', 'tags'. Default: 'newest'. - * @type int $forum_id The ID of the forum for which topics are being - * queried. Default: the ID of the forum belonging to the current - * group, if available. - * @type int $user_id The ID of a user to whom to limit results. If viewing - * a member's profile, defaults to that member's ID; otherwise - * defaults to 0. - * @type int $page The number of the page being requested. Default: 1, or - * the value of $_GET['p']. - * @type int $per_pag The number items to return per page. Default: 20, or - * the value of $_GET['n']. - * @type int $max Optional. Max records to return. Default: false (no max). - * @type int $number Optional. Number of records to return. Default: false. - * @type int $offset Optional. Offset results by a given value. - * Default: false. - * @type string $search_terms Optional. A string to which results should be - * limited. Default: false, or the value of $_GET['fs']. - * @type string|bool $do_stickies Whether to move stickies to the top of - * the sort order. Default: true if looking at a group forum, - * otherwise false. + * @type string $type The 'type' is the sort order/kind. 'newest', + * 'popular', 'unreplied', 'tags'. Default: 'newest'. + * @type int $forum_id The ID of the forum for which topics are being + * queried. Default: the ID of the forum belonging to the current + * group, if available. + * @type int $user_id The ID of a user to whom to limit results. If viewing + * a member's profile, defaults to that member's ID; otherwise + * defaults to 0. + * @type int $page The number of the page being requested. Default: 1, or + * the value of $_GET['p']. + * @type int $per_pag The number items to return per page. Default: 20, or + * the value of $_GET['n']. + * @type int $max Optional. Max records to return. Default: false (no max). + * @type int $number Optional. Number of records to return. Default: false. + * @type int $offset Optional. Offset results by a given value. + * Default: false. + * @type string $search_terms Optional. A string to which results should be + * limited. Default: false, or the value of $_GET['fs']. + * @type string|bool $do_stickies Whether to move stickies to the top of + * the sort order. Default: true if looking at a group forum, + * otherwise false. * } * @return bool True when forum topics are found corresponding to the args, * false otherwise. @@ -498,7 +488,7 @@ function bp_has_forum_topics( $args = '' ) { $bp = buddypress(); - /*** + /* * 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. @@ -509,40 +499,40 @@ function bp_has_forum_topics( $args = '' ) { $search_terms = false; $do_stickies = false; - // User filtering + // User filtering. if ( bp_displayed_user_id() ) $user_id = bp_displayed_user_id(); // "Replied" query must be manually modified if ( 'replies' == bp_current_action() ) { - $user_id = 0; // User id must be handled manually by the filter, not by BB_Query + $user_id = 0; // User id must be handled manually by the filter, not by BB_Query. add_filter( 'get_topics_distinct', 'bp_forums_add_replied_distinct_sql', 20 ); add_filter( 'get_topics_join', 'bp_forums_add_replied_join_sql', 20 ); add_filter( 'get_topics_where', 'bp_forums_add_replied_where_sql', 20 ); } - // If we're in a single group, set this group's forum_id + // If we're in a single group, set this group's forum_id. if ( !$forum_id && !empty( $bp->groups->current_group ) ) { $bp->groups->current_group->forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); // If it turns out there is no forum for this group, return false so - // we don't fetch all global topics + // we don't fetch all global topics. if ( empty( $bp->groups->current_group->forum_id ) ) return false; $forum_id = $bp->groups->current_group->forum_id; } - // If $_GET['fs'] is set, let's auto populate the search_terms var + // If $_GET['fs'] is set, let's auto populate the search_terms var. if ( bp_is_directory() && !empty( $_GET['fs'] ) ) $search_terms = $_GET['fs']; - // Get the pagination arguments from $_REQUEST + // Get the pagination arguments from $_REQUEST. $page = isset( $_REQUEST['p'] ) ? intval( $_REQUEST['p'] ) : 1; $per_page = isset( $_REQUEST['n'] ) ? intval( $_REQUEST['n'] ) : 20; - // By default, stickies are only pushed to the top of the order on individual group forums + // By default, stickies are only pushed to the top of the order on individual group forums. if ( bp_is_group_forum() ) $do_stickies = true; @@ -563,7 +553,7 @@ function bp_has_forum_topics( $args = '' ) { extract( $r ); // If we're viewing a tag URL in the directory, let's override the type and - // set it to tags and the filter to the tag name + // set it to tags and the filter to the tag name. if ( bp_is_current_action( 'tag' ) && $search_terms = bp_action_variable( 0 ) ) { $type = 'tags'; } @@ -571,21 +561,21 @@ function bp_has_forum_topics( $args = '' ) { /** Sticky logic ******************************************************************/ if ( $do_stickies ) { - // Fetch the stickies + // Fetch the stickies. $stickies_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 0, 0, $max, 'sticky', $search_terms ); - // If stickies are found, try merging them + // If stickies are found, try merging them. if ( $stickies_template->has_topics() ) { - // If stickies are for current $page + // If stickies are for current $page. $page_start_num = ( ( $page - 1 ) * $per_page ) + 1; $page_end_num = $page * $per_page <= $stickies_template->total_topic_count ? $page * $per_page : $stickies_template->total_topic_count; - // Calculate the number of sticky topics that will be shown on this page + // Calculate the number of sticky topics that will be shown on this page. if ( $stickies_template->topic_count < $page_start_num ) { $this_page_stickies = 0; } else { - $this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page + $this_page_stickies = $stickies_template->topic_count - $per_page * floor( $stickies_template->topic_count / $per_page ) * ( $page - 1 ); // Total stickies minus sticky count through this page. // $this_page_stickies cannot be more than $per_page or less than 0 if ( $this_page_stickies > $per_page ) @@ -594,11 +584,11 @@ function bp_has_forum_topics( $args = '' ) { $this_page_stickies = 0; } - // Calculate the total number of topics that will be shown on this page + // Calculate the total number of topics that will be shown on this page. $this_page_topics = $stickies_template->total_topic_count >= ( $page * $per_page ) ? $per_page : $page_end_num - ( $page_start_num - 1 ); // If the number of stickies to be shown is less than $per_page, fetch some - // non-stickies to fill in the rest + // non-stickies to fill in the rest. if ( $this_page_stickies < $this_page_topics ) { // How many non-stickies do we need? $non_sticky_number = $this_page_topics - $this_page_stickies; @@ -608,34 +598,34 @@ function bp_has_forum_topics( $args = '' ) { $non_sticky_total = $page_end_num - $stickies_template->topic_count; // The offset is the number of total non-stickies, less the number - // to be shown on this page + // to be shown on this page. $non_sticky_offset = $non_sticky_total - $non_sticky_number; - // Fetch the non-stickies + // Fetch the non-stickies. $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, 1, $per_page, $max, 'no', $search_terms, $non_sticky_offset, $non_sticky_number ); - // If there are stickies to merge on this page, do it now + // If there are stickies to merge on this page, do it now. if ( $this_page_stickies ) { - // Correct the topic_count + // Correct the topic_count. $forum_template->topic_count += (int) $this_page_stickies; - // Figure out which stickies need to be included + // Figure out which stickies need to be included. $this_page_sticky_topics = array_slice( $stickies_template->topics, 0 - $this_page_stickies ); - // Merge these topics into the forum template + // Merge these topics into the forum template. $forum_template->topics = array_merge( $this_page_sticky_topics, (array) $forum_template->topics ); } } else { - // This page has no non-stickies + // This page has no non-stickies. $forum_template = $stickies_template; - // Adjust the topic count and trim the topics + // Adjust the topic count and trim the topics. $forum_template->topic_count = $this_page_stickies; $forum_template->topics = array_slice( $forum_template->topics, $page - 1 ); } // Because we're using a manual offset and number for the topic query, we - // must set the page number manually, and recalculate the pagination links + // must set the page number manually, and recalculate the pagination links. $forum_template->pag_num = $per_page; $forum_template->pag_page = $page; @@ -651,18 +641,18 @@ function bp_has_forum_topics( $args = '' ) { ) ); } else { - // Fetch the non-sticky topics if no stickies were found + // Fetch the non-sticky topics if no stickies were found. $forum_template = new BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, 'all', $search_terms ); } } else { - // When skipping the sticky logic, just pull up the forum topics like usual + // When skipping the sticky logic, just pull up the forum topics like usual. $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) + * @since 1.1.0 * * @param bool $value Whether or not there are topics to display. * @param object $forum_template Global $forum_template object. @@ -711,7 +701,7 @@ function bp_the_topic_id() { /** * Filters the ID of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $topic_id ID for the current topic. */ @@ -735,7 +725,7 @@ function bp_the_topic_title() { /** * Filters the title of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_title Title for the current topic. */ @@ -759,7 +749,7 @@ function bp_the_topic_slug() { /** * Filters the slug of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_slug Slug for the current topic. */ @@ -785,7 +775,7 @@ function bp_the_topic_text() { /** * Filters the text of the first post in the current topic in the loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $post_text Text for the first post in the current topic. */ @@ -809,7 +799,7 @@ function bp_the_topic_poster_id() { /** * Filters the ID of the user who posted the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $topic_poster ID for the user. */ @@ -821,7 +811,7 @@ function bp_the_topic_poster_id() { * * @see bp_get_the_topic_poster_avatar() for a description of arguments. * - * @param array $args See {@link bp_get_the_topic_poster_avatar()}. + * @param array|string $args See {@link bp_get_the_topic_poster_avatar()}. */ function bp_the_topic_poster_avatar( $args = '' ) { echo bp_get_the_topic_poster_avatar( $args ); @@ -829,18 +819,18 @@ function bp_the_topic_poster_avatar( $args = '' ) { /** * Return the avatar of the user who posted the current topic in the loop. * - * @param array $args { + * @param array|string $args { * Arguments for building the avatar. - * @type string $type Avatar type. 'thumb' or 'full'. Default: - * 'thumb'. - * @type int $width Width of the avatar, in pixels. Default: the - * width corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type int $height Height of the avatar, in pixels. Default: the - * height corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type string $alt The text of the image's 'alt' attribute. - * Default: 'Profile picture of [user name]'. + * @type string $type Avatar type. 'thumb' or 'full'. Default: + * 'thumb'. + * @type int $width Width of the avatar, in pixels. Default: the + * width corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type int $height Height of the avatar, in pixels. Default: the + * height corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type string $alt The text of the image's 'alt' attribute. + * Default: 'Profile picture of [user name]'. * } * @return string HTML of user avatar. */ @@ -860,7 +850,7 @@ function bp_the_topic_poster_avatar( $args = '' ) { /** * Filters the avatar for the user who posted the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML for the display of the user's avatar. */ @@ -889,7 +879,7 @@ function bp_the_topic_poster_name() { /** * Filters the name of the user who posted the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $name Name for the user who posted the current topic. */ @@ -917,7 +907,7 @@ function bp_the_topic_object_id() { * * Objects are things like associated groups. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $object_id ID for the object associated with the current topic. */ @@ -952,7 +942,7 @@ function bp_the_topic_object_name() { * 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) + * @since 1.1.0 * * @param string $retval Name for the object associated with the current topic. */ @@ -982,7 +972,7 @@ function bp_the_topic_object_slug() { * 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) + * @since 1.1.0 * * @param string $object_slug Slug for the object associated with the current topic. */ @@ -1005,7 +995,7 @@ 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 + // Currently this will only work with group forums, extended support in the future. if ( bp_is_active( 'groups' ) ) { $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum' ); } else { @@ -1018,7 +1008,7 @@ function bp_the_topic_object_permalink() { * 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) + * @since 1.1.0 * * @param string $permalink Permalink for the object associated with the current topic. */ @@ -1035,7 +1025,7 @@ function bp_the_topic_last_poster_name() { * Return the linked name of the user who last posted to the current topic in the loop. * * @return string HTML link to the profile of the user who last posted - * to the current topic. + * to the current topic. */ function bp_get_the_topic_last_poster_name() { global $forum_template; @@ -1043,7 +1033,7 @@ function bp_the_topic_last_poster_name() { $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 + // of the Members directory. if ( empty( $domain ) || ( bp_get_members_directory_permalink() === $domain ) ) { return __( 'Deleted User', 'buddypress' ); } @@ -1051,7 +1041,7 @@ function bp_the_topic_last_poster_name() { /** * Filters the linked name of the user who last posted to the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML link to the profile of the user who last posted. */ @@ -1063,7 +1053,7 @@ function bp_the_topic_last_poster_name() { * * @see bp_get_the_topic_object_avatar() for description of arguments. * - * @param array $args See {@bp_get_the_topic_object_avatar()}. + * @param array|string $args See {@bp_get_the_topic_object_avatar()}. */ function bp_the_topic_object_avatar( $args = '' ) { echo bp_get_the_topic_object_avatar( $args ); @@ -1074,18 +1064,18 @@ function bp_the_topic_object_avatar( $args = '' ) { * Objects are things like groups. So this function would return the * avatar of the group associated with the forum topic, if it exists. * - * @param array $args { + * @param array|string $args { * Arguments for building the avatar. - * @type string $type Avatar type. 'thumb' or 'full'. Default: - * 'thumb'. - * @type int $width Width of the avatar, in pixels. Default: the - * width corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type int $height Height of the avatar, in pixels. Default: - * the height corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type string $alt The text of the image's 'alt' attribute. - * Default: 'Group logo for [group name]'. + * @type string $type Avatar type. 'thumb' or 'full'. Default: + * 'thumb'. + * @type int $width Width of the avatar, in pixels. Default: the + * width corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type int $height Height of the avatar, in pixels. Default: + * the height corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type string $alt The text of the image's 'alt' attribute. + * Default: 'Group logo for [group name]'. * } * @return string Object avatar. */ @@ -1108,7 +1098,7 @@ function bp_the_topic_object_avatar( $args = '' ) { /** * Filters the avatar of the object associated with the current topic in the loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value HTML output for the object associated with the current topic. */ @@ -1120,7 +1110,7 @@ function bp_the_topic_object_avatar( $args = '' ) { * * @see bp_get_the_topic_last_poster_avatar() for description of arguments. * - * @param array $args See {@bp_get_the_topic_last_poster_avatar()}. + * @param array|string $args See {@bp_get_the_topic_last_poster_avatar()}. */ function bp_the_topic_last_poster_avatar( $args = '' ) { echo bp_get_the_topic_last_poster_avatar( $args ); @@ -1128,18 +1118,18 @@ function bp_the_topic_last_poster_avatar( $args = '' ) { /** * Return the avatar for the user who last posted to the current topic in the loop. * - * @param array $args { + * @param array|string $args { * Arguments for building the avatar. - * @type string $type Avatar type. 'thumb' or 'full'. Default: - * 'thumb'. - * @type int $width Width of the avatar, in pixels. Default: the - * width corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type int $height Height of the avatar, in pixels. Default: - * the height corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type string $alt The text of the image's 'alt' attribute. - * Default: 'Profile picture of [group name]'. + * @type string $type Avatar type. 'thumb' or 'full'. Default: + * 'thumb'. + * @type int $width Width of the avatar, in pixels. Default: the + * width corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type int $height Height of the avatar, in pixels. Default: + * the height corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type string $alt The text of the image's 'alt' attribute. + * Default: 'Profile picture of [group name]'. * } * @return string User avatar. */ @@ -1159,7 +1149,7 @@ function bp_the_topic_last_poster_avatar( $args = '' ) { /** * Filters the avatar for the user who last posted to the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML output for the avatar for the user who last posted. */ @@ -1183,7 +1173,7 @@ function bp_the_topic_start_time() { /** * Filters the start time of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_start_time Start time for the current topic. */ @@ -1207,7 +1197,7 @@ function bp_the_topic_time() { /** * Filters the topic time of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_time Topic time for the current topic. */ @@ -1231,7 +1221,7 @@ function bp_the_topic_forum_id() { /** * Filters the ID of the forum associated with the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $forum_id ID of the forum associated with the current topic. */ @@ -1255,7 +1245,7 @@ function bp_the_topic_status() { /** * Filters the status of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_status Status of the current topic. */ @@ -1271,7 +1261,7 @@ function bp_the_topic_is_topic_open() { /** * Return whether the current topic in the loop is open. * - * @return unknown + * @return string */ function bp_get_the_topic_is_topic_open() { global $forum_template; @@ -1279,7 +1269,7 @@ function bp_the_topic_is_topic_open() { /** * Filters whether or not the current topic in the loop is open. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $topic_open Whether or not the current topic is open. */ @@ -1303,7 +1293,7 @@ function bp_the_topic_last_post_id() { /** * Filters the ID of the last post in the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $topic_last_post_id ID for the last post in the current topic. */ @@ -1319,7 +1309,7 @@ function bp_the_topic_is_sticky() { /** * Return whether the current topic in the loop is sticky. * - * @return unknown + * @return bool */ function bp_get_the_topic_is_sticky() { global $forum_template; @@ -1327,7 +1317,7 @@ function bp_the_topic_is_sticky() { /** * Filters whether or not the current topic in the loop is sticky. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param bool $topic_sticky Whether or not the current topic is sticky. */ @@ -1353,7 +1343,7 @@ function bp_the_topic_total_post_count() { /** * Filters a 'x posts' string with the number of posts in the current topic. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value 'X posts' string value for the current topic. */ @@ -1382,7 +1372,7 @@ function bp_the_topic_total_posts() { /** * Filters the total number of posts in the current topic in the loop. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param int $topic_posts Total number of posts in the current topic. */ @@ -1406,7 +1396,7 @@ function bp_the_topic_tag_count() { /** * Filters the tag count for the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $tag_count Tag count for the current topic. */ @@ -1427,19 +1417,19 @@ function bp_the_topic_permalink() { function bp_get_the_topic_permalink() { global $forum_template; - // The topic is in a loop where its parent object is loaded + // The topic is in a loop where its parent object is loaded. if ( bp_get_the_topic_object_slug() ) { $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 + // We are viewing a single group topic, so use the current item. } elseif ( bp_is_group_forum_topic() ) { $permalink = trailingslashit( bp_get_groups_directory_permalink() . bp_current_item() . '/forum' ); - // We are unsure what the context is, so fallback to forum root slug + // We are unsure what the context is, so fallback to forum root slug. } elseif ( bp_is_single_item() ) { $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item() ); - // This is some kind of error situation, so use forum root + // This is some kind of error situation, so use forum root. } else { $permalink = trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); } @@ -1447,7 +1437,7 @@ function bp_the_topic_permalink() { /** * Filters the permalink for the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Permalink for the current topic in the loop. */ @@ -1473,7 +1463,7 @@ function bp_the_topic_time_since_created() { /** * Filters a 'time since' string describing when the current topic was created. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value 'Time since' value for the current topic. */ @@ -1482,6 +1472,8 @@ function bp_the_topic_time_since_created() { /** * Output an excerpt from the latest post of the current topic in the loop. + * + * @param array|string $args See {@bp_get_the_topic_latest_post_excerpt()}. */ function bp_the_topic_latest_post_excerpt( $args = '' ) { echo bp_get_the_topic_latest_post_excerpt( $args ); @@ -1489,7 +1481,7 @@ function bp_the_topic_latest_post_excerpt( $args = '' ) { /** * Return an excerpt from the latest post of the current topic in the loop. * - * @param array $args { + * @param array|string $args { * @type int $length The length of the excerpted text. Default: 225. * } * @return string Post excerpt. @@ -1510,7 +1502,7 @@ function bp_the_topic_latest_post_excerpt( $args = '' ) { /** * Filters an excerpt from the latest post of the current topic in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $post Post exceprt for the current topic. * @param string $length String length to trim excerpt down to. @@ -1537,7 +1529,7 @@ function bp_the_topic_time_since_last_post() { /** * Filters a 'time since' string describing when the last post in the current topic was created. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value The 'time since' string for the last post in the current topic. */ @@ -1554,7 +1546,7 @@ function bp_the_topic_is_mine() { * Does the current topic belong to the logged-in user? * * @return bool True if the current topic in the loop was created by - * the logged-in user, otherwise false. + * the logged-in user, otherwise false. */ function bp_get_the_topic_is_mine() { global $forum_template; @@ -1567,7 +1559,7 @@ function bp_the_topic_is_mine() { * * @see bp_get_the_topic_admin_links() for a description of arguments. * - * @param array $args See {@link bp_get_the_topic_admin_links()}. + * @param array|string $args See {@link bp_get_the_topic_admin_links()}. */ function bp_the_topic_admin_links( $args = '' ) { echo bp_get_the_topic_admin_links( $args ); @@ -1575,11 +1567,10 @@ function bp_the_topic_admin_links( $args = '' ) { /** * Return the admin links for the current topic in the loop. * - * @param array $args { - * @type string $separator The character to use when separating - * links. Default: '|'. + * @param array|string $args { + * @type string $separator The character to use when separating links. Default: '|'. * } - * @return HTML string containing the admin links for the current topic. + * @return string HTML string containing the admin links for the current topic. */ function bp_get_the_topic_admin_links( $args = '' ) { global $forum_template; @@ -1644,7 +1635,7 @@ function bp_the_topic_css_class() { * This class may contain keywords like 'alt', 'sticky', or 'closed', * based on context. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value Concatenated classes for the current topic in the loop. */ @@ -1666,7 +1657,7 @@ function bp_my_forum_topics_link() { /** * Filters the permalink to the 'personal' topics tab. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Permalink to the 'personal' topics tab. */ @@ -1688,7 +1679,7 @@ function bp_unreplied_forum_topics_link() { /** * Filters the permalink to the 'unreplied' topics tab. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Permalink to the 'unreplied' topics tab. */ @@ -1710,7 +1701,7 @@ function bp_popular_forum_topics_link() { /** * Filters the permalink to the 'popular' topics tab. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Permalink to the 'popular' topics tab. */ @@ -1732,7 +1723,7 @@ function bp_newest_forum_topics_link() { /** * Filters the link to the forums directory. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Link to the forums directory. */ @@ -1762,7 +1753,7 @@ function bp_forum_topic_type() { * * Eg, 'newest', 'popular', etc. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Currently viewed topic list type. */ @@ -1772,7 +1763,7 @@ function bp_forum_topic_type() { /** * Output the value of bp_get_forum_topic_new_reply_link(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_forum_topic_new_reply_link() { echo esc_url( bp_get_forum_topic_new_reply_link() ); @@ -1780,20 +1771,21 @@ function bp_forum_topic_new_reply_link() { /** * Return the permalink for the New Reply button at the top of forum topics. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() Filter bp_get_forum_topic_new_reply_link to * modify. + * * @return string The URL for the New Reply link. */ function bp_get_forum_topic_new_reply_link() { global $topic_template; if ( $topic_template->pag->total_pages == $topic_template->pag_page ) { - // If we are on the last page, no need for a URL base + // If we are on the last page, no need for a URL base. $link = ''; } else { - // Create a link to the last page for the topic + // Create a link to the last page for the topic. $link = add_query_arg( array( 'topic_page' => $topic_template->pag->total_pages, 'num' => $topic_template->pag_num @@ -1803,7 +1795,7 @@ function bp_forum_topic_new_reply_link() { /** * Filters the permalink for the New Reply button at the top of forum topics. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Permalink for the New Reply button. */ @@ -1846,7 +1838,7 @@ function bp_forum_pagination() { /** * Filters the pagination links for the current topic list. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $pag_links HTML pagination links. */ @@ -1887,7 +1879,7 @@ function bp_forum_pagination_count() { /** * Filters the pagination count for the current topic list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $message Pagination count for the current topic list. * @param string $from_num Low end count in the view. @@ -1919,7 +1911,6 @@ class BP_Forums_Template_Topic { /** * The loop iterator. * - * @access public * @var int */ public $current_post = -1; @@ -1927,7 +1918,6 @@ class BP_Forums_Template_Topic { /** * The number of posts returned by the paged query. * - * @access public * @var int */ public $post_count; @@ -1935,7 +1925,6 @@ class BP_Forums_Template_Topic { /** * Array of posts located by the query. * - * @access public * @var array */ public $posts; @@ -1943,7 +1932,6 @@ class BP_Forums_Template_Topic { /** * The post object currently being iterated on. * - * @access public * @var object */ public $post; @@ -1951,7 +1939,6 @@ class BP_Forums_Template_Topic { /** * The ID of the forum whose topic is being queried. * - * @access public * @var int */ public $forum_id; @@ -1959,7 +1946,6 @@ class BP_Forums_Template_Topic { /** * The ID of the topic whose posts are being queried. * - * @access public * @var int */ public $topic_id; @@ -1967,7 +1953,6 @@ class BP_Forums_Template_Topic { /** * The topic object to which the posts belong. * - * @access public * @var object */ public $topic; @@ -1975,7 +1960,6 @@ class BP_Forums_Template_Topic { /** * A flag for whether the loop is currently being iterated. * - * @access public * @var bool */ public $in_the_loop; @@ -1984,7 +1968,7 @@ class BP_Forums_Template_Topic { * Contains a 'total_pages' property holding total number of pages in * this loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var stdClass */ public $pag; @@ -1992,23 +1976,20 @@ class BP_Forums_Template_Topic { /** * The page number being requested. * - * @access public - * @var public + * @var int */ public $pag_page; /** * The number of items being requested per page. * - * @access public - * @var public + * @var int */ public $pag_num; /** * An HTML string containing pagination links. * - * @access public * @var string */ public $pag_links; @@ -2016,7 +1997,6 @@ class BP_Forums_Template_Topic { /** * The total number of posts matching the query parameters. * - * @access public * @var int */ public $total_post_count; @@ -2024,7 +2004,6 @@ class BP_Forums_Template_Topic { /** * Whether requesting a single topic. Not currently used. * - * @access public * @var bool */ public $single_post = false; @@ -2032,7 +2011,6 @@ class BP_Forums_Template_Topic { /** * Term to sort by. * - * @access public * @var string */ public $sort_by; @@ -2040,7 +2018,6 @@ class BP_Forums_Template_Topic { /** * Sort order. * - * @access public * @var string */ public $order; @@ -2048,9 +2025,9 @@ class BP_Forums_Template_Topic { /** * Constructor method. * - * @param int $topic_id ID of the topic whose posts are being requested. - * @param int $per_page Number of items to return per page. - * @param int $max Max records to return. + * @param int $topic_id ID of the topic whose posts are being requested. + * @param int $per_page Number of items to return per page. + * @param int $max Max records to return. * @param string $order Direction to order results. */ function __construct( $topic_id, $per_page, $max, $order ) { @@ -2091,7 +2068,7 @@ class BP_Forums_Template_Topic { } } - // Load topic tags + // Load topic tags. $this->topic_tags = bb_get_topic_tags( $this->topic_id ); $this->pag = new stdClass; @@ -2169,10 +2146,10 @@ class BP_Forums_Template_Topic { /** * Fires right before the rewinding of user posts. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action('topic_loop_end'); - // Do some cleaning up after the loop + // Do some cleaning up after the loop. $this->rewind_posts(); } @@ -2196,7 +2173,7 @@ class BP_Forums_Template_Topic { /** * Fires if the current post item is the first in the topic loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'topic_loop_start' ); } @@ -2206,15 +2183,15 @@ class BP_Forums_Template_Topic { /** * Initiate the loop for a single topic's posts. * - * @param array $args { + * @param array|string $args { * Arguments for limiting the contents of the topic posts loop. - * @type int $topic_id ID of the topic to which the posts belong. - * @type int $per_page Number of items to return per page. Default: 15. - * @type int $max Max items to return. Default: false. - * @type string $order 'ASC' or 'DESC'. + * @type int $topic_id ID of the topic to which the posts belong. + * @type int $per_page Number of items to return per page. Default: 15. + * @type int $max Max items to return. Default: false. + * @type string $order 'ASC' or 'DESC'. * } * @return bool True when posts are found corresponding to the args, - * otherwise false. + * otherwise false. */ function bp_has_forum_topic_posts( $args = '' ) { global $topic_template; @@ -2240,7 +2217,7 @@ function bp_has_forum_topic_posts( $args = '' ) { } else { $topic_template = new BP_Forums_Template_Topic( (int) $topic_id, $per_page, $max, $order ); - // Current topic forum_id needs to match current_group forum_id + // Current topic forum_id needs to match current_group forum_id. if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) ) return false; } @@ -2248,7 +2225,7 @@ function bp_has_forum_topic_posts( $args = '' ) { /** * Filters whether or not there are topics to display. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -2293,7 +2270,7 @@ function bp_the_topic_post_id() { /** * Filters the ID of the current post in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $post_id ID of the current post. */ @@ -2317,7 +2294,7 @@ function bp_the_topic_post_content() { /** * Filters the content of the current post in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $post_text The content of the current post. */ @@ -2337,7 +2314,7 @@ function bp_the_topic_post_css_class() { * context. * * @return string String to put in the 'class' attribute of the current - * post. + * post. */ function bp_get_the_topic_post_css_class() { global $topic_template; @@ -2359,7 +2336,7 @@ function bp_the_topic_post_css_class() { * This class may contain keywords like 'alt', 'deleted', or 'open', * based on context. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value Concatenated classes for the current post in the loop. */ @@ -2371,7 +2348,7 @@ function bp_the_topic_post_css_class() { * * @see bp_get_the_topic_post_poster_avatar() for a description of arguments. * - * @param array $args See {@link bp_get_the_topic_post_poster_avatar()}. + * @param array|string $args See {@link bp_get_the_topic_post_poster_avatar()}. */ function bp_the_topic_post_poster_avatar( $args = '' ) { echo bp_get_the_topic_post_poster_avatar( $args ); @@ -2379,18 +2356,18 @@ function bp_the_topic_post_poster_avatar( $args = '' ) { /** * Return the avatar of the user who posted the current post in the loop. * - * @param array $args { + * @param array|string $args { * Arguments for building the avatar. - * @type string $type Avatar type. 'thumb' or 'full'. Default: - * 'thumb'. - * @type int $width Width of the avatar, in pixels. Default: the - * width corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type int $height Height of the avatar, in pixels. Default: the - * height corresponding to $type. - * See {@link bp_core_fetch_avatar()}. - * @type string $alt The text of the image's 'alt' attribute. - * Default: 'Profile picture of [user name]'. + * @type string $type Avatar type. 'thumb' or 'full'. Default: + * 'thumb'. + * @type int $width Width of the avatar, in pixels. Default: the + * width corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type int $height Height of the avatar, in pixels. Default: the + * height corresponding to $type. + * See {@link bp_core_fetch_avatar()}. + * @type string $alt The text of the image's 'alt' attribute. + * Default: 'Profile picture of [user name]'. * } * @return string HTML of user avatar. */ @@ -2410,7 +2387,7 @@ function bp_the_topic_post_poster_avatar( $args = '' ) { /** * Filters the avatar of the user who posted the current post in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Avatar of the user who posted the current post. */ @@ -2437,7 +2414,7 @@ function bp_the_topic_post_poster_name() { /** * Filters the name of the user who posted the current post in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML link for the poster's name. */ @@ -2454,7 +2431,7 @@ function bp_the_topic_post_poster_link() { * Return a link to the profile of the user who posted the current post. * * @return string Link to the profile of the user who posted the - * current post. + * current post. */ function bp_get_the_topic_post_poster_link() { global $topic_template; @@ -2462,7 +2439,7 @@ function bp_the_topic_post_poster_link() { /** * Filters a link to the profile of the user who posted the current post. * - * @since BuddyPress (1.2.1) + * @since 1.2.1 * * @param string $value Link for the current poster's profile. */ @@ -2488,7 +2465,7 @@ function bp_the_topic_post_time_since() { /** * Filters the 'since' string describing when the current post in the loop was posted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value The 'since' string. */ @@ -2505,7 +2482,7 @@ function bp_the_topic_post_is_mine() { * Does the current post belong to the logged-in user? * * @return bool True if the current post in the loop was created by - * the logged-in user, otherwise false. + * the logged-in user, otherwise false. */ function bp_get_the_topic_post_is_mine() { global $topic_template; @@ -2518,7 +2495,7 @@ function bp_the_topic_post_is_mine() { * * @see bp_get_the_post_admin_links() for a description of arguments. * - * @param array $args See {@link bp_get_the_post_admin_links()}. + * @param array|string $args See {@link bp_get_the_post_admin_links()}. */ function bp_the_topic_post_admin_links( $args = '' ) { echo bp_get_the_topic_post_admin_links( $args ); @@ -2526,11 +2503,11 @@ function bp_the_topic_post_admin_links( $args = '' ) { /** * Return the admin links for the current post in the loop. * - * @param array $args { + * @param array|string $args { * @type string $separator The character to use when separating - * links. Default: '|'. + * links. Default: '|'. * } - * @return HTML string containing the admin links for the current post. + * @return string HTML string containing the admin links for the current post. */ function bp_get_the_topic_post_admin_links( $args = '' ) { global $topic_template; @@ -2557,7 +2534,7 @@ function bp_the_topic_post_admin_links( $args = '' ) { /** * Filters the admin links for the current post in the loop. * - * @since BuddyPress (1.2.7) + * @since 1.2.7 * * @param string $value HTML string containing the admin links for the current post. */ @@ -2581,7 +2558,7 @@ function bp_the_topic_post_edit_text() { /** * Filters the text to edit when editing a post. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value The text to edit when editing a post. */ @@ -2606,7 +2583,7 @@ function bp_the_topic_pagination() { /** * Filters the pagination links for the current topic page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $pag_links HTML pagination links. */ @@ -2617,8 +2594,6 @@ function bp_the_topic_pagination() { * Return the pagination count for the current topic page. * * The "count" is a string of the form "Viewing x of y posts". - * - * @return string */ function bp_the_topic_pagination_count() { global $topic_template; @@ -2637,7 +2612,7 @@ function bp_the_topic_pagination_count() { /** * Filters the pagination count for the current topic page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $message Pagination count for the current topic page. * @param string $from_num Low end count in the view. @@ -2657,7 +2632,7 @@ function bp_the_topic_is_last_page() { * Is this the last page in the current topic? * * @return bool True if this is the last page of posts for the current - * topic, otherwise false. + * topic, otherwise false. */ function bp_get_the_topic_is_last_page() { global $topic_template; @@ -2665,7 +2640,7 @@ function bp_the_topic_is_last_page() { /** * Filters whether or not a user is on the last page in the current topic. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param bool $value Whether or not user is on last page. */ @@ -2680,16 +2655,16 @@ function bp_directory_forums_search_form() { $search_value = !empty( $_REQUEST['fs'] ) ? stripslashes( $_REQUEST['fs'] ) : $default_search_value; $search_form_html = '<form action="" method="get" id="search-forums-form"> - <label><input type="text" name="s" id="forums_search" placeholder="'. esc_attr( $search_value ) .'" /></label> + <label for="forums_search"><input type="text" name="s" id="forums_search" placeholder="'. esc_attr( $search_value ) .'" /></label> <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) + * @since 1.9.0 * - * @param string HTML search form for the forums directory. + * @param string $search_form_html HTML search form for the forums directory. */ echo apply_filters( 'bp_directory_forums_search_form', $search_form_html ); } @@ -2708,7 +2683,7 @@ function bp_forum_permalink( $forum_id = 0 ) { * Return the permalink to a given forum. * * @param int $forum_id Optional. Defaults to the current forum, if - * there is one. + * there is one. * @return string|bool False on failure, a URL on success. */ function bp_get_forum_permalink( $forum_id = 0 ) { @@ -2731,7 +2706,7 @@ function bp_forum_permalink( $forum_id = 0 ) { /** * Filters the permalink to a given forum. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Peramlink to the given forum. */ @@ -2752,7 +2727,7 @@ function bp_forum_name( $forum_id = 0 ) { * Return the name of a given forum. * * @param int $forum_id Optional. Defaults to the current forum, if - * there is one. + * there is one. * @return string|bool False on failure, a name on success. */ function bp_get_forum_name( $forum_id = 0 ) { @@ -2768,7 +2743,7 @@ function bp_forum_name( $forum_id = 0 ) { /** * Filters the name of a given forum. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $forum_name Name of the given forum. * @param string $forum_id ID of the given forum. @@ -2785,12 +2760,12 @@ function bp_forum_name( $forum_id = 0 ) { * A wrapper for {@link bb_tag_heat_map}, which provides it with BP-friendly * defaults. * - * @param array $args { + * @param array|string $args { * An array of optional arguments. - * @type int $smallest Size of the smallest link. Default: 10. - * @type int $largest Size of the largest link. Default: 42. - * @type string $sizing Unit for $largest and $smallest. Default: 'px'. - * @type int $limit Max number of tags to display. Default: 50. + * @type int $smallest Size of the smallest link. Default: 10. + * @type int $largest Size of the largest link. Default: 42. + * @type string $sizing Unit for $largest and $smallest. Default: 'px'. + * @type int $limit Max number of tags to display. Default: 50. * } */ function bp_forums_tag_heat_map( $args = '' ) { @@ -2808,9 +2783,9 @@ function bp_forums_tag_heat_map( $args = '' ) { } /** - * Output the current topic's tag list, comma-separated + * Output the current topic's tag list, comma-separated. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_forum_topic_tag_list() { echo bp_get_forum_topic_tag_list(); @@ -2818,10 +2793,10 @@ function bp_forum_topic_tag_list() { /** * Get the current topic's tag list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $format 'string' returns comma-separated string; - * otherwise returns array. + * otherwise returns array. * @return mixed $tags */ function bp_get_forum_topic_tag_list( $format = 'string' ) { @@ -2843,7 +2818,7 @@ function bp_forum_topic_tag_list() { /** * Filters the current topic's tag list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string|array $tags List or array of tags for the current topic. * @param string $format Requested format for the tags. @@ -2854,7 +2829,7 @@ function bp_forum_topic_tag_list() { /** * Does the current topic have any tags? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if the current topic has tags, otherwise false. */ @@ -2869,7 +2844,7 @@ function bp_forum_topic_has_tags() { /** * Filters whether or not a forum topic has any tags. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $has_tags Whether or not there are any tags. */ @@ -2893,7 +2868,7 @@ function bp_forum_action() { /** * Filters the url to use in a forum form 'action'. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL to use in the forum form 'action'. */ @@ -2916,7 +2891,7 @@ function bp_forum_topic_action() { /** * Filters the url to use in a forum topic form 'action'. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL to use in the forum topic form 'action'. */ @@ -2945,7 +2920,7 @@ function bp_forum_topic_count_for_user( $user_id = 0 ) { /** * Filters the total topic count for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Total topic count for the given user. */ @@ -2974,7 +2949,7 @@ function bp_forum_topic_count( $user_id = 0 ) { /** * Filters the total topic count for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Total topic count for the given user. */ 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 ce6cea7d3132b4526511e3f99dcb0abacc97f9a5..75109f7cb59e7fe1c3068276d6b0e1405aa97b04 100644 --- a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php +++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Forums Deprecated Functions + * BuddyPress Forums Deprecated Functions. * * This file contains all the deprecated functions for BuddyPress forums since * version 1.6. This was a major update for the forums component, moving from @@ -11,7 +10,7 @@ * @subpackage Forums */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -20,7 +19,7 @@ defined( 'ABSPATH' ) || exit; function bp_forums_bbpress_admin() { // The text and URL of the Site Wide Forums button differs depending on whether bbPress - // is running + // is running. if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { // The bbPress admin page will always be on the root blog. switch_to_blog() will // pass through if we're already there. @@ -37,8 +36,6 @@ function bp_forums_bbpress_admin() { $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?> <div class="wrap"> - <?php screen_icon( 'buddypress' ); ?> - <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Forums', 'buddypress' ) ); ?></h2> <?php if ( isset( $_POST['submit'] ) ) : ?> @@ -53,13 +50,13 @@ function bp_forums_bbpress_admin() { if ( isset( $_REQUEST['reinstall'] ) || !bp_forums_is_installed_correctly() ) : - // Delete the bb-config.php location option + // Delete the bb-config.php location option. bp_delete_option( 'bb-config-location' ); - // Now delete the bb-config.php file + // Now delete the bb-config.php file. @unlink( ABSPATH . 'bb-config.php' ); - // show the updated wizard + // Show the updated wizard. bp_forums_bbpress_install_wizard(); else : ?> @@ -120,7 +117,7 @@ function bp_forums_bbpress_install_wizard() { $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : ''; // The text and URL of the Site Wide Forums button differs depending on whether bbPress - // is running + // is running. if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { $bbpress_plugin_is_active = true; @@ -168,15 +165,18 @@ function bp_forums_bbpress_install_wizard() { switch ( $result ) { case 1: - _e( '<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress' ); + echo '<p>'; + _e( 'All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.', 'buddypress' ); + echo '</p>'; break; default: - // Just write the contents to screen - _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?> - + // Just write the contents to screen. + echo '<p>'; + _e( 'A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.', 'buddypress' ); + echo '</p>'; + ?> <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo esc_textarea( $result ); ?></textarea> - - <?php + <?php break; } } else { ?> @@ -199,8 +199,7 @@ function bp_forums_bbpress_install_wizard() { <?php } else { - // Include the plugin install - + // Include the plugin install. add_thickbox(); wp_enqueue_script( 'plugin-install' ); wp_admin_css( 'plugin-install' ); 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 b9ad67fbf19f866eca3293a0c78352527487ea55..33711f6bbbf26c79775bc9413e5d8c45672e9daf 100644 --- a/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php +++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Forums Deprecated Functions + * BuddyPress Forums Deprecated Functions. * * This file contains all the deprecated functions for BuddyPress forums since * version 1.7. This was a major update for the forums component, moving from @@ -11,7 +10,7 @@ * @subpackage Forums */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; function bp_forums_add_admin_menu() { @@ -21,10 +20,10 @@ function bp_forums_add_admin_menu() { $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; - // Add the administration tab under the "Site Admin" tab for site administrators + // Add the administration tab under the "Site Admin" tab for site administrators. $hook = add_submenu_page( $page, __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" ); - // Fudge the highlighted subnav item when on the BuddyPress Forums admin page + // Fudge the highlighted subnav item when on the BuddyPress Forums admin page. add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); } add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' ); @@ -34,7 +33,7 @@ function bp_forums_configure_existing_install() { check_admin_referer( 'bp_forums_existing_install_init' ); - // Sanitize $_REQUEST['bbconfigloc'] + // Sanitize $_REQUEST['bbconfigloc']. $_REQUEST['bbconfigloc'] = apply_filters( 'bp_forums_bbconfig_location', $_REQUEST['bbconfigloc'] ); if ( false === strpos( $_REQUEST['bbconfigloc'], 'bb-config.php' ) ) { @@ -64,7 +63,7 @@ function bp_forums_bbpress_install( $location = '' ) { $bp = buddypress(); - // Create the bb-config.php file + // Create the bb-config.php file. $initial_write = bp_forums_bbpress_write( $bp->plugin_dir . '/bp-forums/bbpress/bb-config-sample.php', $location, @@ -84,7 +83,7 @@ function bp_forums_bbpress_install( $location = '' ) { ) ); - // Add the custom user and usermeta entries to the config file + // Add the custom user and usermeta entries to the config file. if ( $initial_write == 1 ) { $file = file_get_contents( $location ); } else { @@ -146,13 +145,13 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) { return -2; } - // Get the existing lines in the file + // Get the existing lines in the file. $lines = file( $file_source ); - // Initialise an array to store the modified lines + // Initialise an array to store the modified lines. $modified_lines = array(); - // Loop through the lines and modify them + // Loop through the lines and modify them. foreach ( (array) $lines as $line ) { if ( isset( $alterations[substr( $line, 0, 20 )] ) ) { $alteration = $alterations[substr( $line, 0, 20 )]; @@ -183,10 +182,10 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) { return trim( join( null, $modified_lines ) ); } - // Open the file for writing - rewrites the whole file + // Open the file for writing - rewrites the whole file. $file_handle = fopen( $file_target, 'w' ); - // Write lines one by one to avoid OS specific newline hassles + // Write lines one by one to avoid OS specific newline hassles. foreach ( (array) $modified_lines as $modified_line ) { if ( strlen( $modified_line ) - 2 === strrpos( $modified_line, '?>' ) ) { $modified_line = '?>'; @@ -198,7 +197,7 @@ function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) { } } - // Close the config file + // Close the config file. fclose( $file_handle ); @chmod( $file_target, 0666 ); 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 ac7289a047b25fa5eda7090299bf0a1165306376..2fb88e36e250b2a514b9ce05999f628ec3a7a7fd 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Friends Actions + * BuddyPress Friends 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 @@ -9,13 +8,16 @@ * * @package BuddyPress * @subpackage FriendsActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Catch and process friendship requests. + * + * @since 1.0.1 */ function friends_action_add_friend() { if ( !bp_is_friends_component() || !bp_is_current_action( 'add-friend' ) ) @@ -54,6 +56,8 @@ add_action( 'bp_init', 'friends_action_add_friend' ); /** * Catch and process Remove Friendship requests. + * + * @since 1.0.1 */ function friends_action_remove_friend() { if ( !bp_is_friends_component() || !bp_is_current_action( 'remove-friend' ) ) 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 7a74e4c4a3eebf1c76663eb394809e4a1b709a90..9b931ef23e807527954848beb9e30d23bbbb9824 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php @@ -1,16 +1,16 @@ <?php - /** - * BuddyPress Friends Activity Functions + * BuddyPress Friends Activity Functions. * * These functions handle the recording, deleting and formatting of activity * for the user and for this specific component. * * @package BuddyPress * @subpackage FriendsActivity + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -19,15 +19,17 @@ defined( 'ABSPATH' ) || exit; * A wrapper for {@link bp_activity_add()} that provides some Friends-specific * defaults. * + * @since 1.0.0 + * * @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()}. The one difference is the following * argument, which has a different default here: * @type string $component Default: the id of your Friends component - * (usually 'friends'). + * (usually 'friends'). * } * @return bool See {@link bp_activity_add()}. */ @@ -56,14 +58,16 @@ function friends_record_activity( $args = '' ) { /** * Delete an activity item related to the Friends component. * + * @since 1.0.0 + * * @param array $args { * An array of arguments for the item to delete. - * @type int $item_id ID of the 'item' associated with the activity item. - * For Friends activity items, this is usually the user ID of one - * of the friends. - * @type string $type The 'type' of the activity item (eg - * 'friendship_accepted'). - * @type int $user_id ID of the user associated with the activity item. + * @type int $item_id ID of the 'item' associated with the activity item. + * For Friends activity items, this is usually the user ID of one + * of the friends. + * @type string $type The 'type' of the activity item (eg + * 'friendship_accepted'). + * @type int $user_id ID of the user associated with the activity item. * } * @return bool True on success, false on failure. */ @@ -82,6 +86,8 @@ function friends_delete_activity( $args ) { /** * Register the activity actions for bp-friends. + * + * @since 1.1.0 */ function friends_register_activity_actions() { @@ -91,7 +97,7 @@ function friends_register_activity_actions() { $bp = buddypress(); - // These two added in BP 1.6 + // These two added in BP 1.6. bp_activity_set_action( $bp->friends->id, 'friendship_accepted', @@ -110,13 +116,13 @@ function friends_register_activity_actions() { array( 'activity', 'member' ) ); - // < BP 1.6 backpat + // < 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) + * @since 1.1.0 */ do_action( 'friends_register_activity_actions' ); } @@ -125,8 +131,9 @@ add_action( 'bp_register_activity_actions', 'friends_register_activity_actions' /** * Format 'friendship_accepted' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * + * @param string $action Activity action string. * @param object $activity Activity data. * @return string $action Formatted activity action. */ @@ -138,7 +145,7 @@ function bp_friends_format_activity_action_friendship_accepted( $action, $activi // Backward compatibility for legacy filter // The old filter has the $friendship object passed to it. We want to - // avoid having to build this object if it's not necessary + // avoid having to build this object if it's not necessary. if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) { $friendship = new BP_Friends_Friendship( $activity->item_id ); $action = apply_filters( 'friends_activity_friendsip_accepted_action', $action, $friendship ); @@ -147,9 +154,9 @@ function bp_friends_format_activity_action_friendship_accepted( $action, $activi /** * Filters the 'friendship_accepted' activity action format. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action String text for the 'friendship_accepted' action. + * @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 ); @@ -158,9 +165,9 @@ function bp_friends_format_activity_action_friendship_accepted( $action, $activi /** * Format 'friendship_created' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. + * @param string $action Static activity action. * @param object $activity Activity data. * @return string $action Formatted activity action. */ @@ -172,7 +179,7 @@ function bp_friends_format_activity_action_friendship_created( $action, $activit // Backward compatibility for legacy filter // The old filter has the $friendship object passed to it. We want to - // avoid having to build this object if it's not necessary + // avoid having to build this object if it's not necessary. if ( has_filter( 'friends_activity_friendship_accepted_action' ) ) { $friendship = new BP_Friends_Friendship( $activity->item_id ); $action = apply_filters( 'friends_activity_friendsip_accepted_action', $action, $friendship ); @@ -181,9 +188,9 @@ function bp_friends_format_activity_action_friendship_created( $action, $activit /** * Filters the 'friendship_created' activity action format. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action String text for the 'friendship_created' action. + * @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 ); @@ -194,7 +201,7 @@ function bp_friends_format_activity_action_friendship_created( $action, $activit * * This reduces database overhead during the activity loop. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Array of activity items. * @return array @@ -215,7 +222,7 @@ function bp_friends_prefetch_activity_object_data( $activities ) { } if ( ! empty( $friend_ids ) ) { - // Fire a user query to prime user caches + // Fire a user query to prime user caches. new BP_User_Query( array( 'user_ids' => $friend_ids, 'populate_extras' => false, @@ -232,15 +239,15 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_friends_prefetch_activity_ob * * For details on the syntax, see {@link BP_Activity_Query}. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param array $retval Empty array by default - * @param array $filter Current activity arguments + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. * @return array */ function bp_friends_filter_activity_scope( $retval = array(), $filter = array() ) { - // Determine the user_id + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -249,7 +256,7 @@ function bp_friends_filter_activity_scope( $retval = array(), $filter = array() : bp_loggedin_user_id(); } - // Determine friends of user + // Determine friends of user. $friends = friends_get_friend_user_ids( $user_id ); if ( empty( $friends ) ) { $friends = array( 0 ); @@ -263,13 +270,13 @@ function bp_friends_filter_activity_scope( $retval = array(), $filter = array() 'value' => (array) $friends ), - // we should only be able to view sitewide activity content for friends + // We should only be able to view sitewide activity content for friends. array( 'column' => 'hide_sitewide', 'value' => 0 ), - // overrides + // Overrides. 'override' => array( 'filter' => array( 'user_id' => 0 ), 'show_hidden' => true @@ -285,15 +292,15 @@ add_filter( 'bp_activity_set_friends_scope_args', 'bp_friends_filter_activity_sc * * For details on the syntax, see {@link BP_Activity_Query}. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param array $retval Empty array by default - * @param array $filter Current activity arguments + * @param array $retval Empty array by default. + * @param array $filter Current activity arguments. * @return array */ function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = array() ) { - // Determine the user_id + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -302,10 +309,10 @@ function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = : bp_loggedin_user_id(); } - // Get the requested action + // Get the requested action. $action = $filter['filter']['action']; - // Make sure actions are listed in an array + // Make sure actions are listed in an array. if ( ! is_array( $action ) ) { $action = explode( ',', $filter['filter']['action'] ); } @@ -320,7 +327,7 @@ function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = return $retval; } - // Juggle existing override value + // Juggle existing override value. $override = array(); if ( ! empty( $retval['override'] ) ) { $override = $retval['override']; @@ -348,7 +355,7 @@ function bp_friends_filter_activity_just_me_scope( $retval = array(), $filter = ) ); - // Juggle back override value + // Juggle back override value. if ( ! empty( $override ) ) { $retval['override'] = $override; } @@ -361,19 +368,19 @@ add_filter( 'bp_activity_set_just-me_scope_args', 'bp_friends_filter_activity_ju * Add activity stream items when one members accepts another members request * for virtual friendship. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $friendship_id - * @param int $initiator_user_id - * @param int $friend_user_id - * @param object $friendship Optional + * @param int $friendship_id ID of the friendship. + * @param int $initiator_user_id ID of friendship initiator. + * @param int $friend_user_id ID of user whose friendship is requested. + * @param object|bool $friendship Optional Friendship object. */ function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_user_id, $friend_user_id, $friendship = false ) { if ( ! bp_is_active( 'activity' ) ) { return; } - // Record in activity streams for the initiator + // Record in activity streams for the initiator. friends_record_activity( array( 'user_id' => $initiator_user_id, 'type' => 'friendship_created', @@ -382,3 +389,23 @@ function bp_friends_friendship_accepted_activity( $friendship_id, $initiator_use ) ); } add_action( 'friends_friendship_accepted', 'bp_friends_friendship_accepted_activity', 10, 4 ); + +/** + * Deletes friendship activity items when a user is deleted. + * + * @since 2.5.0 + * + * @param int $user_id The ID of the user being deleted. + */ +function bp_friends_delete_activity_on_user_delete( $user_id = 0 ) { + if ( ! bp_is_active( 'activity' ) ) { + return; + } + + bp_activity_delete( array( + 'component' => buddypress()->friends->id, + 'type' => 'friendship_created', + 'secondary_item_id' => $user_id + ) ); +} +add_action( 'friends_remove_data', 'bp_friends_delete_activity_on_user_delete' ); \ No newline at end of file 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 646b71b86de6a9a5d29ae216fc450ed605fa1113..5fb11a5fe09d002cb6f67fc3efa23d4b1e32bb87 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Friends Caching. * @@ -8,16 +7,20 @@ * * @package BuddyPress * @subpackage FriendsCaching + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Clear friends-related cache for members of a specific friendship. * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship whose two members should - * have their friends cache busted. + * have their friends cache busted. + * @return bool */ function friends_clear_friend_object_cache( $friendship_id ) { if ( !$friendship = new BP_Friends_Friendship( $friendship_id ) ) @@ -27,16 +30,16 @@ function friends_clear_friend_object_cache( $friendship_id ) { wp_cache_delete( 'friends_friend_ids_' . $friendship->friend_user_id, 'bp' ); } -// List actions to clear object caches on +// List actions to clear object caches on. add_action( 'friends_friendship_accepted', 'friends_clear_friend_object_cache' ); add_action( 'friends_friendship_deleted', 'friends_clear_friend_object_cache' ); /** * Clear the friend request cache for the user not initiating the friendship. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $friend_user_id The user ID not initiating the friendship + * @param int $friend_user_id The user ID not initiating the friendship. */ function bp_friends_clear_request_cache( $friend_user_id ) { wp_cache_delete( $friend_user_id, 'bp_friends_requests' ); @@ -47,11 +50,11 @@ function bp_friends_clear_request_cache( $friend_user_id ) { * * A friendship is deemed saved when a friendship is requested or accepted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $friendship_id The friendship ID - * @param int $initiator_user_id The user ID initiating the friendship - * @param int $friend_user_id The user ID not initiating the friendship + * @param int $friendship_id The friendship ID. + * @param int $initiator_user_id The user ID initiating the friendship. + * @param int $friend_user_id The user ID not initiating the friendship. */ function bp_friends_clear_request_cache_on_save( $friendship_id, $initiator_user_id, $friend_user_id ) { bp_friends_clear_request_cache( $friend_user_id ); @@ -64,18 +67,18 @@ add_action( 'friends_friendship_accepted', 'bp_friends_clear_request_cache_on_s * * A friendship is deemed removed when a friendship is withdrawn or rejected. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $friendship_id The friendship ID - * @param BP_Friends_Friendship $friendship + * @param int $friendship_id The friendship ID. + * @param BP_Friends_Friendship $friendship Friendship object. */ function bp_friends_clear_request_cache_on_remove( $friendship_id, BP_Friends_Friendship $friendship ) { - bp_friends_clear_request_cache( $friendship->friend_user_id ); + bp_friends_clear_request_cache( $friendship->friend_user_id ); } add_action( 'friends_friendship_withdrawn', 'bp_friends_clear_request_cache_on_remove', 10, 2 ); add_action( 'friends_friendship_rejected', 'bp_friends_clear_request_cache_on_remove', 10, 2 ); -// List actions to clear super cached pages on, if super cache is installed +// List actions to clear super cached pages on, if super cache is installed. add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' ); add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' ); add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' ); 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 0b496ebde3e294d444ee7dd0681774b0351eacc5..f487c9e230763137694f8e5eed7e5a1ae872639c 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Friends Classes + * BuddyPress Friends Classes. * * @package BuddyPress * @subpackage FriendsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; 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 f04c0ce0e0a5b20cc4b77669c6d14409246e02ef..3a0642238d440623daee9ed51386a628bfb03982 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php @@ -1,42 +1,49 @@ <?php - /** - * BuddyPress Friend Filters + * BuddyPress Friend Filters. * * @package BuddyPress * @subpackage FriendsFilters + * @since 1.7.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** * Filter BP_User_Query::populate_extras to add confirmed friendship status. * * Each member in the user query is checked for confirmed friendship status * against the logged-in user. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global WPDB $wpdb WordPress database access object. * - * @param BP_User_Query $user_query The BP_User_Query object. - * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra - * data for, as determined by BP_User_Query. + * @param BP_User_Query $user_query The BP_User_Query object. + * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra + * 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 $wpdb; - // stop if user isn't logged in + // 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 + // 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() ) ); - // The "friend" is the user ID in the pair who is *not* the logged in user + // Keep track of members that have a friendship status with the current user. + $friend_user_ids = array(); + + // The "friend" is the user ID in the pair who is *not* the logged in user. foreach ( (array) $friend_status as $fs ) { $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id; + $friend_user_ids[] = $friend_id; if ( isset( $user_query->results[ $friend_id ] ) ) { if ( 0 == $fs->is_confirmed ) { @@ -49,5 +56,18 @@ function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query $user_query->results[ $friend_id ]->friendship_status = $status; } } + + // The rest are not friends with the current user, so set status accordingly. + $not_friends = array_diff( $user_query->user_ids, $friend_user_ids ); + foreach ( (array) $not_friends as $nf ) { + if ( bp_loggedin_user_id() == $nf ) { + continue; + } + + if ( isset( $user_query->results[ $nf ] ) ) { + $user_query->results[ $nf ]->friendship_status = 'not_friends'; + } + } + } add_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras', 4, 2 ); 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 d52420a82e7f4688bcb0fdbb316d6a992e6c1685..d9de4cb35f844724335025b7c465ea313ff0eca0 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Friends Functions + * BuddyPress Friends Functions. * * Functions are where all the magic happens in BuddyPress. They will * handle the actual saving or manipulation of information. Usually they will @@ -10,22 +9,25 @@ * * @package BuddyPress * @subpackage FriendsFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Create a new friendship. * - * @param int $initiator_userid ID of the "initiator" user (the user who is - * sending the friendship request). - * @param int $friend_userid ID of the "friend" user (the user whose friendship - * is being requested). - * @param bool $force_accept Optional. Whether to force acceptance. When false, - * running friends_add_friend() will result in a friendship request. - * When true, running friends_add_friend() will result in an accepted - * friendship, with no notifications being sent. Default: false. + * @since 1.0.0 + * + * @param int $initiator_userid ID of the "initiator" user (the user who is + * sending the friendship request). + * @param int $friend_userid ID of the "friend" user (the user whose friendship + * is being requested). + * @param bool $force_accept Optional. Whether to force acceptance. When false, + * running friends_add_friend() will result in a friendship request. + * When true, running friends_add_friend() will result in an accepted + * friendship, with no notifications being sent. Default: false. * @return bool True on success, false on failure. */ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = false ) { @@ -35,12 +37,12 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = return false; } - // Check if already friends, and bail if so + // Check if already friends, and bail if so. if ( friends_check_friendship( $initiator_userid, $friend_userid ) ) { return true; } - // Setup the friendship data + // Setup the friendship data. $friendship = new BP_Friends_Friendship; $friendship->initiator_user_id = $initiator_userid; $friendship->friend_user_id = $friend_userid; @@ -52,16 +54,16 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = $friendship->is_confirmed = 1; } - // Bail if friendship could not be saved (how sad!) + // Bail if friendship could not be saved (how sad!). if ( ! $friendship->save() ) { return false; } - // Send notifications + // Send notifications. if ( empty( $force_accept ) ) { $action = 'requested'; - // Update friend totals + // Update friend totals. } else { $action = 'accepted'; friends_update_friend_totals( $friendship->initiator_user_id, $friendship->friend_user_id, 'add' ); @@ -73,12 +75,12 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = * This is a variable hook, depending on context. * The two potential hooks are: friends_friendship_requested, friends_friendship_accepted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param int $id ID of the pending friendship connection. + * @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. + * @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 ); @@ -90,8 +92,10 @@ function friends_add_friend( $initiator_userid, $friend_userid, $force_accept = * * Will also delete the related "friendship_accepted" activity item. * + * @since 1.0.0 + * * @param int $initiator_userid ID of the friendship initiator. - * @param int $friend_userid ID of the friend user. + * @param int $friend_userid ID of the friend user. * @return bool True on success, false on failure. */ function friends_remove_friend( $initiator_userid, $friend_userid ) { @@ -103,15 +107,15 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) { * Fires before the deletion of a friendship activity item * for the user who canceled the friendship. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param int $friendship_id ID of the friendship object, if any, between a pair of users. + * @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. + * @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 items about the friendship id + // Remove the activity stream items about the friendship id. friends_delete_activity( array( 'item_id' => $friendship_id, 'type' => 'friendship_created', 'user_id' => 0 ) ); /** @@ -120,11 +124,11 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) { * 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) + * @since 1.0.0 * - * @param int $friendship_id ID of the friendship object, if any, between a pair of users. + * @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. + * @param int $friend_userid ID of the friend user. */ do_action( 'friends_friendship_deleted', $friendship_id, $initiator_userid, $friend_userid ); @@ -134,10 +138,10 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) { /** * Fires after the friendship connection is removed. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param int $initiator_userid ID of the friendship initiator. - * @param int $friend_userid ID of the friend user. + * @param int $friend_userid ID of the friend user. */ do_action( 'friends_friendship_post_delete', $initiator_userid, $friend_userid ); @@ -152,29 +156,31 @@ function friends_remove_friend( $initiator_userid, $friend_userid ) { * * Also initiates a "friendship_accepted" activity item. * + * @since 1.0.0 + * * @param int $friendship_id ID of the pending friendship object. * @return bool True on success, false on failure. */ function friends_accept_friendship( $friendship_id ) { - // Get the friendship data + // Get the friendship data. $friendship = new BP_Friends_Friendship( $friendship_id, true, false ); - // Accepting friendship + // Accepting friendship. if ( empty( $friendship->is_confirmed ) && BP_Friends_Friendship::accept( $friendship_id ) ) { - // Bump the friendship counts + // 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) + * @since 1.0.0 * - * @param int $id ID of the pending friendship object. + * @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. + * @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 ); @@ -187,6 +193,8 @@ function friends_accept_friendship( $friendship_id ) { /** * Mark a friendship request as rejected. * + * @since 1.0.0 + * * @param int $friendship_id ID of the pending friendship object. * @return bool True on success, false on failure. */ @@ -198,7 +206,7 @@ function friends_reject_friendship( $friendship_id ) { /** * Fires after a friendship request is rejected. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $friendship_id ID of the pending friendship. * @param BP_Friends_Friendship $friendships Friendship object. Passed by reference. @@ -213,9 +221,11 @@ function friends_reject_friendship( $friendship_id ) { /** * Withdraw a friendship request. * + * @since 1.6.0 + * * @param int $initiator_userid ID of the friendship initiator - this is the - * user who requested the friendship, and is doing the withdrawing. - * @param int $friend_userid ID of the requested friend. + * user who requested the friendship, and is doing the withdrawing. + * @param int $friend_userid ID of the requested friend. * @return bool True on success, false on failure. */ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) { @@ -230,10 +240,10 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) { /** * Fires after a friendship request has been withdrawn. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $friendship_id ID of the friendship. - * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference. + * @param BP_Friends_Friendship $friendship Friendship object. Passed by reference. */ do_action_ref_array( 'friends_friendship_withdrawn', array( $friendship_id, &$friendship ) ); @@ -246,7 +256,9 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) { /** * Check whether two users are friends. * - * @param int $user_id ID of the first user. + * @since 1.0.0 + * + * @param int $user_id ID of the first user. * @param int $possible_friend_id ID of the other user. * @return bool Returns true if the two users are friends, otherwise false. */ @@ -263,23 +275,20 @@ function friends_check_friendship( $user_id, $possible_friend_id ) { * * Will return 'is_friends', 'not_friends', 'pending' or 'awaiting_response'. * - * @param int $user_id ID of the first user. + * @since 1.2.0 + * + * @param int $user_id ID of the first user. * @param int $possible_friend_id ID of the other user. * @return string Friend status of the two users. */ function friends_check_friendship_status( $user_id, $possible_friend_id ) { global $members_template; - // check the BP_User_Query first - // @see bp_friends_filter_user_query_populate_extras() + // Check the BP_User_Query first + // @see bp_friends_filter_user_query_populate_extras(). if ( ! empty( $members_template->in_the_loop ) ) { if ( isset( $members_template->member->friendship_status ) ) { return $members_template->member->friendship_status; - - // make sure that the friends BP_User_Query was registered before assuming - // status as 'not_friends' - } elseif ( has_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras' ) ) { - return 'not_friends'; } } @@ -289,6 +298,8 @@ function friends_check_friendship_status( $user_id, $possible_friend_id ) { /** * Get the friend count of a given user. * + * @since 1.2.0 + * * @param int $user_id ID of the user whose friends are being counted. * @return int Friend count of the user. */ @@ -303,7 +314,7 @@ function friends_get_total_friend_count( $user_id = 0 ) { /** * Filters the total friend count for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $count Total friend count for a given user. */ @@ -313,6 +324,8 @@ function friends_get_total_friend_count( $user_id = 0 ) { /** * Check whether a given user has any friends. * + * @since 1.0.0 + * * @param int $user_id ID of the user whose friends are being checked. * @return bool True if the user has friends, otherwise false. */ @@ -331,8 +344,10 @@ function friends_check_user_has_friends( $user_id ) { /** * Get the ID of two users' friendship, if it exists. * + * @since 1.2.0 + * * @param int $initiator_user_id ID of the first user. - * @param int $friend_user_id ID of the second user. + * @param int $friend_user_id ID of the second user. * @return int|bool ID of the friendship if found, otherwise false. */ function friends_get_friendship_id( $initiator_user_id, $friend_user_id ) { @@ -342,12 +357,15 @@ 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 retrieved. + * @since 1.0.0 + * + * @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. + * 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. + * @return array */ function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { return BP_Friends_Friendship::get_friend_user_ids( $user_id, $friend_requests_only, $assoc_arr ); @@ -356,16 +374,18 @@ function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $ /** * 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). + * @since 1.0.0 + * + * @param string $search_terms 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 $pag_num Optional. Max number of friends to return. + * @param int $pag_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. + * @type int $count Total number of friends (disregarding + * pagination) who match the search. * }. Returns false on failure. */ function friends_search_friends( $search_terms, $user_id, $pag_num = 10, $pag_page = 1 ) { @@ -375,8 +395,9 @@ function friends_search_friends( $search_terms, $user_id, $pag_num = 10, $pag_pa /** * 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. + * @since 1.2.0 + * + * @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. */ function friends_get_friendship_request_user_ids( $user_id ) { @@ -386,15 +407,17 @@ function friends_get_friendship_request_user_ids( $user_id ) { /** * Get a user's most recently active friends. * + * @since 1.0.0 + * * @see BP_Core_User::get_users() for a description of return value. * - * @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. - * Default: 0 (no pagination; show all results). - * @param string $filter Optional. Limit results to those matching a search - * string. + * @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. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. * @return array See {@link BP_Core_User::get_users()}. */ function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filter = '' ) { @@ -402,7 +425,7 @@ function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filte /** * Filters a user's most recently active friends. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array { * @type int $total_users Total number of users matched by query params. @@ -415,15 +438,17 @@ function friends_get_recently_active( $user_id, $per_page = 0, $page = 0, $filte /** * Get a user's friends, in alphabetical order. * + * @since 1.0.0 + * * @see BP_Core_User::get_users() for a description of return value. * - * @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. - * Default: 0 (no pagination; show all results). - * @param string $filter Optional. Limit results to those matching a search - * string. + * @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. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. * @return array See {@link BP_Core_User::get_users()}. */ function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter = '' ) { @@ -431,7 +456,7 @@ 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) + * @since 1.2.0 * * @return array { * @type int $total_users Total number of users matched by query params. @@ -444,15 +469,17 @@ function friends_get_alphabetically( $user_id, $per_page = 0, $page = 0, $filter /** * Get a user's friends, in the order in which they joined the site. * + * @since 1.0.0 + * * @see BP_Core_User::get_users() for a description of return value. * - * @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. - * Default: 0 (no pagination; show all results). - * @param string $filter Optional. Limit results to those matching a search - * string. + * @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. + * Default: 0 (no pagination; show all results). + * @param string $filter Optional. Limit results to those matching a search + * string. * @return array See {@link BP_Core_User::get_users()}. */ function friends_get_newest( $user_id, $per_page = 0, $page = 0, $filter = '' ) { @@ -460,7 +487,7 @@ 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) + * @since 1.2.0 * * @param array { * @type int $total_users Total number of users matched by query params. @@ -473,10 +500,12 @@ function friends_get_newest( $user_id, $per_page = 0, $page = 0, $filter = '' ) /** * Get the last active date of many users at once. * + * @since 1.0.0 + * * @see BP_Friends_Friendship::get_bulk_last_active() for a description of * arguments and return value. * - * @param array $user_ids See BP_Friends_Friendship::get_bulk_last_active(). + * @param array $friend_ids See BP_Friends_Friendship::get_bulk_last_active(). * @return array $user_ids See BP_Friends_Friendship::get_bulk_last_active(). */ function friends_get_bulk_last_active( $friend_ids ) { @@ -489,29 +518,29 @@ function friends_get_bulk_last_active( $friend_ids ) { * Excludes friends that are already in the group, and banned friends if the * user is not a group admin. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param int $user_id User ID whose friends to see can be invited. Default: - * ID of the logged-in user. + * @param int $user_id User ID whose friends to see can be invited. Default: + * ID of the logged-in user. * @param int $group_id Group to check possible invitations against. * @return mixed False if no friends, array of users if friends. */ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) { - // Default to logged in user id + // Default to logged in user id. if ( empty( $user_id ) ) $user_id = bp_loggedin_user_id(); - // Only group admins can invited previously banned users + // Only group admins can invited previously banned users. $user_is_admin = (bool) groups_is_user_admin( $user_id, $group_id ); - // Assume no friends + // Assume no friends. $friends = array(); /** * Filters default arguments for list of friends a user can invite into this group. * - * @since BuddyPress (1.5.4) + * @since 1.5.4 * * @param array $value Array of default parameters for invite list. */ @@ -521,7 +550,7 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) { 'per_page' => 0 ) ); - // User has friends + // User has friends. if ( bp_has_members( $args ) ) { /** @@ -534,21 +563,21 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) { */ while ( bp_members() ) : - // Load the member + // Load the member. bp_the_member(); - // Get the user ID of the friend + // Get the user ID of the friend. $friend_user_id = bp_get_member_user_id(); - // Skip friend if already in the group + // Skip friend if already in the group. if ( groups_is_user_member( $friend_user_id, $group_id ) ) continue; - // Skip friend if not group admin and user banned from group + // Skip friend if not group admin and user banned from group. if ( ( false === $user_is_admin ) && groups_is_user_banned( $friend_user_id, $group_id ) ) continue; - // Friend is safe, so add it to the array of possible friends + // Friend is safe, so add it to the array of possible friends. $friends[] = array( 'id' => $friend_user_id, 'full_name' => bp_get_member_name() @@ -557,17 +586,17 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) { endwhile; } - // If no friends, explicitly set to false + // If no friends, explicitly set to false. if ( empty( $friends ) ) $friends = false; /** * Filters the list of potential friends that can be invited to this group. * - * @since BuddyPress (1.5.4) + * @since 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 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 ); @@ -582,7 +611,9 @@ function friends_get_friends_invite_list( $user_id = 0, $group_id = 0 ) { * - 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. + * @since 1.0.0 + * + * @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. */ @@ -593,8 +624,10 @@ function friends_count_invitable_friends( $user_id, $group_id ) { /** * Get a total friend count for a given user. * + * @since 1.0.0 + * * @param int $user_id Optional. ID of the user whose friendships you are - * counting. Default: displayed user (if any), otherwise logged-in user. + * counting. Default: displayed user (if any), otherwise logged-in user. * @return int Friend count for the user. */ function friends_get_friend_count_for_user( $user_id ) { @@ -604,12 +637,14 @@ function friends_get_friend_count_for_user( $user_id ) { /** * Return a list of a user's friends, filtered by a search term. * + * @since 1.0.0 + * * @param string $search_terms Search term to filter on. - * @param int $user_id ID of the user whose friends are being searched. - * @param int $pag_num Number of results to return per page. Default: 0 (no - * pagination - show all results). - * @param int $pag_num Number of the page being requested. Default: 0 (no - * pagination - show all results). + * @param int $user_id ID of the user whose friends are being searched. + * @param int $pag_num Number of results to return per page. Default: 0 (no + * pagination - show all results). + * @param int $pag_page Number of the page being requested. Default: 0 (no + * pagination - show all results). * @return array Array of BP_Core_User objects corresponding to friends. */ function friends_search_users( $search_terms, $user_id, $pag_num = 0, $pag_page = 0 ) { @@ -629,6 +664,8 @@ function friends_search_users( $search_terms, $user_id, $pag_num = 0, $pag_page /** * Has a friendship been confirmed (accepted)? * + * @since 1.0.0 + * * @param int $friendship_id The ID of the friendship being checked. * @return bool True if the friendship is confirmed, otherwise false. */ @@ -644,11 +681,13 @@ function friends_is_friendship_confirmed( $friendship_id ) { * friendship event (acceptance, deletion), call this function to regenerate * the cached values. * - * @param int $initiator_user_id ID of the first user. - * @param int $friend_user_id ID of the second user. - * @param string $status Optional. The friendship event that's been triggered. - * 'add' will ++ each user's friend counts, while any other string - * will --. + * @since 1.0.0 + * + * @param int $initiator_user_id ID of the first user. + * @param int $friend_user_id ID of the second user. + * @param string $status Optional. The friendship event that's been triggered. + * 'add' will ++ each user's friend counts, while any other string + * will --. */ function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $status = 'add' ) { @@ -666,9 +705,11 @@ function friends_update_friend_totals( $initiator_user_id, $friend_user_id, $sta * * Removes the following: * - * - Friendships of which the user is a member - * - Cached friend count for the user - * - Notifications of friendship requests sent by the user + * - Friendships of which the user is a member. + * - Cached friend count for the user. + * - Notifications of friendship requests sent by the user. + * + * @since 1.0.0 * * @param int $user_id ID of the user whose friend data is being removed. */ @@ -677,7 +718,7 @@ function friends_remove_data( $user_id ) { /** * Fires before deletion of friend-related data for a given user. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $user_id ID for the user whose friend data is being removed. */ @@ -685,13 +726,13 @@ function friends_remove_data( $user_id ) { BP_Friends_Friendship::delete_all_for_user( $user_id ); - // Remove usermeta + // 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) + * @since 1.0.0 * * @param int $user_id ID for the user whose friend data is being removed. */ @@ -706,6 +747,8 @@ add_action( 'bp_make_spam_user', 'friends_remove_data' ); * * This is intended to speed up @mentions lookups for a majority of use cases. * + * @since 2.1.0 + * * @see bp_activity_mentions_script() */ function bp_friends_prime_mentions_results() { @@ -723,7 +766,7 @@ function bp_friends_prime_mentions_results() { } $friends_query = array( - 'count_total' => '', // Prevents total count + 'count_total' => '', // Prevents total count. 'populate_extras' => false, 'type' => 'alphabetical', 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 aa42f4c47ce274fef7ec0c0c7ade321c55dd129f..d8066f2bbc182c06a2d510a5467e7345e589dc03 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php @@ -1,263 +1,23 @@ <?php /** - * BuddyPress Friends Streams Loader + * BuddyPress Friends Streams Loader. * * The friends component is for users to create relationships with each other. * * @package BuddyPress * @subpackage Friends + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Friends_Component extends BP_Component { - - /** - * Start the friends component creation process. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'friends', - _x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 60 - ) - ); - } - - /** - * Include bp-friends files. - * - * @see BP_Component::includes() for description of parameters. - * - * @param array $includes See {@link BP_Component::includes()}. - */ - public function includes( $includes = array() ) { - $includes = array( - 'cache', - 'actions', - 'screens', - 'filters', - 'classes', - 'activity', - 'template', - 'functions', - 'notifications', - 'widgets', - ); - - parent::includes( $includes ); - } - - /** - * Set up bp-friends global settings. - * - * The BP_FRIENDS_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for description of parameters. - * - * @param array $args See {@link BP_Component::setup_globals()}. - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - // Deprecated. Do not use. - // Defined conditionally to support unit tests. - if ( ! defined( 'BP_FRIENDS_DB_VERSION' ) ) { - define( 'BP_FRIENDS_DB_VERSION', '1800' ); - } - - // Define a slug, if necessary - if ( !defined( 'BP_FRIENDS_SLUG' ) ) - define( 'BP_FRIENDS_SLUG', $this->id ); - - // Global tables for the friends component - $global_tables = array( - 'table_name' => $bp->table_prefix . 'bp_friends', - 'table_name_meta' => $bp->table_prefix . 'bp_friends_meta', - ); - - // All globals for the friends component. - // Note that global_tables is included in this array. - $args = array( - 'slug' => BP_FRIENDS_SLUG, - 'has_directory' => false, - 'search_string' => __( 'Search Friends...', 'buddypress' ), - 'notification_callback' => 'friends_format_notifications', - 'global_tables' => $global_tables - ); - - parent::setup_globals( $args ); - } - - /** - * Set up component navigation. - * - * @since BuddyPress (1.5.0) - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - $bp = buddypress(); - - // Add 'Friends' to the main navigation - $count = friends_get_total_friend_count(); - $class = ( 0 === $count ) ? 'no-count' : 'count'; - $main_nav = array( - 'name' => sprintf( __( 'Friends <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ), - 'slug' => $this->slug, - 'position' => 60, - 'screen_function' => 'friends_screen_my_friends', - 'default_subnav_slug' => 'my-friends', - 'item_css_id' => $bp->friends->id - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - $friends_link = trailingslashit( $user_domain . bp_get_friends_slug() ); - - // Add the subnav items to the friends nav item - $sub_nav[] = array( - 'name' => _x( 'Friendships', 'Friends screen sub nav', 'buddypress' ), - 'slug' => 'my-friends', - 'parent_url' => $friends_link, - 'parent_slug' => bp_get_friends_slug(), - 'screen_function' => 'friends_screen_my_friends', - 'position' => 10, - 'item_css_id' => 'friends-my-friends' - ); - - $sub_nav[] = array( - 'name' => _x( 'Requests', 'Friends screen sub nav', 'buddypress' ), - 'slug' => 'requests', - 'parent_url' => $friends_link, - 'parent_slug' => bp_get_friends_slug(), - 'screen_function' => 'friends_screen_requests', - 'position' => 20, - 'user_has_access' => bp_core_can_edit_settings() - ); - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up bp-friends integration with the WordPress admin bar. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_admin_bar() for a description of arguments. - * - * @param array $wp_admin_nav See BP_Component::setup_admin_bar() - * for description. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - $bp = buddypress(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $user_domain = bp_loggedin_user_domain(); - $friends_link = trailingslashit( $user_domain . $this->slug ); - - // Pending friend requests - $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ); - if ( !empty( $count ) ) { - $title = sprintf( _x( 'Friends <span class="count">%s</span>', 'My Account Friends menu', 'buddypress' ), number_format_i18n( $count ) ); - $pending = sprintf( _x( 'Pending Requests <span class="count">%s</span>', 'My Account Friends menu sub nav', 'buddypress' ), number_format_i18n( $count ) ); - } else { - $title = _x( 'Friends', 'My Account Friends menu', 'buddypress' ); - $pending = _x( 'No Pending Requests','My Account Friends menu sub nav', 'buddypress' ); - } - - // Add the "My Account" sub menus - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => $title, - 'href' => trailingslashit( $friends_link ) - ); - - // My Friends - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-friendships', - 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ), - 'href' => trailingslashit( $friends_link ) - ); - - // Requests - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-requests', - 'title' => $pending, - 'href' => trailingslashit( $friends_link . 'requests' ) - ); - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title>. - */ - public function setup_title() { - $bp = buddypress(); - - // Adjust title - if ( bp_is_friends_component() ) { - if ( bp_is_my_profile() ) { - $bp->bp_options_title = __( 'Friendships', 'buddypress' ); - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-friends-component.php'; /** * Set up the bp-forums component. + * + * @since 1.6.0 */ function bp_setup_friends() { buddypress()->friends = new BP_Friends_Component(); 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 7c4c236ed8b5b8e58640b60a3d63887c4ecec323..a86629337d585ea6871c7d2d6a19b06e88b1fc04 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php @@ -1,16 +1,16 @@ <?php - /** - * BuddyPress Friends Activity Functions + * BuddyPress Friends Activity Functions. * * These functions handle the recording, deleting and formatting of activity * for the user and for this specific component. * * @package BuddyPress - * @subpackage FriendsActivity + * @subpackage FriendsNotifications + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Emails ********************************************************************/ @@ -21,87 +21,28 @@ defined( 'ABSPATH' ) || exit; * When a friendship is requested, an email and a BP notification are sent to * the user of whom friendship has been requested ($friend_id). * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship object. - * @param int $initiator_id ID of the user who initiated the request. - * @param int $friend_id ID of the request recipient. + * @param int $initiator_id ID of the user who initiated the request. + * @param int $friend_id ID of the request recipient. */ function friends_notification_new_request( $friendship_id, $initiator_id, $friend_id ) { - - $initiator_name = bp_core_get_user_displayname( $initiator_id ); - - if ( 'no' == bp_get_user_meta( (int) $friend_id, 'notification_friends_friendship_request', true ) ) - return false; - - $ud = get_userdata( $friend_id ); - $all_requests_link = bp_core_get_user_domain( $friend_id ) . bp_get_friends_slug() . '/requests/'; - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = trailingslashit( bp_core_get_user_domain( $friend_id ) . $settings_slug . '/notifications' ); - $initiator_link = bp_core_get_user_domain( $initiator_id ); - - // Set up and send the message - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ) ) ); - $message = sprintf( __( -'%1$s wants to add you as a friend. - -To view all of your pending friendship requests: %2$s - -To view %3$s\'s profile: %4$s - ---------------------- -', 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_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 ); + if ( 'no' == bp_get_user_meta( (int) $friend_id, 'notification_friends_friendship_request', true ) ) { + return; } - /** - * 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 ); + $args = array( + 'tokens' => array( + 'friend-requests.url' => esc_url( bp_core_get_user_domain( $friend_id ) . bp_get_friends_slug() . '/requests/' ), + 'friend.id' => $friend_id, + 'friendship.id' => $friendship_id, + 'initiator.id' => $initiator_id, + 'initiator.url' => esc_url( bp_core_get_user_domain( $initiator_id ) ), + 'initiator.name' => bp_core_get_user_displayname( $initiator_id ), + ), + ); + bp_send_email( 'friends-request', $friend_id, $args ); } add_action( 'friends_friendship_requested', 'friends_notification_new_request', 10, 3 ); @@ -111,83 +52,29 @@ add_action( 'friends_friendship_requested', 'friends_notification_new_request', * When a friendship request is accepted, an email and a BP notification are * sent to the user who requested the friendship ($initiator_id). * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship object. - * @param int $initiator_id ID of the user who initiated the request. - * @param int $friend_id ID of the request recipient. + * @param int $initiator_id ID of the user who initiated the request. + * @param int $friend_id ID of the request recipient. */ function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) { + $initiator_id = (int) $initiator_id; - $friend_name = bp_core_get_user_displayname( $friend_id ); - - if ( 'no' == bp_get_user_meta( (int) $initiator_id, 'notification_friends_friendship_accepted', true ) ) - return false; - - $ud = get_userdata( $initiator_id ); - $friend_link = bp_core_get_user_domain( $friend_id ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = trailingslashit( bp_core_get_user_domain( $initiator_id ) . $settings_slug . '/notifications' ); - - // Set up and send the message - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ) ) ); - $message = sprintf( __( -'%1$s accepted your friend request. - -To view %2$s\'s profile: %3$s - ---------------------- -', 'buddypress' ), $friend_name, $friend_name, $friend_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 ); + if ( 'no' == bp_get_user_meta( $initiator_id, 'notification_friends_friendship_accepted', true ) ) { + return; } - /** - * 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 ); + $args = array( + 'tokens' => array( + 'friend.id' => $friend_id, + 'friendship.url' => esc_url( bp_core_get_user_domain( $friend_id ) ), + 'friend.name' => bp_core_get_user_displayname( $friend_id ), + 'friendship.id' => $friendship_id, + 'initiator.id' => $initiator_id, + ), + ); + bp_send_email( 'friends-request-accepted', $initiator_id, $args ); } add_action( 'friends_friendship_accepted', 'friends_notification_accepted_request', 10, 3 ); @@ -196,13 +83,15 @@ add_action( 'friends_friendship_accepted', 'friends_notification_accepted_reques /** * Notification formatting callback for bp-friends notifications. * - * @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'. + * @since 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'. * @return array|string */ function friends_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { @@ -214,7 +103,7 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t // $action and $amount are used to generate dynamic filter names. $action = 'accepted'; - // Set up the string and the filter + // Set up the string and the filter. if ( (int) $total_items > 1 ) { $text = sprintf( __( '%d friends accepted your friendship requests', 'buddypress' ), (int) $total_items ); $amount = 'multiple'; @@ -230,7 +119,7 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t $action = 'request'; - // Set up the string and the filter + // Set up the string and the filter. if ( (int) $total_items > 1 ) { $text = sprintf( __( 'You have %d pending friendship requests', 'buddypress' ), (int) $total_items ); $amount = 'multiple'; @@ -242,7 +131,7 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t break; } - // Return either an HTML link or an array, depending on the requested format + // Return either an HTML link or an array, depending on the requested format. if ( 'string' == $format ) { /** @@ -255,7 +144,7 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t * - bp_friends_single_friendship_request_notification * - bp_friends_multiple_friendship_request_notification * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string|array $value Depending on format, an HTML link to new requests profile * tab or array with link and text. @@ -275,7 +164,7 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t /** * Fires at the end of the bp-friends notification format callback. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $action The kind of notification being rendered. * @param int $item_id The primary item ID. @@ -291,6 +180,8 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t /** * Clear friend-related notifications when ?new=1 + * + * @since 1.2.0 */ function friends_clear_friend_notifications() { if ( isset( $_GET['new'] ) && bp_is_active( 'notifications' ) ) { @@ -302,7 +193,7 @@ add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notification /** * Delete any friendship request notifications for the logged in user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_friends_mark_friendship_request_notifications_by_type() { if ( isset( $_GET['new'] ) && bp_is_active( 'notifications' ) ) { @@ -314,7 +205,7 @@ add_action( 'friends_screen_requests', 'bp_friends_mark_friendship_request_notif /** * Delete any friendship acceptance notifications for the logged in user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_friends_mark_friendship_accepted_notifications_by_type() { if ( bp_is_active( 'notifications' ) ) { @@ -326,10 +217,11 @@ add_action( 'friends_screen_my_friends', 'bp_friends_mark_friendship_accepted_no /** * Notify one use that another user has requested their virtual friendship. * - * @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 receiver user ID + * @since 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 receiver user ID. */ function bp_friends_friendship_requested_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { if ( bp_is_active( 'notifications' ) ) { @@ -349,10 +241,10 @@ add_action( 'friends_friendship_requested', 'bp_friends_friendship_requested_not /** * Remove friend request notice when a member rejects another members * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $friendship_id (not used) - * @param object $friendship + * @param int $friendship_id Friendship ID (not used). + * @param object $friendship Friendship object. */ function bp_friends_mark_friendship_rejected_notifications_by_item_id( $friendship_id, $friendship ) { if ( bp_is_active( 'notifications' ) ) { @@ -364,22 +256,23 @@ add_action( 'friends_friendship_rejected', 'bp_friends_mark_friendship_rejected_ /** * Notify a member when another member accepts their virtual friendship request. * - * @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 receiver user ID + * @since 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 receiver user ID. */ function bp_friends_add_friendship_accepted_notification( $friendship_id, $initiator_user_id, $friend_user_id ) { - // Bail if notifications is not active + // Bail if notifications is not active. if ( ! bp_is_active( 'notifications' ) ) { return; } - // Remove the friend request notice + // Remove the friend request notice. bp_notifications_mark_notifications_by_item_id( $friend_user_id, $initiator_user_id, buddypress()->friends->id, 'friendship_request' ); - // Add a friend accepted notice for the initiating user + // Add a friend accepted notice for the initiating user. bp_notifications_add_notification( array( 'user_id' => $initiator_user_id, 'item_id' => $friend_user_id, @@ -393,12 +286,12 @@ function bp_friends_add_friendship_accepted_notification( $friendship_id, $initi add_action( 'friends_friendship_accepted', 'bp_friends_add_friendship_accepted_notification', 10, 3 ); /** - * Remove friend request notice when a member withdraws their friend request + * Remove friend request notice when a member withdraws their friend request. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $friendship_id (not used) - * @param object $friendship + * @param int $friendship_id Friendship ID (not used). + * @param object $friendship Friendship Object. */ function bp_friends_mark_friendship_withdrawn_notifications_by_item_id( $friendship_id, $friendship ) { if ( bp_is_active( 'notifications' ) ) { @@ -408,10 +301,11 @@ function bp_friends_mark_friendship_withdrawn_notifications_by_item_id( $friends add_action( 'friends_friendship_withdrawn', 'bp_friends_mark_friendship_withdrawn_notifications_by_item_id', 10, 2 ); /** - * Remove friendship requests FROM user, used primarily when a user is deleted + * Remove friendship requests FROM user, used primarily when a user is deleted. + * + * @since 1.9.0 * - * @since BuddyPress (1.9.0) - * @param int $user_id + * @param int $user_id ID of the user whose notifications are removed. */ function bp_friends_remove_notifications_data( $user_id = 0 ) { if ( bp_is_active( 'notifications' ) ) { 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 77055812bc48ed6c2b25d45c9832fe6415242a5c..4c22cfdfa90994bbd785999598903581a6c6e8f2 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Friends Screen Functions + * BuddyPress Friends Screen Functions. * * Screen functions are the controllers of BuddyPress. They will execute when * their specific URL is caught. They will first save or manipulate data using @@ -9,27 +8,30 @@ * * @package BuddyPress * @subpackage FriendsScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Catch and process the My Friends page. + * + * @since 1.0.0 */ function friends_screen_my_friends() { /** * Fires before the loading of template for the My Friends page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'friends_screen_my_friends' ); /** * Filters the template used to display the My Friends page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the my friends template to load. */ @@ -38,10 +40,12 @@ function friends_screen_my_friends() { /** * Catch and process the Requests page. + * + * @since 1.0.0 */ function friends_screen_requests() { if ( bp_is_action_variable( 'accept', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'friends_accept_friendship' ); if ( friends_accept_friendship( bp_action_variable( 1 ) ) ) @@ -52,7 +56,7 @@ function friends_screen_requests() { bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) ); } elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'friends_reject_friendship' ); if ( friends_reject_friendship( bp_action_variable( 1 ) ) ) @@ -63,7 +67,7 @@ function friends_screen_requests() { bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) ); } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'friends_withdraw_friendship' ); if ( friends_withdraw_friendship( bp_loggedin_user_id(), bp_action_variable( 1 ) ) ) @@ -77,14 +81,14 @@ function friends_screen_requests() { /** * Fires before the loading of template for the friends requests page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'friends_screen_requests' ); /** * Filters the template used to display the My Friends page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the friends request template to load. */ @@ -93,6 +97,8 @@ function friends_screen_requests() { /** * Add Friends-related settings to the Settings > Notifications page. + * + * @since 1.0.0 */ function friends_screen_notification_settings() { @@ -116,14 +122,14 @@ function friends_screen_notification_settings() { <tr id="friends-notification-settings-request"> <td></td> <td><?php _ex( 'A member sends you a friendship request', 'Friend settings on notification settings page', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php checked( $send_requests, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-yes" value="yes" <?php checked( $send_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-request-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" id="notification-friends-friendship-request-no" value="no" <?php checked( $send_requests, 'no', true ) ?>/><label for="notification-friends-friendship-request-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <tr id="friends-notification-settings-accepted"> <td></td> <td><?php _ex( 'A member accepts your friendship request', 'Friend settings on notification settings page', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-yes" value="yes" <?php checked( $accept_requests, 'yes', true ) ?>/><label for="notification-friends-friendship-accepted-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" id="notification-friends-friendship-accepted-no" value="no" <?php checked( $accept_requests, 'no', true ) ?>/><label for="notification-friends-friendship-accepted-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <?php @@ -131,7 +137,7 @@ function friends_screen_notification_settings() { /** * Fires after the last table row on the friends notification screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'friends_screen_notification_settings' ); ?> 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 41821d83a51b38ff5c3a04647293eba1ffbc9c6a..e101f1771612303a9c311c4a547b867af17bd219 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php @@ -1,19 +1,19 @@ <?php - /** * BuddyPress Friends Template Functions. * * @package BuddyPress * @subpackage FriendsTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Output the friends component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_friends_slug() */ @@ -23,14 +23,16 @@ function bp_friends_slug() { /** * Return the friends component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * + * @return string */ function bp_get_friends_slug() { /** * Filters the friends component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Friends component slug. */ @@ -40,7 +42,7 @@ function bp_friends_slug() { /** * Output the friends component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_friends_root_slug() */ @@ -50,14 +52,16 @@ function bp_friends_root_slug() { /** * Return the friends component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * + * @return string */ function bp_get_friends_root_slug() { /** * Filters the friends component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Friends component root slug. */ @@ -205,7 +209,7 @@ function bp_friend_search_form() { /** * Output the "Add Friend" button in the member loop. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ function bp_member_add_friend_button() { bp_add_friend_button( bp_get_member_user_id() ); @@ -214,6 +218,8 @@ add_action( 'bp_directory_members_actions', 'bp_member_add_friend_button' ); /** * Output the friend count for the current member in the loop. + * + * @since 1.2.0 */ function bp_member_total_friend_count() { echo bp_get_member_total_friend_count(); @@ -223,6 +229,8 @@ function bp_member_total_friend_count() { * * Return value is a string of the form "x friends". * + * @since 1.2.0 + * * @return string A string of the form "x friends". */ function bp_get_member_total_friend_count() { @@ -233,7 +241,7 @@ function bp_member_total_friend_count() { /** * Filters text used to denote total friend count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value String of the form "x friends". * @param int $value Total friend count for current member in the loop. @@ -249,6 +257,8 @@ function bp_member_total_friend_count() { /** * Output the ID of the current user in the friend request loop. * + * @since 1.2.6 + * * @see bp_get_potential_friend_id() for a description of arguments. * * @param int $user_id See {@link bp_get_potential_friend_id()}. @@ -259,10 +269,12 @@ function bp_potential_friend_id( $user_id = 0 ) { /** * Return the ID of current user in the friend request loop. * + * @since 1.2.6 + * * @global object $friends_template * * @param int $user_id Optional. If provided, the function will simply - * return this value. + * return this value. * @return int ID of potential friend. */ function bp_get_potential_friend_id( $user_id = 0 ) { @@ -276,7 +288,7 @@ function bp_potential_friend_id( $user_id = 0 ) { /** * Filters the ID of current user in the friend request loop. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param int $user_id ID of current user in the friend request loop. */ @@ -288,8 +300,10 @@ function bp_potential_friend_id( $user_id = 0 ) { * * Returns - 'is_friend', 'not_friends', 'pending'. * + * @since 1.2.6 + * * @param int $user_id ID of the potential friend. Default: the value of - * {@link bp_get_potential_friend_id()}. + * {@link bp_get_potential_friend_id()}. * @return string 'is_friend', 'not_friends', or 'pending'. */ function bp_is_friend( $user_id = 0 ) { @@ -306,7 +320,7 @@ function bp_is_friend( $user_id = 0 ) { /** * Filters the status of friendship between logged in user and given user. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param string $value String status of friendship. Possible values are 'is_friend', 'not_friends', 'pending'. */ @@ -316,10 +330,12 @@ function bp_is_friend( $user_id = 0 ) { /** * Output the Add Friend button. * + * @since 1.0.0 + * * @see bp_get_add_friend_button() for information on arguments. * - * @param int $potential_friend_id See {@link bp_get_add_friend_button()}. - * @param int $friend_status See {@link bp_get_add_friend_button()}. + * @param int $potential_friend_id See {@link bp_get_add_friend_button()}. + * @param int|bool $friend_status See {@link bp_get_add_friend_button()}. */ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false ) { echo bp_get_add_friend_button( $potential_friend_id, $friend_status ); @@ -327,9 +343,11 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false /** * Create the Add Friend button. * - * @param int $potential_friend_id ID of the user to whom the button - * applies. Default: value of {@link bp_get_potential_friend_id()}. - * @param bool $friend_status Not currently used. + * @since 1.1.0 + * + * @param int $potential_friend_id ID of the user to whom the button + * applies. Default: value of {@link bp_get_potential_friend_id()}. + * @param bool $friend_status Not currently used. * @return string HTML for the Add Friend button. */ function bp_get_add_friend_button( $potential_friend_id = 0, $friend_status = false ) { @@ -354,8 +372,8 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false 'link_href' => wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $potential_friend_id . '/', 'friends_withdraw_friendship' ), 'link_text' => __( 'Cancel Friendship Request', 'buddypress' ), 'link_title' => __( 'Cancel Friendship Requested', 'buddypress' ), - 'link_id' => 'friend-' . $potential_friend_id, - 'link_rel' => 'remove', + 'link_id' => 'friend-' . $potential_friend_id, + 'link_rel' => 'remove', 'link_class' => 'friendship-button pending_friend requested' ); break; @@ -415,7 +433,7 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false /** * Filters the HTML for the add friend button. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $button HTML markup for add friend button. */ @@ -425,10 +443,12 @@ function bp_add_friend_button( $potential_friend_id = 0, $friend_status = false /** * Get a comma-separated list of IDs of a user's friends. * + * @since 1.2.0 + * * @param int $user_id Optional. Default: the displayed user's ID, or the - * logged-in user's ID. + * logged-in user's ID. * @return string|bool A comma-separated list of friend IDs if any are found, - * otherwise false. + * otherwise false. */ function bp_get_friend_ids( $user_id = 0 ) { @@ -449,8 +469,10 @@ function bp_get_friend_ids( $user_id = 0 ) { * Note that we return a 0 if no pending requests are found. This is necessary * because of the structure of the $include parameter in bp_has_members(). * + * @since 1.2.0 + * * @param int $user_id ID of the user whose requests are being retrieved. - * Defaults to displayed user. + * Defaults to displayed user. * @return array|int An array of user IDs if found, or a 0 if none are found. */ function bp_get_friendship_requests( $user_id = 0 ) { @@ -473,7 +495,7 @@ function bp_get_friendship_requests( $user_id = 0 ) { /** * Filters the total pending friendship requests for a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array|int An array of user IDs if found, or a 0 if none are found. */ @@ -482,6 +504,8 @@ function bp_get_friendship_requests( $user_id = 0 ) { /** * Output the ID of the friendship between the logged-in user and the current user in the loop. + * + * @since 1.2.0 */ function bp_friend_friendship_id() { echo bp_get_friend_friendship_id(); @@ -489,6 +513,8 @@ function bp_friend_friendship_id() { /** * Return the ID of the friendship between the logged-in user and the current user in the loop. * + * @since 1.2.0 + * * @return int ID of the friendship. */ function bp_get_friend_friendship_id() { @@ -502,7 +528,7 @@ function bp_friend_friendship_id() { /** * Filters the ID of the friendship between the logged in user and the current user in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $friendship_id ID of the friendship. */ @@ -511,6 +537,8 @@ function bp_friend_friendship_id() { /** * Output the URL for accepting the current friendship request in the loop. + * + * @since 1.0.0 */ function bp_friend_accept_request_link() { echo bp_get_friend_accept_request_link(); @@ -518,6 +546,8 @@ function bp_friend_accept_request_link() { /** * Return the URL for accepting the current friendship request in the loop. * + * @since 1.0.0 + * * @return string accept-friendship URL. */ function bp_get_friend_accept_request_link() { @@ -531,7 +561,7 @@ function bp_friend_accept_request_link() { /** * Filters the URL for accepting the current friendship request in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Accept-friendship URL. */ @@ -540,6 +570,8 @@ function bp_friend_accept_request_link() { /** * Output the URL for rejecting the current friendship request in the loop. + * + * @since 1.0.0 */ function bp_friend_reject_request_link() { echo bp_get_friend_reject_request_link(); @@ -547,6 +579,8 @@ function bp_friend_reject_request_link() { /** * Return the URL for rejecting the current friendship request in the loop. * + * @since 1.0.0 + * * @return string reject-friendship URL. */ function bp_get_friend_reject_request_link() { @@ -560,7 +594,7 @@ function bp_friend_reject_request_link() { /** * Filters the URL for rejecting the current friendship request in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Reject-friendship URL. */ @@ -570,6 +604,8 @@ function bp_friend_reject_request_link() { /** * Output the total friend count for a given user. * + * @since 1.2.0 + * * @param int $user_id See {@link friends_get_total_friend_count()}. */ function bp_total_friend_count( $user_id = 0 ) { @@ -578,6 +614,8 @@ function bp_total_friend_count( $user_id = 0 ) { /** * Return the total friend count for a given user. * + * @since 1.2.0 + * * @param int $user_id See {@link friends_get_total_friend_count()}. * @return int Total friend count. */ @@ -586,7 +624,7 @@ function bp_total_friend_count( $user_id = 0 ) { /** * Filters the total friend count for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Total friend count. */ @@ -597,6 +635,8 @@ function bp_total_friend_count( $user_id = 0 ) { /** * Output the total friendship request count for a given user. * + * @since 1.2.0 + * * @see bp_friend_get_total_requests_count() for description of arguments. * * @param int $user_id See {@link bp_friend_get_total_requests_count(). @@ -607,8 +647,10 @@ function bp_friend_total_requests_count( $user_id = 0 ) { /** * Return the total friendship request count for a given user. * + * @since 1.2.0 + * * @param int $user_id ID of the user whose requests are being counted. - * Default: ID of the logged-in user. + * Default: ID of the logged-in user. * @return int Friend count. */ function bp_friend_get_total_requests_count( $user_id = 0 ) { @@ -618,7 +660,7 @@ function bp_friend_total_requests_count( $user_id = 0 ) { /** * Filters the total friendship request count for a given user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Friendship request count. */ @@ -630,10 +672,11 @@ function bp_friend_total_requests_count( $user_id = 0 ) { /** * Display the number of friends in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @uses bp_friends_get_profile_stats() to get the stats. * - * @param array $args before|after|user_id - * @uses bp_friends_get_profile_stats() to get the stats + * @param array|string $args before|after|user_id. */ function bp_friends_profile_stats( $args = '' ) { echo bp_friends_get_profile_stats( $args ); @@ -643,14 +686,14 @@ add_action( 'bp_members_admin_user_stats', 'bp_friends_profile_stats', 7, 1 ); /** * Return the number of friends in user's profile. * - * @since BuddyPress (2.0.0) + * @since 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_friends_get_profile_stats( $args = '' ) { - // Parse the args + // Parse the args. $r = bp_parse_args( $args, array( 'before' => '<li class="bp-friends-profile-stats">', 'after' => '</li>', @@ -659,18 +702,18 @@ function bp_friends_get_profile_stats( $args = '' ) { 'output' => '' ), 'friends_get_profile_stats' ); - // Allow completely overloaded output + // Allow completely overloaded output. if ( empty( $r['output'] ) ) { - // Only proceed if a user ID was passed + // Only proceed if a user ID was passed. if ( ! empty( $r['user_id'] ) ) { - // Get the user's friends + // Get the user's friends. if ( empty( $r['friends'] ) ) { $r['friends'] = absint( friends_get_total_friend_count( $r['user_id'] ) ); } - // If friends exist, show some formatted output + // If friends exist, show some formatted output. $r['output'] = $r['before'] . sprintf( _n( '%s friend', '%s friends', $r['friends'], 'buddypress' ), '<strong>' . $r['friends'] . '</strong>' ) . $r['after']; } } @@ -678,10 +721,10 @@ function bp_friends_get_profile_stats( $args = '' ) { /** * Filters the number of friends in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value Formatted string displaying total friends count. - * @param array $r Array of arguments for string formatting and output. + * @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 ad4205d31e02662483f8c9b28058893934455182..19e965c0ff8d2796b8ac74f4b226558b1c54b71a 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-widgets.php @@ -1,19 +1,21 @@ <?php /** - * BuddyPress Widgets + * BuddyPress Friends Widgets. * * @package BuddyPress * @subpackage Friends - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-core-friends-widget.php'; + /** * Register the friends widget. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_friends_register_widgets() { if ( ! bp_is_active( 'friends' ) ) { @@ -31,185 +33,12 @@ function bp_friends_register_widgets() { } add_action( 'bp_register_widgets', 'bp_friends_register_widgets' ); -/*** MEMBER FRIENDS WIDGET *****************/ - -/** - * The User Friends widget class. - * - * @since BuddyPress (1.9.0) - */ -class BP_Core_Friends_Widget extends WP_Widget { - - /** - * Class constructor. - */ - function __construct() { - $widget_ops = array( - 'description' => __( 'A dynamic list of recently active, popular, and newest Friends of the displayed member. Widget is only shown when viewing a member profile.', 'buddypress' ), - 'classname' => 'widget_bp_core_friends_widget buddypress widget', - ); - parent::__construct( false, $name = _x( '(BuddyPress) Friends', 'widget name', 'buddypress' ), $widget_ops ); - - } - - /** - * Display the widget. - * - * @param array $args Widget arguments. - * @param array $instance The widget settings, as saved by the user. - */ - function widget( $args, $instance ) { - extract( $args ); - - if ( ! bp_displayed_user_id() ) { - return; - } - - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() ); - - $user_id = bp_displayed_user_id(); - $link = trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ); - $instance['title'] = sprintf( __( '%s’s Friends', 'buddypress' ), bp_get_displayed_user_fullname() ); - - if ( empty( $instance['friend_default'] ) ) { - $instance['friend_default'] = 'active'; - } - - /** - * 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; - - $title = $instance['link_title'] ? '<a href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>' : esc_html( $title ); - - echo $before_title . $title . $after_title; - - $members_args = array( - 'user_id' => absint( $user_id ), - 'type' => sanitize_text_field( $instance['friend_default'] ), - 'max' => absint( $instance['max_friends'] ), - 'populate_extras' => 1, - ); - - ?> - - <?php if ( bp_has_members( $members_args ) ) : ?> - <div class="item-options" id="friends-list-options"> - <a href="<?php bp_members_directory_permalink(); ?>" id="newest-friends" <?php if ( $instance['friend_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a> - | <a href="<?php bp_members_directory_permalink(); ?>" id="recently-active-friends" <?php if ( $instance['friend_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a> - | <a href="<?php bp_members_directory_permalink(); ?>" id="popular-friends" <?php if ( $instance['friend_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></a> - </div> - - <ul id="friends-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['friend_default'] ) - bp_member_registered(); - if ( 'active' == $instance['friend_default'] ) - bp_member_last_active(); - if ( 'popular' == $instance['friend_default'] ) - bp_member_total_friend_count(); - ?> - </span> - </div> - </div> - </li> - - <?php endwhile; ?> - </ul> - <?php wp_nonce_field( 'bp_core_widget_friends', '_wpnonce-friends' ); ?> - <input type="hidden" name="friends_widget_max" id="friends_widget_max" value="<?php echo absint( $instance['max_friends'] ); ?>" /> - - <?php else: ?> - - <div class="widget-error"> - <?php _e( 'Sorry, no members were found.', 'buddypress' ); ?> - </div> - - <?php endif; ?> - - <?php echo $after_widget; ?> - <?php - } - - /** - * Process a widget save. - * - * @param array $new_instance The parameters saved by the user. - * @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 ) { - $instance = $old_instance; - - $instance['max_friends'] = absint( $new_instance['max_friends'] ); - $instance['friend_default'] = sanitize_text_field( $new_instance['friend_default'] ); - $instance['link_title'] = (bool) $new_instance['link_title']; - - return $instance; - } - - /** - * Render the widget edit form. - * - * @param array $instance The saved widget settings. - */ - function form( $instance ) { - $defaults = array( - 'max_friends' => 5, - 'friend_default' => 'active', - 'link_title' => false - ); - $instance = wp_parse_args( (array) $instance, $defaults ); - - $max_friends = $instance['max_friends']; - $friend_default = $instance['friend_default']; - $link_title = (bool) $instance['link_title']; - ?> - - <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-friends-max"><?php _e( 'Max friends to show:', 'buddypress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_friends' ); ?>" name="<?php echo $this->get_field_name( 'max_friends' ); ?>" type="text" value="<?php echo absint( $max_friends ); ?>" style="width: 30%" /></label></p> - - <p> - <label for="bp-core-widget-friends-default"><?php _e( 'Default friends to show:', 'buddypress' ); ?> - <select name="<?php echo $this->get_field_name( 'friend_default' ) ?>"> - <option value="newest" <?php selected( $friend_default, 'newest' ); ?>><?php _e( 'Newest', 'buddypress' ) ?></option> - <option value="active" <?php selected( $friend_default, 'active' );?>><?php _e( 'Active', 'buddypress' ) ?></option> - <option value="popular" <?php selected( $friend_default, 'popular' ); ?>><?php _e( 'Popular', 'buddypress' ) ?></option> - </select> - </label> - </p> - - <?php - } -} - /** Widget AJAX ***************************************************************/ /** * Process AJAX pagination or filtering for the Friends widget. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_core_ajax_widget_friends() { @@ -237,21 +66,21 @@ function bp_core_ajax_widget_friends() { ); if ( bp_has_members( $members_args ) ) : ?> - <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?> + <?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> + <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> + <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> + <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> + <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> + <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count(); ?></span></div> <?php endif; ?> </div> </li> @@ -259,7 +88,7 @@ function bp_core_ajax_widget_friends() { <?php else: ?> <?php echo "-1[[SPLIT]]<li>"; ?> - <?php _e( 'There were no members found, please try another filter.', 'buddypress' ) ?> + <?php _e( 'There were no members found, please try another filter.', 'buddypress' ); ?> <?php echo "</li>"; ?> <?php endif; } diff --git a/wp-content/plugins/buddypress/bp-friends/classes/class-bp-core-friends-widget.php b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-core-friends-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..a1ea9d4983bc32ad719643d59e0d375022c3779a --- /dev/null +++ b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-core-friends-widget.php @@ -0,0 +1,197 @@ +<?php +/** + * BuddyPress Friends Widget. + * + * @package BuddyPress + * @subpackage Friends + * @since 1.9.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The User Friends widget class. + * + * @since 1.9.0 + */ +class BP_Core_Friends_Widget extends WP_Widget { + + /** + * Class constructor. + * + * @since 1.9.0 + */ + function __construct() { + $widget_ops = array( + 'description' => __( 'A dynamic list of recently active, popular, and newest Friends of the displayed member. Widget is only shown when viewing a member profile.', 'buddypress' ), + 'classname' => 'widget_bp_core_friends_widget buddypress widget', + ); + parent::__construct( false, $name = _x( '(BuddyPress) Friends', 'widget name', 'buddypress' ), $widget_ops ); + + } + + /** + * Display the widget. + * + * @since 1.9.0 + * + * @param array $args Widget arguments. + * @param array $instance The widget settings, as saved by the user. + */ + function widget( $args, $instance ) { + global $members_template; + + extract( $args ); + + if ( ! bp_displayed_user_id() ) { + return; + } + + $min = bp_core_get_minified_asset_suffix(); + wp_enqueue_script( 'bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array( 'jquery' ), bp_get_version() ); + + $user_id = bp_displayed_user_id(); + $link = trailingslashit( bp_displayed_user_domain() . bp_get_friends_slug() ); + $instance['title'] = sprintf( __( "%s's Friends", 'buddypress' ), bp_get_displayed_user_fullname() ); + + if ( empty( $instance['friend_default'] ) ) { + $instance['friend_default'] = 'active'; + } + + /** + * Filters the Friends widget title. + * + * @since 1.8.0 + * @since 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 = $instance['link_title'] ? '<a href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>' : esc_html( $title ); + + echo $before_title . $title . $after_title; + + $members_args = array( + 'user_id' => absint( $user_id ), + 'type' => sanitize_text_field( $instance['friend_default'] ), + 'max' => absint( $instance['max_friends'] ), + 'populate_extras' => 1, + ); + + // Back up the global. + $old_members_template = $members_template; + + ?> + + <?php if ( bp_has_members( $members_args ) ) : ?> + <div class="item-options" id="friends-list-options"> + <a href="<?php bp_members_directory_permalink(); ?>" id="newest-friends" <?php if ( $instance['friend_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ); ?></a> + | <a href="<?php bp_members_directory_permalink(); ?>" id="recently-active-friends" <?php if ( $instance['friend_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ); ?></a> + | <a href="<?php bp_members_directory_permalink(); ?>" id="popular-friends" <?php if ( $instance['friend_default'] == 'popular' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ); ?></a> + </div> + + <ul id="friends-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['friend_default'] ) + bp_member_registered(); + if ( 'active' == $instance['friend_default'] ) + bp_member_last_active(); + if ( 'popular' == $instance['friend_default'] ) + bp_member_total_friend_count(); + ?> + </span> + </div> + </div> + </li> + + <?php endwhile; ?> + </ul> + <?php wp_nonce_field( 'bp_core_widget_friends', '_wpnonce-friends' ); ?> + <input type="hidden" name="friends_widget_max" id="friends_widget_max" value="<?php echo absint( $instance['max_friends'] ); ?>" /> + + <?php else: ?> + + <div class="widget-error"> + <?php _e( 'Sorry, no members were found.', 'buddypress' ); ?> + </div> + + <?php endif; ?> + + <?php echo $after_widget; + + // Restore the global. + $members_template = $old_members_template; + } + + /** + * Process a widget save. + * + * @since 1.9.0 + * + * @param array $new_instance The parameters saved by the user. + * @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 ) { + $instance = $old_instance; + + $instance['max_friends'] = absint( $new_instance['max_friends'] ); + $instance['friend_default'] = sanitize_text_field( $new_instance['friend_default'] ); + $instance['link_title'] = (bool) $new_instance['link_title']; + + return $instance; + } + + /** + * Render the widget edit form. + * + * @since 1.9.0 + * + * @param array $instance The saved widget settings. + * @return void + */ + function form( $instance ) { + $defaults = array( + 'max_friends' => 5, + 'friend_default' => 'active', + 'link_title' => false + ); + $instance = wp_parse_args( (array) $instance, $defaults ); + + $max_friends = $instance['max_friends']; + $friend_default = $instance['friend_default']; + $link_title = (bool) $instance['link_title']; + ?> + + <p><label for="<?php echo $this->get_field_id( 'link_title' ); ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title'); ?>" id="<?php echo $this->get_field_id( 'link_title' ); ?>" value="1" <?php checked( $link_title ); ?> /> <?php _e( 'Link widget title to Members directory', 'buddypress' ); ?></label></p> + + <p><label for="<?php echo $this->get_field_id( 'max_friends' ); ?>"><?php _e( 'Max friends to show:', 'buddypress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_friends' ); ?>" name="<?php echo $this->get_field_name( 'max_friends' ); ?>" type="text" value="<?php echo absint( $max_friends ); ?>" style="width: 30%" /></label></p> + + <p> + <label for="<?php echo $this->get_field_id( 'friend_default' ) ?>"><?php _e( 'Default friends to show:', 'buddypress' ); ?></label> + <select name="<?php echo $this->get_field_name( 'friend_default' ); ?>" id="<?php echo $this->get_field_id( 'friend_default' ); ?>"> + <option value="newest" <?php selected( $friend_default, 'newest' ); ?>><?php _e( 'Newest', 'buddypress' ); ?></option> + <option value="active" <?php selected( $friend_default, 'active' );?>><?php _e( 'Active', 'buddypress' ); ?></option> + <option value="popular" <?php selected( $friend_default, 'popular' ); ?>><?php _e( 'Popular', 'buddypress' ); ?></option> + </select> + </p> + + <?php + } +} diff --git a/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-component.php b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-component.php new file mode 100644 index 0000000000000000000000000000000000000000..cfe65d58c623f93c7ed2cc3404483428dc99bb31 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-component.php @@ -0,0 +1,270 @@ +<?php +/** + * BuddyPress Friends Streams Loader. + * + * The friends component is for users to create relationships with each other. + * + * @package BuddyPress + * @subpackage Friends + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Defines the BuddyPress Friends Component. + * + * @since 1.5.0 + */ +class BP_Friends_Component extends BP_Component { + + /** + * Start the friends component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'friends', + _x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 60 + ) + ); + } + + /** + * Include bp-friends files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes( $includes = array() ) { + $includes = array( + 'cache', + 'actions', + 'screens', + 'filters', + 'classes', + 'activity', + 'template', + 'functions', + 'notifications', + 'widgets', + ); + + parent::includes( $includes ); + } + + /** + * Set up bp-friends global settings. + * + * The BP_FRIENDS_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals( $args = array() ) { + $bp = buddypress(); + + // Deprecated. Do not use. + // Defined conditionally to support unit tests. + if ( ! defined( 'BP_FRIENDS_DB_VERSION' ) ) { + define( 'BP_FRIENDS_DB_VERSION', '1800' ); + } + + // Define a slug, if necessary. + if ( ! defined( 'BP_FRIENDS_SLUG' ) ) { + define( 'BP_FRIENDS_SLUG', $this->id ); + } + + // Global tables for the friends component. + $global_tables = array( + 'table_name' => $bp->table_prefix . 'bp_friends', + 'table_name_meta' => $bp->table_prefix . 'bp_friends_meta', + ); + + // All globals for the friends component. + // Note that global_tables is included in this array. + $args = array( + 'slug' => BP_FRIENDS_SLUG, + 'has_directory' => false, + 'search_string' => __( 'Search Friends...', 'buddypress' ), + 'notification_callback' => 'friends_format_notifications', + 'global_tables' => $global_tables + ); + + parent::setup_globals( $args ); + } + + /** + * Set up component navigation. + * + * @since 1.5.0 + * + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $access = bp_core_can_edit_settings(); + $slug = bp_get_friends_slug(); + $friends_link = trailingslashit( $user_domain . $slug ); + + // Add 'Friends' to the main navigation. + $count = friends_get_total_friend_count(); + $class = ( 0 === $count ) ? 'no-count' : 'count'; + $main_nav = array( + 'name' => sprintf( __( 'Friends <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ), + 'slug' => $slug, + 'position' => 60, + 'screen_function' => 'friends_screen_my_friends', + 'default_subnav_slug' => 'my-friends', + 'item_css_id' => $this->id + ); + + // Add the subnav items to the friends nav item. + $sub_nav[] = array( + 'name' => _x( 'Friendships', 'Friends screen sub nav', 'buddypress' ), + 'slug' => 'my-friends', + 'parent_url' => $friends_link, + 'parent_slug' => $slug, + 'screen_function' => 'friends_screen_my_friends', + 'position' => 10, + 'item_css_id' => 'friends-my-friends' + ); + + $sub_nav[] = array( + 'name' => _x( 'Requests', 'Friends screen sub nav', 'buddypress' ), + 'slug' => 'requests', + 'parent_url' => $friends_link, + 'parent_slug' => $slug, + 'screen_function' => 'friends_screen_requests', + 'position' => 20, + 'user_has_access' => $access + ); + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up bp-friends integration with the WordPress admin bar. + * + * @since 1.5.0 + * + * @see BP_Component::setup_admin_bar() for a description of arguments. + * + * @param array $wp_admin_nav See BP_Component::setup_admin_bar() + * for description. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() ); + + // Pending friend requests. + $count = count( friends_get_friendship_request_user_ids( bp_loggedin_user_id() ) ); + if ( !empty( $count ) ) { + $title = sprintf( _x( 'Friends <span class="count">%s</span>', 'My Account Friends menu', 'buddypress' ), bp_core_number_format( $count ) ); + $pending = sprintf( _x( 'Pending Requests <span class="count">%s</span>', 'My Account Friends menu sub nav', 'buddypress' ), bp_core_number_format( $count ) ); + } else { + $title = _x( 'Friends', 'My Account Friends menu', 'buddypress' ); + $pending = _x( 'No Pending Requests','My Account Friends menu sub nav', 'buddypress' ); + } + + // Add the "My Account" sub menus. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => $title, + 'href' => $friends_link + ); + + // My Friends. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-friendships', + 'title' => _x( 'Friendships', 'My Account Friends menu sub nav', 'buddypress' ), + 'href' => $friends_link, + 'position' => 10 + ); + + // Requests. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-requests', + 'title' => $pending, + 'href' => trailingslashit( $friends_link . 'requests' ), + 'position' => 20 + ); + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() { + + // Adjust title. + if ( bp_is_friends_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = __( 'Friendships', 'buddypress' ); + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups. + * + * @since 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/classes/class-bp-friends-friendship.php b/wp-content/plugins/buddypress/bp-friends/classes/class-bp-friends-friendship.php index 5181c4ad293c7c4650d19ad2fcb67a896a3486fc..7617c1dc4ea662290e71d1f8f468b312817fe60a 100644 --- 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 @@ -1,23 +1,26 @@ <?php /** - * BuddyPress Friends Classes + * BuddyPress Friends Classes. * * @package BuddyPress * @subpackage FriendsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * BuddyPress Friendship object. + * + * @since 1.0.0 */ class BP_Friends_Friendship { /** * ID of the friendship. * - * @access public + * @since 1.0.0 * @var int */ public $id; @@ -25,7 +28,7 @@ class BP_Friends_Friendship { /** * User ID of the friendship initiator. * - * @access public + * @since 1.0.0 * @var int */ public $initiator_user_id; @@ -33,7 +36,7 @@ class BP_Friends_Friendship { /** * User ID of the 'friend' - the one invited to the friendship. * - * @access public + * @since 1.0.0 * @var int */ public $friend_user_id; @@ -41,7 +44,7 @@ class BP_Friends_Friendship { /** * Has the friendship been confirmed/accepted? * - * @access public + * @since 1.0.0 * @var int */ public $is_confirmed; @@ -51,7 +54,7 @@ class BP_Friends_Friendship { * * Not currently used by BuddyPress. * - * @access public + * @since 1.0.0 * @var int */ public $is_limited; @@ -59,7 +62,7 @@ class BP_Friends_Friendship { /** * Date the friendship was created. * - * @access public + * @since 1.0.0 * @var string */ public $date_created; @@ -69,15 +72,15 @@ class BP_Friends_Friendship { * * Not currently used in BuddyPress. * - * @access public - * @var unknown + * @since 1.0.0 + * @var bool */ public $is_request; /** * Should additional friend details be queried? * - * @access public + * @since 1.0.0 * @var bool */ public $populate_friend_details; @@ -85,7 +88,7 @@ class BP_Friends_Friendship { /** * Details about the friend. * - * @access public + * @since 1.0.0 * @var BP_Core_User */ public $friend; @@ -93,10 +96,11 @@ class BP_Friends_Friendship { /** * 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. + * @since 1.5.0 + * + * @param int|null $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; @@ -110,6 +114,8 @@ class BP_Friends_Friendship { /** * Set up data about the current friendship. + * + * @since 1.0.0 */ public function populate() { global $wpdb; @@ -136,6 +142,8 @@ class BP_Friends_Friendship { /** * Save the current friendship to the database. * + * @since 1.0.0 + * * @return bool True on success, false on failure. */ public function save() { @@ -152,17 +160,17 @@ class BP_Friends_Friendship { /** * Fires before processing and saving the current friendship request. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param Object $value Current friendship request object. */ do_action_ref_array( 'friends_friendship_before_save', array( &$this ) ); - // Update + // 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 + // 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; @@ -171,7 +179,7 @@ class BP_Friends_Friendship { /** * Fires after processing and saving the current friendship request. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param Object $value Current friendship request object. */ @@ -180,6 +188,13 @@ class BP_Friends_Friendship { return $result; } + /** + * Delete the current friendship from the database. + * + * @since 1.0.0 + * + * @return bool|int + */ public function delete() { global $wpdb; @@ -193,12 +208,15 @@ class BP_Friends_Friendship { /** * Get the IDs of a given user's friends. * - * @param int $user_id ID of the user whose friends are being retrieved. + * @since 1.0.0 + * + * @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. + * 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. + * @return array $fids IDs of friends for provided user. */ public static function get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) { global $wpdb; @@ -229,10 +247,11 @@ class BP_Friends_Friendship { /** * Get the ID of the friendship object, if any, between a pair of users. * - * @param int $user_id The ID of the first user. + * @since 1.0.0 + * + * @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. + * @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; @@ -245,8 +264,10 @@ class BP_Friends_Friendship { /** * Get a list of IDs of users who have requested friendship of a given user. * + * @since 1.2.0 + * * @param int $user_id The ID of the user who has received the - * friendship requests. + * 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 ) { @@ -268,9 +289,11 @@ class BP_Friends_Friendship { /** * Get a total friend count for a given user. * + * @since 1.0.0 + * * @param int $user_id Optional. ID of the user whose friendships you - * are counting. Default: displayed user (if any), otherwise - * logged-in user. + * 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 ) { @@ -281,12 +304,14 @@ class BP_Friends_Friendship { $bp = buddypress(); - /* This is stored in 'total_friend_count' usermeta. - This function will recalculate, update and return. */ + /* + * 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 + // 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; @@ -298,28 +323,32 @@ class BP_Friends_Friendship { /** * 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). + * @since 1.0.0 + * + * @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|null $limit Optional. Max number of friends to return. + * @param int|null $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. + * @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. + /* + * 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) + // name (@todo - figure out why this restriction). $search_terms_like = bp_esc_like( $filter ) . '%'; $pag_sql = ''; @@ -337,12 +366,12 @@ class BP_Friends_Friendship { $bp = buddypress(); - // filter the user_ids based on the search criteria. + // 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 ); + $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 ); } @@ -361,14 +390,16 @@ class BP_Friends_Friendship { * 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) + * sent the initial request). * - * @param int $initiator_userid The ID of the user who is the initiator - * of the potential friendship/request. + * @since 1.0.0 + * + * @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'. + * recipient of the potential friendship/request. + * @return string $value 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; @@ -399,16 +430,18 @@ class BP_Friends_Friendship { * * @todo Why is this in the Friends component? * + * @since 1.0.0 + * * @param array $user_ids IDs of users whose last_active meta is - * being queried. - * @return array Array of last_active values + user_ids. + * being queried. + * @return array $retval 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 + // Sort and structure as expected in legacy function. usort( $last_activities, create_function( '$a, $b', ' if ( $a["date_recorded"] == $b["date_recorded"] ) { return 0; @@ -432,6 +465,8 @@ class BP_Friends_Friendship { /** * Mark a friendship as accepted. * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship to be accepted. * @return int Number of database rows updated. */ @@ -440,12 +475,14 @@ class BP_Friends_Friendship { $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() ) ); + 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. * + * @since 1.6.0 + * * @param int $friendship_id ID of the friendship to be withdrawn. * @return int Number of database rows deleted. */ @@ -460,6 +497,8 @@ class BP_Friends_Friendship { /** * Remove a friendship or a friendship request MADE OF the logged-in user. * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship to be rejected. * @return int Number of database rows deleted. */ @@ -476,18 +515,20 @@ class BP_Friends_Friendship { * * @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). + * @since 1.0.0 + * + * @param string $filter String to search by. + * @param int $user_id A user ID param that is unused. + * @param int|null $limit Optional. Max number of records to return. + * @param int|null $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) + // name (@todo - figure out why this restriction). $search_terms_like = bp_esc_like( $filter ) . '%'; $usermeta_table = $wpdb->base_prefix . 'usermeta'; @@ -499,7 +540,7 @@ class BP_Friends_Friendship { $bp = buddypress(); - // filter the user_ids based on the search criteria. + // 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 { @@ -519,6 +560,8 @@ class BP_Friends_Friendship { * * @todo Why does this exist, and why is it in bp-friends? * + * @since 1.0.0 + * * @param string $filter Search term. * @return int Count of users matching the search term. */ @@ -526,7 +569,7 @@ class BP_Friends_Friendship { global $wpdb; // Only search for matching strings at the beginning of the - // name (@todo - figure out why this restriction) + // name (@todo - figure out why this restriction). $search_terms_like = bp_esc_like( $filter ) . '%'; $usermeta_table = $wpdb->prefix . 'usermeta'; @@ -534,7 +577,7 @@ class BP_Friends_Friendship { $bp = buddypress(); - // filter the user_ids based on the search criteria. + // 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 { @@ -554,6 +597,8 @@ class BP_Friends_Friendship { * * @todo Why does this exist, and why is it in bp-friends? * + * @since 1.0.0 + * * @param array $user_ids Array of user IDs. * @return array User IDs, sorted by the associated display names. */ @@ -573,11 +618,13 @@ class BP_Friends_Friendship { /** * Get a list of random friend IDs. * - * @param int $user_id ID of the user whose friends are being retrieved. + * @since 1.0.0 + * + * @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. + * Default: 5. * @return array|bool An array of random friend user IDs on success; - * false if none are found. + * false if none are found. */ public static function get_random_friends( $user_id, $total_friends = 5 ) { global $wpdb; @@ -591,7 +638,7 @@ class BP_Friends_Friendship { $fids[] = ( $results[$i]->friend_user_id == $user_id ) ? $results[$i]->initiator_user_id : $results[$i]->friend_user_id; } - // remove duplicates + // Remove duplicates. if ( count( $fids ) > 0 ) return array_flip( array_flip( $fids ) ); else @@ -607,28 +654,30 @@ class BP_Friends_Friendship { * - 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. + * @since 1.0.0 + * + * @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 + // 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 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 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 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; @@ -641,6 +690,8 @@ class BP_Friends_Friendship { /** * Get the friend user IDs for a given friendship. * + * @since 1.0.0 + * * @param int $friendship_id ID of the friendship. * @return object friend_user_id and initiator_user_id. */ @@ -655,6 +706,8 @@ class BP_Friends_Friendship { /** * Delete all friendships and friend notifications related to a user. * + * @since 1.0.0 + * * @param int $user_id ID of the user being expunged. */ public static function delete_all_for_user( $user_id ) { @@ -662,10 +715,10 @@ class BP_Friends_Friendship { $bp = buddypress(); - // Get friends of $user_id + // Get friends of $user_id. $friend_ids = BP_Friends_Friendship::get_friend_user_ids( $user_id ); - // Delete all friendships related to $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 @@ -674,7 +727,7 @@ class BP_Friends_Friendship { $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 + // 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.min.js b/wp-content/plugins/buddypress/bp-friends/js/widget-friends.min.js index 7651285184c6416b16c64d906983d0a081d38811..30ad64768b0b676ddc1812454fb3a7687094ea7a 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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/js/admin.min.js b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js index 0f54f3d1d6e62659cbe50ff34bbe23c376917c14..a73ef2bd7619a2705a2cc09e125f7811f4a92a9c 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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 8f46fcc7077c86c30096c09b7a02221e5b2d33dd..d8b4e7990c1a3500640d33fd700130cbce098103 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Groups Actions + * BuddyPress Groups 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 @@ -9,15 +8,16 @@ * * @package BuddyPress * @subpackage GroupsActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Protect access to single groups. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_groups_group_access_protection() { if ( ! bp_is_group() ) { @@ -29,11 +29,11 @@ function bp_groups_group_access_protection() { $no_access_args = array(); if ( ! $user_has_access && 'hidden' !== $current_group->status ) { - // Always allow access to home and request-membership + // Always allow access to home and request-membership. if ( bp_is_current_action( 'home' ) || bp_is_current_action( 'request-membership' ) ) { $user_has_access = true; - // User doesn't have access, so set up redirect args + // User doesn't have access, so set up redirect args. } elseif ( is_user_logged_in() ) { $no_access_args = array( 'message' => __( 'You do not have access to this group.', 'buddypress' ), @@ -43,7 +43,7 @@ function bp_groups_group_access_protection() { } } - // Protect the admin tab from non-admins + // Protect the admin tab from non-admins. if ( bp_is_current_action( 'admin' ) && ! bp_is_item_admin() ) { $user_has_access = false; $no_access_args = array( @@ -60,25 +60,24 @@ function bp_groups_group_access_protection() { * want to change the $no_access_args, to avoid problems such as * logged-in users being redirected to wp-login.php. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param bool $user_has_access True if the user has access to the - * content, otherwise false. - * @param array $no_access_args Arguments to be passed to - * bp_core_no_access() in case of no access. Note that this - * value is passed by reference, so it can be modified by the - * filter callback. + * @param bool $user_has_access True if the user has access to the + * content, otherwise false. + * @param array $no_access_args Arguments to be passed to bp_core_no_access() in case + * of no access. Note that this value is passed by reference, + * so it can be modified by the filter callback. */ $user_has_access = apply_filters_ref_array( 'bp_group_user_has_access', array( $user_has_access, &$no_access_args ) ); - // If user has access, we return rather than redirect + // If user has access, we return rather than redirect. if ( $user_has_access ) { return; } // Hidden groups should return a 404 for non-members. // Unset the current group so that you're not redirected - // to the default group tab + // to the default group tab. if ( 'hidden' == $current_group->status ) { buddypress()->groups->current_group = 0; buddypress()->is_single_item = false; @@ -93,27 +92,31 @@ add_action( 'bp_actions', 'bp_groups_group_access_protection' ); /** * Catch and process group creation form submissions. + * + * @since 1.2.0 + * + * @return bool */ function groups_action_create_group() { - // If we're not at domain.org/groups/create/ then return false + // If we're not at domain.org/groups/create/ then return false. if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) ) return false; if ( !is_user_logged_in() ) return false; - if ( !bp_user_can_create_groups() ) { + if ( !bp_user_can_create_groups() ) { bp_core_add_message( __( 'Sorry, you are not allowed to create groups.', 'buddypress' ), 'error' ); bp_core_redirect( bp_get_groups_directory_permalink() ); } $bp = buddypress(); - // Make sure creation steps are in the right order + // Make sure creation steps are in the right order. groups_action_sort_creation_steps(); - // If no current step is set, reset everything so we can start a fresh group creation + // If no current step is set, reset everything so we can start a fresh group creation. $bp->groups->current_create_step = bp_action_variable( 1 ); if ( !bp_get_groups_current_create_step() ) { unset( $bp->groups->current_create_step ); @@ -127,32 +130,32 @@ function groups_action_create_group() { 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 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( trailingslashit( bp_get_groups_directory_permalink() . 'create' ) ); } - // Fetch the currently completed steps variable + // Fetch the currently completed steps variable. if ( isset( $_COOKIE['bp_completed_create_steps'] ) && !isset( $reset_steps ) ) $bp->groups->completed_create_steps = json_decode( base64_decode( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ) ); - // Set the ID of the new group, if it has already been created in a previous step + // Set the ID of the new group, if it has already been created in a previous step. if ( isset( $_COOKIE['bp_new_group_id'] ) ) { $bp->groups->new_group_id = (int) $_COOKIE['bp_new_group_id']; $bp->groups->current_group = groups_get_group( array( 'group_id' => $bp->groups->new_group_id ) ); - // Only allow the group creator to continue to edit the new group + // Only allow the group creator to continue to edit the new group. if ( ! bp_is_group_creator( $bp->groups->current_group, bp_loggedin_user_id() ) ) { bp_core_add_message( __( 'Only the group creator may continue editing this group.', 'buddypress' ), 'error' ); bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create' ) ); } } - // If the save, upload or skip button is hit, lets calculate what we need to save + // If the save, upload or skip button is hit, lets calculate what we need to save. if ( isset( $_POST['save'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'groups_create_save_' . bp_get_groups_current_create_step() ); if ( 'group-details' == bp_get_groups_current_create_step() ) { @@ -176,7 +179,7 @@ function groups_action_create_group() { if ( !isset($_POST['group-show-forum']) ) { $group_enable_forum = 0; } else { - // Create the forum if enable_forum = 1 + // Create the forum if enable_forum = 1. if ( bp_is_active( 'forums' ) && !groups_get_groupmeta( $bp->groups->new_group_id, 'forum_id' ) ) { groups_new_group_forum(); } @@ -195,7 +198,7 @@ function groups_action_create_group() { /** * Filters the allowed invite statuses. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $value Array of statuses allowed. * Possible values are 'members, @@ -211,7 +214,7 @@ function groups_action_create_group() { if ( ! empty( $_POST['friends'] ) ) { foreach ( (array) $_POST['friends'] as $friend ) { groups_invite_user( array( - 'user_id' => $friend, + 'user_id' => (int) $friend, 'group_id' => $bp->groups->new_group_id, ) ); } @@ -226,7 +229,7 @@ function groups_action_create_group() { * This hook is a variable hook dependent on the current step * in the creation process. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_create_group_step_save_' . bp_get_groups_current_create_step() ); @@ -235,7 +238,7 @@ function groups_action_create_group() { * * Mostly for clearing cache on a generic action name. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_create_group_step_complete' ); @@ -248,12 +251,12 @@ function groups_action_create_group() { if ( !in_array( bp_get_groups_current_create_step(), $completed_create_steps ) ) $bp->groups->completed_create_steps[] = bp_get_groups_current_create_step(); - // Reset cookie info + // Reset cookie info. setcookie( 'bp_new_group_id', $bp->groups->new_group_id, time()+60*60*24, COOKIEPATH ); setcookie( 'bp_completed_create_steps', base64_encode( json_encode( $bp->groups->completed_create_steps ) ), time()+60*60*24, COOKIEPATH ); // If we have completed all steps and hit done on the final step we - // can redirect to the completed group + // can redirect to the completed group. $keys = array_keys( $bp->groups->group_creation_steps ); if ( count( $bp->groups->completed_create_steps ) == count( $keys ) && bp_get_groups_current_create_step() == array_pop( $keys ) ) { unset( $bp->groups->current_create_step ); @@ -271,7 +274,7 @@ function groups_action_create_group() { /** * Fires after the group has been successfully created. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $new_group_id ID of the newly created group. */ @@ -299,7 +302,7 @@ function groups_action_create_group() { } } - // Remove invitations + // Remove invitations. if ( 'group-invites' === bp_get_groups_current_create_step() && ! empty( $_REQUEST['user_id'] ) && is_numeric( $_REQUEST['user_id'] ) ) { if ( ! check_admin_referer( 'groups_invite_uninvite_user' ) ) { return false; @@ -317,39 +320,37 @@ function groups_action_create_group() { bp_core_redirect( trailingslashit( bp_get_groups_directory_permalink() . 'create/step/group-invites' ) ); } - // Group avatar is handled separately + // Group avatar is handled separately. if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) { if ( ! isset( $bp->avatar_admin ) ) { $bp->avatar_admin = new stdClass(); } if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) { - // Normally we would check a nonce here, but the group save nonce is used instead - - // Pass the file to the avatar upload handler + // Normally we would check a nonce here, but the group save nonce is used instead. + // Pass the file to the avatar upload handler. if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) { $bp->avatar_admin->step = 'crop-image'; - // Make sure we include the jQuery jCrop file for image cropping + // Make sure we include the jQuery jCrop file for image cropping. add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' ); } } - // If the image cropping is done, crop the image and save a full/thumb version + // If the image cropping is done, crop the image and save a full/thumb version. if ( isset( $_POST['avatar-crop-submit'] ) && isset( $_POST['upload'] ) ) { - // Normally we would check a nonce here, but the group save nonce is used instead - + // Normally we would check a nonce here, but the group save nonce is used instead. if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) bp_core_add_message( __( 'There was an error saving the group profile photo, please try uploading again.', 'buddypress' ), 'error' ); else - bp_core_add_message( __( 'The group profile photo was uploaded successfully!', 'buddypress' ) ); + bp_core_add_message( __( 'The group profile photo was uploaded successfully.', 'buddypress' ) ); } } /** * Filters the template to load for the group creation screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to the group creation template to load. */ @@ -359,22 +360,26 @@ add_action( 'bp_actions', 'groups_action_create_group' ); /** * Catch and process "Join Group" button clicks. + * + * @since 1.0.0 + * + * @return bool */ function groups_action_join_group() { if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) ) return false; - // Nonce check + // Nonce check. if ( !check_admin_referer( 'groups_join_group' ) ) return false; $bp = buddypress(); - // Skip if banned or already a member + // Skip if banned or already a member. if ( !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { - // User wants to join a group that is not public + // User wants to join a group that is not public. if ( $bp->groups->current_group->status != 'public' ) { if ( !groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' ); @@ -382,7 +387,7 @@ function groups_action_join_group() { } } - // User wants to join any group + // User wants to join any group. if ( !groups_join_group( $bp->groups->current_group->id ) ) bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' ); else @@ -394,7 +399,7 @@ function groups_action_join_group() { /** * Filters the template to load for the single group screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to the single group template to load. */ @@ -411,26 +416,28 @@ add_action( 'bp_actions', 'groups_action_join_group' ); * Note: When leaving a group from the group directory, AJAX is used and * another function handles this. See {@link bp_legacy_theme_ajax_joinleave_group()}. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 + * + * @return bool */ function groups_action_leave_group() { if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'leave-group' ) ) { return false; } - // Nonce check + // Nonce check. if ( ! check_admin_referer( 'groups_leave_group' ) ) { return false; } - // User wants to leave any group + // User wants to leave any group. if ( groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) { $bp = buddypress(); - // Stop sole admins from abandoning their group + // Stop sole admins from abandoning their group. $group_admins = groups_get_group_admins( bp_get_current_group_id() ); - if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() ) { + if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == bp_loggedin_user_id() ) { bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' ); } elseif ( ! groups_leave_group( $bp->groups->current_group->id ) ) { bp_core_add_message( __( 'There was an error leaving the group.', 'buddypress' ), 'error' ); @@ -455,6 +462,8 @@ add_action( 'bp_actions', 'groups_action_leave_group' ); /** * Sort the group creation steps. * + * @since 1.1.0 + * * @return false|null False on failure. */ function groups_action_sort_creation_steps() { @@ -474,7 +483,7 @@ function groups_action_sort_creation_steps() { $temp[$step['position']] = array( 'name' => $step['name'], 'slug' => $slug ); } - // Sort the steps by their position key + // Sort the steps by their position key. ksort($temp); unset($bp->groups->group_creation_steps); @@ -491,6 +500,8 @@ function groups_action_sort_creation_steps() { /** * Catch requests for a random group page (example.com/groups/?random-group) and redirect. + * + * @since 1.2.0 */ function groups_action_redirect_to_random_group() { @@ -505,25 +516,25 @@ add_action( 'bp_actions', 'groups_action_redirect_to_random_group' ); /** * Load the activity feed for the current group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @return false|null False on failure. */ function groups_action_group_feed() { - // get current group + // Get current group. $group = groups_get_current_group(); if ( ! bp_is_active( 'activity' ) || ! bp_is_groups_component() || ! $group || ! bp_is_current_action( 'feed' ) ) return false; - // if group isn't public or if logged-in user is not a member of the group, do - // not output the group activity feed + // If group isn't public or if logged-in user is not a member of the group, do + // not output the group activity feed. if ( ! bp_group_is_visible( $group ) ) { return false; } - // setup the feed + // Set up the feed. buddypress()->activity->feed = new BP_Activity_Feed( array( 'id' => 'group', 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 65efa6fd05c029e1d637dce160e21d19dfeb8d89..4ff1290f98ee23433b5d8381c0564385429ac820 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Activity Functions. * @@ -8,14 +7,17 @@ * * @package BuddyPress * @subpackage GroupsActivity + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Register activity actions for the Groups component. * + * @since 1.1.0 + * * @return bool|null False on failure. */ function groups_register_activity_actions() { @@ -54,7 +56,7 @@ function groups_register_activity_actions() { // These actions are for the legacy forums // Since the bbPress plugin also shares the same 'forums' identifier, we also - // check for the legacy forums loader class to be extra cautious + // check for the legacy forums loader class to be extra cautious. if ( bp_is_active( 'forums' ) && class_exists( 'BP_Forums_Component' ) ) { bp_activity_set_action( $bp->groups->id, @@ -78,7 +80,7 @@ function groups_register_activity_actions() { /** * Fires at end of registration of the default activity actions for the Groups component. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_register_activity_actions' ); } @@ -87,11 +89,10 @@ add_action( 'bp_register_activity_actions', 'groups_register_activity_actions' ) /** * Format 'created_group' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action Static activity action. * @param object $activity Activity data object. - * * @return string */ function bp_groups_format_activity_action_created_group( $action, $activity ) { @@ -108,7 +109,7 @@ function bp_groups_format_activity_action_created_group( $action, $activity ) { /** * Filters the 'created_group' activity actions. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $action The 'created_group' activity action. * @param object $activity Activity data object. @@ -119,11 +120,10 @@ function bp_groups_format_activity_action_created_group( $action, $activity ) { /** * Format 'joined_group' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action Static activity action. * @param object $activity Activity data object. - * * @return string */ function bp_groups_format_activity_action_joined_group( $action, $activity ) { @@ -138,12 +138,12 @@ function bp_groups_format_activity_action_joined_group( $action, $activity ) { $action = sprintf( __( '%1$s joined the group %2$s', 'buddypress' ), $user_link, $group_link ); // Legacy filters (do not follow parameter patterns of other activity - // action filters, and requires apply_filters_ref_array()) + // action filters, and requires apply_filters_ref_array()). if ( has_filter( 'groups_activity_membership_accepted_action' ) ) { $action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( $action, $user_link, &$group ) ); } - // Another legacy filter + // Another legacy filter. if ( has_filter( 'groups_activity_accepted_invite_action' ) ) { $action = apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( $action, $activity->user_id, &$group ) ); } @@ -151,7 +151,7 @@ function bp_groups_format_activity_action_joined_group( $action, $activity ) { /** * Filters the 'joined_group' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action The 'joined_group' activity actions. * @param object $activity Activity data object. @@ -162,11 +162,10 @@ function bp_groups_format_activity_action_joined_group( $action, $activity ) { /** * Format 'group_details_updated' activity actions. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -205,7 +204,7 @@ function bp_groups_format_activity_action_group_details_updated( $action, $activ /** * Filters the 'group_details_updated' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action The 'group_details_updated' activity actions. * @param object $activity Activity data object. @@ -218,10 +217,9 @@ function bp_groups_format_activity_action_group_details_updated( $action, $activ * * This reduces database overhead during the activity loop. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $activities Array of activity items. - * * @return array */ function bp_groups_prefetch_activity_object_data( $activities ) { @@ -243,7 +241,7 @@ function bp_groups_prefetch_activity_object_data( $activities ) { // TEMPORARY - Once the 'populate_extras' issue is solved // in the groups component, we can do this with groups_get_groups() - // rather than manually + // rather than manually. $uncached_ids = array(); foreach ( $group_ids as $group_id ) { if ( false === wp_cache_get( $group_id, 'bp_groups' ) ) { @@ -269,16 +267,15 @@ add_filter( 'bp_activity_prefetch_object_data', 'bp_groups_prefetch_activity_obj /** * 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 + * @since 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 + // Determine the user_id. if ( ! empty( $filter['user_id'] ) ) { $user_id = $filter['user_id']; } else { @@ -287,7 +284,7 @@ function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) : bp_loggedin_user_id(); } - // Determine groups of user + // Determine groups of user. $groups = groups_get_user_groups( $user_id ); if ( empty( $groups['groups'] ) ) { $groups = array( 'groups' => 0 ); @@ -318,7 +315,7 @@ function bp_groups_filter_activity_scope( $retval = array(), $filter = array() ) ), $show_hidden, - // overrides + // Overrides. 'override' => array( 'filter' => array( 'user_id' => 0 ), 'show_hidden' => true @@ -335,6 +332,8 @@ add_filter( 'bp_activity_set_groups_scope_args', 'bp_groups_filter_activity_scop * A wrapper for {@link bp_activity_add()} that provides some Groups-specific * defaults. * + * @since 1.0.0 + * * @see bp_activity_add() for more detailed description of parameters and * return values. * @@ -355,7 +354,7 @@ function groups_record_activity( $args = '' ) { return false; } - // Set the default for hide_sitewide by checking the status of the group + // Set the default for hide_sitewide by checking the status of the group. $hide_sitewide = false; if ( !empty( $args['item_id'] ) ) { if ( bp_get_current_group_id() == $args['item_id'] ) { @@ -389,9 +388,10 @@ function groups_record_activity( $args = '' ) { /** * Update the last_activity meta value for a given group. * + * @since 1.0.0 + * * @param int $group_id Optional. The ID of the group whose last_activity is * being updated. Default: the current group's ID. - * * @return bool|null False on failure. */ function groups_update_last_activity( $group_id = 0 ) { @@ -415,27 +415,26 @@ add_action( 'groups_new_forum_topic_post', 'groups_update_last_activity' ); /** * Add an activity stream item when a member joins a group. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user joining the group. * @param int $group_id ID of the group. - * * @return bool|null False on failure. */ function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) { - // Bail if Activity is not active + // Bail if Activity is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } - // Get the group so we can get it's name + // Get the group so we can get it's name. $group = groups_get_group( array( 'group_id' => $group_id ) ); /** * Filters the 'membership_accepted' activity actions. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value The 'membership_accepted' activity action. * @param int $user_id ID of the user joining the group. @@ -443,7 +442,7 @@ function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) { */ $action = apply_filters_ref_array( 'groups_activity_membership_accepted_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress' ), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $user_id, &$group ) ); - // Record in activity streams + // Record in activity streams. groups_record_activity( array( 'action' => $action, 'type' => 'joined_group', @@ -456,12 +455,11 @@ add_action( 'groups_membership_accepted', 'bp_groups_membership_accepted_add_act /** * Add an activity item when a group's details are updated. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -475,7 +473,7 @@ function bp_groups_group_details_updated_add_activity( $group_id, $old_group, $n return false; } - // If the admin has opted not to notify members, don't post an activity item either + // If the admin has opted not to notify members, don't post an activity item either. if ( empty( $notify_members ) ) { return; } @@ -529,7 +527,7 @@ add_action( 'groups_details_updated', 'bp_groups_group_details_updated_add_activ /** * Delete all activity items related to a specific group. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $group_id ID of the group. */ @@ -550,22 +548,22 @@ add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_activity', * joined_group activity so users cannot flood the activity stream by * joining/leaving the group in quick succession. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $group_id ID of 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 ) { - // Bail if Activity component is not active + // Bail if Activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return; } - // Get the member's group membership information + // Get the member's group membership information. $membership = new BP_Groups_Member( $user_id, $group_id ); - // Check the time period, and maybe delete their recent group activity + // Check the time period, and maybe delete their recent group activity. if ( time() <= strtotime( '+5 minutes', (int) strtotime( $membership->date_modified ) ) ) { bp_activity_delete( array( 'component' => buddypress()->groups->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 46a105712834c6ad8557e973c70929d76cfd46f0..04a3dfdeafa645cdee88e1f43788860a3f206c31 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php @@ -6,28 +6,30 @@ * help text, on which this implementation is heavily based. * * @package BuddyPress - * @since BuddyPress (1.7.0) * @subpackage Groups + * @since 1.7.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -// Include WP's list table class +// Include WP's list table class. if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); -// per_page screen option. Has to be hooked in extremely early. +require dirname( __FILE__ ) . '/classes/class-bp-groups-list-table.php'; + +// The per_page screen option. Has to be hooked in extremely early. if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] ) add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 ); /** * Register the Groups component admin screen. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_groups_add_admin_menu() { - // Add our screen + // Add our screen. $hook = add_menu_page( _x( 'Groups', 'Admin Groups page title', 'buddypress' ), _x( 'Groups', 'Admin Groups menu', 'buddypress' ), @@ -48,10 +50,9 @@ add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' ); * This ensures that the Groups menu item appears in the proper order on the * main Dashboard menu. * - * @since BuddyPress (1.7.0) + * @since 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() ) { @@ -67,31 +68,29 @@ add_filter( 'bp_admin_menu_order', 'bp_groups_admin_menu_order' ); * including: processing form requests, registering contextual help, and * setting up screen options. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table. */ function bp_groups_admin_load() { global $bp_groups_list_table; - // Build redirection URL + // Build redirection URL. $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] ); - // Decide whether to load the dev version of the CSS and JavaScript - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : 'min.'; - - $doaction = bp_admin_list_table_current_bulk_action(); + $doaction = bp_admin_list_table_current_bulk_action(); + $min = bp_core_get_minified_asset_suffix(); /** * Fires at top of groups admin page. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $doaction Current $_GET action being performed in admin screen. */ do_action( 'bp_groups_admin_load', $doaction ); - // Edit screen + // Edit screen. if ( 'do_delete' == $doaction && ! empty( $_GET['gid'] ) ) { check_admin_referer( 'bp-groups-delete' ); @@ -110,7 +109,7 @@ function bp_groups_admin_load() { bp_core_redirect( $redirect_to ); } elseif ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { - // columns screen option + // Columns screen option. add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); get_current_screen()->add_help_tab( array( @@ -121,7 +120,7 @@ function bp_groups_admin_load() { '<p>' . __( '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 clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen.', 'buddypress' ) . '</p>' ) ); - // Help panel - sidebar links + // Help panel - sidebar links. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . '<p><a href="https://buddypress.org/support">' . __( 'Support Forums', 'buddypress' ) . '</a></p>' @@ -136,23 +135,23 @@ function bp_groups_admin_load() { /** * Fires after the registration of all of the default group meta boxes. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_groups_admin_meta_boxes' ); - // Enqueue JavaScript files + // Enqueue JavaScript files. wp_enqueue_script( 'postbox' ); wp_enqueue_script( 'dashboard' ); - // Index screen + // Index screen. } else { - // Create the Groups screen list table + // Create the Groups screen list table. $bp_groups_list_table = new BP_Groups_List_Table(); - // per_page screen option + // The per_page screen option. add_screen_option( 'per_page', array( 'label' => _x( 'Groups', 'Groups per page (screen options)', 'buddypress' )) ); - // Help panel - overview text + // Help panel - overview text. get_current_screen()->add_help_tab( array( 'id' => 'bp-groups-overview', 'title' => __( 'Overview', 'buddypress' ), @@ -169,22 +168,29 @@ function bp_groups_admin_load() { '<p>' . __( '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 to a page where you’ll be asked to confirm the permanent deletion of the group(s).', 'buddypress' ) . '</p>', ) ); - // Help panel - sidebar links + // Help panel - sidebar links. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' ); + + // Add accessible hidden heading and text for Groups screen pagination. + if ( bp_get_major_wp_version() >= 4.4 ) { + get_current_screen()->set_screen_reader_content( array( + 'heading_pagination' => __( 'Groups list navigation', 'buddypress' ), + ) ); + } } $bp = buddypress(); - // Enqueue CSS and JavaScript - wp_enqueue_script( 'bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true ); + // Enqueue CSS and JavaScript. + wp_enqueue_script( 'bp_groups_admin_js', $bp->plugin_url . "bp-groups/admin/js/admin{$min}.js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true ); wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array( 'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ), 'warn_on_leave' => __( 'If you leave this page, you will lose any unsaved changes you have made to the group.', 'buddypress' ), ) ); - wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() ); + wp_enqueue_style( 'bp_groups_admin_css', $bp->plugin_url . "bp-groups/admin/css/admin{$min}.css", array(), bp_get_version() ); wp_style_add_data( 'bp_groups_admin_css', 'rtl', true ); if ( $min ) { @@ -193,7 +199,7 @@ function bp_groups_admin_load() { if ( $doaction && 'save' == $doaction ) { - // Get group ID + // Get group ID. $group_id = isset( $_REQUEST['gid'] ) ? (int) $_REQUEST['gid'] : ''; $redirect_to = add_query_arg( array( @@ -201,30 +207,29 @@ function bp_groups_admin_load() { 'action' => 'edit' ), $redirect_to ); - // Check this is a valid form submission + // Check this is a valid form submission. check_admin_referer( 'edit-group_' . $group_id ); - // Get the group from the database + // Get the group from the database. $group = groups_get_group( 'group_id=' . $group_id ); - // If the group doesn't exist, just redirect back to the index + // If the group doesn't exist, just redirect back to the index. if ( empty( $group->slug ) ) { wp_redirect( $redirect_to ); exit; } - // Check the form for the updated properties - - // Store errors + // Check the form for the updated properties. + // Store errors. $error = 0; $success_new = $error_new = $success_modified = $error_modified = array(); // Group name and description are handled with - // groups_edit_base_group_details() + // groups_edit_base_group_details(). if ( !groups_edit_base_group_details( $group_id, $_POST['bp-groups-name'], $_POST['bp-groups-description'], 0 ) ) { $error = $group_id; - // using negative integers for different error messages... eek! + // Using negative integers for different error messages... eek! if ( empty( $_POST['bp-groups-name'] ) && empty( $_POST['bp-groups-description'] ) ) { $error = -3; } elseif ( empty( $_POST['bp-groups-name'] ) ) { @@ -234,13 +239,13 @@ function bp_groups_admin_load() { } } - // Enable discussion forum + // Enable discussion forum. $enable_forum = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0; /** * Filters the allowed status values for the group. * - * @since BuddyPress (1.0.2) + * @since 1.0.2 * * @param array $value Array of allowed group statuses. */ @@ -250,7 +255,7 @@ function bp_groups_admin_load() { /** * Filters the allowed invite status values for the group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $value Array of allowed invite statuses. */ @@ -261,7 +266,7 @@ function bp_groups_admin_load() { $error = $group_id; } - // Process new members + // Process new members. $user_names = array(); if ( ! empty( $_POST['bp-groups-new-members'] ) ) { @@ -274,7 +279,7 @@ function bp_groups_admin_load() { $un = trim( $user_name ); // Make sure the user exists before attempting - // to add to the group + // to add to the group. $user = get_user_by( 'slug', $un ); if ( empty( $user ) ) { @@ -289,11 +294,11 @@ function bp_groups_admin_load() { } } - // Process member role changes + // Process member role changes. if ( ! empty( $_POST['bp-groups-role'] ) && ! empty( $_POST['bp-groups-existing-role'] ) ) { // Before processing anything, make sure you're not - // attempting to remove the all user admins + // attempting to remove the all user admins. $admin_count = 0; foreach ( (array) $_POST['bp-groups-role'] as $new_role ) { if ( 'admin' == $new_role ) { @@ -309,30 +314,32 @@ function bp_groups_admin_load() { } else { - // Process only those users who have had their roles changed + // Process only those users who have had their roles changed. foreach ( (array) $_POST['bp-groups-role'] as $user_id => $new_role ) { + $user_id = (int) $user_id; $existing_role = isset( $_POST['bp-groups-existing-role'][$user_id] ) ? $_POST['bp-groups-existing-role'][$user_id] : ''; if ( $existing_role != $new_role ) { + $result = false; switch ( $new_role ) { case 'mod' : // Admin to mod is a demotion. Demote to - // member, then fall through + // member, then fall through. if ( 'admin' == $existing_role ) { groups_demote_member( $user_id, $group_id ); } case 'admin' : // If the user was banned, we must - // unban first + // unban first. if ( 'banned' == $existing_role ) { groups_unban_member( $user_id, $group_id ); } // At this point, each existing_role - // is a member, so promote + // is a member, so promote. $result = groups_promote_member( $user_id, $group_id, $new_role ); break; @@ -360,7 +367,7 @@ function bp_groups_admin_load() { break; } - // Store the success or failure + // Store the success or failure. if ( $result ) { $success_modified[] = $user_id; } else { @@ -374,19 +381,18 @@ function bp_groups_admin_load() { /** * Fires before redirect so plugins can do something first on save action. * - * @since BuddyPress (1.6.0) + * @since 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 - + // Create the redirect URL. if ( $error ) { - // This means there was an error updating group details + // This means there was an error updating group details. $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to ); } else { - // Group details were update successfully + // Group details were update successfully. $redirect_to = add_query_arg( 'updated', 1, $redirect_to ); } @@ -413,7 +419,7 @@ function bp_groups_admin_load() { /** * Filters the URL to redirect to after successfully editing a group. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $redirect_to URL to redirect user to. */ @@ -431,19 +437,18 @@ function bp_groups_admin_load() { /** * Handle save/update of screen options for the Groups component admin screen. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @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 ) { if ( 'toplevel_page_bp_groups_per_page' != $option && 'toplevel_page_bp_groups_network_per_page' != $option ) return $value; - // Per page + // Per page. $new_value = (int) $new_value; if ( $new_value < 1 || $new_value > 999 ) return $value; @@ -454,21 +459,21 @@ function bp_groups_admin_screen_options( $value, $option, $new_value ) { /** * Select the appropriate Groups admin screen, and output it. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_groups_admin() { - // Decide whether to load the index or edit screen + // Decide whether to load the index or edit screen. $doaction = bp_admin_list_table_current_bulk_action(); - // Display the single group edit screen + // Display the single group edit screen. if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { bp_groups_admin_edit(); - // Display the group deletion confirmation screen + // Display the group deletion confirmation screen. } elseif ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) { bp_groups_admin_delete(); - // Otherwise, display the groups index screen + // Otherwise, display the groups index screen. } else { bp_groups_admin_index(); } @@ -477,7 +482,7 @@ function bp_groups_admin() { /** * Display the single groups edit screen. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_groups_admin_edit() { @@ -486,7 +491,7 @@ function bp_groups_admin_edit() { $messages = array(); - // If the user has just made a change to a group, build status messages + // If the user has just made a change to a group, build status messages. if ( !empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) { $no_admins = ! empty( $_REQUEST['no_admins'] ) ? 1 : 0; $errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : ''; @@ -524,33 +529,33 @@ function bp_groups_admin_edit() { } if ( ! empty( $error_new ) ) { - $messages[] = sprintf( __( 'The following users could not be added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $error_new ) ); + $messages[] = sprintf( __( 'The following users could not be added to the group: %s', 'buddypress' ), '<em>' . esc_html( implode( ', ', $error_new ) ) . '</em>' ); } if ( ! empty( $success_new ) ) { - $messages[] = sprintf( __( 'The following users were successfully added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $success_new ) ); + $messages[] = sprintf( __( 'The following users were successfully added to the group: %s', 'buddypress' ), '<em>' . esc_html( implode( ', ', $success_new ) ) . '</em>' ); } if ( ! empty( $error_modified ) ) { $error_modified = bp_groups_admin_get_usernames_from_ids( $error_modified ); - $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: <em>%s</em>', 'buddypress' ), implode( ', ', $error_modified ) ); + $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: %s', 'buddypress' ), '<em>' . esc_html( implode( ', ', $error_modified ) ) . '</em>' ); } if ( ! empty( $success_modified ) ) { $success_modified = bp_groups_admin_get_usernames_from_ids( $success_modified ); - $messages[] = sprintf( __( 'The following members were successfully modified: <em>%s</em>', 'buddypress' ), implode( ', ', $success_modified ) ); + $messages[] = sprintf( __( 'The following members were successfully modified: %s', 'buddypress' ), '<em>' . esc_html( implode( ', ', $success_modified ) ) . '</em>' ); } } $is_error = ! empty( $no_admins ) || ! empty( $errors ) || ! empty( $error_new ) || ! empty( $error_modified ); - // Get the group from the database - $group = groups_get_group( 'group_id=' . $_GET['gid'] ); + // Get the group from the database. + $group = groups_get_group( 'group_id=' . (int) $_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 + // 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 ); @@ -559,23 +564,22 @@ function bp_groups_admin_edit() { * * Useful for plugins to modify the group before display. * - * @since BuddyPress (1.7.0) + * @since 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"> - <?php screen_icon( 'buddypress-groups' ); ?> - <h2><?php _e( 'Edit Group', 'buddypress' ); ?> + <h1><?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_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a> <?php endif; ?> - </h2> + </h1> - <?php // If the user has just made a change to an group, display the status messages ?> + <?php // If the user has just made a change to an group, display the status messages. ?> <?php if ( !empty( $messages ) ) : ?> <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "</p><p>", $messages ); ?></p></div> <?php endif; ?> @@ -589,14 +593,15 @@ function bp_groups_admin_edit() { <div id="post-body-content"> <div id="postdiv"> <div id="bp_groups_name" class="postbox"> - <h3><?php _e( 'Name and Description', 'buddypress' ); ?></h3> + <h2><?php _e( 'Name and Description', 'buddypress' ); ?></h2> <div class="inside"> + <label for="bp-groups-name" class="screen-reader-text"><?php _e( 'Group Name', 'buddypress' ); ?></label> <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" /> <div id="bp-groups-permalink-box"> <strong><?php esc_html_e( 'Permalink:', 'buddypress' ) ?></strong> <span id="sample-permalink"><?php bp_group_permalink( $group ) ?></span> <a href="<?php echo bp_group_permalink( $group ) ?>" class="button button-small" id="bp-groups-visit-group"><?php esc_html_e( 'Visit Group', 'buddypress' ) ?></a> </div> - + <label for="bp-groups-description" class="screen-reader-text"><?php _e( 'Group Description', 'buddypress' ); ?></label> <?php wp_editor( stripslashes( $group->description ), 'bp-groups-description', array( 'media_buttons' => false, 'teeny' => true, 'textarea_rows' => 5, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> </div> </div> @@ -634,7 +639,7 @@ function bp_groups_admin_edit() { * We include a separate confirmation because group deletion is truly * irreversible. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_groups_admin_delete() { @@ -650,10 +655,10 @@ function bp_groups_admin_delete() { $groups = groups_get_groups( array( 'include' => $group_ids, 'show_hidden' => true, - 'per_page' => null, // Return all results + 'per_page' => null, // Return all results. ) ); - // Create a new list of group ids, based on those that actually exist + // Create a new list of group ids, based on those that actually exist. $gids = array(); foreach ( $groups['groups'] as $group ) { $gids[] = $group->id; @@ -662,13 +667,12 @@ function bp_groups_admin_delete() { $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?> <div class="wrap"> - <?php screen_icon( 'buddypress-groups' ); ?> - <h2><?php _e( 'Delete Groups', 'buddypress' ) ?></h2> + <h1><?php _e( 'Delete Groups', 'buddypress' ) ?></h1> <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p> <ul class="bp-group-delete-list"> <?php foreach ( $groups['groups'] as $group ) : ?> - <li><?php echo esc_html( $group->name ) ?></li> + <li><?php echo apply_filters( 'bp_get_group_name', $group->name, $group ); ?></li> <?php endforeach; ?> </ul> @@ -686,7 +690,7 @@ function bp_groups_admin_delete() { * * This screen contains a list of all BuddyPress groups. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @global BP_Groups_List_Table $bp_groups_list_table Group screen list table. * @global string $plugin_page Currently viewed plugin page. @@ -696,7 +700,7 @@ function bp_groups_admin_index() { $messages = array(); - // If the user has just made a change to a group, build status messages + // If the user has just made a change to a group, build status messages. if ( ! empty( $_REQUEST['deleted'] ) ) { $deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; @@ -705,7 +709,7 @@ function bp_groups_admin_index() { } } - // Prepare the group items for display + // Prepare the group items for display. $bp_groups_list_table->prepare_items(); /** @@ -713,15 +717,14 @@ function bp_groups_admin_index() { * * Useful for plugins to modify the messages before display. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $messages Array of messages to be displayed. */ do_action( 'bp_groups_admin_index', $messages ); ?> <div class="wrap"> - <?php screen_icon( 'buddypress-groups' ); ?> - <h2> + <h1> <?php _e( 'Groups', 'buddypress' ); ?> <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> @@ -731,14 +734,14 @@ function bp_groups_admin_index() { <?php if ( !empty( $_REQUEST['s'] ) ) : ?> <span class="subtitle"><?php printf( __( 'Search results for “%s”', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span> <?php endif; ?> - </h2> + </h1> - <?php // If the user has just made a change to an group, display the status messages ?> + <?php // If the user has just made a change to an group, display the status messages. ?> <?php if ( !empty( $messages ) ) : ?> <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> <?php endif; ?> - <?php // Display each group on its own row ?> + <?php // Display each group on its own row. ?> <?php $bp_groups_list_table->views(); ?> <form id="bp-groups-form" action="" method="get"> @@ -755,7 +758,7 @@ function bp_groups_admin_index() { /** * Markup for the single group's Settings metabox. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param object $item Information about the current group. */ @@ -799,11 +802,14 @@ function bp_groups_admin_edit_metabox_settings( $item ) { /** * Output the markup for a single group's Add New Members metabox. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param BP_Groups_Group $item The BP_Groups_Group object for the current group. */ function bp_groups_admin_edit_metabox_add_new_members( $item ) { ?> + <label for="bp-groups-new-members" class="screen-reader-text"><?php _e( 'Add new members', 'buddypress' ); ?></label> <input name="bp-groups-new-members" id="bp-groups-new-members" class="bp-suggest-user" placeholder="<?php esc_attr_e( 'Enter a comma-separated list of user logins.', 'buddypress' ) ?>" /> <ul id="bp-groups-new-members-list"></ul> <?php @@ -812,7 +818,7 @@ function bp_groups_admin_edit_metabox_add_new_members( $item ) { /** * Renders the Members metabox on single group pages. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param BP_Groups_Group $item The BP_Groups_Group object for the current group. */ @@ -820,7 +826,7 @@ 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(), @@ -850,20 +856,20 @@ 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 + // Loop through each member type. foreach ( $members as $member_type => $type_users ) : ?> <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>"> - <h4><?php switch ( $member_type ) : + <h3><?php switch ( $member_type ) : case 'admin' : esc_html_e( 'Administrators', 'buddypress' ); break; case 'mod' : esc_html_e( 'Moderators', 'buddypress' ); break; case 'member' : esc_html_e( 'Members', 'buddypress' ); break; case 'banned' : esc_html_e( 'Banned Members', 'buddypress' ); break; - endswitch; ?></h4> + endswitch; ?></h3> <div class="bp-group-admin-pagination table-top"> <?php echo $pagination[ $member_type ] ?> @@ -897,6 +903,7 @@ function bp_groups_admin_edit_metabox_members( $item ) { </td> <td class="urole-column"> + <label for="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" class="screen-reader-text"><?php _e( 'Select group role for member', 'buddypress' ); ?></label> <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->ID ); ?>]"> <optgroup label="<?php esc_attr_e( 'Roles', 'buddypress' ); ?>"> <option class="admin" value="admin" <?php selected( 'admin', $member_type ); ?>><?php esc_html_e( 'Administrator', 'buddypress' ); ?></option> @@ -934,7 +941,7 @@ function bp_groups_admin_edit_metabox_members( $item ) { /** * Fires after the listing of a single row for members in a group on the group edit screen. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param int $ID ID of the user being rendered. * @param BP_Groups_Group $item Object for the current group. @@ -967,7 +974,7 @@ function bp_groups_admin_edit_metabox_members( $item ) { /** * Renders the Status metabox for the Groups admin edit screen. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param object $item Information about the currently displayed group. */ @@ -984,7 +991,7 @@ function bp_groups_admin_edit_metabox_status( $item ) { </div> <div id="publishing-action"> - <?php submit_button( __( 'Save Changes', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?> + <?php submit_button( __( 'Save Changes', 'buddypress' ), 'primary', 'save', false ); ?> </div> <div class="clear"></div> </div><!-- #major-publishing-actions --> @@ -1002,11 +1009,10 @@ function bp_groups_admin_edit_metabox_status( $item ) { * Plugin authors should not use this function, as it is likely to be * deprecated soon. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @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 ) { @@ -1016,14 +1022,14 @@ function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query, return $pagination; } - // The key used to paginate this member type in the $_GET global + // The key used to paginate this member type in the $_GET global. $qs_key = $member_type . '_page'; $url_base = remove_query_arg( array( $qs_key, 'updated', 'success_modified' ), $_SERVER['REQUEST_URI'] ); $page = isset( $_GET[ $qs_key ] ) ? absint( $_GET[ $qs_key ] ) : 1; $per_page = 10; // @todo Make this customizable? - // Don't show anything if there's no pagination + // Don't show anything if there's no pagination. if ( 1 === $page && $query->total_users <= $per_page ) { return $pagination; } @@ -1060,10 +1066,9 @@ function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query, /** * Get a set of usernames corresponding to a set of user IDs. * - * @since BuddyPress (1.7.0) + * @since 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() ) { @@ -1081,11 +1086,11 @@ function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) { /** * AJAX handler for group member autocomplete requests. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ function bp_groups_admin_autocomplete_handler() { - // Bail if user user shouldn't be here, or is a large network + // Bail if user user shouldn't be here, or is a large network. if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) ) { wp_die( -1 ); } @@ -1110,7 +1115,7 @@ function bp_groups_admin_autocomplete_handler() { foreach ( $suggestions as $user ) { $matches[] = array( - // translators: 1: user_login, 2: user_email + // Translators: 1: user_login, 2: user_email. 'label' => sprintf( __( '%1$s (%2$s)', 'buddypress' ), $user->name, $user->ID ), 'value' => $user->ID, ); @@ -1120,633 +1125,3 @@ function bp_groups_admin_autocomplete_handler() { wp_die( json_encode( $matches ) ); } add_action( 'wp_ajax_bp_group_admin_member_autocomplete', 'bp_groups_admin_autocomplete_handler' ); - -/** - * List table class for the Groups component admin page. - * - * @since BuddyPress (1.7.0) - */ -class BP_Groups_List_Table extends WP_List_Table { - - /** - * The type of view currently being displayed. - * - * e.g. "All", "Pending", "Approved", "Spam"... - * - * @since BuddyPress (1.7.0) - * - * @access public - * @var string - */ - public $view = 'all'; - - /** - * 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 - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - - // Define singular and plural labels, as well as whether we support AJAX. - parent::__construct( array( - 'ajax' => false, - 'plural' => 'groups', - 'singular' => 'group', - ) ); - } - - /** - * 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 (1.7.0) - */ - public function prepare_items() { - global $groups_template; - - $screen = get_current_screen(); - - // Option defaults - $include_id = false; - $search_terms = false; - - // Set current page - $page = $this->get_pagenum(); - - // Set per page from the screen options - $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) ); - - // Sort order. - $order = 'DESC'; - if ( !empty( $_REQUEST['order'] ) ) { - $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC'; - } - - // Order by - default to newest - $orderby = 'last_activity'; - if ( ! empty( $_REQUEST['orderby'] ) ) { - switch ( $_REQUEST['orderby'] ) { - case 'name' : - $orderby = 'name'; - break; - case 'id' : - $orderby = 'date_created'; - break; - case 'members' : - $orderby = 'total_member_count'; - break; - case 'last_active' : - $orderby = 'last_activity'; - break; - } - } - - // Are we doing a search? - if ( !empty( $_REQUEST['s'] ) ) - $search_terms = $_REQUEST['s']; - - // Check if user has clicked on a specific group (if so, fetch only that group). - if ( !empty( $_REQUEST['gid'] ) ) - $include_id = (int) $_REQUEST['gid']; - - // Set the current view - if ( isset( $_GET['group_status'] ) && in_array( $_GET['group_status'], array( 'public', 'private', 'hidden' ) ) ) { - $this->view = $_GET['group_status']; - } - - // We'll use the ids of group types for the 'include' param - $this->group_type_ids = BP_Groups_Group::get_group_type_ids(); - - // Pass a dummy array if there are no groups of this type - $include = false; - if ( 'all' != $this->view && isset( $this->group_type_ids[ $this->view ] ) ) { - $include = ! empty( $this->group_type_ids[ $this->view ] ) ? $this->group_type_ids[ $this->view ] : array( 0 ); - } - - // Get group type counts for display in the filter tabs - $this->group_counts = array(); - foreach ( $this->group_type_ids as $group_type => $group_ids ) { - $this->group_counts[ $group_type ] = count( $group_ids ); - } - - // 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 { - $groups_args = array( - 'include' => $include, - 'per_page' => $per_page, - 'page' => $page, - 'orderby' => $orderby, - 'order' => $order - ); - - $groups = array(); - if ( bp_has_groups( $groups_args ) ) { - while ( bp_groups() ) { - bp_the_group(); - $groups[] = (array) $groups_template->group; - } - } - } - - // Set raw data to display - $this->items = $groups; - - // Store information needed for handling table pagination - $this->set_pagination_args( array( - 'per_page' => $per_page, - 'total_items' => $groups_template->total_group_count, - 'total_pages' => ceil( $groups_template->total_group_count / $per_page ) - ) ); - } - - /** - * Get an array of all the columns on the page. - * - * @since BuddyPress (1.7.0) - * - * @return array Array of column headers. - */ - public function get_column_info() { - $this->_column_headers = array( - $this->get_columns(), - array(), - $this->get_sortable_columns(), - $this->get_default_primary_column_name(), - ); - - return $this->_column_headers; - } - - /** - * Display a message on screen when no items are found ("No groups found"). - * - * @since BuddyPress (1.7.0) - */ - public function no_items() { - _e( 'No groups found.', 'buddypress' ); - } - - /** - * Output the Groups data table. - * - * @since BuddyPress (1.7.0) - */ - public function display() { - $this->display_tablenav( 'top' ); ?> - - <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> - <thead> - <tr> - <?php $this->print_column_headers(); ?> - </tr> - </thead> - - <tfoot> - <tr> - <?php $this->print_column_headers( false ); ?> - </tr> - </tfoot> - - <tbody id="the-comment-list"> - <?php $this->display_rows_or_placeholder(); ?> - </tbody> - </table> - <?php - - $this->display_tablenav( 'bottom' ); - } - - /** - * Generate content for a single row of the table. - * - * @since BuddyPress (1.7.0) - * - * @param object|array $item The current group item in the loop. - */ - public function single_row( $item = array() ) { - static $even = false; - - $row_classes = array(); - - if ( $even ) { - $row_classes = array( 'even' ); - } else { - $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 ) . '"'; - - echo '<tr' . $row_class . ' id="group-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">'; - echo $this->single_row_columns( $item ); - echo '</tr>'; - - $even = ! $even; - } - - /** - * Get the list of views available on this table (e.g. "all", "public"). - * - * @since BuddyPress (1.7.0) - */ - public function get_views() { - $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?> - - <ul class="subsubsub"> - <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 - } - - /** - * Get bulk actions for single group row. - * - * @since BuddyPress (1.7.0) - * - * @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' ) - ) ); - } - - /** - * Get the table column titles. - * - * @since BuddyPress (1.7.0) - * - * @see WP_List_Table::single_row_columns() - * - * @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' ), - 'description' => _x( 'Description', 'Groups admin Group Description column header', 'buddypress' ), - 'status' => _x( 'Status', 'Groups admin Privacy Status column header', 'buddypress' ), - 'members' => _x( '# Members', 'Groups admin Members column header', 'buddypress' ), - 'last_active' => _x( 'Last Active', 'Groups admin Last Active column header', 'buddypress' ) - ) ); - } - - /** - * 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 - * last_active to be desc_first (since you're generally interested in - * the *most* recently active group, not the *least*). But because - * the default sort for the Groups admin screen is DESC by last_active, - * we want the first click on the Last Active column header to switch - * the sort order - ie, to make it ASC. Thus last_active is set to - * $desc_first = false. - * - * @since BuddyPress (1.7.0) - * - * @return array Array of sortable column names. - */ - public function get_sortable_columns() { - return array( - 'gid' => array( 'gid', false ), - 'comment' => array( 'name', false ), - 'members' => array( 'members', false ), - 'last_active' => array( 'last_active', false ), - ); - } - - /** - * Override WP_List_Table::row_actions(). - * - * Basically a duplicate of the row_actions() method, but removes the - * unnecessary <button> addition. - * - * @since 2.3.3 - * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. - * - * @param array $actions The list of actions - * @param bool $always_visible Whether the actions should be always visible - * @return string - */ - public function row_actions( $actions, $always_visible = false ) { - $action_count = count( $actions ); - $i = 0; - - if ( !$action_count ) - return ''; - - $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; - foreach ( $actions as $action => $link ) { - ++$i; - ( $i == $action_count ) ? $sep = '' : $sep = ' | '; - $out .= "<span class='$action'>$link$sep</span>"; - } - $out .= '</div>'; - - return $out; - } - - /** - * Markup for the Checkbox column. - * - * @since BuddyPress (1.7.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - public function column_cb( $item = array() ) { - printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id'] ); - } - - /** - * Markup for the Group ID column. - * - * @since BuddyPress (1.7.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - public function column_gid( $item = array() ) { - echo '<strong>' . absint( $item['id'] ) . '</strong>'; - } - - /** - * Name column, and "quick admin" rollover actions. - * - * Called "comment" in the CSS so we can re-use some WP core CSS. - * - * @since BuddyPress (1.7.0) - * - * @see WP_List_Table::single_row_columns() - * - * @param array $item A singular item (one full row). - */ - public function column_comment( $item = array() ) { - - // Preorder items: Edit | Delete | View - $actions = array( - 'edit' => '', - 'delete' => '', - 'view' => '', - ); - - // We need the group object for some BP functions - $item_obj = (object) $item; - - // Build actions URLs - $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&gid=' . $item['id'] ); - $delete_url = wp_nonce_url( $base_url . "&action=delete", 'bp-groups-delete' ); - $edit_url = $base_url . '&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 - - // Edit - $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) ); - - // Delete - $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) ); - - // Visit - $actions['view'] = sprintf( '<a href="%s">%s</a>', esc_url( $view_url ), __( 'View', 'buddypress' ) ); - - /** - * 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 - $avatar = ''; - - if ( buddypress()->avatar->show_avatars ) { - $avatar = bp_core_fetch_avatar( array( - 'item_id' => $item['id'], - 'object' => 'group', - 'type' => 'thumb', - 'avatar_dir' => 'group-avatars', - 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ), - 'width' => '32', - 'height' => '32', - 'title' => $group_name - ) ); - } - - $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name ); - - echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions ); - } - - /** - * Markup for the Description column. - * - * @since BuddyPress (1.7.0) - * - * @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 ) ); - } - - /** - * Markup for the Status column. - * - * @since BuddyPress (1.7.0) - * - * @param array $item Information about the current row. - */ - public function column_status( $item = array() ) { - $status = $item['status']; - $status_desc = ''; - - // @todo This should be abstracted out somewhere for the whole - // Groups component - switch ( $status ) { - case 'public' : - $status_desc = __( 'Public', 'buddypress' ); - break; - case 'private' : - $status_desc = __( 'Private', 'buddypress' ); - break; - case 'hidden' : - $status_desc = __( 'Hidden', 'buddypress' ); - 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 ) ); - } - - /** - * Markup for the Number of Members column. - * - * @since BuddyPress (1.7.0) - * - * @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 ) ); - } - - /** - * Markup for the Last Active column. - * - * @since BuddyPress (1.7.0) - * - * @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 custom column. - * - * @since BuddyPress (2.0.0) - * - * @param array $item Information about the current row. - * @param string $column_name 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 ); - } - - /** - * Get name of default primary column - * - * @since BuddyPress (2.3.3) - * @access protected - * - * @return string - */ - protected function get_default_primary_column_name() { - // comment column is mapped to Group's name - return 'comment'; - } -} 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 8a307e01d792634bda110a8970487e593d734f42..f27f74e568b123ddfcaf2c5be43af02b4048de75 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Toolbar. * @@ -7,15 +6,16 @@ * * @package BuddyPress * @subpackage Groups + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Add the Group Admin top-level menu when viewing group pages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @todo Add dynamic menu items for group extensions. * @@ -26,35 +26,35 @@ function bp_groups_group_admin_menu() { global $wp_admin_bar; $bp = buddypress(); - // Only show if viewing a group + // Only show if viewing a group. if ( ! bp_is_group() || bp_is_group_create() ) { return false; } - // Only show this menu to group admins and super admins + // Only show this menu to group admins and super admins. if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_group_is_admin() ) { return false; } - // Unique ID for the 'Edit Group' menu + // Unique ID for the 'Edit Group' menu. $bp->group_admin_menu_id = 'group-admin'; - // Add the top-level Group Admin button + // Add the top-level Group Admin button. $wp_admin_bar->add_menu( array( 'id' => $bp->group_admin_menu_id, 'title' => __( 'Edit Group', 'buddypress' ), 'href' => bp_get_group_permalink( $bp->groups->current_group ) ) ); - // Index of the Manage tabs parent slug + // Index of the Manage tabs parent slug. $nav_index = $bp->groups->current_group->slug . '_manage'; - // Check if current group has Manage tabs + // Check if current group has Manage tabs. if ( empty( $bp->bp_options_nav[ $nav_index ] ) ) { return; } - // Build the Group Admin menus + // Build the Group Admin menus. foreach ( $bp->bp_options_nav[ $nav_index ] as $menu ) { /** * Should we add the current manage link in the Group's "Edit" Admin Bar menu ? @@ -66,7 +66,7 @@ function bp_groups_group_admin_menu() { if ( $menu['show_in_admin_bar'] ) { $title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu['name'] ); - // Title is specific for delete + // Title is specific for delete. if ( 'delete-group' == $menu['slug'] ) { $title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu['name'] ); } @@ -85,7 +85,7 @@ add_action( 'admin_bar_menu', 'bp_groups_group_admin_menu', 99 ); /** * Remove rogue WP core Edit menu when viewing a single group. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_groups_remove_edit_page_menu() { if ( bp_is_group() ) { 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 c8df9cde5d3587b56d4b57a529b585f37452953b..3d09916551eb4c69b6d6c5b5e941533b85d4156f 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Caching. * @@ -8,9 +7,10 @@ * * @package BuddyPress * @subpackage Groups + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -24,6 +24,7 @@ defined( 'ABSPATH' ) || exit; * $group_ids and adds it to WP cache. This improves efficiency when using * groupmeta within a loop context. * + * @since 1.6.0 * * @param int|string|array|bool $group_ids Accepts a single group_id, or a * comma-separated list or array of @@ -47,6 +48,8 @@ function bp_groups_update_meta_cache( $group_ids = false ) { /** * Clear the cached group count. * + * @since 1.0.0 + * * @param int $group_id Not used. */ function groups_clear_group_object_cache( $group_id ) { @@ -61,7 +64,7 @@ add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cach /** * Bust group caches when editing or deleting. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param int $group_id The group being edited. */ @@ -76,10 +79,10 @@ add_action( 'groups_settings_updated', 'bp_groups_delete_group_cache' ); /** * Bust group cache when modifying metadata. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $meta_id - * @param int $group_id + * @param int $meta_id Meta ID. + * @param int $group_id Group ID. */ function bp_groups_delete_group_cache_on_metadata_change( $meta_id, $group_id ) { wp_cache_delete( $group_id, 'bp_groups' ); @@ -90,13 +93,13 @@ add_action( 'added_group_meta', 'bp_groups_delete_group_cache_on_metadata_change /** * Clear caches for the group creator when a group is created. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @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 ) { - // Clears the 'total groups' for this user + // Clears the 'total groups' for this user. groups_clear_group_user_object_cache( $group_obj->id, $group_obj->creator_id ); } add_action( 'groups_created_group', 'bp_groups_clear_group_creator_cache', 10, 2 ); @@ -104,13 +107,13 @@ 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. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param BP_Groups_Group $group_obj Group object. * @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 + // Clears the 'total groups' cache for each member in a group. foreach ( (array) $user_ids as $user_id ) groups_clear_group_user_object_cache( $group_obj->id, $user_id ); } @@ -121,7 +124,7 @@ add_action( 'bp_groups_delete_group', 'bp_groups_clear_group_members_caches', 10 * * Count is cleared when an invite is accepted, rejected or deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $user_id The user ID. */ @@ -137,7 +140,7 @@ add_action( 'groups_delete_invite', 'bp_groups_clear_invite_count_for_user' ); * * Groan. Our API functions are not consistent. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $group_id The group ID. Not used in this function. * @param int $user_id The user ID. @@ -150,7 +153,7 @@ add_action( 'groups_uninvite_user', 'bp_groups_clear_invite_count_on_uninvite', /** * Clear a user's cached total group invite count when a new invite is sent. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $group_id The group ID. Not used in this function. * @param array $invited_users Array of invited user IDs. @@ -165,6 +168,8 @@ add_action( 'groups_send_invites', 'bp_groups_clear_invite_count_on_send', 10, 2 /** * Clear a user's cached group count. * + * @since 1.2.0 + * * @param int $group_id The group ID. Not used in this function. * @param int $user_id The user ID. */ @@ -181,7 +186,7 @@ add_action( 'groups_remove_member', 'groups_clear_group_user_object_cache', 10, /** * Clear group administrator cache. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param int $group_id The group ID. */ @@ -198,9 +203,9 @@ add_action( 'groups_delete_group', 'groups_clear_group_administrator_cache' ); * This accounts for situations where group administrators are added manually * using {@link BP_Groups_Member::save()}. Usually via a plugin. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param BP_Groups_Member $member + * @param BP_Groups_Member $member Member object. */ function groups_clear_group_administrator_cache_on_member_save( BP_Groups_Member $member ) { groups_clear_group_administrator_cache( $member->group_id ); 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 736691f5b279241c19337ef2db09f792056a4add..c7b822bb4385f8cb9b0053d96ebff533b1447621 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage GroupsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; require dirname( __FILE__ ) . '/classes/class-bp-group-extension.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 d3972f84d27b1eeb644c2cbfb01768418ff282bf..d1bf7f9beadef5e167ba3ceeec736f70336305a1 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php @@ -1,17 +1,16 @@ <?php - /** * BuddyPress Groups Filters. * * @package BuddyPress * @subpackage GroupsFilters + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -// Filter bbPress template locations - +// Filter bbPress template locations. add_filter( 'bp_groups_get_directory_template', 'bp_add_template_locations' ); add_filter( 'bp_get_single_group_template', 'bp_add_template_locations' ); @@ -51,28 +50,35 @@ add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' ); add_filter( 'groups_group_name_before_save', 'force_balance_tags' ); add_filter( 'groups_group_description_before_save', 'force_balance_tags' ); -// Trim trailing spaces from name and description when saving +// Trim trailing spaces from name and description when saving. add_filter( 'groups_group_name_before_save', 'trim' ); add_filter( 'groups_group_description_before_save', 'trim' ); -// Escape output of new group creation details +// Support emojis. +if ( function_exists( 'wp_encode_emoji' ) ) { + add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' ); +} + +// Escape output of new group creation details. add_filter( 'bp_get_new_group_id', 'esc_attr' ); add_filter( 'bp_get_new_group_name', 'esc_attr' ); add_filter( 'bp_get_new_group_description', 'esc_textarea' ); -// Format numberical output +// Format numerical 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_for_user', 'bp_core_number_format' ); +// Activity component integration. +add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 ); + /** * Filter output of Group Description through WordPress's KSES API. * - * @since BuddyPress (1.1.0) - * - * @param string $content + * @since 1.1.0 * + * @param string $content Content to filter. * @return string */ function bp_groups_filter_kses( $content = '' ) { @@ -87,12 +93,11 @@ function bp_groups_filter_kses( $content = '' ) { // to target the specific `buddypress-groups` context. $allowed_tags = wp_kses_allowed_html( 'buddypress-groups' ); - // Add our own tags allowed in group descriptions + // Add our own tags allowed in group descriptions. $allowed_tags['a']['class'] = array(); $allowed_tags['img'] = array(); $allowed_tags['img']['src'] = array(); $allowed_tags['img']['alt'] = array(); - $allowed_tags['img']['class'] = array(); $allowed_tags['img']['width'] = array(); $allowed_tags['img']['height'] = array(); $allowed_tags['img']['class'] = array(); @@ -102,13 +107,13 @@ function bp_groups_filter_kses( $content = '' ) { /** * Filters the HTML elements allowed for a given context. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $allowed_tags Allowed tags, attributes, and/or entities. */ $tags = apply_filters( 'bp_groups_filter_kses', $allowed_tags ); - // Return KSES'ed content, allowing the above tags + // Return KSES'ed content, allowing the above tags. return wp_kses( $content, $tags ); } @@ -116,6 +121,8 @@ function bp_groups_filter_kses( $content = '' ) { /** * Filter bbPress query SQL when on group pages or on forums directory. + * + * @since 1.1.0 */ function groups_add_forum_privacy_sql() { add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' ); @@ -127,8 +134,9 @@ add_filter( 'bbpress_init', 'groups_add_forum_privacy_sql' ); /** * Add fields to bbPress query for group-specific data. * - * @param string $sql + * @since 1.1.0 * + * @param string $sql SQL statement to amend. * @return string */ function groups_add_forum_fields_sql( $sql = '' ) { @@ -139,8 +147,9 @@ function groups_add_forum_fields_sql( $sql = '' ) { /** * Add JOINed tables to bbPress query for group-specific data. * - * @param string $sql + * @since 1.1.0 * + * @param string $sql SQL statement to amend. * @return string */ function groups_add_forum_tables_sql( $sql = '' ) { @@ -154,16 +163,17 @@ function groups_add_forum_tables_sql( $sql = '' ) { /** * Add WHERE clauses to bbPress query for group-specific data and access protection. * - * @param string $sql + * @since 1.1.0 * + * @param string $sql SQL Statement to amend. * @return string */ function groups_add_forum_where_sql( $sql = '' ) { - // Define locale variable + // Define locale variable. $parts = array(); - // Set this for groups + // Set this for groups. $parts['groups'] = "(gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id)"; // Restrict to public... @@ -174,6 +184,7 @@ function groups_add_forum_where_sql( $sql = '' ) { * * Decide if private are visible */ + // Are we in our own profile? if ( bp_is_my_profile() ) unset( $parts['private'] ); @@ -182,33 +193,34 @@ function groups_add_forum_where_sql( $sql = '' ) { elseif ( bp_current_user_can( 'bp_moderate' ) ) unset( $parts['private'] ); - // No need to filter on a single item + // No need to filter on a single item. elseif ( bp_is_single_item() ) unset( $parts['private'] ); - // Check the SQL filter that was passed + // Check the SQL filter that was passed. if ( !empty( $sql ) ) $parts['passed'] = $sql; - // Assemble Voltron + // Assemble Voltron. $parts_string = implode( ' AND ', $parts ); $bp = buddypress(); - // Set it to the global filter + // Set it to the global filter. $bp->groups->filter_sql = $parts_string; - // Return the global filter + // Return the global filter. return $bp->groups->filter_sql; } /** * Modify bbPress caps for bp-forums. * - * @param bool $value - * @param string $cap - * @param array $args + * @since 1.1.0 * + * @param bool $value Original value for current_user_can check. + * @param string $cap Capability checked. + * @param array $args Arguments for the caps. * @return bool */ function groups_filter_bbpress_caps( $value, $cap, $args ) { @@ -236,9 +248,12 @@ add_filter( 'bb_current_user_can', 'groups_filter_bbpress_caps', 10, 3 ); * * This speeds up the query. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BB_Query::_filter_sql() + * + * @param string $sql SQL statement. + * @return string */ function groups_filter_forums_root_page_sql( $sql ) { @@ -247,7 +262,7 @@ function groups_filter_forums_root_page_sql( $sql ) { * * This filter is used to prevent fetching information that is not used. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value SQL string to specify fetching just topic_id. */ @@ -259,11 +274,10 @@ 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) + * @since 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 ) { @@ -271,10 +285,37 @@ function bp_groups_maybe_load_mentions_scripts( $load_mentions, $mentions_enable return $load_mentions; } - if ( $load_mentions || ( bp_is_group_activity() || bp_is_group_home() ) ) { + if ( $load_mentions || bp_is_group_activity() ) { return true; } return $load_mentions; } add_filter( 'bp_activity_maybe_load_mentions_scripts', 'bp_groups_maybe_load_mentions_scripts', 10, 2 ); + +/** + * Disable at-mention notifications for users who are not a member of the non-public group where the activity appears. + * + * @since 2.5.0 + * + * @param bool $send Whether to send the notification. + * @param array $usernames Array of all usernames being notified. + * @param int $user_id ID of the user to be notified. + * @param BP_Activity_Activity $activity Activity object. + * @return bool + */ +function bp_groups_disable_at_mention_notification_for_non_public_groups( $send, $usernames, $user_id, BP_Activity_Activity $activity ) { + // Skip the check for administrators, who can get notifications from non-public groups. + if ( user_can( $user_id, 'bp_moderate' ) ) { + return $send; + } + + if ( 'groups' === $activity->component ) { + $group = groups_get_group( array( 'group_id' => $activity->item_id ) ); + if ( 'public' !== $group->status && ! groups_is_user_member( $user_id, $group->id ) ) { + $send = false; + } + } + + return $send; +} 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 85a64cebe371009103a0c9a5ca34cff7b2720b8c..1a8545b25fbb8d02a80c1efd4538c57747f6ed40 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Forums. * @@ -12,9 +11,10 @@ * * @package BuddyPress * @subpackage GroupsForums + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -22,7 +22,7 @@ defined( 'ABSPATH' ) || exit; * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id The group ID that the new forum should be attached to. * @param string $group_name The group name. @@ -52,7 +52,7 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = /** * Fires after the creation of a new forum inside a specific BuddyPress group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $forum_id ID of the newly created forum. * @param int $group_id ID of the associated group. @@ -63,10 +63,9 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = /** * Update group forum metadata (title, description, slug) when the group's details are edited. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $group_id Group id, passed from groups_details_updated. - * * @return mixed */ function groups_update_group_forum( $group_id ) { @@ -87,7 +86,7 @@ function groups_update_group_forum( $group_id ) { /** * Filters the group forum metadata value argument. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param array $value Array of metadata values to update the group forum with. */ @@ -105,14 +104,13 @@ add_action( 'groups_details_updated', 'groups_update_group_forum' ); * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.0.0) + * @since 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. - * * @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 ) { @@ -123,7 +121,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Filters the text for the forum post before save. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $post_text Text for the forum post. */ @@ -132,7 +130,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Filters the ID for the forum post before save. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $topic_id ID of the topic the post will be associated with. */ @@ -158,7 +156,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Filters the new groups activity forum post action. * - * @since BuddyPress (1.2.0) + * @since 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. @@ -170,7 +168,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Filters the new groups activity forum post content. * - * @since BuddyPress (1.2.0) + * @since 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. @@ -182,7 +180,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Filters the new groups activity forum post primary link. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value URL to the newly posted forum post. */ @@ -200,7 +198,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { /** * Fires after the creation of a new group forum topic post. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $value ID of the current group. * @param int $post_id ID of the new created forum topic post. @@ -215,13 +213,12 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.0.0) + * @since 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. - * * @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 ) { @@ -231,7 +228,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups forum topic title before saving. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $topic_title The title for the forum topic. */ @@ -240,7 +237,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups forum topic text before saving. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $topic_text The text for the forum topic. */ @@ -249,7 +246,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups forum topic tags before saving. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $topic_tags A comma-delimited string of topic tags. */ @@ -258,7 +255,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the forum ID this forum topic resides in. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $forum_id The forum ID this forum topic resides in. */ @@ -281,7 +278,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups activity forum topic action. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_action Formatted action related to forum topic. * @param string $topic_text New topic text. @@ -292,7 +289,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups activity forum topic content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_content Excerpt-length activity content to be posted. * @param string $topic_text New topic text. @@ -303,7 +300,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Filters the new groups activity forum topic primary link. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Concatenated primary link. */ @@ -321,7 +318,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ /** * Fires after the creation of a new group forum topic. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $value ID of the current group. * @param object $topic Object holding current topic details. Passed by reference. @@ -336,13 +333,12 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @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. - * * @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 ) { @@ -364,7 +360,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, return false; } - // Get the corresponding activity item + // Get the corresponding activity item. if ( bp_is_active( 'activity' ) ) { $id = bp_activity_get_activity_id( array( 'item_id' => bp_get_current_group_id(), @@ -401,7 +397,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, /** * Fires after the update of a group forum topic. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param object $topic Object holding current topic being updated. Passed by reference. */ @@ -415,13 +411,12 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @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. - * * @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 ) { @@ -454,7 +449,7 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page $primary_link .= "?topic_page=" . $page; } - // Get the corresponding activity item + // Get the corresponding activity item. if ( bp_is_active( 'activity' ) ) { $id = bp_activity_get_activity_id( array( 'user_id' => $post->poster_id, @@ -489,7 +484,7 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page /** * Fires after the update of a group forum post. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param object $post Object holding current post being updated. * @param object $topic Object holding current topic details. Passed by reference. @@ -504,16 +499,15 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.1.0) + * @since 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 ) { $bp = buddypress(); - // Before deleting the thread, get the post ids so that their activity items can be deleted + // Before deleting the thread, get the post ids so that their activity items can be deleted. $posts = bp_forums_get_topic_posts( array( 'topic_id' => $topic_id, 'per_page' => -1 ) ); $action = bp_forums_delete_topic( array( 'topic_id' => $topic_id ) ); @@ -522,16 +516,16 @@ function groups_delete_group_forum_topic( $topic_id ) { /** * Fires before the deletion of a group forum topic. * - * @since BuddyPress (1.2.9) + * @since 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 + // Delete the corresponding activity stream items. if ( bp_is_active( 'activity' ) ) { - // The activity item for the initial topic + // The activity item for the initial topic. bp_activity_delete( array( 'item_id' => bp_get_current_group_id(), 'secondary_item_id' => $topic_id, @@ -539,7 +533,7 @@ function groups_delete_group_forum_topic( $topic_id ) { 'type' => 'new_forum_topic' ) ); - // The activity item for each post + // The activity item for each post. foreach ( (array) $posts as $post ) { bp_activity_delete( array( 'item_id' => bp_get_current_group_id(), @@ -553,7 +547,7 @@ function groups_delete_group_forum_topic( $topic_id ) { /** * Fires after the deletion of a group forum topic. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic that was deleted. */ @@ -568,13 +562,12 @@ function groups_delete_group_forum_topic( $topic_id ) { * * Uses the bundled version of bbPress packaged with BuddyPress. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @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 ) { @@ -586,14 +579,14 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) { /** * Fires before the deletion of a group forum post. * - * @since BuddyPress (1.5.0) + * @since 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 + // Delete the corresponding activity stream item. if ( bp_is_active( 'activity' ) ) { bp_activity_delete( array( 'item_id' => bp_get_current_group_id(), @@ -606,7 +599,7 @@ 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) + * @since 1.1.0 * * @param int $post_id ID of the post that was deleted. * @param int $topic_id ID of the associated topic. @@ -620,11 +613,10 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) { /** * Get a total count of all public topics of a given type, across groups/forums. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'. * Default: 'newest'. - * * @return int The topic count. */ function groups_total_public_forum_topic_count( $type = 'newest' ) { @@ -632,7 +624,7 @@ 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) + * @since 1.1.0 * * @param int $value Total count of all public topics. */ @@ -642,12 +634,11 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) { /** * Get a total count of all topics of a given status, across groups/forums. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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 ) { @@ -655,7 +646,7 @@ function groups_total_forum_topic_count( $status = 'public', $search_terms = fal /** * Filters the total count of all topics of a given status, across groups/forums. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Total count of all topics. */ 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 a65f82dc407230701f9c75518eb49bc41e7f2edd..2e77c3e5491e1bd8802ebf5c83f318e2c88f3a01 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Functions. * @@ -10,15 +9,16 @@ * * @package BuddyPress * @subpackage GroupsFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Check whether there is a Groups directory page in the $bp global. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if set, False if empty. */ @@ -35,13 +35,15 @@ 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. * + * @since 1.2.0 + * * @param array|string $args { - * Array of al arguments. - * @type int $group_id ID of the group. - * @type bool $load_users No longer used. - * @type bool $populate_extras Whether to fetch membership data and other - * extra information about the group. - * Default: false. + * Array of al arguments. + * @type int $group_id ID of the group. + * @type bool $load_users No longer used. + * @type bool $populate_extras Whether to fetch membership data and other + * extra information about the group. + * Default: false. * } * @return BP_Groups_Group $group The group object. */ @@ -61,7 +63,7 @@ function groups_get_group( $args = '' ) { /** * Filters a single group object. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param BP_Groups_Group $group Single group object. */ @@ -73,7 +75,7 @@ function groups_get_group( $args = '' ) { /** * Create a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array|string $args { * An array of arguments. @@ -84,7 +86,7 @@ function groups_get_group( $args = '' ) { * @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'. + * '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, @@ -110,25 +112,25 @@ function groups_create_group( $args = '' ) { $args = wp_parse_args( $args, $defaults ); extract( $args, EXTR_SKIP ); - // Pass an existing group ID + // Pass an existing group ID. if ( ! empty( $group_id ) ) { $group = groups_get_group( array( 'group_id' => (int) $group_id ) ); $name = ! empty( $name ) ? $name : $group->name; $slug = ! empty( $slug ) ? $slug : $group->slug; $description = ! empty( $description ) ? $description : $group->description; - // Groups need at least a name + // Groups need at least a name. if ( empty( $name ) ) { return false; } - // Create a new group + // Create a new group. } else { - // Instantiate new group object + // Instantiate new group object. $group = new BP_Groups_Group; } - // Set creator ID + // Set creator ID. if ( $creator_id ) { $group->creator_id = (int) $creator_id; } elseif ( is_user_logged_in() ) { @@ -139,12 +141,12 @@ function groups_create_group( $args = '' ) { return false; } - // Validate status + // Validate status. if ( ! groups_is_valid_status( $status ) ) { return false; } - // Set group name + // Set group name. $group->name = $name; $group->description = $description; $group->slug = $slug; @@ -152,12 +154,12 @@ function groups_create_group( $args = '' ) { $group->enable_forum = (int) $enable_forum; $group->date_created = $date_created; - // Save group + // Save group. if ( ! $group->save() ) { return false; } - // If this is a new group, set up the creator as the first member and admin + // If this is a new group, set up the creator as the first member and admin. if ( empty( $group_id ) ) { $member = new BP_Groups_Member; $member->group_id = $group->id; @@ -171,7 +173,7 @@ function groups_create_group( $args = '' ) { /** * Fires after the creation of a new group and a group creator needs to be made. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $id ID of the newly created group. * @param BP_Groups_Member $member Instance of the member who is assigned @@ -185,7 +187,7 @@ function groups_create_group( $args = '' ) { /** * Fires after the update of a group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $id ID of the updated group. * @param BP_Groups_Group $group Instance of the group being updated. @@ -196,7 +198,7 @@ function groups_create_group( $args = '' ) { /** * Fires after the creation or update of a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the newly created group. * @param BP_Groups_Group $group Instance of the group being updated. @@ -212,12 +214,13 @@ 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..."). * + * @since 1.0.0 + * * @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 ) { @@ -241,7 +244,7 @@ function groups_edit_base_group_details( $group_id, $group_name, $group_desc, $n /** * Fired after a group's details are updated. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $value ID of the group. * @param BP_Groups_Group $old_group Group object, before being modified. @@ -258,12 +261,13 @@ 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). * + * @since 1.0.0 + * * @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 ) { @@ -271,14 +275,14 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_ $group = groups_get_group( array( 'group_id' => $group_id ) ); $group->enable_forum = $enable_forum; - /*** + /** * Before we potentially switch the group status, if it has been changed to public * from private and there are outstanding membership requests, auto-accept those requests. */ if ( 'private' == $group->status && 'public' == $status ) groups_accept_all_pending_membership_requests( $group->id ); - // Now update the status + // Now update the status. $group->status = $status; if ( !$group->save() ) @@ -291,7 +295,7 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_ } } - // Set the invite status + // Set the invite status. if ( $invite_status ) groups_update_groupmeta( $group->id, 'invite_status', $invite_status ); @@ -300,7 +304,7 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_ /** * Fires after the update of a groups settings. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that was updated. */ @@ -312,10 +316,9 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_ /** * Delete a group and all of its associated metadata. * - * @since BuddyPress (1.0.0) + * @since 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 ) { @@ -323,27 +326,27 @@ function groups_delete_group( $group_id ) { /** * Fires before the deletion of a group. * - * @since BuddyPress (1.5.0) + * @since 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 + // Get the group object. $group = groups_get_group( array( 'group_id' => $group_id ) ); - // Bail if group cannot be deleted + // Bail if group cannot be deleted. if ( ! $group->delete() ) { return false; } - // Remove all outstanding invites for this group + // Remove all outstanding invites for this group. groups_delete_all_group_invites( $group_id ); /** * Fires after the deletion of a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group that was deleted. */ @@ -355,8 +358,9 @@ function groups_delete_group( $group_id ) { /** * Check a group status (eg 'private') against the whitelist of registered statuses. * - * @param string $status Status to check. + * @since 1.1.0 * + * @param string $status Status to check. * @return bool True if status is allowed, otherwise false. */ function groups_is_valid_status( $status ) { @@ -368,8 +372,9 @@ function groups_is_valid_status( $status ) { /** * Provide a unique, sanitized version of a group slug. * - * @param string $slug Group slug to check. + * @since 1.0.0 * + * @param string $slug Group slug to check. * @return string $slug A unique and sanitized slug. */ function groups_check_slug( $slug ) { @@ -394,8 +399,9 @@ function groups_check_slug( $slug ) { /** * Get a group slug by its ID. * - * @param int $group_id The numeric ID of the group. + * @since 1.0.0 * + * @param int $group_id The numeric ID of the group. * @return string The group's slug. */ function groups_get_slug( $group_id ) { @@ -406,10 +412,9 @@ function groups_get_slug( $group_id ) { /** * Get a group ID by its slug. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $group_slug The group's slug. - * * @return int The ID. */ function groups_get_id( $group_slug ) { @@ -421,10 +426,11 @@ function groups_get_id( $group_slug ) { /** * Remove a user from a group. * + * @since 1.0.0 + * * @param int $group_id ID of the group. * @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 ) { @@ -440,7 +446,7 @@ function groups_leave_group( $group_id, $user_id = 0 ) { } } - if ( ! groups_remove_member( $user_id, $group_id ) ) { + if ( ! BP_Groups_Member::delete( $user_id, $group_id ) ) { return false; } @@ -449,7 +455,7 @@ function groups_leave_group( $group_id, $user_id = 0 ) { /** * Fires after a user leaves a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group. * @param int $user_id ID of the user leaving the group. @@ -462,10 +468,11 @@ function groups_leave_group( $group_id, $user_id = 0 ) { /** * Add a user to a group. * + * @since 1.0.0 + * * @param int $group_id ID of the group. * @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 ) { @@ -481,7 +488,7 @@ function groups_join_group( $group_id, $user_id = 0 ) { if ( groups_check_for_membership_request( $user_id, $group_id ) ) groups_delete_membership_request( null, $user_id, $group_id ); - // User is already a member, just return true + // User is already a member, just return true. if ( groups_is_user_member( $user_id, $group_id ) ) return true; @@ -504,7 +511,7 @@ function groups_join_group( $group_id, $user_id = 0 ) { else $group = $bp->groups->current_group; - // Record this in activity streams + // Record this in activity streams. groups_record_activity( array( 'type' => 'joined_group', 'item_id' => $group_id, @@ -514,7 +521,7 @@ function groups_join_group( $group_id, $user_id = 0 ) { /** * Fires after a user joins a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group. * @param int $user_id ID of the user joining the group. @@ -529,8 +536,9 @@ function groups_join_group( $group_id, $user_id = 0 ) { /** * Get a list of group administrators. * - * @param int $group_id ID of the group. + * @since 1.0.0 * + * @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 ) { @@ -540,8 +548,9 @@ function groups_get_group_admins( $group_id ) { /** * Get a list of group moderators. * - * @param int $group_id ID of the group. + * @since 1.0.0 * + * @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 ) { @@ -557,6 +566,8 @@ function groups_get_group_mods( $group_id ) { * To use the legacy query, filter 'bp_use_legacy_group_member_query', * returning true. * + * @since 1.0.0 + * * @param array $args { * An array of optional arguments. * @type int $group_id ID of the group whose members are being queried. @@ -580,7 +591,7 @@ function groups_get_group_mods( $group_id ) { */ function groups_get_group_members( $args = array() ) { - // Backward compatibility with old method of passing arguments + // Backward compatibility with old method of passing arguments. if ( ! is_array( $args ) || func_num_args() > 1 ) { _deprecated_argument( __METHOD__, '2.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); @@ -612,14 +623,14 @@ function groups_get_group_members( $args = array() ) { // For legacy users. Use of BP_Groups_Member::get_all_for_group() // is deprecated. func_get_args() can't be passed to a function in PHP - // 5.2.x, so we create a variable + // 5.2.x, so we create a variable. $func_args = func_get_args(); if ( apply_filters( 'bp_use_legacy_group_member_query', false, __FUNCTION__, $func_args ) ) { $retval = BP_Groups_Member::get_all_for_group( $r['group_id'], $r['per_page'], $r['page'], $r['exclude_admins_mods'], $r['exclude_banned'], $r['exclude'] ); } else { - // exclude_admins_mods and exclude_banned are legacy arguments. - // Convert to group_role + // Both exclude_admins_mods and exclude_banned are legacy arguments. + // Convert to group_role. if ( empty( $r['group_role'] ) ) { $r['group_role'] = array( 'member' ); @@ -633,7 +644,7 @@ function groups_get_group_members( $args = array() ) { } } - // Perform the group member query (extends BP_User_Query) + // Perform the group member query (extends BP_User_Query). $members = new BP_Group_Member_Query( array( 'group_id' => $r['group_id'], 'per_page' => $r['per_page'], @@ -644,7 +655,7 @@ function groups_get_group_members( $args = array() ) { 'type' => $r['type'], ) ); - // Structure the return value as expected by the template functions + // Structure the return value as expected by the template functions. $retval = array( 'members' => array_values( $members->results ), 'count' => $members->total_users, @@ -657,8 +668,9 @@ function groups_get_group_members( $args = array() ) { /** * Get the member count for a group. * - * @param int $group_id Group ID. + * @since 1.2.3 * + * @param int $group_id Group ID. * @return int Count of confirmed members for the group. */ function groups_get_total_member_count( $group_id ) { @@ -670,6 +682,8 @@ function groups_get_total_member_count( $group_id ) { /** * Get a collection of groups, based on the parameters passed. * + * @since 1.2.0 + * * @param array|string $args { * Array of arguments. Supports all arguments of * {@link BP_Groups_Group::get()}. Where the default values differ, they @@ -682,19 +696,19 @@ function groups_get_total_member_count( $group_id ) { function groups_get_groups( $args = '' ) { $defaults = array( - 'type' => false, // active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts - 'order' => 'DESC', // 'ASC' or 'DESC' - 'orderby' => 'date_created', // date_created, last_activity, total_member_count, name, random - 'user_id' => false, // Pass a user_id to limit to only groups that this user is a member of - 'include' => false, // Only include these specific groups (group_ids) - 'exclude' => false, // Do not include these specific groups (group_ids) - 'search_terms' => false, // Limit to groups that match these search terms - 'meta_query' => false, // Filter by groupmeta. See WP_Meta_Query for syntax - 'show_hidden' => false, // Show hidden groups to non-admins - 'per_page' => 20, // The number of results to return per page - 'page' => 1, // The page to return if limiting per page - 'populate_extras' => true, // Fetch meta such as is_banned and is_member - 'update_meta_cache' => true, // Pre-fetch groupmeta for queried groups + 'type' => false, // Active, newest, alphabetical, random, popular, most-forum-topics or most-forum-posts. + 'order' => 'DESC', // 'ASC' or 'DESC' + 'orderby' => 'date_created', // date_created, last_activity, total_member_count, name, random. + 'user_id' => false, // Pass a user_id to limit to only groups that this user is a member of. + 'include' => false, // Only include these specific groups (group_ids). + 'exclude' => false, // Do not include these specific groups (group_ids). + 'search_terms' => false, // Limit to groups that match these search terms. + 'meta_query' => false, // Filter by groupmeta. See WP_Meta_Query for syntax. + 'show_hidden' => false, // Show hidden groups to non-admins. + 'per_page' => 20, // The number of results to return per page. + 'page' => 1, // The page to return if limiting per page. + 'populate_extras' => true, // Fetch meta such as is_banned and is_member. + 'update_meta_cache' => true, // Pre-fetch groupmeta for queried groups. ); $r = wp_parse_args( $args, $defaults ); @@ -718,7 +732,7 @@ function groups_get_groups( $args = '' ) { /** * Filters the collection of groups based on parsed parameters. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param BP_Groups_Group $groups Object of found groups based on parameters. * Passed by reference. @@ -731,6 +745,8 @@ function groups_get_groups( $args = '' ) { /** * Get the total group count for the site. * + * @since 1.2.0 + * * @return int */ function groups_get_total_group_count() { @@ -747,6 +763,8 @@ function groups_get_total_group_count() { /** * Get the IDs of the groups of which a specified user is a member. * + * @since 1.0.0 + * * @param int $user_id ID of the user. * @param int $pag_num Optional. Max number of results to return. * Default: false (no limit). @@ -768,8 +786,9 @@ 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. + * @since 1.0.0 * + * @param int $user_id Optional. Default: ID of the displayed user. * @return int Group count. */ function groups_total_groups_for_user( $user_id = 0 ) { @@ -784,13 +803,13 @@ function groups_total_groups_for_user( $user_id = 0 ) { wp_cache_set( 'bp_total_groups_for_user_' . $user_id, $count, 'bp' ); } - return $count; + return (int) $count; } /** * Get the BP_Groups_Group object corresponding to the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return BP_Groups_Group The current group object. */ @@ -804,7 +823,7 @@ function groups_get_current_group() { /** * Filters the BP_Groups_Group object corresponding to the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param BP_Groups_Group $current_group Current BP_Groups_Group object. */ @@ -816,8 +835,9 @@ 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. + * @since 1.1.0 + * + * @param int $group_id Optional. ID of the group. Default: ID of the current group. * @return string */ function groups_avatar_upload_dir( $group_id = 0 ) { @@ -836,7 +856,7 @@ function groups_avatar_upload_dir( $group_id = 0 ) { /** * Filters the avatar upload directory path for a given group. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $value Array of parts related to the groups avatar upload directory. */ @@ -855,9 +875,10 @@ function groups_avatar_upload_dir( $group_id = 0 ) { /** * Check whether a user is an admin of a given group. * + * @since 1.0.0 + * * @param int $user_id ID of the user. * @param int $group_id ID of the group. - * * @return bool */ function groups_is_user_admin( $user_id, $group_id ) { @@ -867,9 +888,10 @@ function groups_is_user_admin( $user_id, $group_id ) { /** * Check whether a user is a mod of a given group. * + * @since 1.0.0 + * * @param int $user_id ID of the user. * @param int $group_id ID of the group. - * * @return bool */ function groups_is_user_mod( $user_id, $group_id ) { @@ -879,15 +901,26 @@ function groups_is_user_mod( $user_id, $group_id ) { /** * Check whether a user is a member of a given group. * + * @since 1.0.0 + * * @param int $user_id ID of the user. * @param int $group_id ID of the group. - * * @return bool */ function groups_is_user_member( $user_id, $group_id ) { return BP_Groups_Member::check_is_member( $user_id, $group_id ); } +/** + * Check whether a user is banned from a given group. + * + * @since 1.0.0 + * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. + * + * @return bool + */ function groups_is_user_banned( $user_id, $group_id ) { return BP_Groups_Member::check_is_banned( $user_id, $group_id ); } @@ -895,11 +928,10 @@ function groups_is_user_banned( $user_id, $group_id ) { /** * Is the specified user the creator of the group? * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. - * * @return bool */ function groups_is_user_creator( $user_id, $group_id ) { @@ -911,7 +943,7 @@ function groups_is_user_creator( $user_id, $group_id ) { /** * Post an Activity status update affiliated with a group. * - * @todo Should bail out when the Activity component is not active. + * @since 1.2.0 * * @param array|string $args { * Array of arguments. @@ -921,9 +953,13 @@ function groups_is_user_creator( $user_id, $group_id ) { * @type int $group_id Optional. ID of the group to be affiliated with the * update. Default: ID of the current group. * } - * @return int + * @return int|bool Returns the ID of the new activity item on success, or false on failure. */ function groups_post_update( $args = '' ) { + if ( ! bp_is_active( 'activity' ) ) { + return false; + } + $bp = buddypress(); $defaults = array( @@ -947,14 +983,14 @@ function groups_post_update( $args = '' ) { if ( !bp_current_user_can( 'bp_moderate' ) && !groups_is_user_member( $user_id, $group_id ) ) return false; - // Record this in activity streams + // Record this in activity streams. $activity_action = sprintf( __( '%1$s posted an update in the group %2$s', 'buddypress'), bp_core_get_userlink( $user_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . esc_attr( $bp->groups->current_group->name ) . '</a>' ); $activity_content = $content; /** * Filters the action for the new group activity update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_action The new group activity update. */ @@ -963,7 +999,7 @@ function groups_post_update( $args = '' ) { /** * Filters the content for the new group activity update. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $activity_content The content of the update. */ @@ -982,7 +1018,7 @@ function groups_post_update( $args = '' ) { /** * Fires after posting of an Activity status update affiliated with a group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $content The content of the update. * @param int $user_id ID of the user posting the update. @@ -999,11 +1035,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|bool $limit Limit to restrict to. - * @param int|bool $page - * @param string|array|bool $exclude + * @since 1.0.0 * + * @param int $user_id ID of the inviting user. + * @param int|bool $limit Limit to restrict to. + * @param int|bool $page Optional. Page offset of results to return. + * @param string|array|bool $exclude Array of comma-separated list of group IDs + * to exclude from results. * @return array $value IDs of users who have been invited to the group by the * user but have not yet accepted. */ @@ -1018,10 +1056,9 @@ function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = fals /** * Get the total group invite count for a user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $user_id The user ID. - * * @return int */ function groups_get_invite_count_for_user( $user_id = 0 ) { @@ -1035,6 +1072,8 @@ function groups_get_invite_count_for_user( $user_id = 0 ) { /** * Invite a user to a group. * + * @since 1.0.0 + * * @param array|string $args { * Array of arguments. * @type int $user_id ID of the user being invited. @@ -1064,11 +1103,11 @@ function groups_invite_user( $args = '' ) { if ( empty( $user_id ) || empty( $group_id ) ) return false; - // if the user has already requested membership, accept the request + // If the user has already requested membership, accept the request. if ( $membership_id = groups_check_for_membership_request( $user_id, $group_id ) ) { groups_accept_membership_request( $membership_id, $user_id, $group_id ); - // Otherwise, create a new invitation + // Otherwise, create a new invitation. } elseif ( ! groups_is_user_member( $user_id, $group_id ) && ! groups_check_user_has_invite( $user_id, $group_id, 'all' ) ) { $invite = new BP_Groups_Member; $invite->group_id = $group_id; @@ -1083,7 +1122,7 @@ function groups_invite_user( $args = '' ) { /** * Fires after the creation of a new group invite. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $args Array of parsed arguments for the group invite. */ @@ -1098,9 +1137,10 @@ function groups_invite_user( $args = '' ) { * * Functionally, this is equivalent to removing a user from a group. * + * @since 1.0.0 + * * @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 ) { @@ -1111,7 +1151,7 @@ function groups_uninvite_user( $user_id, $group_id ) { /** * Fires after uninviting a user from a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group being uninvited from. * @param int $user_id ID of the user being uninvited. @@ -1126,15 +1166,16 @@ function groups_uninvite_user( $user_id, $group_id ) { * * Returns true if a user is already a member of the group. * + * @since 1.0.0 + * * @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 ) { // If the user is already a member (because BP at one point allowed two invitations to - // slip through), delete all existing invitations/requests and return true + // slip through), delete all existing invitations/requests and return true. if ( groups_is_user_member( $user_id, $group_id ) ) { if ( groups_check_user_has_invite( $user_id, $group_id ) ) { groups_delete_invite( $user_id, $group_id ); @@ -1154,18 +1195,18 @@ function groups_accept_invite( $user_id, $group_id ) { return false; } - // Remove request to join + // Remove request to join. if ( $member->check_for_membership_request( $user_id, $group_id ) ) { $member->delete_request( $user_id, $group_id ); } - // Modify group meta + // Modify group meta. groups_update_groupmeta( $group_id, 'last_activity', bp_core_current_time() ); /** * Fires after a user has accepted a group invite. * - * @since BuddyPress (1.0.0) + * @since 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. @@ -1178,9 +1219,10 @@ function groups_accept_invite( $user_id, $group_id ) { /** * Reject a group invitation. * + * @since 1.0.0 + * * @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 ) { @@ -1190,7 +1232,7 @@ function groups_reject_invite( $user_id, $group_id ) { /** * Fires after a user rejects a group invitation. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user rejecting the invite. * @param int $group_id ID of the group being rejected. @@ -1203,9 +1245,10 @@ function groups_reject_invite( $user_id, $group_id ) { /** * Delete a group invitation. * + * @since 1.0.0 + * * @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 ) { @@ -1215,7 +1258,7 @@ function groups_delete_invite( $user_id, $group_id ) { /** * Fires after the deletion of a group invitation. * - * @since BuddyPress (1.9.0) + * @since 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. @@ -1228,6 +1271,8 @@ function groups_delete_invite( $user_id, $group_id ) { /** * Send all pending invites by a single user to a specific group. * + * @since 1.0.0 + * * @param int $user_id ID of the inviting user. * @param int $group_id ID of the group. */ @@ -1243,7 +1288,7 @@ function groups_send_invites( $user_id, $group_id ) { for ( $i = 0, $count = count( $invited_users ); $i < $count; ++$i ) { $member = new BP_Groups_Member( $invited_users[$i], $group_id ); - // Send the actual invite + // Send the actual invite. groups_notification_group_invites( $group, $member, $user_id ); $member->invite_sent = 1; @@ -1253,20 +1298,23 @@ function groups_send_invites( $user_id, $group_id ) { /** * Fires after the sending of invites for a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added $user_id to passed parameters. * * @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. + * @param int $user_id ID of the inviting user. */ - do_action( 'groups_send_invites', $group_id, $invited_users ); + do_action( 'groups_send_invites', $group_id, $invited_users, $user_id ); } /** * Get IDs of users with outstanding invites to a given group from a specified user. * + * @since 1.0.0 + * * @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. */ @@ -1281,11 +1329,12 @@ 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). * + * @since 1.0.0 + * * @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' ) { @@ -1295,8 +1344,9 @@ 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. + * @since 1.0.0 * + * @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 ) { @@ -1308,10 +1358,11 @@ function groups_delete_all_group_invites( $group_id ) { /** * Promote a member to a new status within a group. * + * @since 1.0.0 + * * @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 ) { @@ -1327,7 +1378,7 @@ function groups_promote_member( $user_id, $group_id, $status ) { /** * Fires before the promotion of a user to a new status. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $group_id ID of the group being promoted in. * @param int $user_id ID of the user being promoted. @@ -1341,9 +1392,10 @@ function groups_promote_member( $user_id, $group_id, $status ) { /** * Demote a user to 'member' status within a group. * + * @since 1.0.0 + * * @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 ) { @@ -1356,7 +1408,7 @@ function groups_demote_member( $user_id, $group_id ) { /** * Fires before the demotion of a user to 'member'. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group being demoted in. * @param int $user_id ID of the user being demoted. @@ -1369,9 +1421,10 @@ function groups_demote_member( $user_id, $group_id ) { /** * Ban a member from a group. * + * @since 1.0.0 + * * @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 ) { @@ -1384,7 +1437,7 @@ function groups_ban_member( $user_id, $group_id ) { /** * Fires before the banning of a member from a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group being banned from. * @param int $user_id ID of the user being banned. @@ -1397,9 +1450,10 @@ function groups_ban_member( $user_id, $group_id ) { /** * Unban a member from a group. * + * @since 1.0.0 + * * @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 ) { @@ -1412,7 +1466,7 @@ function groups_unban_member( $user_id, $group_id ) { /** * Fires before the unbanning of a member from a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group being unbanned from. * @param int $user_id ID of the user being unbanned. @@ -1427,30 +1481,24 @@ function groups_unban_member( $user_id, $group_id ) { /** * Remove a member from a group. * + * @since 1.2.6 + * * @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() ) { - // 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; - } - } + 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) + * @since 1.2.6 * * @param int $group_id ID of the group being removed from. * @param int $user_id ID of the user being removed. @@ -1465,22 +1513,23 @@ function groups_remove_member( $user_id, $group_id ) { /** * Create a group membership request. * + * @since 1.0.0 + * * @param int $requesting_user_id ID of the user requesting membership. * @param int $group_id ID of the group. - * * @return bool True on success, false on failure. */ function groups_send_membership_request( $requesting_user_id, $group_id ) { - // Prevent duplicate requests + // Prevent duplicate requests. if ( groups_check_for_membership_request( $requesting_user_id, $group_id ) ) return false; - // Check if the user is already a member or is banned + // Check if the user is already a member or is banned. if ( groups_is_user_member( $requesting_user_id, $group_id ) || groups_is_user_banned( $requesting_user_id, $group_id ) ) return false; - // Check if the user is already invited - if so, simply accept invite + // Check if the user is already invited - if so, simply accept invite. if ( groups_check_user_has_invite( $requesting_user_id, $group_id ) ) { groups_accept_invite( $requesting_user_id, $group_id ); return true; @@ -1499,14 +1548,14 @@ function groups_send_membership_request( $requesting_user_id, $group_id ) { if ( $requesting_user->save() ) { $admins = groups_get_group_admins( $group_id ); - // Saved okay, now send the email notification + // Saved okay, now send the email notification. for ( $i = 0, $count = count( $admins ); $i < $count; ++$i ) groups_notification_new_membership_request( $requesting_user_id, $admins[$i]->user_id, $group_id, $requesting_user->id ); /** * Fires after the creation of a new membership request. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $requesting_user_id ID of the user requesting membership. * @param array $admins Array of group admins. @@ -1524,6 +1573,8 @@ function groups_send_membership_request( $requesting_user_id, $group_id ) { /** * Accept a pending group membership request. * + * @since 1.0.0 + * * @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 @@ -1531,7 +1582,6 @@ function groups_send_membership_request( $requesting_user_id, $group_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 ) { @@ -1556,7 +1606,7 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_ /** * Fires after a group membership request has been accepted. * - * @since BuddyPress (1.0.0) + * @since 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. @@ -1570,6 +1620,8 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_ /** * Reject a pending group membership request. * + * @since 1.0.0 + * * @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 @@ -1577,7 +1629,6 @@ function groups_accept_membership_request( $membership_id, $user_id = 0, $group_ * @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 ) { @@ -1588,7 +1639,7 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_ /** * Fires after a group membership request has been rejected. * - * @since BuddyPress (1.0.0) + * @since 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. @@ -1602,6 +1653,8 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_ /** * Delete a pending group membership request. * + * @since 1.2.0 + * * @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 @@ -1609,7 +1662,6 @@ function groups_reject_membership_request( $membership_id, $user_id = 0, $group_ * @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 ) { @@ -1627,9 +1679,10 @@ function groups_delete_membership_request( $membership_id, $user_id = 0, $group_ /** * Check whether a user has an outstanding membership request for a given group. * + * @since 1.0.0 + * * @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 ) { @@ -1639,8 +1692,9 @@ 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. + * @since 1.0.2 * + * @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 ) { @@ -1655,7 +1709,7 @@ function groups_accept_all_pending_membership_requests( $group_id ) { /** * Fires after the acceptance of all pending membership requests to a group. * - * @since BuddyPress (1.0.2) + * @since 1.0.2 * * @param int $group_id ID of the group whose pending memberships were accepted. */ @@ -1669,6 +1723,8 @@ function groups_accept_all_pending_membership_requests( $group_id ) { /** * Delete metadata for a group. * + * @since 1.0.0 + * * @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 @@ -1677,17 +1733,16 @@ function groups_accept_all_pending_membership_requests( $group_id ) { * 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 ) { global $wpdb; - // Legacy - if no meta_key is passed, delete all for the item + // Legacy - if no meta_key is passed, delete all for the item. if ( empty( $meta_key ) ) { $keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$wpdb->groupmeta} WHERE group_id = %d", $group_id ) ); - // With no meta_key, ignore $delete_all + // With no meta_key, ignore $delete_all. $delete_all = false; } else { $keys = array( $meta_key ); @@ -1708,12 +1763,13 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa /** * Get a piece of group metadata. * + * @since 1.0.0 + * * @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. - * * @return mixed Metadata value. */ function groups_get_groupmeta( $group_id, $meta_key = '', $single = true ) { @@ -1727,13 +1783,14 @@ function groups_get_groupmeta( $group_id, $meta_key = '', $single = true ) { /** * Update a piece of group metadata. * + * @since 1.0.0 + * * @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. @@ -1749,16 +1806,15 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value, $prev_value /** * Add a piece of group metadata. * - * @since BuddyPress (2.0.0) + * @since 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 + * @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 ) { @@ -1774,7 +1830,7 @@ function groups_add_groupmeta( $group_id, $meta_key, $meta_value, $unique = fals /** * Delete all group membership information for the specified user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user. */ @@ -1784,7 +1840,7 @@ function groups_remove_data_for_user( $user_id ) { /** * Fires after the deletion of all data for a user. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $user_id ID of the user whose data is being deleted. */ 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 674448cacd6fe9436e66986f7e1a9da985faf91e..98aaecd62a231eca556de1d80f70ef0eb9897039 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Loader. * @@ -9,747 +8,18 @@ * * @package BuddyPress * @subpackage GroupsLoader + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Groups_Component extends BP_Component { - - /** - * Auto-join group when non group member performs group activity. - * - * @since BuddyPress (1.5.0) - * @access public - * @var bool - */ - public $auto_join; - - /** - * The group being currently accessed. - * - * @since BuddyPress (1.5.0) - * @access public - * @var BP_Groups_Group - */ - public $current_group; - - /** - * Default group extension. - * - * @since BuddyPress (1.6.0) - * @access public - * @todo Is this used anywhere? Is this a duplicate of $default_extension? - */ - var $default_component; - - /** - * Default group extension. - * - * @since BuddyPress (1.6.0) - * @access public - * @var string - */ - public $default_extension; - - /** - * Illegal group names/slugs. - * - * @since BuddyPress (1.5.0) - * @access public - * @var array - */ - public $forbidden_names; - - /** - * Group creation/edit steps (e.g. Details, Settings, Avatar, Invites). - * - * @since BuddyPress (1.5.0) - * @access public - * @var array - */ - public $group_creation_steps; - - /** - * Types of group statuses (Public, Private, Hidden). - * - * @since BuddyPress (1.5.0) - * @access public - * @var array - */ - public $valid_status; - - /** - * Start the groups component creation process. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'groups', - _x( 'User Groups', 'Group screen page <title>', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 70 - ) - ); - } - - /** - * Include Groups component files. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::includes() for a description of arguments. - * - * @param array $includes See BP_Component::includes() for a description. - */ - public function includes( $includes = array() ) { - $includes = array( - 'cache', - 'forums', - 'actions', - 'filters', - 'screens', - 'classes', - 'widgets', - 'activity', - 'template', - 'adminbar', - 'functions', - 'notifications' - ); - - if ( is_admin() ) - $includes[] = 'admin'; - - parent::includes( $includes ); - } - - /** - * Set up component global data. - * - * The BP_GROUPS_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for a description of arguments. - * - * @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_GROUPS_SLUG' ) ) - define( 'BP_GROUPS_SLUG', $this->id ); - - // Global tables for groups component - $global_tables = array( - 'table_name' => $bp->table_prefix . 'bp_groups', - 'table_name_members' => $bp->table_prefix . 'bp_groups_members', - 'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta' - ); - - // Metadata tables for groups component - $meta_tables = array( - 'group' => $bp->table_prefix . 'bp_groups_groupmeta', - ); - - // All globals for groups component. - // Note that global_tables is included in this array. - $args = array( - 'slug' => BP_GROUPS_SLUG, - 'root_slug' => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG, - 'has_directory' => true, - 'directory_title' => _x( 'Groups', 'component directory title', 'buddypress' ), - 'notification_callback' => 'groups_format_notifications', - 'search_string' => _x( 'Search Groups...', 'Component directory search', 'buddypress' ), - 'global_tables' => $global_tables, - 'meta_tables' => $meta_tables, - ); - - parent::setup_globals( $args ); - - /** Single Group Globals **********************************************/ - - // Are we viewing a single group? - 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' ) { - $this->current_group = groups_get_group( array( - 'group_id' => $group_id, - 'populate_extras' => true, - ) ); - - } 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 ) ); - } - - // When in a single group, the first action is bumped down one because of the - // group name, so we need to adjust this and set the group name to current_item. - $bp->current_item = bp_current_action(); - $bp->current_action = bp_action_variable( 0 ); - array_shift( $bp->action_variables ); - - // Using "item" not "group" for generic support in other components. - if ( bp_current_user_can( 'bp_moderate' ) ) - bp_update_is_item_admin( true, 'groups' ); - else - bp_update_is_item_admin( groups_is_user_admin( bp_loggedin_user_id(), $this->current_group->id ), 'groups' ); - - // If the user is not an admin, check if they are a moderator - if ( !bp_is_item_admin() ) - bp_update_is_item_mod ( groups_is_user_mod ( bp_loggedin_user_id(), $this->current_group->id ), 'groups' ); - - // Is the logged in user a member of the group? - if ( ( is_user_logged_in() && groups_is_user_member( bp_loggedin_user_id(), $this->current_group->id ) ) ) - $this->current_group->is_user_member = true; - else - $this->current_group->is_user_member = false; - - // Should this group be visible to the logged in user? - if ( 'public' == $this->current_group->status || $this->current_group->is_user_member ) - $this->current_group->is_visible = true; - else - $this->current_group->is_visible = false; - - // If this is a private or hidden group, does the user have access? - if ( 'private' == $this->current_group->status || 'hidden' == $this->current_group->status ) { - if ( $this->current_group->is_user_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) ) - $this->current_group->user_has_access = true; - else - $this->current_group->user_has_access = false; - } else { - $this->current_group->user_has_access = true; - } - - // Set current_group to 0 to prevent debug errors - } else { - $this->current_group = 0; - } - - /** - * 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', - 'invites', - 'send-invites', - 'forum', - 'delete', - 'add', - 'admin', - 'request-membership', - 'members', - 'settings', - 'avatar', - $this->slug, - $this->root_slug, - ) ); - - // If the user was attempting to access a group, but no group by that name was found, 404 - if ( bp_is_groups_component() && empty( $this->current_group ) && bp_current_action() && !in_array( bp_current_action(), $this->forbidden_names ) ) { - bp_do_404(); - return; - } - - /** - * 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' ), - 'position' => 0 - ), - 'group-settings' => array( - 'name' => _x( 'Settings', 'Group screen nav', 'buddypress' ), - 'position' => 10 - ) - ) ); - - // If avatar uploads are not disabled, add avatar option - $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads(); - if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) { - $this->group_creation_steps['group-avatar'] = array( - 'name' => _x( 'Photo', 'Group screen nav', 'buddypress' ), - 'position' => 20 - ); - } - - // If friends component is active, add invitations - if ( bp_is_active( 'friends' ) ) { - $this->group_creation_steps['group-invites'] = array( - 'name' => _x( 'Invites', 'Group screen nav', 'buddypress' ), - 'position' => 30 - ); - } - - /** - * 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', - 'hidden' - ) ); - - // Auto join group when non group member performs group activity - $this->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? false : true; - } - - /** - * Set up canonical stack for this component. - * - * @since BuddyPress (2.1.0) - */ - public function setup_canonical_stack() { - if ( ! bp_is_groups_component() ) { - return; - } - - if ( empty( $this->current_group ) ) { - return; - } - - - /** - * 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() ) { - buddypress()->current_action = $this->default_extension; - } - - // Prepare for a redirect to the canonical URL - buddypress()->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group ); - - if ( bp_current_action() ) { - buddypress()->canonical_stack['action'] = bp_current_action(); - } - - if ( !empty( buddypress()->action_variables ) ) { - buddypress()->canonical_stack['action_variables'] = bp_action_variables(); - } - - // When viewing the default extension, the canonical URL should not have - // that extension's slug, unless more has been tacked onto the URL via - // action variables - if ( bp_is_current_action( $this->default_extension ) && empty( buddypress()->action_variables ) ) { - unset( buddypress()->canonical_stack['action'] ); - } - } - - /** - * Set up component navigation. - * - * @since BuddyPress (1.5.0) - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Only grab count if we're on a user page - if ( bp_is_user() ) { - $count = bp_get_total_group_count_for_user(); - $class = ( 0 === $count ) ? 'no-count' : 'count'; - $nav_name = sprintf( _x( 'Groups <span class="%s">%s</span>', 'Group screen nav with counter', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ); - } else { - $nav_name = _x( 'Groups', 'Group screen nav without counter', 'buddypress' ); - } - - // Add 'Groups' to the main navigation - $main_nav = array( - 'name' => $nav_name, - 'slug' => $this->slug, - 'position' => 70, - 'screen_function' => 'groups_screen_my_groups', - 'default_subnav_slug' => 'my-groups', - 'item_css_id' => $this->id - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - $user_domain = false; - } - - if ( !empty( $user_domain ) ) { - $groups_link = trailingslashit( $user_domain . $this->slug ); - - // Add the My Groups nav item - $sub_nav[] = array( - 'name' => __( 'Memberships', 'buddypress' ), - 'slug' => 'my-groups', - 'parent_url' => $groups_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'groups_screen_my_groups', - 'position' => 10, - 'item_css_id' => 'groups-my-groups' - ); - - // Add the Group Invites nav item - $sub_nav[] = array( - 'name' => __( 'Invitations', 'buddypress' ), - 'slug' => 'invites', - 'parent_url' => $groups_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'groups_screen_group_invites', - 'user_has_access' => bp_core_can_edit_settings(), - 'position' => 30 - ); - - parent::setup_nav( $main_nav, $sub_nav ); - } - - if ( bp_is_groups_component() && bp_is_single_item() ) { - - // Reset sub nav - $sub_nav = array(); - - // Add 'Groups' to the main navigation - $main_nav = array( - 'name' => __( 'Memberships', 'buddypress' ), - 'slug' => $this->current_group->slug, - 'position' => -1, // Do not show in BuddyBar - 'screen_function' => 'groups_screen_group_home', - 'default_subnav_slug' => $this->default_extension, - 'item_css_id' => $this->id - ); - - $group_link = bp_get_group_permalink( $this->current_group ); - - // Add the "Home" subnav item, as this will always be present - $sub_nav[] = array( - 'name' => _x( 'Home', 'Group screen navigation title', 'buddypress' ), - 'slug' => 'home', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_home', - 'position' => 10, - 'item_css_id' => 'home' - ); - - // If this is a private group, and the user is not a - // member and does not have an outstanding invitation, - // show a "Request Membership" nav item. - if ( is_user_logged_in() && - ! $this->current_group->is_user_member && - ! groups_check_for_membership_request( bp_loggedin_user_id(), $this->current_group->id ) && - $this->current_group->status == 'private' && - ! groups_check_user_has_invite( bp_loggedin_user_id(), $this->current_group->id ) - ) { - - $sub_nav[] = array( - 'name' => _x( 'Request Membership','Group screen nav', 'buddypress' ), - 'slug' => 'request-membership', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_request_membership', - 'position' => 30 - ); - } - - // Forums are enabled and turned on - if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) { - $sub_nav[] = array( - 'name' => _x( 'Forum', 'My Group screen nav', 'buddypress' ), - 'slug' => 'forum', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_forum', - 'position' => 40, - 'user_has_access' => $this->current_group->user_has_access, - 'item_css_id' => 'forums' - ); - } - - $sub_nav[] = array( - 'name' => sprintf( _x( 'Members <span>%s</span>', 'My Group screen nav', 'buddypress' ), number_format( $this->current_group->total_member_count ) ), - 'slug' => 'members', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_members', - 'position' => 60, - 'user_has_access' => $this->current_group->user_has_access, - 'item_css_id' => 'members', - 'no_access_url' => $group_link, - ); - - if ( bp_is_active( 'friends' ) && bp_groups_user_can_send_invites() ) { - $sub_nav[] = array( - 'name' => _x( 'Send Invites', 'My Group screen nav', 'buddypress' ), - 'slug' => 'send-invites', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_invite', - 'item_css_id' => 'invite', - 'position' => 70, - 'user_has_access' => $this->current_group->user_has_access, - 'no_access_url' => $group_link, - ); - } - - // If the user is a group admin, then show the group admin nav item - if ( bp_is_item_admin() ) { - $sub_nav[] = array( - 'name' => _x( 'Manage', 'My Group screen nav', 'buddypress' ), - 'slug' => 'admin', - 'parent_url' => $group_link, - 'parent_slug' => $this->current_group->slug, - 'screen_function' => 'groups_screen_group_admin', - 'position' => 1000, - 'user_has_access' => true, - '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'); - } - } - - /** - * Set up the component entries in the WordPress Admin Bar. - * - * @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. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - $bp = buddypress(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $user_domain = bp_loggedin_user_domain(); - $groups_link = trailingslashit( $user_domain . $this->slug ); - - // Pending group invites - $count = groups_get_invite_count_for_user(); - $title = _x( 'Groups', 'My Account Groups', 'buddypress' ); - $pending = _x( 'No Pending Invites', 'My Account Groups sub nav', 'buddypress' ); - - if ( !empty( $count['total'] ) ) { - $title = sprintf( _x( 'Groups <span class="count">%s</span>', 'My Account Groups nav', 'buddypress' ), $count ); - $pending = sprintf( _x( 'Pending Invites <span class="count">%s</span>', 'My Account Groups sub nav', 'buddypress' ), $count ); - } - - // Add the "My Account" sub menus - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => $title, - 'href' => trailingslashit( $groups_link ) - ); - - // My Groups - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-memberships', - 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ), - 'href' => trailingslashit( $groups_link ) - ); - - // Invitations - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-invites', - 'title' => $pending, - 'href' => trailingslashit( $groups_link . 'invites' ) - ); - - // Create a Group - if ( bp_user_can_create_groups() ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-create', - 'title' => _x( 'Create a Group', 'My Account Groups sub nav', 'buddypress' ), - 'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' ) - ); - } - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title>. - */ - public function setup_title() { - $bp = buddypress(); - - if ( bp_is_groups_component() ) { - - if ( bp_is_my_profile() && !bp_is_single_item() ) { - $bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' ); - - } 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', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - - // We are viewing a single group, so set up the - // group navigation menu using the $this->current_group global. - } 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, - 'object' => 'group', - 'type' => 'thumb', - 'avatar_dir' => 'group-avatars', - 'alt' => __( 'Group Profile Photo', 'buddypress' ) - ) ); - - if ( empty( $bp->bp_options_avatar ) ) { - $bp->bp_options_avatar = '<img src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Profile Photo', 'buddypress' ) . '" class="avatar" />'; - } - } - } - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-groups-component.php'; /** * Bootstrap the Notifications component. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_setup_groups() { buddypress()->groups = new BP_Groups_Component(); 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 3bd75d7574251a9ba2fffa09c01e9e6a0df64313..3ee37a2b0dd265366ed85556871470f7821d62e7 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Notification Functions. * @@ -8,9 +7,10 @@ * * @package BuddyPress * @subpackage GroupsActivity + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Emails ********************************************************************/ @@ -18,13 +18,12 @@ defined( 'ABSPATH' ) || exit; /** * Notify all group members when a group is updated. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @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, $old_group = null ) { - $group = groups_get_group( array( 'group_id' => $group_id ) ); if ( $old_group instanceof BP_Groups_Group ) { @@ -32,7 +31,7 @@ function groups_notification_group_updated( $group_id = 0, $old_group = null ) { if ( $group->name !== $old_group->name ) { $changed[] = sprintf( - _x( '* Name changed from "%s" to "%s"', 'Group update email text', 'buddypress' ), + _x( '* Name changed from "%s" to "%s".', 'Group update email text', 'buddypress' ), esc_html( $old_group->name ), esc_html( $group->name ) ); @@ -40,7 +39,7 @@ function groups_notification_group_updated( $group_id = 0, $old_group = null ) { if ( $group->description !== $old_group->description ) { $changed[] = sprintf( - _x( '* Description changed from "%s" to "%s"', 'Group update email text', 'buddypress' ), + _x( '* Description changed from "%s" to "%s".', 'Group update email text', 'buddypress' ), esc_html( $old_group->description ), esc_html( $group->description ) ); @@ -50,7 +49,7 @@ function groups_notification_group_updated( $group_id = 0, $old_group = null ) { /** * Filters the bullet points listing updated items in the email notification after a group is updated. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $changed Array of bullet points. */ @@ -58,72 +57,27 @@ function groups_notification_group_updated( $group_id = 0, $old_group = null ) { $changed_text = ''; if ( ! empty( $changed ) ) { - $changed_text = "\n\n" . implode( "\n", $changed ); + $changed_text = implode( "\n", $changed ); } - $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) ); $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); - foreach ( (array) $user_ids as $user_id ) { - // Continue if member opted out of receiving this email + // Continue if member opted out of receiving this email. if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) { continue; } - $ud = bp_core_get_core_userdata( $user_id ); - - // Set up and send the message - $to = $ud->user_email; - - $group_link = bp_get_group_permalink( $group ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/'; - - $message = sprintf( __( -'Group details for the group "%1$s" were updated: %2$s - -To view the group: %3$s - ---------------------- -', 'buddypress' ), $group->name, $changed_text, $group_link ); - - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); - - /** - * 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 ); - - unset( $message, $to ); + $args = array( + 'tokens' => array( + 'changed_text' => $changed_text, + 'group' => $group, + 'group.id' => $group_id, + 'group.url' => esc_url( bp_get_group_permalink( $group ) ), + 'group.name' => $group->name, + ), + ); + bp_send_email( 'groups-details-updated', (int) $user_id, $args ); } /** @@ -131,31 +85,30 @@ To view the group: %3$s * * See https://buddypress.trac.wordpress.org/ticket/3644 for blank message parameter. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * @since 2.5.0 $subject has been unset and is deprecated. * * @param array $user_ids Array of user IDs to notify about the update. - * @param string $subject Email notification subject text. + * @param string $subject Deprecated in 2.5; now an empty string. * @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 ); + do_action( 'bp_groups_sent_updated_email', $user_ids, '', '', $group_id ); } /** * Notify group admin about new membership request. * - * @since BuddyPress (1.0.0) + * @since 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 false|null False on failure. */ function groups_notification_new_membership_request( $requesting_user_id = 0, $admin_id = 0, $group_id = 0, $membership_id = 0 ) { - // Trigger a BuddyPress Notification + // Trigger a BuddyPress Notification. if ( bp_is_active( 'notifications' ) ) { bp_notifications_add_notification( array( 'user_id' => $admin_id, @@ -166,233 +119,75 @@ function groups_notification_new_membership_request( $requesting_user_id = 0, $a ) ); } - // Bail if member opted out of receiving this email + // Bail if member opted out of receiving this email. if ( 'no' === bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) ) { - return false; - } - - // Username of the user requesting a membership: %1$s in mail - $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id ); - $group = groups_get_group( array( 'group_id' => $group_id ) ); - - // Group Administrator user's data - $ud = bp_core_get_core_userdata( $admin_id ); - $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests'; - - // Link to the user's profile who's requesting a membership: %3$s in mail - $profile_link = bp_core_get_user_domain( $requesting_user_id ); - - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - // Link to the group administrator email settings: %s in "disable notifications" part of the email - $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 ) ) ); - - 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. - -To view all pending membership requests for this group, please visit: -%3$s - -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 ); + return; } - /** - * 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 ); + $group = groups_get_group( array( 'group_id' => $group_id ) ); + $args = array( + 'tokens' => array( + 'admin.id' => $admin_id, + 'group' => $group, + 'group.name' => $group->name, + 'group.id' => $group_id, + 'group-requests.url' => esc_url( bp_get_group_permalink( $group ) . 'admin/membership-requests' ), + 'membership.id' => $membership_id, + 'profile.url' => esc_url( bp_core_get_user_domain( $requesting_user_id ) ), + 'requesting-user.id' => $requesting_user_id, + 'requesting-user.name' => bp_core_get_user_displayname( $requesting_user_id ), + ), + ); + bp_send_email( 'groups-membership-request', (int) $admin_id, $args ); } /** * Notify member about their group membership request. * - * @since BuddyPress (1.0.0) + * @since 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 false|null */ function groups_notification_membership_request_completed( $requesting_user_id = 0, $group_id = 0, $accepted = true ) { - // Trigger a BuddyPress Notification + // Trigger a BuddyPress Notification. if ( bp_is_active( 'notifications' ) ) { - // What type of acknowledgement - $type = ! empty( $accepted ) - ? 'membership_request_accepted' - : 'membership_request_rejected'; + // What type of acknowledgement. + $type = ! empty( $accepted ) ? 'membership_request_accepted' : 'membership_request_rejected'; bp_notifications_add_notification( array( 'user_id' => $requesting_user_id, 'item_id' => $group_id, 'component_name' => buddypress()->groups->id, - 'component_action' => $type + 'component_action' => $type, ) ); } - // Bail if member opted out of receiving this email + // Bail if member opted out of receiving this email. if ( 'no' === bp_get_user_meta( $requesting_user_id, 'notification_membership_request_completed', true ) ) { - return false; + return; } - $group = groups_get_group( array( 'group_id' => $group_id ) ); - $ud = bp_core_get_core_userdata( $requesting_user_id ); - $group_link = bp_get_group_permalink( $group ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/'; - $to = $ud->user_email; + $group = groups_get_group( array( 'group_id' => $group_id ) ); + $args = array( + 'tokens' => array( + 'group' => $group, + 'group.id' => $group_id, + 'group.name' => $group->name, + 'group.url' => esc_url( bp_get_group_permalink( $group ) ), + 'requesting-user.id' => $requesting_user_id, + ), + ); - // Set up and send the message if ( ! empty( $accepted ) ) { - $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) ); - $message = sprintf( __( -'Your membership request for the group "%1$s" has been accepted. - -To view the group please login and visit: %2$s - ---------------------- -', 'buddypress' ), $group->name, $group_link ); - + bp_send_email( 'groups-membership-request-accepted', (int) $requesting_user_id, $args ); } else { - $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name ) ) ); - $message = sprintf( __( -'Your membership request for the group "%1$s" has been rejected. - -To submit another request please log in and visit: %2$s - ---------------------- -', 'buddypress' ), $group->name, $group_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 ); + bp_send_email( 'groups-membership-request-rejected', (int) $requesting_user_id, $args ); } - - /** - * 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 ); add_action( 'groups_membership_rejected', 'groups_notification_membership_request_completed', 10, 3 ); @@ -400,12 +195,10 @@ add_action( 'groups_membership_rejected', 'groups_notification_membership_reques /** * Notify group member they have been promoted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. - * - * @return false|null False on failure. */ function groups_notification_promoted_member( $user_id = 0, $group_id = 0 ) { @@ -418,206 +211,84 @@ function groups_notification_promoted_member( $user_id = 0, $group_id = 0 ) { $type = 'member_promoted_to_mod'; } - // Trigger a BuddyPress Notification + // Trigger a BuddyPress Notification. if ( bp_is_active( 'notifications' ) ) { bp_notifications_add_notification( array( 'user_id' => $user_id, 'item_id' => $group_id, 'component_name' => buddypress()->groups->id, - 'component_action' => $type + 'component_action' => $type, ) ); } - // Bail if admin opted out of receiving this email + // Bail if admin opted out of receiving this email. if ( 'no' === bp_get_user_meta( $user_id, 'notification_groups_admin_promotion', true ) ) { - return false; - } - - $group = groups_get_group( array( 'group_id' => $group_id ) ); - $ud = bp_core_get_core_userdata($user_id); - $group_link = bp_get_group_permalink( $group ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/'; - - // Set up and send the message - $to = $ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ) ) ); - $message = sprintf( __( -'You have been promoted to %1$s for the group: "%2$s". - -To view the group please visit: %3$s - ---------------------- -', 'buddypress' ), $promoted_to, $group->name, $group_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 ); + return; } - /** - * 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 ); + $group = groups_get_group( array( 'group_id' => $group_id ) ); + $args = array( + 'tokens' => array( + 'group' => $group, + 'group.id' => $group_id, + 'group.url' => esc_url( bp_get_group_permalink( $group ) ), + 'group.name' => $group->name, + 'promoted_to' => $promoted_to, + 'user.id' => $user_id, + ), + ); + bp_send_email( 'groups-member-promoted', (int) $user_id, $args ); } add_action( 'groups_promoted_member', 'groups_notification_promoted_member', 10, 2 ); /** * Notify a member they have been invited to a group. * - * @since BuddyPress (1.0.0) + * @since 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 null|false False on failure. */ function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) { - // Bail if member has already been invited + // Bail if member has already been invited. if ( ! empty( $member->invite_sent ) ) { return; } // @todo $inviter_ud may be used for caching, test without it - $inviter_ud = bp_core_get_core_userdata( $inviter_user_id ); - $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true ); - $inviter_link = bp_core_get_user_domain( $inviter_user_id ); - $group_link = bp_get_group_permalink( $group ); - - // Setup the ID for the invited user + $inviter_ud = bp_core_get_core_userdata( $inviter_user_id ); $invited_user_id = $member->user_id; - // Trigger a BuddyPress Notification + // Trigger a BuddyPress Notification. if ( bp_is_active( 'notifications' ) ) { bp_notifications_add_notification( array( 'user_id' => $invited_user_id, 'item_id' => $group->id, 'component_name' => buddypress()->groups->id, - 'component_action' => 'group_invite' + 'component_action' => 'group_invite', ) ); } - // Bail if member opted out of receiving this email + // Bail if member opted out of receiving this email. if ( 'no' === bp_get_user_meta( $invited_user_id, 'notification_groups_invite', true ) ) { - return false; - } - - $invited_ud = bp_core_get_core_userdata( $invited_user_id ); - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $invited_user_id ) . $settings_slug . '/notifications/'; - $invited_link = bp_core_get_user_domain( $invited_user_id ); - $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' ); - - // Set up and send the message - $to = $invited_ud->user_email; - $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) ); - $message = sprintf( __( -'One of your friends %1$s has invited you to the group: "%2$s". - -To view your group invites visit: %3$s - -To view the group visit: %4$s - -To view %5$s\'s profile visit: %6$s - ---------------------- -', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link ); - - // Only show the disable notifications line if the settings component is enabled - if ( bp_is_active( 'settings' ) ) { - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + return; } - /** - * 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 ); + $invited_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_groups_slug(); + $args = array( + 'tokens' => array( + 'group' => $group, + 'group.url' => bp_get_group_permalink( $group ), + 'group.name' => $group->name, + 'inviter.name' => bp_core_get_userlink( $inviter_user_id, true, false, true ), + 'inviter.url' => bp_core_get_user_domain( $inviter_user_id ), + 'inviter.id' => $inviter_user_id, + 'invites.url' => esc_url( $invited_link . '/invites/' ), + ), + ); + bp_send_email( 'groups-invitation', (int) $invited_user_id, $args ); } /** Notifications *************************************************************/ @@ -625,7 +296,7 @@ To view %5$s\'s profile visit: %6$s /** * Format notifications for the Groups component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $action The kind of notification being rendered. * @param int $item_id The primary item ID. @@ -634,7 +305,6 @@ To view %5$s\'s profile visit: %6$s * 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' ) { @@ -649,8 +319,8 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to $amount = 'single'; // Set up the string and the filter - // Because different values are passed to the filters, we'll return the - // values inline + // because different values are passed to the filters, + // we'll return values inline. if ( (int) $total_items > 1 ) { $text = sprintf( __( '%1$d new membership requests for the group "%2$s"', 'buddypress' ), (int) $total_items, $group->name ); $amount = 'multiple'; @@ -664,7 +334,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for request. * @param string $group_link The permalink for the group. @@ -682,7 +352,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param string $group_link The permalink for the group. @@ -709,7 +379,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for request. * @param string $group_link The permalink for the group. @@ -727,7 +397,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param string $group_link The permalink for the group. @@ -763,7 +433,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters multiple accepted group membership requests notification for string format. * Complete filter - bp_groups_multiple_membership_request_accepted_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $total_items Total number of accepted requests. @@ -778,7 +448,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification * @param int $total_items Total number of accepted requests. @@ -802,7 +472,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters single accepted group membership request notification for string format. * Complete filter - bp_groups_single_membership_request_accepted_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param string $group_link The permalink for the group. @@ -817,7 +487,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param string $group_link The permalink for the group. @@ -852,7 +522,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters multiple rejected group membership requests notification for string format. * Complete filter - bp_groups_multiple_membership_request_rejected_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $total_items Total number of rejected requests. @@ -867,7 +537,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $total_items Total number of rejected requests. @@ -890,7 +560,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters single rejected group membership requests notification for string format. * Complete filter - bp_groups_single_membership_request_rejected_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $group_link The permalink for the group. @@ -905,7 +575,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $group_link The permalink for the group. @@ -939,7 +609,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $total_items Total number of rejected requests. @@ -952,7 +622,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $total_items Total number of rejected requests. @@ -973,7 +643,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $group_link The permalink for the group. @@ -987,7 +657,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $group_link The permalink for the group. @@ -1021,7 +691,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $total_items Total number of rejected requests. @@ -1055,7 +725,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $group_link The permalink for the group. @@ -1069,7 +739,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * 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) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $group_link The permalink for the group. @@ -1103,7 +773,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters multiple group invitation notification for string format. * Complete filter - bp_groups_multiple_group_invite_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $total_items Total number of rejected requests. @@ -1116,7 +786,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters multiple group invitation notification for non-string format. * Complete filter - bp_groups_multiple_group_invite_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $total_items Total number of rejected requests. @@ -1137,7 +807,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters single group invitation notification for string format. * Complete filter - bp_groups_single_group_invite_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $string HTML anchor tag for notification. * @param int $group_link The permalink for the group. @@ -1151,7 +821,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to * Filters single group invitation notification for non-string format. * Complete filter - bp_groups_single_group_invite_notification. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $array Array holding permalink and content for notification. * @param int $group_link The permalink for the group. @@ -1166,13 +836,36 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to } } + break; + + default: + + /** + * Filters plugin-added group-related custom component_actions. + * + * @since 2.4.0 + * + * @param string $notification Null value. + * @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. + */ + $custom_action_notification = apply_filters( 'bp_groups_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format ); + + if ( ! is_null( $custom_action_notification ) ) { + return $custom_action_notification; + } + break; } /** * Fires right before returning the formatted group notifications. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $action The type of notification being rendered. * @param int $item_id The primary item ID. @@ -1187,7 +880,7 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to /** * Remove all notifications for any member belonging to a specific group. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $group_id ID of the group. */ @@ -1201,7 +894,7 @@ add_action( 'groups_delete_group', 'bp_groups_delete_group_delete_all_notificati /** * When a demotion takes place, delete any corresponding promotion notifications. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. @@ -1217,7 +910,7 @@ add_action( 'groups_demoted_member', 'bp_groups_delete_promotion_notifications', /** * Mark notifications read when a member accepts a group invitation. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. @@ -1234,18 +927,18 @@ add_action( 'groups_delete_invite', 'bp_groups_accept_invite_mark_notifications' /** * Mark notifications read when a member views their group memberships. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_groups_screen_my_groups_mark_notifications() { - // Delete group request notifications for the user + // Delete group request notifications for the user. if ( isset( $_GET['n'] ) && bp_is_active( 'notifications' ) ) { - // Get the necessary ID's + // Get the necessary ID's. $group_id = buddypress()->groups->id; $user_id = bp_loggedin_user_id(); - // Mark notifications read + // Mark notifications read. bp_notifications_mark_notifications_by_type( $user_id, $group_id, 'membership_request_accepted' ); bp_notifications_mark_notifications_by_type( $user_id, $group_id, 'membership_request_rejected' ); bp_notifications_mark_notifications_by_type( $user_id, $group_id, 'member_promoted_to_mod' ); @@ -1258,7 +951,7 @@ add_action( 'groups_screen_group_home', 'bp_groups_screen_my_groups_mark_notific /** * Mark group invitation notifications read when a member views their invitations. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_groups_screen_invites_mark_notifications() { if ( bp_is_active( 'notifications' ) ) { @@ -1270,7 +963,7 @@ add_action( 'groups_screen_group_invites', 'bp_groups_screen_invites_mark_notifi /** * Mark group join requests read when an admin or moderator visits the group administration area. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_groups_screen_group_admin_requests_mark_notifications() { if ( bp_is_active( 'notifications' ) ) { @@ -1282,7 +975,7 @@ add_action( 'groups_screen_group_admin_requests', 'bp_groups_screen_group_admin_ /** * Delete new group membership notifications when a user is being deleted. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user. */ 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 61a9ed6030c34fd9d13d0521159762de096908fb..fb01e02c5cdabb19c2badd906b0694003a706dc1 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Groups Screen Functions * @@ -9,13 +8,18 @@ * * @package BuddyPress * @subpackage GroupsScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-groups-theme-compat.php'; + /** * Handle the display of the Groups directory index. + * + * @since 1.0.0 */ function groups_directory_groups_setup() { if ( bp_is_groups_directory() ) { @@ -24,14 +28,14 @@ function groups_directory_groups_setup() { /** * Fires before the loading of the Groups directory index. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_directory_groups_setup' ); /** * Filters the template to load for the Groups directory index. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to the groups directory index template to load. */ @@ -42,20 +46,22 @@ add_action( 'bp_screens', 'groups_directory_groups_setup', 2 ); /** * Handle the loading of the My Groups page. + * + * @since 1.0.0 */ function groups_screen_my_groups() { /** * Fires before the loading of the My Groups page. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_screen_my_groups' ); /** * Filters the template to load for the My Groups page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to the My Groups page template to load. */ @@ -64,12 +70,14 @@ function groups_screen_my_groups() { /** * Handle the loading of a user's Groups > Invites page. + * + * @since 1.0.0 */ function groups_screen_group_invites() { $group_id = (int)bp_action_variable( 1 ); if ( bp_is_action_variable( 'accept' ) && is_numeric( $group_id ) ) { - // Check the nonce + // Check the nonce. if ( !check_admin_referer( 'groups_accept_invite' ) ) return false; @@ -78,7 +86,7 @@ function groups_screen_group_invites() { } else { bp_core_add_message( __('Group invite accepted', 'buddypress') ); - // Record this in activity streams + // Record this in activity streams. $group = groups_get_group( array( 'group_id' => $group_id ) ); groups_record_activity( array( @@ -96,7 +104,7 @@ function groups_screen_group_invites() { bp_core_redirect( $redirect_to ); } elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) { - // Check the nonce + // Check the nonce. if ( !check_admin_referer( 'groups_reject_invite' ) ) return false; @@ -118,7 +126,7 @@ function groups_screen_group_invites() { /** * Fires before the loading of a users Groups > Invites template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $group_id ID of the group being displayed */ @@ -127,7 +135,7 @@ function groups_screen_group_invites() { /** * Filters the template to load for a users Groups > Invites page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a users Groups > Invites page template. */ @@ -136,6 +144,8 @@ function groups_screen_group_invites() { /** * Handle the loading of a single group's page. + * + * @since 1.0.0 */ function groups_screen_group_home() { @@ -146,14 +156,14 @@ function groups_screen_group_home() { /** * Fires before the loading of a single group's page. * - * @since BuddyPress (1.0.0) + * @since 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) + * @since 1.0.0 * * @param string $value Path to a single group's template to load. */ @@ -162,6 +172,8 @@ function groups_screen_group_home() { /** * This screen function handles actions related to group forums. + * + * @since 1.0.0 */ function groups_screen_group_forum() { @@ -183,7 +195,7 @@ function groups_screen_group_forum() { if ( ! bp_is_single_item() ) return false; - // Fetch the details we need + // Fetch the details we need. $topic_slug = (string)bp_action_variable( 1 ); $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug ); $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); @@ -194,19 +206,19 @@ function groups_screen_group_forum() { if ( !empty( $topic_slug ) && !empty( $topic_id ) ) { - // Posting a reply + // Posting a reply. if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_new_reply' ); - // Auto join this user if they are not yet a member of this group + // Auto join this user if they are not yet a member of this group. if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); } $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; - // Don't allow reply flooding + // Don't allow reply flooding. if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) { bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' ); } else { @@ -228,9 +240,9 @@ function groups_screen_group_forum() { bp_core_redirect( $redirect ); } - // Sticky a topic + // Sticky a topic. elseif ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_stick_topic' ); if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) ) { @@ -242,7 +254,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been stickied. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic being stickied. */ @@ -250,9 +262,9 @@ function groups_screen_group_forum() { bp_core_redirect( wp_get_referer() ); } - // Un-Sticky a topic + // Un-Sticky a topic. elseif ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_unstick_topic' ); if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) ) { @@ -264,7 +276,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been un-stickied. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic being un-stickied. */ @@ -272,9 +284,9 @@ function groups_screen_group_forum() { bp_core_redirect( wp_get_referer() ); } - // Close a topic + // Close a topic. elseif ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_close_topic' ); if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) ) { @@ -286,7 +298,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been closed. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic being closed. */ @@ -294,9 +306,9 @@ function groups_screen_group_forum() { bp_core_redirect( wp_get_referer() ); } - // Open a topic + // Open a topic. elseif ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_open_topic' ); if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) ) { @@ -308,7 +320,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been opened. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic being opened. */ @@ -316,9 +328,9 @@ function groups_screen_group_forum() { bp_core_redirect( wp_get_referer() ); } - // Delete a topic + // Delete a topic. elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) { - // Fetch the topic + // Fetch the topic. $topic = bp_forums_get_topic_details( $topic_id ); /* Check the logged in user can delete this topic */ @@ -326,13 +338,13 @@ function groups_screen_group_forum() { bp_core_redirect( wp_get_referer() ); } - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_delete_topic' ); /** * Fires before a group forum topic is deleted. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $topic_id ID of the topic being deleted. */ @@ -347,7 +359,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been deleted. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $topic_id ID of the topic being deleted. */ @@ -355,18 +367,18 @@ function groups_screen_group_forum() { bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' ); } - // Editing a topic + // Editing a topic. elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) { - // Fetch the topic + // Fetch the topic. $topic = bp_forums_get_topic_details( $topic_id ); - // Check the logged in user can edit this topic + // Check the logged in user can edit this topic. if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) { bp_core_redirect( wp_get_referer() ); } if ( isset( $_POST['save_changes'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_edit_topic' ); $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false; @@ -380,7 +392,7 @@ function groups_screen_group_forum() { /** * Fires after a group forum topic has been edited. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $topic_id ID of the topic being edited. */ @@ -391,29 +403,29 @@ function groups_screen_group_forum() { /** * Filters the template to load for a topic edit page. * - * @since BuddyPress (1.1.0) + * @since 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 + // Delete a post. } elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) { - // Fetch the post + // Fetch the post. $post = bp_forums_get_post( $post_id ); - // Check the logged in user can edit this topic + // Check the logged in user can edit this topic. if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) { bp_core_redirect( wp_get_referer() ); } - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_delete_post' ); /** * Fires before the deletion of a group forum post. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $post_id ID of the forum post being deleted. */ @@ -428,26 +440,26 @@ function groups_screen_group_forum() { /** * Fires after the deletion of a group forum post. * - * @since BuddyPress (1.1.0) + * @since 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 + // Editing a post. } elseif ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) { - // Fetch the post + // Fetch the post. $post = bp_forums_get_post( $post_id ); - // Check the logged in user can edit this topic + // Check the logged in user can edit this topic. if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) { bp_core_redirect( wp_get_referer() ); } if ( isset( $_POST['save_changes'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_edit_post' ); $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; @@ -465,7 +477,7 @@ function groups_screen_group_forum() { /** * Fires after the editing of a group forum post. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $post_id ID of the forum post being edited. */ @@ -476,7 +488,7 @@ function groups_screen_group_forum() { /** 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 + // Standard topic display. } else { if ( !empty( $user_is_banned ) ) { bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) ); @@ -485,30 +497,30 @@ function groups_screen_group_forum() { /** * Filters the template to load for a topic page. * - * @since BuddyPress (1.1.0) + * @since 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' ) ); } - // Forum topic does not exist + // Forum topic does not exist. } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) { bp_do_404(); return; } else { - // Posting a topic + // Posting a topic. if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_forums_new_topic' ); if ( $user_is_banned ) { $error_message = __( "You have been banned from this group.", 'buddypress' ); } elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { - // Auto join this user if they are not yet a member of this group + // Auto join this user if they are not yet a member of this group. groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); } @@ -541,7 +553,7 @@ function groups_screen_group_forum() { /** * Fires at the end of the group forum screen loading process. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $topic_id ID of the topic being displayed. * @param int $forum_id ID of the forum being displayed. @@ -551,7 +563,7 @@ function groups_screen_group_forum() { /** * Filters the template to load for a group forum page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group forum template. */ @@ -561,6 +573,8 @@ function groups_screen_group_forum() { /** * Handle the display of a group's Members page. + * + * @since 1.0.0 */ function groups_screen_group_members() { @@ -569,13 +583,13 @@ function groups_screen_group_members() { $bp = buddypress(); - // Refresh the group member count meta + // Refresh the group member count meta. groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) ); /** * Fires before the loading of a group's Members page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group whose members are being displayed. */ @@ -584,7 +598,7 @@ function groups_screen_group_members() { /** * Filters the template to load for a group's Members page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's Members template. */ @@ -593,6 +607,8 @@ function groups_screen_group_members() { /** * Handle the display of a group's Send Invites page. + * + * @since 1.0.0 */ function groups_screen_group_invite() { @@ -619,7 +635,7 @@ function groups_screen_group_invite() { /** * Fires after the sending of a group invite inside the group's Send Invites page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group whose members are being displayed. */ @@ -631,7 +647,7 @@ function groups_screen_group_invite() { /** * Filters the template to load for a group's Send Invites page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's Send Invites template. */ @@ -648,7 +664,7 @@ function groups_screen_group_invite() { * Note that this function is only used when JS is disabled. Normally, clicking * Remove Invite removes the invitation via AJAX. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function groups_remove_group_invite() { if ( ! bp_is_group_invites() ) { @@ -687,6 +703,8 @@ add_action( 'bp_screens', 'groups_remove_group_invite' ); /** * Handle the display of a group's Request Membership page. + * + * @since 1.0.0 */ function groups_screen_group_request_membership() { @@ -698,7 +716,7 @@ function groups_screen_group_request_membership() { if ( 'private' != $bp->groups->current_group->status ) return false; - // If the user is already invited, accept invitation + // If the user is already invited, accept invitation. if ( groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { if ( groups_accept_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) bp_core_add_message( __( 'Group invite accepted', 'buddypress' ) ); @@ -710,7 +728,7 @@ function groups_screen_group_request_membership() { // If the user has submitted a request, send it. if ( isset( $_POST['group-request-send']) ) { - // Check the nonce + // Check the nonce. if ( !check_admin_referer( 'groups_request_membership' ) ) return false; @@ -725,7 +743,7 @@ function groups_screen_group_request_membership() { /** * Fires before the loading of a group's Request Memebership page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group currently being displayed. */ @@ -734,15 +752,45 @@ function groups_screen_group_request_membership() { /** * Filters the template to load for a group's Request Membership page. * - * @since BuddyPress (1.0.0) + * @since 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' ) ); } +/** + * Handle the loading of a single group's activity. + * + * @since 2.4.0 + */ +function groups_screen_group_activity() { + + if ( ! bp_is_single_item() ) { + return false; + } + + /** + * Fires before the loading of a single group's activity page. + * + * @since 2.4.0 + */ + do_action( 'groups_screen_group_activity' ); + + /** + * Filters the template to load for a single group's activity page. + * + * @since 2.4.0 + * + * @param string $value Path to a single group's template to load. + */ + bp_core_load_template( apply_filters( 'groups_screen_group_activity', 'groups/single/activity' ) ); +} + /** * Handle the display of a single group activity item. + * + * @since 1.2.0 */ function groups_screen_group_activity_permalink() { @@ -758,6 +806,8 @@ add_action( 'bp_screens', 'groups_screen_group_activity_permalink' ); /** * Handle the display of a group's Admin pages. + * + * @since 1.0.0 */ function groups_screen_group_admin() { if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) ) @@ -771,6 +821,8 @@ function groups_screen_group_admin() { /** * Handle the display of a group's admin/edit-details page. + * + * @since 1.0.0 */ function groups_screen_group_admin_edit_details() { @@ -781,9 +833,9 @@ function groups_screen_group_admin_edit_details() { $bp = buddypress(); - // If the edit form has been submitted, save the edited details + // If the edit form has been submitted, save the edited details. if ( isset( $_POST['save'] ) ) { - // Check the nonce + // Check the nonce. if ( !check_admin_referer( 'groups_edit_group_details' ) ) return false; @@ -798,7 +850,7 @@ function groups_screen_group_admin_edit_details() { /** * Fires before the redirect if a group details has been edited and saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that was edited. */ @@ -810,7 +862,7 @@ function groups_screen_group_admin_edit_details() { /** * Fires before the loading of the group admin/edit-details page template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that is being displayed. */ @@ -819,7 +871,7 @@ function groups_screen_group_admin_edit_details() { /** * Filters the template to load for a group's admin/edit-details page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's admin/edit-details template. */ @@ -830,6 +882,8 @@ add_action( 'bp_screens', 'groups_screen_group_admin_edit_details' ); /** * Handle the display of a group's admin/group-settings page. + * + * @since 1.0.0 */ function groups_screen_group_admin_settings() { @@ -841,21 +895,21 @@ function groups_screen_group_admin_settings() { $bp = buddypress(); - // If the edit form has been submitted, save the edited details + // If the edit form has been submitted, save the edited details. if ( isset( $_POST['save'] ) ) { $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0; - // Checked against a whitelist for security + // Checked against a whitelist for security. /** This filter is documented in bp-groups/bp-groups-admin.php */ $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; - // Checked against a whitelist for security + // Checked against a whitelist for security. /** This filter is documented in bp-groups/bp-groups-admin.php */ $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); $invite_status = isset( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; - // Check the nonce + // Check the nonce. if ( !check_admin_referer( 'groups_edit_group_settings' ) ) return false; @@ -868,7 +922,7 @@ function groups_screen_group_admin_settings() { /** * Fires before the redirect if a group settings has been edited and saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that was edited. */ @@ -880,7 +934,7 @@ function groups_screen_group_admin_settings() { /** * Fires before the loading of the group admin/group-settings page template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that is being displayed. */ @@ -889,7 +943,7 @@ function groups_screen_group_admin_settings() { /** * Filters the template to load for a group's admin/group-settings page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's admin/group-settings template. */ @@ -899,22 +953,24 @@ add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); /** * Handle the display of a group's Change Avatar page. + * + * @since 1.0.0 */ function groups_screen_group_admin_avatar() { if ( 'group-avatar' != bp_get_group_current_admin_tab() ) return false; - // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here + // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here. if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) return false; $bp = buddypress(); - // If the group admin has deleted the admin avatar + // If the group admin has deleted the admin avatar. if ( bp_is_action_variable( 'delete', 1 ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_group_avatar_delete' ); if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) { @@ -932,23 +988,23 @@ function groups_screen_group_admin_avatar() { if ( !empty( $_FILES ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_avatar_upload' ); - // Pass the file to the avatar upload handler + // Pass the file to the avatar upload handler. if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) { $bp->avatar_admin->step = 'crop-image'; - // Make sure we include the jQuery jCrop file for image cropping + // Make sure we include the jQuery jCrop file for image cropping. add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' ); } } - // If the image cropping is done, crop the image and save a full/thumb version + // If the image cropping is done, crop the image and save a full/thumb version. if ( isset( $_POST['avatar-crop-submit'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_avatar_cropstore' ); $args = array( @@ -972,7 +1028,7 @@ function groups_screen_group_admin_avatar() { /** * Fires before the loading of the group Change Avatar page template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that is being displayed. */ @@ -981,7 +1037,7 @@ function groups_screen_group_admin_avatar() { /** * Filters the template to load for a group's Change Avatar page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's Change Avatar template. */ @@ -989,8 +1045,45 @@ function groups_screen_group_admin_avatar() { } add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); +/** + * Handle the display of a group's Change cover image page. + * + * @since 2.4.0 + */ +function groups_screen_group_admin_cover_image() { + if ( 'group-cover-image' != bp_get_group_current_admin_tab() ) { + return false; + } + + // If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here. + if ( ! bp_is_item_admin() || ! bp_group_use_cover_image_header() ) { + return false; + } + + /** + * Fires before the loading of the group Change cover image page template. + * + * @since 2.4.0 + * + * @param int $id ID of the group that is being displayed. + */ + do_action( 'groups_screen_group_admin_cover_image', bp_get_current_group_id() ); + + /** + * Filters the template to load for a group's Change cover image page. + * + * @since 2.4.0 + * + * @param string $value Path to a group's Change cover image template. + */ + bp_core_load_template( apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ) ); +} +add_action( 'bp_screens', 'groups_screen_group_admin_cover_image' ); + /** * This function handles actions related to member management on the group admin. + * + * @since 1.0.0 */ function groups_screen_group_admin_manage_members() { @@ -1020,7 +1113,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the redirect after a group member has been promoted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user being promoted. * @param int $id ID of the group user is promoted within. @@ -1039,7 +1132,7 @@ function groups_screen_group_admin_manage_members() { if ( !check_admin_referer( 'groups_demote_member' ) ) return false; - // Stop sole admins from abandoning their group + // Stop sole admins from abandoning their group. $group_admins = groups_get_group_admins( $bp->groups->current_group->id ); if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id ) bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' ); @@ -1053,7 +1146,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the redirect after a group member has been demoted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user being demoted. * @param int $id ID of the group user is demoted within. @@ -1079,7 +1172,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the redirect after a group member has been banned. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user being banned. * @param int $id ID of the group user is banned from. @@ -1105,7 +1198,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the redirect after a group member has been unbanned. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user being unbanned. * @param int $id ID of the group user is unbanned from. @@ -1131,7 +1224,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the redirect after a group member has been removed. * - * @since BuddyPress (1.2.6) + * @since 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. @@ -1145,7 +1238,7 @@ function groups_screen_group_admin_manage_members() { /** * Fires before the loading of a group's manage members template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group whose manage members page is being displayed. */ @@ -1154,7 +1247,7 @@ function groups_screen_group_admin_manage_members() { /** * Filters the template to load for a group's manage members page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's manage members template. */ @@ -1164,6 +1257,8 @@ add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' ); /** * Handle the display of Admin > Membership Requests. + * + * @since 1.0.0 */ function groups_screen_group_admin_requests() { $bp = buddypress(); @@ -1186,7 +1281,7 @@ function groups_screen_group_admin_requests() { if ( !check_admin_referer( 'groups_accept_membership_request' ) ) return false; - // Accept the membership request + // Accept the membership request. if ( !groups_accept_membership_request( $membership_id ) ) bp_core_add_message( __( 'There was an error accepting the membership request. Please try again.', 'buddypress' ), 'error' ); else @@ -1197,7 +1292,7 @@ function groups_screen_group_admin_requests() { if ( !check_admin_referer( 'groups_reject_membership_request' ) ) return false; - // Reject the membership request + // Reject the membership request. if ( !groups_reject_membership_request( $membership_id ) ) bp_core_add_message( __( 'There was an error rejecting the membership request. Please try again.', 'buddypress' ), 'error' ); else @@ -1207,7 +1302,7 @@ function groups_screen_group_admin_requests() { /** * Fires before the redirect if a group membership request has been handled. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that was edited. * @param string $request_action Membership request action being performed. @@ -1220,7 +1315,7 @@ function groups_screen_group_admin_requests() { /** * Fires before the loading of the group membership request page template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that is being displayed. */ @@ -1229,7 +1324,7 @@ function groups_screen_group_admin_requests() { /** * Filters the template to load for a group's membership request page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to a group's membership request template. */ @@ -1239,6 +1334,8 @@ add_action( 'bp_screens', 'groups_screen_group_admin_requests' ); /** * Handle the display of the Delete Group page. + * + * @since 1.0.0 */ function groups_screen_group_admin_delete_group() { @@ -1260,7 +1357,7 @@ function groups_screen_group_admin_delete_group() { /** * Fires before the deletion of a group from the Delete Group page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $id ID of the group being deleted. */ @@ -1270,12 +1367,12 @@ function groups_screen_group_admin_delete_group() { 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' ); } else { - bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) ); + 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) + * @since 1.0.0 * * @param int $id ID of the group being deleted. */ @@ -1290,7 +1387,7 @@ function groups_screen_group_admin_delete_group() { /** * Fires before the loading of the Delete Group page template. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $id ID of the group that is being displayed. */ @@ -1299,7 +1396,7 @@ function groups_screen_group_admin_delete_group() { /** * Filters the template to load for the Delete Group page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Path to the Delete Group template. */ @@ -1309,6 +1406,8 @@ add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' ); /** * Render the group settings fields on the Notification Settings page. + * + * @since 1.0.0 */ function groups_screen_notification_settings() { @@ -1338,26 +1437,26 @@ function groups_screen_notification_settings() { <tr id="groups-notification-settings-invitation"> <td></td> <td><?php _ex( 'A member invites you to join a group', 'group settings on notification settings page','buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php checked( $group_invite, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-yes" value="yes" <?php checked( $group_invite, 'yes', true ) ?>/><label for="notification-groups-invite-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_groups_invite]" id="notification-groups-invite-no" value="no" <?php checked( $group_invite, 'no', true ) ?>/><label for="notification-groups-invite-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <tr id="groups-notification-settings-info-updated"> <td></td> <td><?php _ex( 'Group information is updated', 'group settings on notification settings page', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php checked( $group_update, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php checked( $group_update, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-yes" value="yes" <?php checked( $group_update, 'yes', true ) ?>/><label for="notification-groups-group-updated-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" id="notification-groups-group-updated-no" value="no" <?php checked( $group_update, 'no', true ) ?>/><label for="notification-groups-group-updated-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <tr id="groups-notification-settings-promoted"> <td></td> <td><?php _ex( 'You are promoted to a group administrator or moderator', 'group settings on notification settings page', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php checked( $group_promo, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-yes" value="yes" <?php checked( $group_promo, 'yes', true ) ?>/><label for="notification-groups-admin-promotion-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" id="notification-groups-admin-promotion-no" value="no" <?php checked( $group_promo, 'no', true ) ?>/><label for="notification-groups-admin-promotion-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <tr id="groups-notification-settings-request"> <td></td> <td><?php _ex( 'A member requests to join a private group for which you are an admin', 'group settings on notification settings page', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php checked( $group_request, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-yes" value="yes" <?php checked( $group_request, 'yes', true ) ?>/><label for="notification-groups-membership-request-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" id="notification-groups-membership-request-no" value="no" <?php checked( $group_request, 'no', true ) ?>/><label for="notification-groups-membership-request-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <?php @@ -1365,7 +1464,7 @@ function groups_screen_notification_settings() { /** * Fires at the end of the available group settings fields on Notification Settings page. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_screen_notification_settings' ); ?> @@ -1378,257 +1477,4 @@ add_action( 'bp_notification_settings', 'groups_screen_notification_settings' ); /** Theme Compatibility *******************************************************/ -/** - * The main theme compat class for BuddyPress Groups. - * - * 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) - */ -class BP_Groups_Theme_Compat { - - /** - * Set up theme compatibility for the Groups component. - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - add_action( 'bp_setup_theme_compat', array( $this, 'is_group' ) ); - } - - /** - * Are we looking at something that needs group theme compatibility? - * - * @since BuddyPress (1.7.0) - */ - public function is_group() { - - // Bail if not looking at a group - if ( ! bp_is_groups_component() ) - return; - - // Group Directory - 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' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); - - // Creating a group - } elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) { - add_filter( 'bp_get_buddypress_template', array( $this, 'create_template_hierarchy' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); - - // Group page - } elseif ( bp_is_single_item() ) { - add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'single_content' ) ); - - } - } - - /** Directory *********************************************************/ - - /** - * Add template hierarchy to theme compat for the group directory page. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with directory data. - * - * @since BuddyPress (1.7.0) - */ - public function directory_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => bp_get_directory_title( 'groups' ), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the groups index template part. - * - * @since BuddyPress (1.7.0) - */ - public function directory_content() { - return bp_buffer_template_part( 'groups/index', null, false ); - } - - /** Create ************************************************************/ - - /** - * Add custom template hierarchy to theme compat for the group create page. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with create screen data. - * - * @since BuddyPress (1.7.0) - */ - public function create_dummy_post() { - - $title = _x( 'Groups', 'Group creation page', 'buddypress' ); - - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => $title, - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the create screen template part. - * - * @since BuddyPress (1.7.0) - */ - public function create_content() { - return bp_buffer_template_part( 'groups/create', null, false ); - } - - /** Single ************************************************************/ - - /** - * Add custom template hierarchy to theme compat for group pages. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 some variables we're going to reference in our custom templates - $group = groups_get_current_group(); - - /** - * 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', - 'groups/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php', - 'groups/single/index-status-' . sanitize_file_name( $group->status ) . '.php', - 'groups/single/index.php' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with single group data. - * - * @since BuddyPress (1.7.0) - */ - public function single_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => bp_get_current_group_name(), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the single group template part. - * - * @since BuddyPress (1.7.0) - */ - public function single_content() { - return bp_buffer_template_part( 'groups/single/home', null, false ); - } -} new BP_Groups_Theme_Compat(); 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 291bfeff7fab38509103ed6fd76ef8809d11c7a7..e67c93ee70c3f24967f7a27c13db3af818e331fc 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php @@ -1,16 +1,24 @@ <?php - /** * BuddyPress Groups Template Functions. + * + * @package BuddyPress + * @subpackage GroupsTemplates + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-groups-template.php'; +require dirname( __FILE__ ) . '/classes/class-bp-groups-group-members-template.php'; +require dirname( __FILE__ ) . '/classes/class-bp-groups-membership-requests-template.php'; +require dirname( __FILE__ ) . '/classes/class-bp-groups-invite-template.php'; + /** * Output the groups component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_groups_slug() { echo bp_get_groups_slug(); @@ -18,7 +26,7 @@ function bp_groups_slug() { /** * Return the groups component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -27,7 +35,7 @@ function bp_groups_slug() { /** * Filters the groups component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Groups component slug. */ @@ -37,7 +45,7 @@ function bp_groups_slug() { /** * Output the groups component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_groups_root_slug() { echo bp_get_groups_root_slug(); @@ -45,7 +53,7 @@ function bp_groups_root_slug() { /** * Return the groups component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -54,7 +62,7 @@ function bp_groups_root_slug() { /** * Filters the groups component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Groups component root slug. */ @@ -64,7 +72,7 @@ function bp_groups_root_slug() { /** * Output group directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_groups_directory_permalink() { echo esc_url( bp_get_groups_directory_permalink() ); @@ -72,7 +80,7 @@ function bp_groups_directory_permalink() { /** * Return group directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -81,438 +89,81 @@ function bp_groups_directory_permalink() { /** * Filters the group directory permalink. * - * @since BuddyPress (1.5.0) + * @since 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() ) ); } -/** - * The main Groups template loop class. - * - * Responsible for loading a group of groups into a loop for display. - */ -class BP_Groups_Template { - - /** - * The loop iterator. - * - * @access public - * @var int - */ - public $current_group = -1; - - /** - * The number of groups returned by the paged query. - * - * @access public - * @var int - */ - public $group_count; - - /** - * Array of groups located by the query. - * - * @access public - * @var array - */ - public $groups; - - /** - * The group object currently being iterated on. - * - * @access public - * @var object - */ - public $group; - - /** - * A flag for whether the loop is currently being iterated. - * - * @access public - * @var bool - */ - public $in_the_loop; - - /** - * The page number being requested. - * - * @access public - * @var string - */ - public $pag_page; - - /** - * The number of items being requested per page. - * - * @access public - * @var string - */ - public $pag_num; - - /** - * An HTML string containing pagination links. - * - * @access public - * @var string - */ - public $pag_links; - - /** - * The total number of groups matching the query parameters. - * - * @access public - * @var int - */ - public $total_group_count; - - /** - * Whether the template loop is for a single group page. - * - * @access public - * @var bool - */ - public $single_group = false; - - /** - * Field to sort by. - * - * @access public - * @var string - */ - public $sort_by; - - /** - * Sort order. - * - * @access public - * @var string - */ - public $order; - - /** - * Constructor method. - * - * @see BP_Groups_Group::get() for an in-depth description of arguments. - * - * @param array $args { - * Array of arguments. Accepts all arguments accepted by - * {@link BP_Groups_Group::get()}. In cases where the default - * values of the params differ, they have been discussed below. - * @type int $per_page Default: 20. - * @type int $page Default: 1. - * } - */ - function __construct( $args = array() ){ - - // 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 => 'user_id', - 1 => 'type', - 2 => 'page', - 3 => 'per_page', - 4 => 'max', - 5 => 'slug', - 6 => 'search_terms', - 7 => 'populate_extras', - 8 => 'include', - 9 => 'exclude', - 10 => 'show_hidden', - 11 => 'page_arg', - ); - - $func_args = func_get_args(); - $args = bp_core_parse_args_array( $old_args_keys, $func_args ); - } - - $defaults = array( - '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_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 ); - } elseif ( 'single-group' == $type ) { - $this->single_group = true; - - if ( groups_get_current_group() ) { - $group = groups_get_current_group(); - - } else { - $group = groups_get_group( array( - 'group_id' => BP_Groups_Group::get_id_from_slug( $r['slug'] ), - 'populate_extras' => $r['populate_extras'], - ) ); - } - - // backwards compatibility - the 'group_id' variable is not part of the - // BP_Groups_Group object, but we add it here for devs doing checks against it - // - // @see https://buddypress.trac.wordpress.org/changeset/3540 - // - // this is subject to removal in a future release; devs should check against - // $group->id instead - $group->group_id = $group->id; - - $this->groups = array( $group ); - - } else { - $this->groups = groups_get_groups( array( - 'type' => $type, - 'order' => $order, - 'orderby' => $orderby, - 'per_page' => $this->pag_num, - 'page' => $this->pag_page, - 'user_id' => $user_id, - 'search_terms' => $search_terms, - 'meta_query' => $meta_query, - 'include' => $include, - 'exclude' => $exclude, - 'populate_extras' => $populate_extras, - 'update_meta_cache' => $update_meta_cache, - 'show_hidden' => $show_hidden - ) ); - } - - if ( 'invites' == $type ) { - $this->total_group_count = (int) $this->groups['total']; - $this->group_count = (int) $this->groups['total']; - $this->groups = $this->groups['groups']; - } elseif ( 'single-group' == $type ) { - if ( empty( $group->id ) ) { - $this->total_group_count = 0; - $this->group_count = 0; - } else { - $this->total_group_count = 1; - $this->group_count = 1; - } - } else { - if ( empty( $max ) || $max >= (int) $this->groups['total'] ) { - $this->total_group_count = (int) $this->groups['total']; - } else { - $this->total_group_count = (int) $max; - } - - $this->groups = $this->groups['groups']; - - if ( !empty( $max ) ) { - if ( $max >= count( $this->groups ) ) { - $this->group_count = count( $this->groups ); - } else { - $this->group_count = (int) $max; - } - } else { - $this->group_count = count( $this->groups ); - } - } - - // Build pagination links - if ( (int) $this->total_group_count && (int) $this->pag_num ) { - $pag_args = array( - $this->pag_arg => '%#%' - ); - - if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { - $base = remove_query_arg( 's', wp_get_referer() ); - } else { - $base = ''; - } - - $add_args = array( - 'num' => $this->pag_num, - 'sortby' => $this->sort_by, - 'order' => $this->order, - ); - - if ( ! empty( $search_terms ) ) { - $add_args['s'] = urlencode( $search_terms ); - } - - $this->pag_links = paginate_links( array( - 'base' => add_query_arg( $pag_args, $base ), - 'format' => '', - 'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ), - 'current' => $this->pag_page, - 'prev_text' => _x( '←', 'Group pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Group pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => $add_args, - ) ); - } - } - - /** - * Whether there are groups available in the loop. - * - * @see bp_has_groups() - * - * @return bool True if there are items in the loop, otherwise false. - */ - function has_groups() { - if ( $this->group_count ) - return true; - - return false; - } - - /** - * Set up the next group and iterate index. - * - * @return object The next group to iterate over. - */ - function next_group() { - $this->current_group++; - $this->group = $this->groups[$this->current_group]; - - return $this->group; - } - - /** - * Rewind the groups and reset member index. - */ - function rewind_groups() { - $this->current_group = -1; - if ( $this->group_count > 0 ) { - $this->group = $this->groups[0]; - } - } - - /** - * Whether there are groups left in the loop to iterate over. - * - * This method is used by {@link bp_groups()} as part of the while loop - * that controls iteration inside the groups loop, eg: - * while ( bp_groups() ) { ... - * - * @see bp_groups() - * - * @return bool True if there are more groups to show, otherwise false. - */ - function groups() { - 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current group inside the loop. - * - * Used by {@link bp_the_group()} to set up the current group data - * while looping, so that template tags used during that iteration make - * reference to the current member. - * - * @see bp_the_group() - */ - function the_group() { - $this->in_the_loop = true; - $this->group = $this->next_group(); - - 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' ); - } - } -} - /** * Start the Groups Template Loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array|string $args { * Array of parameters. All items are optional. - * @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. + * @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 $order Sort order. 'ASC' or 'DESC'. + * Default: 'DESC'. + * @type string $orderby Property to sort by. + * 'date_created', 'last_activity', 'total_member_count', + * 'name', 'random'. Default: 'last_activity'. + * @type int $page Page offset of results to return. + * Default: 1 (first page of results). + * @type int $per_page Number of items to return per page + * of results. Default: 20. + * @type int $max Does NOT affect query. May change the + * reported number of total groups found, + * but not the actual number of found + * groups. Default: false. + * @type bool $show_hidden Whether to include hidden groups in + * results. Default: false. + * @type string $page_arg Query argument used for pagination. + * Default: 'grpage'. + * @type int $user_id If provided, results will be limited + * to groups of which the specified user + * is a member. + * Default: value of bp_displayed_user_id(). + * @type string $slug If provided, only the group with the + * matching slug will be returned. + * Default: false. + * @type string $search_terms If provided, only groups whose names or + * descriptions match the search terms will + * be returned. Default: value of + * `$_REQUEST['groups_search']` or + * `$_REQUEST['s']`, if present. Otherwise 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 $update_meta_cache Whether to fetch groupmeta for queried groups. + * Default: true. * } * @return bool True if there are groups to display that match the params */ function bp_has_groups( $args = '' ) { global $groups_template; - /*** + /* * Defaults based on the current page & overridden by parsed $args */ $slug = false; $type = ''; $search_terms = false; - // When looking your own groups, check for two action variables + // When looking your own groups, check for two action variables. if ( bp_is_current_action( 'my-groups' ) ) { if ( bp_is_action_variable( 'most-popular', 0 ) ) { $type = 'popular'; @@ -520,24 +171,27 @@ function bp_has_groups( $args = '' ) { $type = 'alphabetical'; } - // When looking at invites, set type to invites + // When looking at invites, set type to invites. } elseif ( bp_is_current_action( 'invites' ) ) { $type = 'invites'; - // When looking at a single group, set the type and slug + // When looking at a single group, set the type and slug. } elseif ( bp_get_current_group_slug() ) { $type = 'single-group'; $slug = bp_get_current_group_slug(); } - // Default search string (too soon to escape here) - if ( ! empty( $_REQUEST['group-filter-box'] ) ) { + // Default search string (too soon to escape here). + $search_query_arg = bp_core_get_component_search_query_arg( 'groups' ); + if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) { + $search_terms = stripslashes( $_REQUEST[ $search_query_arg ] ); + } elseif ( ! empty( $_REQUEST['group-filter-box'] ) ) { $search_terms = $_REQUEST['group-filter-box']; } elseif ( !empty( $_REQUEST['s'] ) ) { $search_terms = $_REQUEST['s']; } - // Parse defaults and requested arguments + // Parse defaults and requested arguments. $r = bp_parse_args( $args, array( 'type' => $type, 'order' => 'DESC', @@ -557,7 +211,7 @@ function bp_has_groups( $args = '' ) { 'update_meta_cache' => true, ), 'has_groups' ); - // Setup the Groups template global + // Setup the Groups template global. $groups_template = new BP_Groups_Template( array( 'type' => $r['type'], 'order' => $r['order'], @@ -580,7 +234,7 @@ function bp_has_groups( $args = '' ) { /** * Filters whether or not there are groups to iterate over for the groups loop. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -592,6 +246,8 @@ function bp_has_groups( $args = '' ) { /** * Check whether there are more groups to iterate over. * + * @since 1.0.0 + * * @return bool */ function bp_groups() { @@ -602,6 +258,8 @@ function bp_groups() { /** * Set up the current group inside the loop. * + * @since 1.0.0 + * * @return object */ function bp_the_group() { @@ -612,18 +270,21 @@ function bp_the_group() { /** * Is the group visible to the currently logged-in user? * - * @param object|bool $group Optional. Group object. Default: current group in loop. + * @since 1.0.0 * + * @param object|bool $group Optional. Group object. Default: current group in loop. * @return bool */ function bp_group_is_visible( $group = false ) { global $groups_template; - if ( bp_current_user_can( 'bp_moderate' ) ) + if ( bp_current_user_can( 'bp_moderate' ) ) { return true; + } - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } if ( 'public' == $group->status ) { return true; @@ -639,6 +300,8 @@ function bp_group_is_visible( $group = false ) { /** * Output the ID of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. Default: current group in loop. */ function bp_group_id( $group = false ) { @@ -647,31 +310,35 @@ function bp_group_id( $group = false ) { /** * Get the ID of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return int */ function bp_get_group_id( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the ID of the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param int $id ID of the current group in the loop. + * @param int $id ID of the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_id', $group->id ); + return apply_filters( 'bp_get_group_id', $group->id, $group ); } /** * Output the row class of the current group in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $classes Array of custom classes. */ @@ -681,21 +348,20 @@ function bp_group_class( $classes = array() ) { /** * Get the row class of the current group in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $classes Array of custom classes. - * * @return string Row class of the group. */ function bp_get_group_class( $classes = array() ) { global $groups_template; - // Add even/odd classes, but only if there's more than 1 group + // Add even/odd classes, but only if there's more than 1 group. if ( $groups_template->group_count > 1 ) { $pos_in_loop = (int) $groups_template->current_group; $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; - // If we've only one group in the loop, don't bother with odd and even + // If we've only one group in the loop, don't bother with odd and even. } else { $classes[] = 'bp-single-group'; } @@ -703,20 +369,20 @@ function bp_group_class( $classes = array() ) { // Group type - public, private, hidden. $classes[] = sanitize_key( $groups_template->group->status ); - // User's group role + // User's group role. if ( bp_is_user_active() ) { - // Admin + // Admin. if ( bp_group_is_admin() ) { $classes[] = 'is-admin'; } - // Moderator + // Moderator. if ( bp_group_is_mod() ) { $classes[] = 'is-mod'; } - // Member + // Member. if ( bp_group_is_member() ) { $classes[] = 'is-member'; } @@ -732,7 +398,7 @@ function bp_group_class( $classes = array() ) { /** * Filters classes that will be applied to row class of the current group in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param array $classes Array of determined classes for the row. */ @@ -746,6 +412,8 @@ function bp_group_class( $classes = array() ) { /** * Output the name of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -755,30 +423,36 @@ function bp_group_name( $group = false ) { /** * Get the name of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_name( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the name of the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param string $name Name of the current group in the loop. + * @param string $name Name of the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_name', $group->name ); + return apply_filters( 'bp_get_group_name', $group->name, $group ); } /** * Output the type of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -789,23 +463,25 @@ function bp_group_type( $group = false ) { /** * Get the type of the current group in the loop. * + * @since 1.0.0 + * * @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 ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } if ( 'public' == $group->status ) { - $type = __( "Public Group", "buddypress" ); + $type = __( "Public Group", 'buddypress' ); } elseif ( 'hidden' == $group->status ) { - $type = __( "Hidden Group", "buddypress" ); + $type = __( "Hidden Group", 'buddypress' ); } elseif ( 'private' == $group->status ) { - $type = __( "Private Group", "buddypress" ); + $type = __( "Private Group", 'buddypress' ); } else { $type = ucwords( $group->status ) . ' ' . __( 'Group', 'buddypress' ); } @@ -813,15 +489,19 @@ function bp_get_group_type( $group = false ) { /** * Filters the type for the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param string $type Type for the current group in the loop. + * @param string $type Type for the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_type', $type ); + return apply_filters( 'bp_get_group_type', $type, $group ); } /** * Output the status of the current group in the loop. * + * @since 1.1.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -831,31 +511,35 @@ function bp_group_status( $group = false ) { /** * Get the status of the current group in the loop. * + * @since 1.1.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_status( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the status of the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $status Status of the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_status', $group->status ); + return apply_filters( 'bp_get_group_status', $group->status, $group ); } /** * Output the group avatar while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array|string $args { * See {@link bp_get_group_avatar()} for description of arguments. @@ -865,19 +549,24 @@ function bp_group_avatar( $args = '' ) { echo bp_get_group_avatar( $args ); } /** - * Return the group avatar while in the groups loop. + * Get a group's avatar. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * + * @see bp_core_fetch_avatar() For a description of arguments and return values. + * @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. + * 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: 'Group logo of [group name]'. + * @type string $class Default: 'avatar'. + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type bool $id Passed to `$css_id` parameter. * } - * @return string + * @return string Group avatar string. */ function bp_get_group_avatar( $args = '' ) { global $groups_template; @@ -887,7 +576,7 @@ function bp_group_avatar( $args = '' ) { return false; } - // Parse the arguments + // Parse the arguments. $r = bp_parse_args( $args, array( 'type' => 'full', 'width' => false, @@ -897,7 +586,7 @@ function bp_group_avatar( $args = '' ) { 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name ) ) ); - // Fetch the avatar from the folder + // Fetch the avatar from the folder. $avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'title' => $groups_template->group->name, @@ -911,7 +600,7 @@ function bp_group_avatar( $args = '' ) { 'height' => $r['height'] ) ); - // If No avatar found, provide some backwards compatibility + // If No avatar found, provide some backwards compatibility. if ( empty( $avatar ) ) { $avatar = '<img src="' . esc_url( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />'; } @@ -919,7 +608,7 @@ function bp_group_avatar( $args = '' ) { /** * Filters the group avatar while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $avatar HTML image element holding the group avatar. * @param array $r Array of parsed arguments for the group avatar. @@ -930,7 +619,7 @@ function bp_group_avatar( $args = '' ) { /** * Output the group avatar thumbnail while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Optional. Group object. * Default: current group in loop. @@ -941,11 +630,10 @@ function bp_group_avatar_thumb( $group = false ) { /** * Return the group avatar thumbnail while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_avatar_thumb( $group = false ) { @@ -958,7 +646,7 @@ function bp_group_avatar_thumb( $group = false ) { /** * Output the miniature group avatar thumbnail while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Optional. Group object. * Default: current group in loop. @@ -969,11 +657,10 @@ function bp_group_avatar_mini( $group = false ) { /** * Return the miniature group avatar thumbnail while in the groups loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_avatar_mini( $group = false ) { @@ -985,9 +672,25 @@ function bp_group_avatar_mini( $group = false ) { ) ); } +/** Group cover image *********************************************************/ + +/** + * Should we use the group's cover image header. + * + * @since 2.4.0 + * + * @return bool True if the displayed user has a cover image, + * False otherwise + */ +function bp_group_use_cover_image_header() { + return (bool) bp_is_active( 'groups', 'cover_image' ) && ! bp_disable_group_cover_image_uploads() && bp_attachments_is_wp_version_supported(); +} + /** * Output the 'last active' string for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -997,21 +700,24 @@ function bp_group_last_active( $group = false ) { /** * Return the 'last active' string for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_last_active( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $last_active = $group->last_activity; - if ( !$last_active ) + if ( !$last_active ) { $last_active = groups_get_groupmeta( $group->id, 'last_activity' ); + } if ( empty( $last_active ) ) { return __( 'not yet active', 'buddypress' ); @@ -1020,17 +726,21 @@ function bp_group_last_active( $group = false ) { /** * Filters the 'last active' string for the current gorup in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Determined last active value for the current group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ) ); + return apply_filters( 'bp_get_group_last_active', bp_core_time_since( $last_active ), $group ); } } /** * Output the permalink for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1040,9 +750,10 @@ function bp_group_permalink( $group = false ) { /** * Return the permalink for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_permalink( $group = false ) { @@ -1055,16 +766,20 @@ function bp_group_permalink( $group = false ) { /** * Filters the permalink for the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Permalink for the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ) ); + return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_groups_directory_permalink() . $group->slug . '/' ), $group ); } /** * Output the permalink for the admin section of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1074,30 +789,36 @@ function bp_group_admin_permalink( $group = false ) { /** * Return the permalink for the admin section of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_admin_permalink( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Permalink for the admin section of the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) ); + return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ), $group ); } /** * Return the slug for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1107,30 +828,36 @@ function bp_group_slug( $group = false ) { /** * Return the slug for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_slug( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the slug for the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param string $slug Slug for the current group in the loop. + * @param string $slug Slug for the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_slug', $group->slug ); + return apply_filters( 'bp_get_group_slug', $group->slug, $group ); } /** * Output the description for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1140,30 +867,36 @@ function bp_group_description( $group = false ) { /** * Return the description for the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_description( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the description for the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Description for the current group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_description', stripslashes($group->description) ); + return apply_filters( 'bp_get_group_description', stripslashes( $group->description ), $group ); } /** * Output the description for the current group in the loop, for use in a textarea. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1177,34 +910,39 @@ function bp_group_description_editable( $group = false ) { * filters that 'bp_get_group_description' has, which makes it * appropriate for "raw" editing. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_description_editable( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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. + * '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) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $description Description for the current group in the loop. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_description_editable', $group->description ); + return apply_filters( 'bp_get_group_description_editable', $group->description, $group ); } /** * Output an excerpt of the group description. * + * @since 1.0.0 + * * @param object|bool $group Optional. The group being referenced. * Defaults to the group currently being * iterated on in the groups loop. @@ -1215,10 +953,11 @@ function bp_group_description_excerpt( $group = false ) { /** * Get an excerpt of a group description. * + * @since 1.0.0 + * * @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 ) { @@ -1231,7 +970,7 @@ function bp_group_description_excerpt( $group = false ) { /** * Filters the excerpt of a group description. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Excerpt of a group description. * @param object $group Object for group whose description is made into an excerpt. @@ -1244,6 +983,8 @@ function bp_group_description_excerpt( $group = false ) { * * Either 'Public' or 'Private'. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1255,16 +996,18 @@ function bp_group_public_status( $group = false ) { * * Either 'Public' or 'Private'. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_public_status( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } if ( $group->is_public ) { return __( 'Public', 'buddypress' ); @@ -1291,21 +1034,31 @@ function bp_group_is_public( $group = false ) { * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * - * @return unknown + * @return mixed */ function bp_get_group_is_public( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - return apply_filters( 'bp_get_group_is_public', $group->is_public ); + /** + * Filters whether the current group in the loop is public. + * + * @since 2.5.0 Added the `$group` parameter. + * + * @param bool $public True if the group is public. + * @param object $group Group object. + */ + return apply_filters( 'bp_get_group_is_public', $group->is_public, $group ); } /** * Output the created date of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1315,30 +1068,36 @@ function bp_group_date_created( $group = false ) { /** * Return the created date of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_date_created( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the created date of the current group in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Created date for the current group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) ); + return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ), $group ); } /** * Output the username of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1348,30 +1107,36 @@ function bp_group_creator_username( $group = false ) { /** * Return the username of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_creator_username( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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) + * @since 1.7.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Username of the group creator. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) ); + return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ), $group ); } /** * Output the user ID of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1381,30 +1146,36 @@ function bp_group_creator_id( $group = false ) { /** * Return the user ID of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return int */ function bp_get_group_creator_id( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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) + * @since 1.7.0 + * @since 2.5.0 Added the `$group` parameter. * * @param int $creator_id User ID of the group creator. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_creator_id', $group->creator_id ); + return apply_filters( 'bp_get_group_creator_id', $group->creator_id, $group ); } /** * Output the permalink of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1414,44 +1185,51 @@ function bp_group_creator_permalink( $group = false ) { /** * Return the permalink of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_creator_permalink( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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) + * @since 1.7.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Permalink of the group creator. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) ); + return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ), $group ); } /** * Determine whether a user is the creator of the current group in the loop. * + * @since 1.7.0 + * * @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 ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( empty( $user_id ) ) + if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); + } return (bool) ( $group->creator_id == $user_id ); } @@ -1459,6 +1237,8 @@ function bp_is_group_creator( $group = false, $user_id = 0 ) { /** * Output the avatar of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. * @param array $args { @@ -1472,6 +1252,8 @@ function bp_group_creator_avatar( $group = false, $args = array() ) { /** * Return the avatar of the creator of the current group in the loop. * + * @since 1.7.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. * @param array $args { @@ -1490,8 +1272,9 @@ function bp_group_creator_avatar( $group = false, $args = array() ) { function bp_get_group_creator_avatar( $group = false, $args = array() ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $defaults = array( 'type' => 'full', @@ -1510,11 +1293,13 @@ function bp_group_creator_avatar( $group = false, $args = array() ) { /** * Filters the avatar of the creator of the current group in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $avatar Avatar of the group creator. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_creator_avatar', $avatar ); + return apply_filters( 'bp_get_group_creator_avatar', $avatar, $group ); } /** @@ -1522,6 +1307,8 @@ function bp_group_creator_avatar( $group = false, $args = array() ) { * * Alias of {@link bp_is_item_admin()}. * + * @since 1.1.0 + * * @return bool */ function bp_group_is_admin() { @@ -1533,6 +1320,8 @@ function bp_group_is_admin() { * * Alias of {@link bp_is_item_mod()}. * + * @since 1.1.0 + * * @return bool */ function bp_group_is_mod() { @@ -1542,6 +1331,8 @@ function bp_group_is_mod() { /** * Output markup listing group admins. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1552,7 +1343,7 @@ function bp_group_list_admins( $group = false ) { $group =& $groups_template->group; } - // fetch group admins if 'populate_extras' flag is false + // Fetch group admins if 'populate_extras' flag is false. if ( empty( $group->args['populate_extras'] ) ) { $query = new BP_Group_Member_Query( array( 'group_id' => $group->id, @@ -1582,6 +1373,8 @@ function bp_group_list_admins( $group = false ) { /** * Output markup listing group mod. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. */ @@ -1592,7 +1385,7 @@ function bp_group_list_mods( $group = false ) { $group =& $groups_template->group; } - // fetch group mods if 'populate_extras' flag is false + // Fetch group mods if 'populate_extras' flag is false. if ( empty( $group->args['populate_extras'] ) ) { $query = new BP_Group_Member_Query( array( 'group_id' => $group->id, @@ -1630,7 +1423,7 @@ function bp_group_list_mods( $group = false ) { /** * Return a list of user IDs for a group's admins. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param BP_Groups_Group|bool $group Optional. The group being queried. Defaults * to the current group in the loop. @@ -1641,8 +1434,9 @@ function bp_group_list_mods( $group = false ) { function bp_group_admin_ids( $group = false, $format = 'string' ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $admin_ids = array(); @@ -1652,25 +1446,28 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) { } } - if ( 'string' == $format ) + 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) + * @since 1.5.0 + * @since 2.5.0 Added the `$group` parameter. * * @param array|string $admin_ids List of user IDs for a group's admins. + * @param object $group Group object. */ - return apply_filters( 'bp_group_admin_ids', $admin_ids ); + return apply_filters( 'bp_group_admin_ids', $admin_ids, $group ); } /** * Return a list of user IDs for a group's moderators. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param BP_Groups_Group|bool $group Optional. The group being queried. * Defaults to the current group in the loop. @@ -1681,8 +1478,9 @@ function bp_group_admin_ids( $group = false, $format = 'string' ) { function bp_group_mod_ids( $group = false, $format = 'string' ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $mod_ids = array(); @@ -1692,23 +1490,28 @@ function bp_group_mod_ids( $group = false, $format = 'string' ) { } } - if ( 'string' == $format ) + 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) + * @since 1.5.0 + * @since 2.5.0 Added the `$group` parameter. * * @param array|string $admin_ids List of user IDs for a group's moderators. + * @param object $group Group object. */ - return apply_filters( 'bp_group_mod_ids', $mod_ids ); + return apply_filters( 'bp_group_mod_ids', $mod_ids, $group ); } /** * Output the permalink of the current group's Members page. + * + * @since 1.0.0 */ function bp_group_all_members_permalink() { echo bp_get_group_all_members_permalink(); @@ -1716,25 +1519,29 @@ function bp_group_all_members_permalink() { /** * Return the permalink of the Members page of the current group in the loop. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in loop. - * * @return string */ function bp_get_group_all_members_permalink( $group = false ) { global $groups_template; - if ( empty( $group ) ) + 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) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Permalink of the Members page for the current group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members' ); + return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members', $group ); } /** @@ -1742,7 +1549,7 @@ function bp_group_all_members_permalink() { * * No longer used in BuddyPress. * - * @todo Deprecate + * @todo Deprecate. */ function bp_group_search_form() { @@ -1765,13 +1572,14 @@ function bp_group_search_form() { * * No longer used in BuddyPress. * - * @todo Deprecate + * @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() ) ) + if ( !groups_total_groups_for_user( bp_displayed_user_id() ) ) { return true; + } return false; } @@ -1787,14 +1595,17 @@ function bp_group_show_no_groups_message() { */ function bp_group_is_activity_permalink() { - if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) ) + if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( bp_get_activity_slug() ) ) { return false; + } return true; } /** * Output the pagination HTML for a group loop. + * + * @since 1.2.0 */ function bp_groups_pagination_links() { echo bp_get_groups_pagination_links(); @@ -1802,6 +1613,8 @@ function bp_groups_pagination_links() { /** * Get the pagination HTML for a group loop. * + * @since 1.2.0 + * * @return string */ function bp_get_groups_pagination_links() { @@ -1810,7 +1623,7 @@ function bp_groups_pagination_links() { /** * Filters the pagination HTML for a group loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $pag_links HTML markup for the pagination links. */ @@ -1819,6 +1632,8 @@ function bp_groups_pagination_links() { /** * Output the "Viewing x-y of z groups" pagination message. + * + * @since 1.2.0 */ function bp_groups_pagination_count() { echo bp_get_groups_pagination_count(); @@ -1826,6 +1641,8 @@ function bp_groups_pagination_count() { /** * Generate the "Viewing x-y of z groups" pagination message. * + * @since 1.5.0 + * * @return string */ function bp_get_groups_pagination_count() { @@ -1845,7 +1662,7 @@ function bp_groups_pagination_count() { /** * Filters the "Viewing x-y of z groups" pagination message. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -1861,6 +1678,8 @@ function bp_groups_pagination_count() { * "Auto-join" is the toggle that determines whether users are joined to a * public group automatically when creating content in that group. * + * @since 1.2.6 + * * @return bool */ function bp_groups_auto_join() { @@ -1868,7 +1687,7 @@ function bp_groups_auto_join() { /** * Filters whether groups auto-join is enabled. * - * @since BuddyPres (1.2.6) + * @since 1.2.6 * * @param bool $value Enabled status. */ @@ -1878,6 +1697,8 @@ function bp_groups_auto_join() { /** * Output the total member count for a group. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. Default: current group in loop. */ function bp_group_total_members( $group = false ) { @@ -1886,29 +1707,35 @@ function bp_group_total_members( $group = false ) { /** * Get the total member count for a group. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the total member count for a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param int $total_member_count Total member count for a group. + * @param int $total_member_count Total member count for a group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_total_members', $group->total_member_count ); + return apply_filters( 'bp_get_group_total_members', $group->total_member_count, $group ); } /** * Output the "x members" count string for a group. + * + * @since 1.2.0 */ function bp_group_member_count() { echo bp_get_group_member_count(); @@ -1916,6 +1743,8 @@ function bp_group_member_count() { /** * Generate the "x members" count string for a group. * + * @since 1.2.0 + * * @return string */ function bp_get_group_member_count() { @@ -1932,7 +1761,7 @@ function bp_group_member_count() { /** * Filters the "x members" count string for a group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $count_string The "x members" count string for a group. */ @@ -1941,6 +1770,8 @@ function bp_group_member_count() { /** * Output the URL of the Forum page of the current group in the loop. + * + * @since 1.0.0 */ function bp_group_forum_permalink() { echo bp_get_group_forum_permalink(); @@ -1948,30 +1779,36 @@ function bp_group_forum_permalink() { /** * Generate the URL of the Forum page of a group. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the URL of the Forum page of a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL permalink for the Forum Page. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum' ); + return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum', $group ); } /** * Output the topic count for a group forum. * + * @since 1.2.0 + * * @param array|string $args See {@link bp_get_group_forum_topic_count()}. */ function bp_group_forum_topic_count( $args = '' ) { @@ -1980,6 +1817,8 @@ function bp_group_forum_topic_count( $args = '' ) { /** * Generate the topic count string for a group forum. * + * @since 1.2.0 + * * @param array|string $args { * Array of arguments. * @type bool $showtext Optional. If true, result will be formatted as "x topics". @@ -1998,20 +1837,24 @@ function bp_group_forum_topic_count( $args = '' ) { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) + if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) { return false; + } - if ( !bp_is_active( 'forums' ) ) + if ( !bp_is_active( 'forums' ) ) { return false; + } - if ( !$groups_template->group->forum_counts ) + if ( !$groups_template->group->forum_counts ) { $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id ); + } if ( (bool) $showtext ) { - if ( 1 == (int) $groups_template->group->forum_counts[0]->topics ) + if ( 1 == (int) $groups_template->group->forum_counts[0]->topics ) { $total_topics = sprintf( __( '%d topic', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->topics ); - else + } else { $total_topics = sprintf( __( '%d topics', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->topics ); + } } else { $total_topics = (int) $groups_template->group->forum_counts[0]->topics; } @@ -2019,7 +1862,7 @@ function bp_group_forum_topic_count( $args = '' ) { /** * Filters the topic count string for a group forum. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $total_topics Total topic count string. * @param bool $showtext Whether or not to return as formatted string. @@ -2030,6 +1873,8 @@ function bp_group_forum_topic_count( $args = '' ) { /** * Output the post count for a group forum. * + * @since 1.2.0 + * * @param array|string $args See {@link bp_get_group_forum_post_count()}. */ function bp_group_forum_post_count( $args = '' ) { @@ -2038,6 +1883,8 @@ function bp_group_forum_post_count( $args = '' ) { /** * Generate the post count string for a group forum. * + * @since 1.2.0 + * * @param array|string $args { * Array of arguments. * @type bool $showtext Optional. If true, result will be formatted as "x posts". @@ -2056,20 +1903,24 @@ function bp_group_forum_post_count( $args = '' ) { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) + if ( !$forum_id = groups_get_groupmeta( $groups_template->group->id, 'forum_id' ) ) { return false; + } - if ( !bp_is_active( 'forums' ) ) + if ( !bp_is_active( 'forums' ) ) { return false; + } - if ( !$groups_template->group->forum_counts ) + if ( !$groups_template->group->forum_counts ) { $groups_template->group->forum_counts = bp_forums_get_forum_topicpost_count( (int) $forum_id ); + } if ( (bool) $showtext ) { - if ( 1 == (int) $groups_template->group->forum_counts[0]->posts ) + if ( 1 == (int) $groups_template->group->forum_counts[0]->posts ) { $total_posts = sprintf( __( '%d post', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->posts ); - else + } else { $total_posts = sprintf( __( '%d posts', 'buddypress' ), (int) $groups_template->group->forum_counts[0]->posts ); + } } else { $total_posts = (int) $groups_template->group->forum_counts[0]->posts; } @@ -2077,7 +1928,7 @@ function bp_group_forum_post_count( $args = '' ) { /** * Filters the post count string for a group forum. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $total_posts Total post count string. * @param bool $showtext Whether or not to return as formatted string. @@ -2088,18 +1939,21 @@ function bp_group_forum_post_count( $args = '' ) { /** * Determine whether forums are enabled for a group. * - * @param object|bool $group Optional. Group object. Default: current group in loop. + * @since 1.0.0 * + * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( ! empty( $group->enable_forum ) ) + if ( ! empty( $group->enable_forum ) ) { return true; + } return false; } @@ -2107,41 +1961,49 @@ function bp_group_is_forum_enabled( $group = false ) { /** * Output the 'checked' attribute for the group forums settings UI. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. Default: current group in loop. */ function bp_group_show_forum_setting( $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( $group->enable_forum ) + if ( $group->enable_forum ) { echo ' checked="checked"'; + } } /** * Output the 'checked' attribute for a given status in the settings UI. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( $setting == $group->status ) + if ( $setting == $group->status ) { echo ' checked="checked"'; + } } /** * Output the 'checked' value, if needed, for a given invite_status on the group create/admin screens * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $setting The setting you want to check against ('members', - * 'mods', or 'admins'). + * 'mods', or 'admins'). * @param object|bool $group Optional. Group object. Default: current group in loop. */ function bp_group_show_invite_status_setting( $setting, $group = false ) { @@ -2149,8 +2011,9 @@ function bp_group_show_invite_status_setting( $setting, $group = false ) { $invite_status = bp_group_get_invite_status( $group_id ); - if ( $setting == $invite_status ) + if ( $setting == $invite_status ) { echo ' checked="checked"'; + } } /** @@ -2164,12 +2027,11 @@ function bp_group_show_invite_status_setting( $setting, $group = false ) { * * This function can be used either in or out of the loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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'. @@ -2181,10 +2043,10 @@ function bp_group_get_invite_status( $group_id = false ) { $bp = buddypress(); if ( isset( $bp->groups->current_group->id ) ) { - // Default to the current group first + // Default to the current group first. $group_id = $bp->groups->current_group->id; } elseif ( isset( $groups_template->group->id ) ) { - // Then see if we're in the loop + // Then see if we're in the loop. $group_id = $groups_template->group->id; } else { return false; @@ -2193,7 +2055,7 @@ function bp_group_get_invite_status( $group_id = false ) { $invite_status = groups_get_groupmeta( $group_id, 'invite_status' ); - // Backward compatibility. When 'invite_status' is not set, fall back to a default value + // Backward compatibility. When 'invite_status' is not set, fall back to a default value. if ( !$invite_status ) { $invite_status = apply_filters( 'bp_group_invite_status_fallback', 'members' ); } @@ -2203,7 +2065,7 @@ function bp_group_get_invite_status( $group_id = false ) { * * Invite status in this case means who from the group can send invites. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -2214,8 +2076,8 @@ function bp_group_get_invite_status( $group_id = false ) { /** * Can a user send invitations in the specified group? * - * @since BuddyPress (1.5.0) - * @since BuddyPress (2.2.0) Added the $user_id parameter. + * @since 1.5.0 + * @since 2.2.0 Added the $user_id parameter. * * @param int $group_id The group ID to check. * @param int $user_id The user ID to check. @@ -2236,7 +2098,7 @@ function bp_groups_user_can_send_invites( $group_id = 0, $user_id = 0 ) { } if ( $user_id ) { - // Users with the 'bp_moderate' cap can always send invitations + // Users with the 'bp_moderate' cap can always send invitations. if ( user_can( $user_id, 'bp_moderate' ) ) { $can_send_invites = true; } else { @@ -2267,8 +2129,8 @@ function bp_groups_user_can_send_invites( $group_id = 0, $user_id = 0 ) { /** * 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. + * @since 1.5.0 + * @since 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 @@ -2284,7 +2146,7 @@ function bp_groups_user_can_send_invites( $group_id = 0, $user_id = 0 ) { * * @deprecated 1.5 * @deprecated No longer used. - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @todo Remove in 1.4 * * @param bool $admin_list @@ -2295,8 +2157,9 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) { _deprecated_function( __FUNCTION__, '1.5', 'No longer used. See /bp-default/groups/single/admin.php' ); - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } if ( $admins = groups_get_group_admins( $group->id ) ) : ?> @@ -2371,8 +2234,9 @@ function bp_group_admin_memberlist( $admin_list = false, $group = false ) { function bp_group_mod_memberlist( $admin_list = false, $group = false ) { global $groups_template; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } if ( $group_mods = groups_get_group_mods( $group->id ) ) { ?> @@ -2433,29 +2297,35 @@ function bp_group_mod_memberlist( $admin_list = false, $group = false ) { /** * Determine whether a group has moderators. * - * @param object|bool $group Optional. Group object. Default: current group in loop. + * @since 1.0.0 * + * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters whether a group has moderators. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param array $value Array of user IDs who are a moderator of the provided group. + * @param array $value Array of user IDs who are a moderator of the provided group. + * @param object $group Group object. */ - return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ) ); + return apply_filters( 'bp_group_has_moderators', groups_get_group_mods( $group->id ), $group ); } /** * Output a URL for promoting a user to moderator. * + * @since 1.1.0 + * * @param array|string $args See {@link bp_get_group_member_promote_mod_link()}. */ function bp_group_member_promote_mod_link( $args = '' ) { @@ -2464,6 +2334,8 @@ function bp_group_member_promote_mod_link( $args = '' ) { /** * Generate a URL for promoting a user to moderator. * + * @since 1.1.0 + * * @param array|string $args { * @type int $user_id ID of the member to promote. Default: * current member in a group member loop. @@ -2485,7 +2357,7 @@ function bp_group_member_promote_mod_link( $args = '' ) { /** * Filters a URL for promoting a user to moderator. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value URL to use for promoting a user to moderator. */ @@ -2495,6 +2367,8 @@ function bp_group_member_promote_mod_link( $args = '' ) { /** * Output a URL for promoting a user to admin. * + * @since 1.1.0 + * * @param array|string $args See {@link bp_get_group_member_promote_admin_link()}. */ function bp_group_member_promote_admin_link( $args = '' ) { @@ -2503,6 +2377,8 @@ function bp_group_member_promote_admin_link( $args = '' ) { /** * Generate a URL for promoting a user to admin. * + * @since 1.1.0 + * * @param array|string $args { * @type int $user_id ID of the member to promote. Default: * current member in a group member loop. @@ -2524,7 +2400,7 @@ function bp_group_member_promote_admin_link( $args = '' ) { /** * Filters a URL for promoting a user to admin. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value URL to use for promoting a user to admin. */ @@ -2534,78 +2410,91 @@ function bp_group_member_promote_admin_link( $args = '' ) { /** * Output a URL for demoting a user to member. * + * @since 1.0.0 + * * @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; - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } echo bp_get_group_member_demote_link( $user_id ); } /** * Generate a URL for demoting a user to member. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } /** * Filters a URL for demoting a user to member. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL to use for demoting a user to member. + * @param object $group Group object. */ - 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' ) ); + 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' ), $group ); } /** * Output a URL for banning a member from a group. * + * @since 1.0.0 + * * @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; - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } echo bp_get_group_member_ban_link( $user_id ); } /** * Generate a URL for banning a member from a group. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters a URL for banning a member from a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL to use for banning a member. */ @@ -2615,39 +2504,45 @@ function bp_group_member_ban_link( $user_id = 0 ) { /** * Output a URL for unbanning a member from a group. * + * @since 1.0.0 + * * @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; - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } echo bp_get_group_member_unban_link( $user_id ); } /** * Generate a URL for unbanning a member from a group. * + * @since 1.0.0 + * * @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; - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters a URL for unbanning a member from a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL to use for unbanning a member. */ @@ -2657,45 +2552,54 @@ function bp_group_member_unban_link( $user_id = 0 ) { /** * Output a URL for removing a member from a group. * + * @since 1.2.6 + * * @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; - if ( !$user_id ) + if ( !$user_id ) { $user_id = $members_template->member->user_id; + } echo bp_get_group_member_remove_link( $user_id ); } /** * Generate a URL for removing a member from a group. * + * @since 1.2.6 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters a URL for removing a member from a group. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL to use for removing a member. + * @param object $group Group object. */ - 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' ) ); + 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' ), $group ); } /** * HTML admin subnav items for group pages. * + * @since 1.0.0 + * * @param object|bool $group Optional. Group object. * Default: current group in the loop. */ @@ -2723,10 +2627,11 @@ function bp_group_admin_tabs( $group = false ) { * BackCompat for plugins/themes directly hooking groups_admin_tabs * without using the Groups Extension API. * + * @since 2.2.0 + * * @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 = '' ) { @@ -2753,6 +2658,8 @@ function bp_group_admin_tabs_backcompat( $subnav_output = '', $subnav_item = '', /** * Output the group count for the displayed user. + * + * @since 1.1.0 */ function bp_group_total_for_member() { echo bp_get_group_total_for_member(); @@ -2760,6 +2667,8 @@ function bp_group_total_for_member() { /** * Get the group count for the displayed user. * + * @since 1.1.0 + * * @return string */ function bp_get_group_total_for_member() { @@ -2767,7 +2676,7 @@ function bp_group_total_for_member() { /** * FIlters the group count for a displayed user. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $value Total group count for a displayed user. */ @@ -2777,6 +2686,8 @@ function bp_group_total_for_member() { /** * Output the 'action' attribute for a group form. * + * @since 1.0.0 + * * @param string $page Page slug. */ function bp_group_form_action( $page ) { @@ -2785,31 +2696,37 @@ function bp_group_form_action( $page ) { /** * Generate the 'action' attribute for a group form. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the 'action' attribute for a group form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Action attribute for a group form. + * @param object $group Group object. */ - return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page ); + return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page, $group ); } /** * Output the 'action' attribute for a group admin form. * + * @since 1.0.0 + * * @param string|bool $page Optional. Page slug. */ function bp_group_admin_form_action( $page = false ) { @@ -2818,47 +2735,55 @@ function bp_group_admin_form_action( $page = false ) { /** * Generate the 'action' attribute for a group admin form. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( empty( $page ) ) + if ( empty( $page ) ) { $page = bp_action_variable( 0 ); + } /** * Filters the 'action' attribute for a group admin form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Action attribute for a group admin form. + * @param object $group Group object. */ - return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page ); + return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page, $group ); } /** * Determine whether the logged-in user has requested membership to a group. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) ) + if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) ) { return true; + } return false; } @@ -2866,39 +2791,45 @@ function bp_group_has_requested_membership( $group = false ) { /** * Check if current user is member of a group. * + * @since 1.0.0 + * * @global object $groups_template * * @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; - // Site admins always have access - if ( bp_current_user_can( 'bp_moderate' ) ) + // Site admins always have access. + if ( bp_current_user_can( 'bp_moderate' ) ) { return true; + } - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters whether current user is member of a group. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 + * @since 2.5.0 Added the `$group` parameter. * - * @param bool $is_member If user is a member of group or not. + * @param bool $is_member If user is a member of group or not. + * @param object $group Group object. */ - return apply_filters( 'bp_group_is_member', !empty( $group->is_member ) ); + return apply_filters( 'bp_group_is_member', ! empty( $group->is_member ), $group ); } /** * Check whether the current user has an outstanding invite to the current group in the loop. * + * @since 2.1.0 + * * @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 ) { @@ -2911,11 +2842,13 @@ function bp_group_is_invited( $group = false ) { /** * Filters whether current user has an outstanding invite to current group in loop. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param bool $is_invited If user has an outstanding group invite. + * @param bool $is_invited If user has an outstanding group invite. + * @param object $group Group object. */ - return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ) ); + return apply_filters( 'bp_group_is_invited', ! empty( $group->is_invited ), $group ); } /** @@ -2931,31 +2864,30 @@ function bp_group_is_invited( $group = false ) { * be found from the database. If the logged-in user had the 'bp_moderate' * capability, the return value would be boolean false. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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 ) { global $groups_template; - // Site admins always have access + // Site admins always have access. if ( bp_current_user_can( 'bp_moderate' ) ) { return false; } - // check groups loop first - // @see BP_Groups_Group::get_group_extras() + // Check groups loop first + // @see BP_Groups_Group::get_group_extras(). if ( ! empty( $groups_template->in_the_loop ) && isset( $groups_template->group->is_banned ) ) { $retval = $groups_template->group->is_banned; - // not in loop + // Not in loop. } else { - // Default to not banned + // Default to not banned. $retval = false; if ( empty( $group ) ) { @@ -2974,15 +2906,19 @@ 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) + * @since 1.5.0 + * @since 2.5.0 Added the `$group` parameter. * - * @param bool $is_invited If user has been from current group. + * @param bool $is_invited If user has been from current group. + * @param object $group Group object. */ - return (bool) apply_filters( 'bp_group_is_user_banned', $retval ); + return (bool) apply_filters( 'bp_group_is_user_banned', $retval, $group ); } /** * Output the URL for accepting an invitation to the current group in the loop. + * + * @since 1.0.0 */ function bp_group_accept_invite_link() { echo bp_get_group_accept_invite_link(); @@ -2990,31 +2926,37 @@ function bp_group_accept_invite_link() { /** * Generate the URL for accepting an invitation to a group. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $bp = buddypress(); /** * Filters the URL for accepting an invitation to a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL for accepting an invitation to a group. + * @param object $group Group object. */ - 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' ) ); + 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' ), $group ); } /** * Output the URL for accepting an invitation to the current group in the loop. + * + * @since 1.0.0 */ function bp_group_reject_invite_link() { echo bp_get_group_reject_invite_link(); @@ -3022,31 +2964,37 @@ function bp_group_reject_invite_link() { /** * Generate the URL for rejecting an invitation to a group. * + * @since 1.0.0 + * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } $bp = buddypress(); /** * Filters the URL for rejecting an invitation to a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL for rejecting an invitation to a group. + * @param object $group Group object. */ - 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' ) ); + 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' ), $group ); } /** * Output the URL for confirming a request to leave a group. + * + * @since 1.0.0 */ function bp_group_leave_confirm_link() { echo bp_get_group_leave_confirm_link(); @@ -3054,29 +3002,35 @@ function bp_group_leave_confirm_link() { /** * Generate the URL for confirming a request to leave a group. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the URL for confirming a request to leave a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL for confirming a request to leave a group. + * @param object $group Group object. */ - return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ) ); + return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ), $group ); } /** * Output the URL for rejecting a request to leave a group. + * + * @since 1.0.0 */ function bp_group_leave_reject_link() { echo bp_get_group_leave_reject_link(); @@ -3084,29 +3038,35 @@ function bp_group_leave_reject_link() { /** * Generate the URL for rejecting a request to leave a group. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the URL for rejecting a request to leave a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value URL for rejecting a request to leave a group. + * @param object $group Group object. */ - return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ) ); + return apply_filters( 'bp_get_group_leave_reject_link', bp_get_group_permalink( $group ), $group ); } /** * Output the 'action' attribute for a group send invite form. + * + * @since 1.0.0 */ function bp_group_send_invite_form_action() { echo bp_get_group_send_invite_form_action(); @@ -3114,46 +3074,54 @@ function bp_group_send_invite_form_action() { /** * Output the 'action' attribute for a group send invite form. * + * @since 1.0.0 + * * @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 ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } /** * Filters the 'action' attribute for a group send invite form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $value Action attribute for a group send invite form. + * @param object $group Group object. */ - return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send' ); + return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send', $group ); } /** * Determine whether the current user has friends to invite to a group. * + * @since 1.0.0 + * * @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; - if ( !bp_is_active( 'friends' ) ) + if ( !bp_is_active( 'friends' ) ) { return false; + } - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( !friends_check_user_has_friends( bp_loggedin_user_id() ) || !friends_count_invitable_friends( bp_loggedin_user_id(), $group->id ) ) + if ( !friends_check_user_has_friends( bp_loggedin_user_id() ) || !friends_count_invitable_friends( bp_loggedin_user_id(), $group->id ) ) { return false; + } return true; } @@ -3161,7 +3129,7 @@ function bp_has_friends_to_invite( $group = false ) { /** * Output a 'New Topic' button for a group. * - * @since BuddyPress (1.2.7) + * @since 1.2.7 * * @param BP_Groups_Group|bool $group The BP Groups_Group object if passed, * boolean false if not passed. @@ -3173,21 +3141,22 @@ function bp_group_new_topic_button( $group = false ) { /** * Returns a 'New Topic' button for a group. * - * @since BuddyPress (1.2.7) + * @since 1.2.7 * * @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; - if ( empty( $group ) ) + if ( empty( $group ) ) { $group =& $groups_template->group; + } - if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() ) + if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() ) { return false; + } $button = array( 'id' => 'new_topic', @@ -3205,17 +3174,19 @@ function bp_group_new_topic_button( $group = false ) { /** * Filters the HTML button for creating a new topic in a group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * @since 2.5.0 Added the `$group` parameter. * * @param string $button HTML button for a new topic. + * @param object $group Group object. */ - return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) ); + return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button, $group ) ); } /** * Output button to join a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Single group object. */ @@ -3225,40 +3196,39 @@ function bp_group_join_button( $group = false ) { /** * Return button to join a group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param object|bool $group Single group object. - * * @return mixed */ function bp_get_group_join_button( $group = false ) { global $groups_template; - // Set group to current loop group if none passed + // Set group to current loop group if none passed. if ( empty( $group ) ) { $group =& $groups_template->group; } - // Don't show button if not logged in or previously banned + // Don't show button if not logged in or previously banned. if ( ! is_user_logged_in() || bp_group_is_user_banned( $group ) ) { return false; } - // Group creation was not completed or status is unknown + // Group creation was not completed or status is unknown. if ( empty( $group->status ) ) { return false; } - // Already a member + // Already a member. if ( ! empty( $group->is_member ) ) { - // Stop sole admins from abandoning their group - $group_admins = groups_get_group_admins( $group->id ); - if ( ( 1 == count( $group_admins ) ) && ( bp_loggedin_user_id() === (int) $group_admins[0]->user_id ) ) { + // Stop sole admins from abandoning their group. + $group_admins = groups_get_group_admins( $group->id ); + if ( ( 1 == count( $group_admins ) ) && ( bp_loggedin_user_id() === (int) $group_admins[0]->user_id ) ) { return false; } - // Setup button attributes + // Setup button attributes. $button = array( 'id' => 'leave_group', 'component' => 'groups', @@ -3272,10 +3242,10 @@ function bp_group_join_button( $group = false ) { 'link_class' => 'group-button leave-group', ); - // Not a member + // Not a member. } else { - // Show different buttons based on group status + // Show different buttons based on group status. switch ( $group->status ) { case 'hidden' : return false; @@ -3298,7 +3268,7 @@ function bp_group_join_button( $group = false ) { case 'private' : // Member has outstanding invitation - - // show an "Accept Invitation" button + // show an "Accept Invitation" button. if ( $group->is_invited ) { $button = array( 'id' => 'accept_invite', @@ -3314,7 +3284,7 @@ function bp_group_join_button( $group = false ) { ); // Member has requested membership but request is pending - - // show a "Request Sent" button + // show a "Request Sent" button. } elseif ( $group->is_pending ) { $button = array( 'id' => 'membership_requested', @@ -3330,7 +3300,7 @@ function bp_group_join_button( $group = false ) { ); // Member has not requested membership yet - - // show a "Request Membership" button + // show a "Request Membership" button. } else { $button = array( 'id' => 'request_membership', @@ -3353,17 +3323,19 @@ function bp_group_join_button( $group = false ) { /** * Filters the HTML button for joining a group. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 + * @since 2.4.0 Added $group parameter to filter args. * * @param string $button HTML button for joining a group. + * @param object $group BuddyPress group object */ - return bp_get_button( apply_filters( 'bp_get_group_join_button', $button ) ); + return bp_get_button( apply_filters( 'bp_get_group_join_button', $button, $group ) ); } /** * Output the Create a Group button. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_group_create_button() { echo bp_get_group_create_button(); @@ -3371,7 +3343,7 @@ function bp_group_create_button() { /** * Get the Create a Group button. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -3398,7 +3370,7 @@ function bp_group_create_button() { /** * Filters the HTML button for creating a group. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $button HTML button for creating a group. */ @@ -3408,7 +3380,7 @@ function bp_group_create_button() { /** * Output the Create a Group nav item. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_group_create_nav_item() { echo bp_get_group_create_nav_item(); @@ -3417,15 +3389,15 @@ function bp_group_create_nav_item() { /** * Get the Create a Group nav item. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return string */ function bp_get_group_create_nav_item() { - // Get the create a group button + // Get the create a group button. $create_group_button = bp_get_group_create_button(); - // Make sure the button is available + // Make sure the button is available. if ( empty( $create_group_button ) ) { return; } @@ -3435,7 +3407,7 @@ function bp_group_create_nav_item() { /** * Filters the Create a Group nav item. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $output HTML output for nav item. */ @@ -3446,18 +3418,19 @@ function bp_group_create_nav_item() { * 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) + * @since 2.2.0 + * + * @uses bp_group_create_nav_item() to output the create a Group nav item. * - * @uses bp_group_create_nav_item() to output the create a Group nav item. * @return string HTML Output */ function bp_group_backcompat_create_nav_item() { - // Bail if the Groups nav item is already used by bp-legacy + // Bail if the Groups nav item is already used by bp-legacy. if ( has_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 ) ) { return; } - // Bail if the theme is not filtering the Groups directory title + // Bail if the theme is not filtering the Groups directory title. if ( ! has_filter( 'bp_groups_directory_header' ) ) { return; } @@ -3470,28 +3443,29 @@ add_action( 'bp_groups_directory_group_filter', 'bp_group_backcompat_create_nav_ * 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). * - * @since BuddyPress (1.0.0) + * @since 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. + * + * @param object|null $group Group to get status message for. Optional; defaults to current group. */ function bp_group_status_message( $group = null ) { global $groups_template; - // Group not passed so look for loop + // Group not passed so look for loop. if ( empty( $group ) ) { $group =& $groups_template->group; } - // Group status is not set (maybe outside of group loop?) + // Group status is not set (maybe outside of group loop?). if ( empty( $group->status ) ) { $message = __( 'This group is not currently accessible.', 'buddypress' ); - // Group has a status + // Group has a status. } else { switch( $group->status ) { - // Private group + // Private group. case 'private' : if ( ! bp_group_has_requested_membership( $group ) ) { if ( is_user_logged_in() ) { @@ -3509,7 +3483,7 @@ function bp_group_status_message( $group = null ) { break; - // Hidden group + // Hidden group. case 'hidden' : default : $message = __( 'This is a hidden group and only invited members can join.', 'buddypress' ); @@ -3522,7 +3496,7 @@ function bp_group_status_message( $group = null ) { * * This will be true if it is a hidden or private group, and the user does not have access. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $message Message to display to the current user. * @param object $group Group to get status message for. @@ -3535,11 +3509,13 @@ function bp_group_status_message( $group = null ) { * * This function is no longer used, but may still be used by older themes. * - * @since BuddyPress (1.0.0) + * @since 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" />'; + $query_arg = bp_core_get_component_search_query_arg( 'groups' ); + + if ( isset( $_REQUEST[ $query_arg ] ) ) { + echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST[ $query_arg ] ) . '" name="search_terms" />'; } if ( isset( $_REQUEST['letter'] ) ) { @@ -3554,7 +3530,7 @@ function bp_group_hidden_fields() { /** * Output the total number of groups. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ function bp_total_group_count() { echo bp_get_total_group_count(); @@ -3562,7 +3538,8 @@ function bp_total_group_count() { /** * Return the total number of groups. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 + * * @return type */ function bp_get_total_group_count() { @@ -3570,7 +3547,7 @@ function bp_total_group_count() { /** * Filters the total number of groups. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $value Total number of groups found. */ @@ -3580,7 +3557,7 @@ function bp_total_group_count() { /** * Output the total number of groups a user belongs to. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id User ID to get group membership count. */ @@ -3592,11 +3569,10 @@ function bp_total_group_count_for_user( $user_id = 0 ) { * * Filtered by `bp_core_number_format()` by default * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id User ID to get group membership count. - * - * @return int + * @return string */ function bp_get_total_group_count_for_user( $user_id = 0 ) { $count = groups_total_groups_for_user( $user_id ); @@ -3604,7 +3580,7 @@ function bp_total_group_count_for_user( $user_id = 0 ) { /** * Filters the total number of groups a user belongs to. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $count Total number of groups for the user. * @param int $user_id ID of the user being checked. @@ -3612,267 +3588,92 @@ function bp_total_group_count_for_user( $user_id = 0 ) { return apply_filters( 'bp_get_total_group_count_for_user', $count, $user_id ); } -/** Group Members *************************************************************/ +/* Group Members *************************************************************/ -class BP_Groups_Group_Members_Template { - public $current_member = -1; - public $member_count; - public $members; - public $member; +/** + * Initialize a group member query loop. + * + * @since 1.0.0 + * + * @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 $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; - public $in_the_loop; + $exclude_admins_mods = 1; - public $pag_page; - public $pag_num; - public $pag_links; - public $total_group_count; + if ( bp_is_group_members() ) { + $exclude_admins_mods = 0; + } - /** - * 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 $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. - * } - */ - 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); - - $old_args_keys = array( - 0 => 'group_id', - 1 => 'per_page', - 2 => 'max', - 3 => 'exclude_admins_mods', - 4 => 'exclude_banned', - 5 => 'exclude', - 6 => 'group_role', - ); + $r = wp_parse_args( $args, array( + 'group_id' => bp_get_current_group_id(), + 'page' => 1, + 'per_page' => 20, + 'max' => false, + 'exclude' => false, + 'exclude_admins_mods' => $exclude_admins_mods, + 'exclude_banned' => 1, + 'group_role' => false, + 'search_terms' => null, + 'type' => 'last_joined', + ) ); - $func_args = func_get_args(); - $args = bp_core_parse_args_array( $old_args_keys, $func_args ); - } + if ( is_null( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) ) { + $r['search_terms'] = $_REQUEST['s']; + } - $r = wp_parse_args( $args, array( - 'group_id' => bp_get_current_group_id(), - 'page' => 1, - 'per_page' => 20, - 'page_arg' => 'mlpage', - 'max' => false, - 'exclude' => false, - 'exclude_admins_mods' => 1, - 'exclude_banned' => 1, - 'group_role' => false, - 'search_terms' => false, - 'type' => 'last_joined', - ) ); + $members_template = new BP_Groups_Group_Members_Template( $r ); - $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 ( empty( $current_group ) || ( $current_group && $current_group->id !== bp_get_current_group_id() ) ) { - $current_group = groups_get_group( array( 'group_id' => $r['group_id'] ) ); - } - - // Assemble the base URL for pagination - $base_url = trailingslashit( bp_get_group_permalink( $current_group ) . bp_current_action() ); - if ( bp_action_variable() ) { - $base_url = trailingslashit( $base_url . bp_action_variable() ); - } - - $members_args = $r; - - $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 ( empty( $r['max'] ) || ( $r['max'] >= (int) $this->members['count'] ) ) { - $this->total_member_count = (int) $this->members['count']; - } else { - $this->total_member_count = (int) $r['max']; - } - - // Reset members array for subsequent looping - $this->members = $this->members['members']; - - if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->members ) ) ) { - $this->member_count = (int) count( $this->members ); - } else { - $this->member_count = (int) $r['max']; - } - - $this->pag_links = paginate_links( array( - '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' => '←', - 'next_text' => '→', - 'mid_size' => 1, - 'add_args' => array(), - ) ); - } - - public function has_members() { - if ( ! empty( $this->member_count ) ) { - return true; - } - - return false; - } - - public function next_member() { - $this->current_member++; - $this->member = $this->members[ $this->current_member ]; - - return $this->member; - } - - public function rewind_members() { - $this->current_member = -1; - if ( $this->member_count > 0 ) { - $this->member = $this->members[0]; - } - } - - public function members() { - $tick = intval( $this->current_member + 1 ); - if ( $tick < $this->member_count ) { - return true; - } 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(); - } - - $this->in_the_loop = false; - return false; - } - - public function the_member() { - $this->in_the_loop = true; - $this->member = $this->next_member(); - - // 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 ); - } - } -} + /** + * Filters whether or not a group member query has members to display. + * + * @since 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 ); +} /** - * Initialize a group member query loop. + * @since 1.0.0 * - * @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 $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 + * @return mixed */ -function bp_group_has_members( $args = '' ) { - global $members_template; - - $exclude_admins_mods = 1; - - if ( bp_is_group_members() ) { - $exclude_admins_mods = 0; - } - - $r = wp_parse_args( $args, array( - 'group_id' => bp_get_current_group_id(), - 'page' => 1, - 'per_page' => 20, - 'max' => false, - 'exclude' => false, - 'exclude_admins_mods' => $exclude_admins_mods, - 'exclude_banned' => 1, - 'group_role' => false, - 'search_terms' => null, - 'type' => 'last_joined', - ) ); - - if ( is_null( $r['search_terms'] ) && ! empty( $_REQUEST['s'] ) ) { - $r['search_terms'] = $_REQUEST['s']; - } - - $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 ); -} - function bp_group_members() { global $members_template; return $members_template->members(); } +/** + * @since 1.0.0 + * + * @return mixed + */ function bp_group_the_member() { global $members_template; @@ -3882,9 +3683,9 @@ function bp_group_the_member() { /** * Output the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param array|string $args {@see bp_core_fetch_avatar()} + * @param array|string $args {@see bp_core_fetch_avatar()}. */ function bp_group_member_avatar( $args = '' ) { echo bp_get_group_member_avatar( $args ); @@ -3892,10 +3693,9 @@ function bp_group_member_avatar( $args = '' ) { /** * Return the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) - * - * @param array|string $args {@see bp_core_fetch_avatar()} + * @since 1.0.0 * + * @param array|string $args {@see bp_core_fetch_avatar()}. * @return string */ function bp_get_group_member_avatar( $args = '' ) { @@ -3911,7 +3711,7 @@ function bp_group_member_avatar( $args = '' ) { /** * Filters the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML markup for group member avatar. * @param array $r Parsed args used for the avatar query. @@ -3922,21 +3722,19 @@ function bp_group_member_avatar( $args = '' ) { /** * Output the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param array|string $args {@see bp_core_fetch_avatar()} + * @param array|string $args {@see bp_core_fetch_avatar()}. */ - function bp_group_member_avatar_thumb( $args = '' ) { echo bp_get_group_member_avatar_thumb( $args ); } /** * Return the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) - * - * @param array|string $args {@see bp_core_fetch_avatar()} + * @since 1.0.0 * + * @param array|string $args {@see bp_core_fetch_avatar()}. * @return string */ function bp_get_group_member_avatar_thumb( $args = '' ) { @@ -3952,7 +3750,7 @@ function bp_group_member_avatar_thumb( $args = '' ) { /** * Filters the group member avatar thumb while in the groups members loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value HTML markup for group member avatar thumb. * @param array $r Parsed args used for the avatar query. @@ -3963,7 +3761,7 @@ function bp_group_member_avatar_thumb( $args = '' ) { /** * Output the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $width Width of avatar to fetch. * @param int $height Height of avatar to fetch. @@ -3974,11 +3772,10 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { /** * Output the group member avatar while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @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 ) { @@ -3996,7 +3793,7 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { /** * Filters the group member avatar mini while in the groups members loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML markup for group member avatar mini. * @param array $r Parsed args used for the avatar query. @@ -4004,73 +3801,118 @@ function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( $r ), $r ); } +/** + * @since 1.0.0 + */ function bp_group_member_name() { echo bp_get_group_member_name(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 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 ); } +/** + * @since 1.0.0 + */ function bp_group_member_url() { echo bp_get_group_member_url(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 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 ) ); } +/** + * @since 1.0.0 + */ function bp_group_member_link() { echo bp_get_group_member_link(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 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>' ); } +/** + * @since 1.2.0 + */ function bp_group_member_domain() { echo bp_get_group_member_domain(); } + + /** + * @since 1.2.0 + * + * @return mixed|void + */ 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) + * @since 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 ) ); } +/** + * @since 1.2.0 + */ function bp_group_member_is_friend() { echo bp_get_group_member_is_friend(); } + + /** + * @since 1.2.0 + * + * @return mixed|void + */ function bp_get_group_member_is_friend() { global $members_template; @@ -4085,29 +3927,41 @@ function bp_group_member_is_friend() { /** * Filters the friendship status between current user and displayed user in group member loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $friend_status Current status of the friendship. */ return apply_filters( 'bp_get_group_member_is_friend', $friend_status ); } +/** + * @since 1.0.0 + */ function bp_group_member_is_banned() { echo bp_get_group_member_is_banned(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 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 ); } +/** + * @since 1.2.6 + */ function bp_group_member_css_class() { global $members_template; @@ -4116,7 +3970,7 @@ function bp_group_member_css_class() { /** * Filters the class to add to the HTML if member is banned. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @param string $value HTML class to add. */ @@ -4124,38 +3978,61 @@ function bp_group_member_css_class() { } } +/** + * @since 1.0.0 + */ function bp_group_member_joined_since() { echo bp_get_group_member_joined_since(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 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') ) ); } +/** + * @since 1.0.0 + */ function bp_group_member_id() { echo bp_get_group_member_id(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ function bp_get_group_member_id() { global $members_template; /** * Filters the member's user ID for group members loop. * - * @since BuddyPress (1.0.0) + * @since 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 ); } +/** + * @since 1.0.0 + * + * @return bool + */ function bp_group_member_needs_pagination() { global $members_template; @@ -4166,41 +4043,68 @@ function bp_group_member_needs_pagination() { return false; } +/** + * @since 1.0.0 + */ function bp_group_pag_id() { echo bp_get_group_pag_id(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ function bp_get_group_pag_id() { /** * Filters the string to be used as the group pag id. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Value to use for the pag id. */ return apply_filters( 'bp_get_group_pag_id', 'pag' ); } +/** + * @since 1.0.0 + */ function bp_group_member_pagination() { echo bp_get_group_member_pagination(); wp_nonce_field( 'bp_groups_member_list', '_member_pag_nonce' ); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ 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) + * @since 1.0.0 * * @param string $pag_links HTML markup for the pagination. */ return apply_filters( 'bp_get_group_member_pagination', $members_template->pag_links ); } +/** + * @since 1.0.0 + */ function bp_group_member_pagination_count() { echo bp_get_group_member_pagination_count(); } + + /** + * @since 1.0.0 + * + * @return mixed|void + */ function bp_get_group_member_pagination_count() { global $members_template; @@ -4218,7 +4122,7 @@ function bp_group_member_pagination_count() { /** * Filters the "Viewing x-y of z members" pagination message. * - * @since BuddyPress (1.0.0) + * @since 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. @@ -4228,10 +4132,19 @@ function bp_group_member_pagination_count() { return apply_filters( 'bp_get_group_member_pagination_count', $message, $from_num, $to_num, $total ); } +/** + * @since 1.0.0 + */ function bp_group_member_admin_pagination() { echo bp_get_group_member_admin_pagination(); wp_nonce_field( 'bp_groups_member_admin_list', '_member_admin_pag_nonce' ); } + + /** + * @since 1.0.0 + * + * @return mixed + */ function bp_get_group_member_admin_pagination() { global $members_template; @@ -4239,11 +4152,82 @@ function bp_group_member_admin_pagination() { } /** - * Output the Group members template + * Output the contents of the current group's home page. * - * @since BuddyPress (2.0.0) + * You should only use this when on a single group page. + * + * @since 2.4.0 + */ +function bp_groups_front_template_part() { + $located = bp_groups_get_front_template(); + + if ( false !== $located ) { + $slug = str_replace( '.php', '', $located ); + + /** + * Let plugins adding an action to bp_get_template_part get it from here + * + * @param string $slug Template part slug requested. + * @param string $name Template part name requested. + */ + do_action( 'get_template_part_' . $slug, $slug, false ); + + load_template( $located, true ); + + } else if ( bp_is_active( 'activity' ) ) { + bp_get_template_part( 'groups/single/activity' ); + + } else if ( bp_is_active( 'members' ) ) { + bp_groups_members_template_part(); + } + + return $located; +} + +/** + * Locate a custom group front template if it exists. + * + * @since 2.4.0 + * + * @param BP_Groups_Group|null $group Optional. Falls back to current group if not passed. + * @return string|bool Path to front template on success; boolean false on failure. + */ +function bp_groups_get_front_template( $group = null ) { + if ( ! is_a( $group, 'BP_Groups_Group' ) ) { + $group = groups_get_current_group(); + } + + if ( ! isset( $group->id ) ) { + return false; + } + + if ( isset( $group->front_template ) ) { + return $group->front_template; + } + + /** + * Filters the hierarchy of group front templates corresponding to a specific group. + * + * @since 2.4.0 + * @since 2.5.0 Added the `$group` parameter. + * + * @param array $template_names Array of template paths. + * @param object $group Group object. + */ + $template_names = apply_filters( 'bp_groups_get_front_template', array( + 'groups/single/front-id-' . sanitize_file_name( $group->id ) . '.php', + 'groups/single/front-slug-' . sanitize_file_name( $group->slug ) . '.php', + 'groups/single/front-status-' . sanitize_file_name( $group->status ) . '.php', + 'groups/single/front.php' + ) ); + + return bp_locate_template( $template_names, false, true ); +} + +/** + * Output the Group members template * - * @return string html output + * @since 2.0.0 */ function bp_groups_members_template_part() { ?> @@ -4261,7 +4245,7 @@ function bp_groups_members_template_part() { * * Part of bp_groups_members_template_part(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_directory_member_sub_types' ); ?> @@ -4279,9 +4263,7 @@ function bp_groups_members_template_part() { /** * Output the Group members filters * - * @since BuddyPress (2.0.0) - * - * @return string html output + * @since 2.0.0 */ function bp_groups_members_filter() { ?> @@ -4304,7 +4286,7 @@ function bp_groups_members_filter() { * * Useful for plugins to add more filter options. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_groups_members_order_options' ); ?> @@ -4313,32 +4295,31 @@ function bp_groups_members_filter() { <?php } -/*************************************************************************** +/* * Group Creation Process Template Tags - **/ + */ /** * Determine if the current logged in user can create groups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses apply_filters() To call 'bp_user_can_create_groups'. * @uses bp_get_option() To retrieve value of 'bp_restrict_group_creation'. Defaults to 0. * @uses bp_current_user_can() To determine if current user if super admin. - * * @return bool True if user can create groups. False otherwise. */ function bp_user_can_create_groups() { - // Super admin can always create groups + // Super admin can always create groups. if ( bp_current_user_can( 'bp_moderate' ) ) { return true; } - // Get group creation option, default to 0 (allowed) + // Get group creation option, default to 0 (allowed). $restricted = (int) bp_get_option( 'bp_restrict_group_creation', 0 ); - // Allow by default + // Allow by default. $can_create = true; // Are regular users restricted? @@ -4349,7 +4330,7 @@ function bp_user_can_create_groups() { /** * Filters if the current logged in user can create groups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $can_create Whether the person can create groups. * @param int $restricted Whether or not group creation is restricted. @@ -4357,6 +4338,11 @@ function bp_user_can_create_groups() { return apply_filters( 'bp_user_can_create_groups', $can_create, $restricted ); } +/** + * @since 1.0.0 + * + * @return bool + */ function bp_group_creation_tabs() { $bp = buddypress(); @@ -4383,27 +4369,39 @@ function bp_group_creation_tabs() { /** * Fires at the end of the creation of the group tabs. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_creation_tabs' ); } +/** + * @since 1.0.0 + */ function bp_group_creation_stage_title() { $bp = buddypress(); /** * Filters the group creation stage title. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value HTML markup for the group creation stage title. */ echo apply_filters( 'bp_group_creation_stage_title', '<span>— ' . $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] . '</span>' ); } +/** + * @since 1.1.0 + */ function bp_group_creation_form_action() { echo bp_get_group_creation_form_action(); } + +/** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_group_creation_form_action() { $bp = buddypress(); @@ -4415,37 +4413,44 @@ function bp_group_creation_form_action() { /** * Filters the group creation form action. * - * @since BuddyPress (1.1.0) + * @since 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 ) ) ); } +/** + * @since 1.1.0 + * + * @param string $step_slug + * + * @return bool + */ function bp_is_group_creation_step( $step_slug ) { - // Make sure we are in the groups component + // Make sure we are in the groups component. if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) { return false; } $bp = buddypress(); - // If this the first step, we can just accept and return true + // If this the first step, we can just accept and return true. $keys = array_keys( $bp->groups->group_creation_steps ); if ( !bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug ) { return true; } // Before allowing a user to see a group creation step we must make sure - // previous steps are completed + // previous steps are completed. if ( !bp_is_first_group_creation_step() ) { if ( !bp_are_previous_group_creation_steps_complete( $step_slug ) ) { return false; } } - // Check the current step against the step parameter + // Check the current step against the step parameter. if ( bp_is_action_variable( $step_slug ) ) { return true; } @@ -4453,6 +4458,13 @@ function bp_is_group_creation_step( $step_slug ) { return false; } +/** + * @since 1.1.0 + * + * @param array $step_slugs + * + * @return bool + */ function bp_is_group_creation_step_complete( $step_slugs ) { $bp = buddypress(); @@ -4477,10 +4489,17 @@ function bp_is_group_creation_step_complete( $step_slugs ) { return true; } +/** + * @since 1.1.0 + * + * @param string $step_slug + * + * @return bool + */ function bp_are_previous_group_creation_steps_complete( $step_slug ) { $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 ) { return true; @@ -4490,7 +4509,7 @@ function bp_are_previous_group_creation_steps_complete( $step_slug ) { $previous_steps = array(); - // Get previous steps + // Get previous steps. foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { if ( $slug === $step_slug ) { break; @@ -4502,9 +4521,18 @@ function bp_are_previous_group_creation_steps_complete( $step_slug ) { return bp_is_group_creation_step_complete( $previous_steps ); } +/** + * @since 1.1.0 + */ function bp_new_group_id() { echo bp_get_new_group_id(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_new_group_id() { $bp = buddypress(); $new_group_id = isset( $bp->groups->new_group_id ) @@ -4514,16 +4542,25 @@ function bp_new_group_id() { /** * Filters the new group ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $new_group_id ID of the new group. */ return apply_filters( 'bp_get_new_group_id', $new_group_id ); } +/** + * @since 1.1.0 + */ function bp_new_group_name() { echo bp_get_new_group_name(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_new_group_name() { $bp = buddypress(); $name = isset( $bp->groups->current_group->name ) @@ -4533,16 +4570,25 @@ function bp_new_group_name() { /** * Filters the new group name. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $name Name of the new group. */ return apply_filters( 'bp_get_new_group_name', $name ); } +/** + * @since 1.1.0 + */ function bp_new_group_description() { echo bp_get_new_group_description(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_new_group_description() { $bp = buddypress(); $description = isset( $bp->groups->current_group->description ) @@ -4552,16 +4598,25 @@ function bp_new_group_description() { /** * Filters the new group description. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $name Description of the new group. */ return apply_filters( 'bp_get_new_group_description', $description ); } +/** + * @since 1.1.0 + */ function bp_new_group_enable_forum() { echo bp_get_new_group_enable_forum(); } + + /** + * @since 1.1.0 + * + * @return int + */ function bp_get_new_group_enable_forum() { $bp = buddypress(); $forum = isset( $bp->groups->current_group->enable_forum ) @@ -4571,16 +4626,25 @@ function bp_new_group_enable_forum() { /** * Filters whether or not to enable forums for the new group. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $forum Whether or not to enable forums. */ return (int) apply_filters( 'bp_get_new_group_enable_forum', $forum ); } +/** + * @since 1.1.0 + */ function bp_new_group_status() { echo bp_get_new_group_status(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_new_group_status() { $bp = buddypress(); $status = isset( $bp->groups->current_group->status ) @@ -4590,41 +4654,72 @@ function bp_new_group_status() { /** * Filters the new group status. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $status Status for the new group. */ return apply_filters( 'bp_get_new_group_status', $status ); } +/** + * Output the avatar for the group currently being created + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For more information on accepted arguments + * + * @param array|string $args See bp_core_fetch_avatar(). + */ function bp_new_group_avatar( $args = '' ) { echo bp_get_new_group_avatar( $args ); } + /** + * Return the avatar for the group currently being created + * + * @since 1.1.0 + * + * @see bp_core_fetch_avatar() For a description of arguments and return values. + * + * @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: 'Group photo'. + * @type string $class Default: 'avatar'. + * @type string $type Default: 'full'. + * @type int|bool $width Default: false. + * @type int|bool $height Default: false. + * @type string $id Passed to $css_id parameter. Default: 'avatar-crop-preview'. + * } + * @return string The avatar for the group being created + */ function bp_get_new_group_avatar( $args = '' ) { - $bp = buddypress(); - $r = wp_parse_args( $args, array( + // Parse arguments. + $r = bp_parse_args( $args, array( 'type' => 'full', 'width' => false, 'height' => false, 'class' => 'avatar', 'id' => 'avatar-crop-preview', - 'alt' => __( 'Group avatar', 'buddypress' ), + 'alt' => __( 'Group photo', 'buddypress' ), 'no_grav' => false - ) ); + ), 'get_new_group_avatar' ); + // Merge parsed arguments with object specific data. $r = array_merge( $r, array( - 'item_id' => $bp->groups->current_group->id, + 'item_id' => bp_get_current_group_id(), 'object' => 'group', 'avatar_dir' => 'group-avatars', ) ); + // Get the avatar. $avatar = bp_core_fetch_avatar( $r ); /** * Filters the new group avatar. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $avatar HTML markup for the new group avatar. * @param array $r Array of parsed arguments for the group avatar. @@ -4633,34 +4728,57 @@ function bp_new_group_avatar( $args = '' ) { return apply_filters( 'bp_get_new_group_avatar', $avatar, $r, $args ); } +/** + * Escape & output the URL to the previous group creation step + * + * @since 1.1.0 + */ function bp_group_creation_previous_link() { - echo bp_get_group_creation_previous_link(); + echo esc_url( bp_get_group_creation_previous_link() ); } + /** + * Return the URL to the previous group creation step + * + * @since 1.1.0 + * + * @return string + */ function bp_get_group_creation_previous_link() { - $bp = buddypress(); + $bp = buddypress(); + $steps = array_keys( $bp->groups->group_creation_steps ); - foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { + // Loop through steps. + foreach ( $steps as $slug ) { + + // Break when the current step is found. if ( bp_is_action_variable( $slug ) ) { break; } + // Add slug to previous steps. $previous_steps[] = $slug; } + // Generate the URL for the previous step. + $group_directory = bp_get_groups_directory_permalink(); + $create_step = 'create/step/'; + $previous_step = array_pop( $previous_steps ); + $url = trailingslashit( $group_directory . $create_step . $previous_step ); + /** * Filters the permalink for the previous step with the group creation process. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * - * @param string $value Permalink for the previous step. + * @param string $url 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 ) ) ); + return apply_filters( 'bp_get_group_creation_previous_link', $url ); } /** * Echoes the current group creation step. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_groups_current_create_step() { echo bp_get_groups_current_create_step(); @@ -4668,7 +4786,7 @@ function bp_groups_current_create_step() { /** * Returns the current group creation step. If none is found, returns an empty string. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Filter bp_get_groups_current_create_step to modify. * @@ -4688,98 +4806,182 @@ function bp_groups_current_create_step() { * * If none is found, returns an empty string. * - * @since BuddyPress (1.6.0) + * @since 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() { - $bp = buddypress(); - - $keys = array_keys( $bp->groups->group_creation_steps ); - $last_step = array_pop( $keys ); +/** + * Is the user looking at the last step in the group creation process. + * + * @since 1.1.0 + * + * @param string $step Step to compare. + * @return bool True if yes, False if no + */ +function bp_is_last_group_creation_step( $step = '' ) { - if ( $last_step == bp_get_groups_current_create_step() ) { - return true; + // Use current step, if no step passed. + if ( empty( $step ) ) { + $step = bp_get_groups_current_create_step(); } - return false; -} + // Get the last step. + $bp = buddypress(); + $steps = array_keys( $bp->groups->group_creation_steps ); + $l_step = array_pop( $steps ); -function bp_is_first_group_creation_step() { - $bp = buddypress(); + // Compare last step to step. + $retval = ( $l_step === $step ); - $keys = array_keys( $bp->groups->group_creation_steps ); - $first_step = array_shift( $keys ); + /** + * Filters whether or not user is looking at last step in group creation process. + * + * @since 2.4.0 + * + * @param bool $retval Whether or not we are looking at last step. + * @param array $steps Array of steps from the group creation process. + * @param string $step Step to compare. + */ + return (bool) apply_filters( 'bp_is_last_group_creation_step', $retval, $steps, $step ); +} - if ( $first_step == bp_get_groups_current_create_step() ) { - return true; +/** + * Is the user looking at the first step in the group creation process + * + * @since 1.1.0 + * + * @param string $step Step to compare. + * @return bool True if yes, False if no + */ +function bp_is_first_group_creation_step( $step = '' ) { + + // Use current step, if no step passed. + if ( empty( $step ) ) { + $step = bp_get_groups_current_create_step(); } - return false; + // Get the first step. + $bp = buddypress(); + $steps = array_keys( $bp->groups->group_creation_steps ); + $f_step = array_shift( $steps ); + + // Compare first step to step. + $retval = ( $f_step === $step ); + + /** + * Filters whether or not user is looking at first step in group creation process. + * + * @since 2.4.0 + * + * @param bool $retval Whether or not we are looking at first step. + * @param array $steps Array of steps from the group creation process. + * @param string $step Step to compare. + */ + return (bool) apply_filters( 'bp_is_first_group_creation_step', $retval, $steps, $step ); } -function bp_new_group_invite_friend_list() { - echo bp_get_new_group_invite_friend_list(); +/** + * Output a list of friends who can be invited to a group + * + * @since 1.0.0 + * + * @param array $args Array of arguments for friends list output. + */ +function bp_new_group_invite_friend_list( $args = array() ) { + echo bp_get_new_group_invite_friend_list( $args ); } - function bp_get_new_group_invite_friend_list( $args = '' ) { - $bp = buddypress(); + /** + * Return a list of friends who can be invited to a group + * + * @since 1.0.0 + * + * @param array $args Array of arguments for friends list output. + * @return mixed HTML list of checkboxes, or false + */ + function bp_get_new_group_invite_friend_list( $args = array() ) { - if ( !bp_is_active( 'friends' ) ) { + // Bail if no friends component. + if ( ! bp_is_active( 'friends' ) ) { return false; } - $defaults = array( + // Parse arguments. + $r = wp_parse_args( $args, array( + 'user_id' => bp_loggedin_user_id(), 'group_id' => false, 'separator' => 'li' - ); - - $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); + ) ); - if ( empty( $group_id ) ) { - $group_id = !empty( $bp->groups->new_group_id ) ? $bp->groups->new_group_id : $bp->groups->current_group->id; + // No group passed, so look for new or current group ID's. + if ( empty( $r['group_id'] ) ) { + $bp = buddypress(); + $r['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 ); + // Setup empty items array. + $items = array(); - for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) { - $checked = ''; + // Get user's friends who are not in this group already. + $friends = friends_get_friends_invite_list( $r['user_id'], $r['group_id'] ); - if ( !empty( $invites ) ) { - if ( in_array( $friends[$i]['id'], $invites ) ) { - $checked = ' checked="checked"'; - } - } + if ( ! empty( $friends ) ) { - $items[] = '<' . $separator . '><input' . $checked . ' type="checkbox" name="friends[]" id="f-' . $friends[$i]['id'] . '" value="' . esc_attr( $friends[$i]['id'] ) . '" /> ' . $friends[$i]['full_name'] . '</' . $separator . '>'; + // Get already invited users. + $invites = groups_get_invites_for_group( $r['user_id'], $r['group_id'] ); + + for ( $i = 0, $count = count( $friends ); $i < $count; ++$i ) { + $checked = in_array( (int) $friends[ $i ]['id'], (array) $invites ); + $items[] = '<' . $r['separator'] . '><label for="f-' . esc_attr( $friends[ $i ]['id'] ) . '"><input' . checked( $checked, true, false ) . ' type="checkbox" name="friends[]" id="f-' . esc_attr( $friends[ $i ]['id'] ) . '" value="' . esc_attr( $friends[ $i ]['id'] ) . '" /> ' . esc_html( $friends[ $i ]['full_name'] ) . '</label></' . $r['separator'] . '>'; } } - if ( !empty( $items ) ) { - return implode( "\n", (array) $items ); + /** + * Filters the array of friends who can be invited to a group. + * + * @since 2.4.0 + * + * @param array $items Array of friends. + * @param array $r Parsed arguments from bp_get_new_group_invite_friend_list() + * @param array $args Unparsed arguments from bp_get_new_group_invite_friend_list() + */ + $invitable_friends = apply_filters( 'bp_get_new_group_invite_friend_list', $items, $r, $args ); + + if ( ! empty( $invitable_friends ) && is_array( $invitable_friends ) ) { + $retval = implode( "\n", $invitable_friends ); + } else { + $retval = false; } - return false; + return $retval; } +/** + * @since 1.0.0 + */ function bp_directory_groups_search_form() { - $default_search_value = bp_get_search_default_text( 'groups' ); - $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; + $query_arg = bp_core_get_component_search_query_arg( 'groups' ); + + if ( ! empty( $_REQUEST[ $query_arg ] ) ) { + $search_value = stripslashes( $_REQUEST[ $query_arg ] ); + } else { + $search_value = bp_get_search_default_text( 'groups' ); + } $search_form_html = '<form action="" method="get" id="search-groups-form"> - <label><input type="text" name="s" id="groups_search" placeholder="'. esc_attr( $search_value ) .'" /></label> + <label for="groups_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="groups_search" placeholder="'. esc_attr( $search_value ) .'" /></label> <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) + * @since 1.9.0 * * @param string $search_form_html HTML markup for the search form. */ @@ -4790,6 +4992,8 @@ function bp_directory_groups_search_form() { /** * Displays group header tabs. * + * @since 1.0.0 + * * @todo Deprecate? */ function bp_groups_header_tabs() { @@ -4809,6 +5013,8 @@ function bp_groups_header_tabs() { /** * Displays group filter titles. * + * @since 1.0.0 + * * @todo Deprecate? */ function bp_groups_filter_title() { @@ -4840,10 +5046,9 @@ function bp_groups_filter_title() { /** * Is the current page a specific group admin screen? * - * @since BuddyPress (1.1.0) - * - * @param string $slug + * @since 1.1.0 * + * @param string $slug Admin screen slug. * @return bool */ function bp_is_group_admin_screen( $slug = '' ) { @@ -4853,7 +5058,7 @@ function bp_is_group_admin_screen( $slug = '' ) { /** * Echoes the current group admin tab slug. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_group_current_admin_tab() { echo bp_get_group_current_admin_tab(); @@ -4861,7 +5066,7 @@ function bp_group_current_admin_tab() { /** * Returns the current group admin tab slug. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value. * @@ -4877,7 +5082,7 @@ function bp_group_current_admin_tab() { /** * Filters the current group admin tab slug. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $tab Current group admin tab slug. */ @@ -4889,9 +5094,11 @@ function bp_group_current_admin_tab() { /** * Outputs the current group avatar. * - * @since BuddyPress (1.0.0) - * @param string $type thumb or full ? + * @since 1.0.0 + * * @uses bp_get_group_current_avatar() to get the avatar of the current group. + * + * @param string $type Thumb or full. */ function bp_group_current_avatar( $type = 'thumb' ) { echo bp_get_group_current_avatar( $type ); @@ -4899,9 +5106,9 @@ function bp_group_current_avatar( $type = 'thumb' ) { /** * Returns the current group avatar. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $type thumb or full ? + * @param string $type Thumb or full. * @return string $tab The current tab's slug. */ function bp_get_group_current_avatar( $type = 'thumb' ) { @@ -4918,7 +5125,7 @@ function bp_group_current_avatar( $type = 'thumb' ) { /** * Filters the current group avatar. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $group_avatar HTML markup for current group avatar. */ @@ -4928,10 +5135,9 @@ function bp_group_current_avatar( $type = 'thumb' ) { /** * Return whether a group has an avatar. * - * @since BuddyPress (1.1.0) - * - * @param int|bool $group_id + * @since 1.1.0 * + * @param int|bool $group_id Group ID to check. * @return boolean */ function bp_get_group_has_avatar( $group_id = false ) { @@ -4954,211 +5160,66 @@ function bp_get_group_has_avatar( $group_id = false ) { return true; } +/** + * @since 1.1.0 + */ function bp_group_avatar_delete_link() { echo bp_get_group_avatar_delete_link(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_group_avatar_delete_link() { $bp = buddypress(); /** * Filters the URL to delete the group avatar. * - * @since BuddyPress (1.1.0) + * @since 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' ) ); } -function bp_group_avatar_edit_form() { - groups_avatar_upload(); -} - +/** + * @since 1.0.0 + */ function bp_custom_group_boxes() { do_action( 'groups_custom_group_boxes' ); } +/** + * @since 1.0.0 + */ function bp_custom_group_admin_tabs() { do_action( 'groups_custom_group_admin_tabs' ); } +/** + * @since 1.0.0 + */ function bp_custom_group_fields_editable() { do_action( 'groups_custom_group_fields_editable' ); } +/** + * @since 1.0.0 + */ function bp_custom_group_fields() { do_action( 'groups_custom_group_fields' ); } -/** Group Membership Requests *************************************************/ - -class BP_Groups_Membership_Requests_Template { - public $current_request = -1; - public $request_count; - public $requests; - public $request; - - public $in_the_loop; - - 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. - * @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) - * } - */ - 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); - - $old_args_keys = array( - 0 => 'group_id', - 1 => 'per_page', - 2 => 'max', - ); - - $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' => 'mrpage', - 'max' => false, - 'type' => 'first_joined', - 'group_id' => bp_get_current_group_id(), - ) ); - - $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'], - 'type' => $r['type'], - 'per_page' => $this->pag_num, - 'page' => $this->pag_page, - - // These filters ensure we only get pending requests - 'is_confirmed' => false, - 'inviter_id' => 0, - ) ); - - $this->requests = array_values( $mquery->results ); - $this->request_count = count( $this->requests ); - - // Compatibility with legacy format of request data objects - foreach ( $this->requests as $rk => $rv ) { - // For legacy reasons, the 'id' property of each - // request must match the membership id, not the ID of - // the user (as it's returned by BP_Group_Member_Query) - $this->requests[ $rk ]->user_id = $rv->ID; - $this->requests[ $rk ]->id = $rv->membership_id; - - // Miscellaneous values - $this->requests[ $rk ]->group_id = $r['group_id']; - } - - if ( empty( $r['max'] ) || ( $r['max'] >= (int) $mquery->total_users ) ) { - $this->total_request_count = (int) $mquery->total_users; - } else { - $this->total_request_count = (int) $r['max']; - } - - if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->requests ) ) ) { - $this->request_count = count( $this->requests ); - } else { - $this->request_count = (int) $r['max']; - } - - $this->pag_links = paginate_links( array( - 'base' => add_query_arg( $this->pag_arg, '%#%' ), - 'format' => '', - 'total' => ceil( $this->total_request_count / $this->pag_num ), - 'current' => $this->pag_page, - 'prev_text' => '←', - 'next_text' => '→', - 'mid_size' => 1, - 'add_args' => array(), - ) ); - } - - public function has_requests() { - if ( ! empty( $this->request_count ) ) { - return true; - } - - return false; - } - - public function next_request() { - $this->current_request++; - $this->request = $this->requests[ $this->current_request ]; - - return $this->request; - } - - public function rewind_requests() { - $this->current_request = -1; - - if ( $this->request_count > 0 ) { - $this->request = $this->requests[0]; - } - } - - public function requests() { - $tick = intval( $this->current_request + 1 ); - if ( $tick < $this->request_count ) { - return true; - } 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(); - } - - $this->in_the_loop = false; - return false; - } - - public function the_request() { - $this->in_the_loop = true; - $this->request = $this->next_request(); - - // 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' ); - } - } -} +/* Group Membership Requests *************************************************/ /** * Initialize a group membership request template loop. * + * @since 1.0.0 + * * @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. @@ -5184,7 +5245,7 @@ function bp_group_has_membership_requests( $args = '' ) { /** * Filters whether or not a group membership query has requests to display. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -5192,99 +5253,144 @@ function bp_group_has_membership_requests( $args = '' ) { return apply_filters( 'bp_group_has_membership_requests', $requests_template->has_requests(), $requests_template ); } +/** + * @since 1.0.0 + * + * @return mixed + */ function bp_group_membership_requests() { global $requests_template; return $requests_template->requests(); } +/** + * @since 1.0.0 + * + * @return mixed + */ function bp_group_the_membership_request() { global $requests_template; return $requests_template->the_request(); } +/** + * @since 1.0.0 + */ function bp_group_request_user_avatar_thumb() { global $requests_template; /** * Filters the requesting user's avatar thumbnail. * - * @since BuddyPress (1.0.0) + * @since 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 ) ) ) ) ); } +/** + * @since 1.0.0 + */ function bp_group_request_reject_link() { echo bp_get_group_request_reject_link(); } + + /** + * @since 1.2.6 + * + * @return mixed|void + */ 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) + * @since 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' ) ); } +/** + * @since 1.0.0 + */ function bp_group_request_accept_link() { echo bp_get_group_request_accept_link(); } + + /** + * @since 1.2.6 + * @return mixed|void + */ 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) + * @since 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' ) ); } +/** + * @since 1.0.0 + */ function bp_group_request_user_link() { echo bp_get_group_request_user_link(); } + + /** + * @since 1.2.6 + * + * @return mixed|void + */ function bp_get_group_request_user_link() { global $requests_template; /** * Filters the URL for the user requesting membership. * - * @since BuddyPress (1.2.6) + * @since 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 ) ); } +/** + * @since 1.0.0 + */ function bp_group_request_time_since_requested() { global $requests_template; /** * Filters the formatted time since membership was requested. * - * @since BuddyPress (1.0.0) + * @since 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 ) ) ) ); } +/** + * @since 1.0.0 + */ function bp_group_request_comment() { global $requests_template; /** * Filters the membership request comment left by user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Membership request comment left by user. */ @@ -5294,7 +5400,7 @@ function bp_group_request_comment() { /** * Output pagination links for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_group_requests_pagination_links() { echo bp_get_group_requests_pagination_links(); @@ -5302,7 +5408,7 @@ function bp_group_requests_pagination_links() { /** * Get pagination links for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -5312,7 +5418,7 @@ function bp_group_requests_pagination_links() { /** * Filters pagination links for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value Pagination links for group membership requests. */ @@ -5322,7 +5428,7 @@ function bp_group_requests_pagination_links() { /** * Output pagination count text for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_group_requests_pagination_count() { echo bp_get_group_requests_pagination_count(); @@ -5330,7 +5436,7 @@ function bp_group_requests_pagination_count() { /** * Get pagination count text for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -5351,7 +5457,7 @@ function bp_group_requests_pagination_count() { /** * Filters pagination count text for group membership requests. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -5363,180 +5469,14 @@ function bp_group_requests_pagination_count() { /** Group Invitations *********************************************************/ -class BP_Groups_Invite_Template { - public $current_invite = -1; - public $invite_count; - public $invites; - public $invite; - - public $in_the_loop; - - public $pag_page; - public $pag_num; - public $pag_links; - public $total_invite_count; - - 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); - - $old_args_keys = array( - 0 => 'user_id', - 1 => 'group_id', - ); - - $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' => 'invitepage', - 'user_id' => bp_loggedin_user_id(), - 'group_id' => bp_get_current_group_id(), - ) ); - - $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'], - 'type' => 'first_joined', - 'per_page' => $this->pag_num, - 'page' => $this->pag_page, - - // These filters ensure we get only pending invites - 'is_confirmed' => false, - 'inviter_id' => $r['user_id'], - ) ); - - $this->invite_data = $iquery->results; - $this->total_invite_count = $iquery->total_users; - $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( $this->pag_arg, '%#%' ), - 'format' => '', - 'total' => ceil( $this->total_invite_count / $this->pag_num ), - 'current' => $this->pag_page, - 'prev_text' => '←', - 'next_text' => '→', - 'mid_size' => 1, - 'add_args' => array(), - ) ); - } else { - $this->pag_links = ''; - } - } - - public function has_invites() { - if ( ! empty( $this->invite_count ) ) { - return true; - } - - return false; - } - - public function next_invite() { - $this->current_invite++; - $this->invite = $this->invites[ $this->current_invite ]; - - return $this->invite; - } - - public function rewind_invites() { - $this->current_invite = -1; - if ( $this->invite_count > 0 ) { - $this->invite = $this->invites[0]; - } - } - - public function invites() { - $tick = intval( $this->current_invite + 1 ); - if ( $tick < $this->invite_count ) { - return true; - } 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(); - } - - $this->in_the_loop = false; - return false; - } - - 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 method previously populated the user object with - // BP_Core_User. We manually configure BP_Core_User data for - // backward compatibility. - if ( bp_is_active( 'xprofile' ) ) { - $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_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; - $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login ); - $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}' title='{$this->invite->user->fullname}'>{$this->invite->user->fullname}</a>"; - $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'active %s', 'buddypress' ) ); - - if ( bp_is_active( 'groups' ) ) { - $total_groups = BP_Groups_Member::total_group_count( $user_id ); - $this->invite->user->total_groups = sprintf( _n( '%d group', '%d groups', $total_groups, 'buddypress' ), $total_groups ); - } - - if ( bp_is_active( 'friends' ) ) { - $this->invite->user->total_friends = BP_Friends_Friendship::total_friend_count( $user_id ); - } - - $this->invite->user->total_blogs = null; - - // 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 ); - } - } -} - +/** + * Whether or not there are invites. + * + * @since 1.1.0 + * + * @param string $args + * @return bool|mixed|void + */ function bp_group_has_invites( $args = '' ) { global $invites_template, $group_id; @@ -5555,7 +5495,7 @@ function bp_group_has_invites( $args = '' ) { } } - // Set the global (for use in BP_Groups_Invite_Template::the_invite()) + // Set the global (for use in BP_Groups_Invite_Template::the_invite()). if ( empty( $group_id ) ) { $group_id = $r['group_id']; } @@ -5569,7 +5509,7 @@ function bp_group_has_invites( $args = '' ) { /** * Filters whether or not a group invites query has invites to display. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -5577,85 +5517,140 @@ function bp_group_has_invites( $args = '' ) { return apply_filters( 'bp_group_has_invites', $invites_template->has_invites(), $invites_template ); } +/** + * @since 1.1.0 + * + * @return mixed + */ function bp_group_invites() { global $invites_template; return $invites_template->invites(); } +/** + * @since 1.1.0 + * + * @return mixed + */ function bp_group_the_invite() { global $invites_template; return $invites_template->the_invite(); } +/** + * @since 1.1.0 + */ function bp_group_invite_item_id() { echo bp_get_group_invite_item_id(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_group_invite_item_id() { global $invites_template; /** * Filters the group invite item ID. * - * @since BuddyPress (1.1.0) + * @since 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 ); } +/** + * @since 1.1.0 + */ function bp_group_invite_user_avatar() { echo bp_get_group_invite_user_avatar(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_group_invite_user_avatar() { global $invites_template; /** * Filters the group invite user avatar. * - * @since BuddyPress (1.1.0) + * @since 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 ); } +/** + * @since 1.1.0 + */ function bp_group_invite_user_link() { echo bp_get_group_invite_user_link(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_group_invite_user_link() { global $invites_template; /** * Filters the group invite user link. * - * @since BuddyPress (1.1.0) + * @since 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 ) ); } +/** + * @since 1.1.0 + */ function bp_group_invite_user_last_active() { echo bp_get_group_invite_user_last_active(); } + + /** + * @since 1.1.0 + * + * @return mixed|void + */ 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) + * @since 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 ); } +/** + * @since 1.1.0 + */ function bp_group_invite_user_remove_invite_url() { echo bp_get_group_invite_user_remove_invite_url(); } + + /** + * @since 1.1.0 + * + * @return string + */ function bp_get_group_invite_user_remove_invite_url() { global $invites_template; @@ -5673,15 +5668,16 @@ function bp_group_invite_user_remove_invite_url() { /** * Output pagination links for group invitations. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_group_invite_pagination_links() { echo bp_get_group_invite_pagination_links(); } + /** * Get pagination links for group invitations. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -5691,7 +5687,7 @@ function bp_group_invite_pagination_links() { /** * Filters the pagination links for group invitations. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value Pagination links for group invitations. */ @@ -5701,7 +5697,7 @@ function bp_group_invite_pagination_links() { /** * Output pagination count text for group invitations. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_group_invite_pagination_count() { echo bp_get_group_invite_pagination_count(); @@ -5709,7 +5705,7 @@ function bp_group_invite_pagination_count() { /** * Get pagination count text for group invitations. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return string */ @@ -5736,11 +5732,11 @@ function bp_group_invite_pagination_count() { /** * Hook group activity feed to <head>. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_groups_activity_feed() { - // Bail if not viewing a single group or activity is not active + // Bail if not viewing a single group or activity is not active. if ( ! bp_is_active( 'groups' ) || ! bp_is_active( 'activity' ) || ! bp_is_group() ) { return; } ?> @@ -5754,7 +5750,7 @@ add_action( 'bp_head', 'bp_groups_activity_feed' ); /** * Output the current group activity-stream RSS URL. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_group_activity_feed_link() { echo bp_get_group_activity_feed_link(); @@ -5762,7 +5758,8 @@ function bp_group_activity_feed_link() { /** * Return the current group activity-stream RSS URL. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * * @return string */ function bp_get_group_activity_feed_link() { @@ -5773,7 +5770,7 @@ function bp_group_activity_feed_link() { /** * Filters the current group activity-stream RSS URL. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $feed_link Current group activity-stream RSS URL. */ @@ -5785,7 +5782,7 @@ function bp_group_activity_feed_link() { /** * Echoes the output of bp_get_current_group_id(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_current_group_id() { echo bp_get_current_group_id(); @@ -5793,7 +5790,7 @@ function bp_current_group_id() { /** * Returns the ID of the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * @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. @@ -5805,7 +5802,7 @@ function bp_current_group_id() { /** * Filters the ID of the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $current_group_id ID of the current group. * @param object $current_group Instance holding the current group. @@ -5816,7 +5813,7 @@ function bp_current_group_id() { /** * Echoes the output of bp_get_current_group_slug(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_current_group_slug() { echo bp_get_current_group_slug(); @@ -5824,7 +5821,7 @@ function bp_current_group_slug() { /** * Returns the slug of the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * @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. @@ -5836,7 +5833,7 @@ function bp_current_group_slug() { /** * Filters the slug of the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $current_group_slug Slug of the current group. * @param object $current_group Instance holding the current group. @@ -5847,7 +5844,7 @@ function bp_current_group_slug() { /** * Echoes the output of bp_get_current_group_name(). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_current_group_name() { echo bp_get_current_group_name(); @@ -5855,7 +5852,7 @@ function bp_current_group_name() { /** * Returns the name of the current group. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * @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. @@ -5870,7 +5867,7 @@ function bp_current_group_name() { /** * Filters the name of the current group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $name Name of the current group. * @param object $current_group Instance holding the current group. @@ -5881,7 +5878,7 @@ function bp_current_group_name() { /** * Echoes the output of bp_get_current_group_description(). * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_current_group_description() { echo bp_get_current_group_description(); @@ -5889,7 +5886,7 @@ function bp_current_group_description() { /** * Returns the description of the current group. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * @uses apply_filters() Filter bp_get_current_group_description to modify * this output. * @@ -5904,7 +5901,7 @@ function bp_current_group_description() { * * This filter is used to apply extra filters related to formatting. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $current_group_desc Description of the current group. */ @@ -5913,7 +5910,7 @@ function bp_current_group_description() { /** * Filters the description of the current group. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $desc Description of the current group. */ @@ -5923,12 +5920,11 @@ function bp_current_group_description() { /** * Output a URL for a group component action. * - * @since BuddyPress (1.2.0) + * @since 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 ) { @@ -5937,12 +5933,11 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) /** * Get a URL for a group component action. * - * @since BuddyPress (1.2.0) + * @since 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 ) { @@ -5950,7 +5945,7 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) $current_group = groups_get_current_group(); $url = ''; - // Must be a group + // Must be a group. if ( ! empty( $current_group->id ) ) { // Append $action to $url if provided @@ -5960,10 +5955,10 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) $url = bp_get_group_permalink( $current_group ); } - // Add a slash at the end of our user url + // Add a slash at the end of our user url. $url = trailingslashit( $url ); - // Add possible query args + // Add possible query args. if ( !empty( $query_args ) && is_array( $query_args ) ) { $url = add_query_arg( $query_args, $url ); } @@ -5979,7 +5974,7 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) /** * Filters a URL for a group component action. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $url URL for a group component action. * @param string $action Action being taken for the group. @@ -5994,7 +5989,7 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) /** * Display the number of groups in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array|string $args before|after|user_id * @@ -6008,7 +6003,7 @@ add_action( 'bp_members_admin_user_stats', 'bp_groups_profile_stats', 8, 1 ); /** * Return the number of groups in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array|string $args before|after|user_id * @return string HTML for stats output. @@ -6043,7 +6038,7 @@ function bp_groups_get_profile_stats( $args = '' ) { /** * Filters the number of groups in user's profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value HTML for stats output. * @param array $r Array of parsed arguments for query. 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 2117aed26cd5a218bedc5d715af461944d039a83..a6d801c89f8e3363d425d1ed704012b8d9dc9230 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php @@ -1,188 +1,35 @@ <?php - /** * BuddyPress Groups Widgets * * @package BuddyPress * @subpackage GroupsWidgets + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/* Register widgets for groups component */ +require dirname( __FILE__ ) . '/classes/class-bp-groups-widget.php'; + +/** + * Register widgets for groups component. + * + * @since 1.0.0 + */ function groups_register_widgets() { add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') ); } add_action( 'bp_register_widgets', 'groups_register_widgets' ); -/*** GROUPS WIDGET *****************/ - -class BP_Groups_Widget extends WP_Widget { - function __construct() { - $widget_ops = array( - 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ), - 'classname' => 'widget_bp_groups_widget buddypress widget', - ); - parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops ); - - if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); - } - } - - /** - * PHP4 constructor - * - * For backward compatibility only - */ - function bp_groups_widget() { - $this->_construct(); - } - - 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 ); - - if ( empty( $instance['group_default'] ) ) - $instance['group_default'] = 'popular'; - - if ( empty( $instance['title'] ) ) - $instance['title'] = __( 'Groups', 'buddypress' ); - - /** - * 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="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title; - - echo $before_title . $title . $after_title; - - $group_args = array( - 'user_id' => $user_id, - 'type' => $instance['group_default'], - 'per_page' => $instance['max_groups'], - 'max' => $instance['max_groups'], - ); - - ?> - - <?php if ( bp_has_groups( $group_args ) ) : ?> - <div class="item-options" id="groups-list-options"> - <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> | - <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> | - <a href="<?php bp_groups_directory_permalink(); ?>" id="popular-groups" <?php if ( $instance['group_default'] == 'popular' ) : ?> class="selected"<?php endif; ?>><?php _e("Popular", 'buddypress') ?></a> - </div> - - <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() ?>" title="<?php bp_group_name() ?>"><?php bp_group_avatar_thumb() ?></a> - </div> - - <div class="item"> - <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> - <div class="item-meta"> - <span class="activity"> - <?php - if ( 'newest' == $instance['group_default'] ) - printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); - if ( 'active' == $instance['group_default'] ) - printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); - elseif ( 'popular' == $instance['group_default'] ) - bp_group_member_count(); - ?> - </span> - </div> - </div> - </li> - - <?php endwhile; ?> - </ul> - <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?> - <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $instance['max_groups'] ); ?>" /> - - <?php else: ?> - - <div class="widget-error"> - <?php _e('There are no groups to display.', 'buddypress') ?> - </div> - - <?php endif; ?> - - <?php echo $after_widget; ?> - <?php - } - - function update( $new_instance, $old_instance ) { - $instance = $old_instance; - - $instance['title'] = strip_tags( $new_instance['title'] ); - $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); - $instance['group_default'] = strip_tags( $new_instance['group_default'] ); - $instance['link_title'] = (bool)$new_instance['link_title']; - - return $instance; - } - - function form( $instance ) { - $defaults = array( - 'title' => __( 'Groups', 'buddypress' ), - 'max_groups' => 5, - 'group_default' => 'active', - 'link_title' => false - ); - $instance = wp_parse_args( (array) $instance, $defaults ); - - $title = strip_tags( $instance['title'] ); - $max_groups = strip_tags( $instance['max_groups'] ); - $group_default = strip_tags( $instance['group_default'] ); - $link_title = (bool)$instance['link_title']; - ?> - - <p><label for="bp-groups-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 Groups directory', 'buddypress' ) ?></label></p> - - <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p> - - <p> - <label for="bp-groups-widget-groups-default"><?php _e('Default groups to show:', 'buddypress'); ?> - <select name="<?php echo $this->get_field_name( 'group_default' ); ?>"> - <option value="newest" <?php if ( $group_default == 'newest' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></option> - <option value="active" <?php if ( $group_default == 'active' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></option> - <option value="popular" <?php if ( $group_default == 'popular' ) : ?>selected="selected"<?php endif; ?>><?php _e( 'Popular', 'buddypress' ) ?></option> - </select> - </label> - </p> - <?php - } -} - +/** + * AJAX callback for the Groups List widget. + * + * @since 1.0.0 + */ function groups_ajax_widget_groups_list() { - check_ajax_referer('groups_widget_groups_list'); + check_ajax_referer( 'groups_widget_groups_list' ); switch ( $_POST['filter'] ) { case 'newest-groups': @@ -237,7 +84,7 @@ function groups_ajax_widget_groups_list() { <?php else: ?> - <?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?> + <?php echo "-1[[SPLIT]]<li>" . __( "No groups matched the current filter.", 'buddypress' ); ?> <?php endif; 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 index 02374ddef4359c1393985ca9d5e439866d628513..5709b0b8648f0c2abb6f6057f0b9914a9a51a8cc 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Groups Classes + * BuddyPress Groups Classes. * * @package BuddyPress * @subpackage GroupsClasses + * @since 1.1.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -35,8 +36,8 @@ defined( 'ABSPATH' ) || exit; * - '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. + * - '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: @@ -62,13 +63,13 @@ defined( 'ABSPATH' ) || exit; * 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( // ... + * '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. @@ -83,9 +84,7 @@ defined( 'ABSPATH' ) || exit; * 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) + * @since 1.1.0 */ class BP_Group_Extension { @@ -94,8 +93,7 @@ class BP_Group_Extension { /** * Information about this extension's screens. * - * @since BuddyPress (1.8.0) - * @access public + * @since 1.8.0 * @var array */ public $screens = array(); @@ -103,8 +101,7 @@ class BP_Group_Extension { /** * The name of the extending class. * - * @since BuddyPress (1.8.0) - * @access public + * @since 1.8.0 * @var string */ public $class_name = ''; @@ -112,8 +109,7 @@ class BP_Group_Extension { /** * A ReflectionClass object of the current extension. * - * @since BuddyPress (1.8.0) - * @access public + * @since 1.8.0 * @var ReflectionClass */ public $class_reflection = null; @@ -121,8 +117,7 @@ class BP_Group_Extension { /** * Parsed configuration parameters for the extension. * - * @since BuddyPress (1.8.0) - * @access public + * @since 1.8.0 * @var array */ public $params = array(); @@ -130,8 +125,7 @@ class BP_Group_Extension { /** * Raw config params, as passed by the extending class. * - * @since BuddyPress (2.1.0) - * @access public + * @since 2.1.0 * @var array */ public $params_raw = array(); @@ -139,8 +133,7 @@ class BP_Group_Extension { /** * The ID of the current group. * - * @since BuddyPress (1.8.0) - * @access public + * @since 1.8.0 * @var int */ public $group_id = 0; @@ -148,7 +141,7 @@ class BP_Group_Extension { /** * The slug of the current extension. * - * @access public + * @since 1.1.0 * @var string */ public $slug = ''; @@ -156,7 +149,7 @@ class BP_Group_Extension { /** * The translatable name of the current extension. * - * @access public + * @since 1.1.0 * @var string */ public $name = ''; @@ -164,7 +157,7 @@ class BP_Group_Extension { /** * The visibility of the extension tab. 'public' or 'private'. * - * @access public + * @since 1.1.0 * @var string */ public $visibility = 'public'; @@ -172,7 +165,7 @@ class BP_Group_Extension { /** * The numeric position of the main nav item. * - * @access public + * @since 1.1.0 * @var int */ public $nav_item_position = 81; @@ -180,7 +173,7 @@ class BP_Group_Extension { /** * Whether to show the nav item. * - * @access public + * @since 1.1.0 * @var bool */ public $enable_nav_item = true; @@ -188,8 +181,7 @@ class BP_Group_Extension { /** * Whether the current user should see the navigation item. * - * @since BuddyPress (2.1.0) - * @access public + * @since 2.1.0 * @var bool */ public $user_can_see_nav_item; @@ -197,8 +189,7 @@ class BP_Group_Extension { /** * Whether the current user can visit the tab. * - * @since BuddyPress (2.1.0) - * @access public + * @since 2.1.0 * @var bool */ public $user_can_visit; @@ -206,7 +197,7 @@ class BP_Group_Extension { /** * The text of the nav item. Defaults to self::name. * - * @access public + * @since 1.1.0 * @var string */ public $nav_item_name = ''; @@ -216,7 +207,7 @@ class BP_Group_Extension { * * Default: 'groups_custom_group_boxes'. * - * @access public + * @since 1.1.0 * @var string */ public $display_hook = 'groups_custom_group_boxes'; @@ -226,7 +217,7 @@ class BP_Group_Extension { * * Default: 'groups/single/plugins'. * - * @access public + * @since 1.1.0 * @var string */ public $template_file = 'groups/single/plugins'; @@ -236,8 +227,7 @@ class BP_Group_Extension { /** * Has the extension been initialized? * - * @since BuddyPress (1.8.0) - * @access protected + * @since 1.8.0 * @var bool */ protected $initialized = false; @@ -245,8 +235,7 @@ class BP_Group_Extension { /** * Extension properties as set by legacy extensions. * - * @since BuddyPress (1.8.0) - * @access protected + * @since 1.8.0 * @var array */ protected $legacy_properties = array(); @@ -257,8 +246,7 @@ class BP_Group_Extension { * 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 + * @since 1.8.0 * @var array */ protected $legacy_properties_converted = array(); @@ -266,8 +254,7 @@ class BP_Group_Extension { /** * Redirect location as defined by post-edit save callback. * - * @since BuddyPress (2.1.0) - * @access protected + * @since 2.1.0 * @var string */ protected $post_save_redirect; @@ -275,8 +262,7 @@ class BP_Group_Extension { /** * Miscellaneous data as set by the __set() magic method. * - * @since BuddyPress (1.8.0) - * @access protected + * @since 1.8.0 * @var array */ protected $data = array(); @@ -290,22 +276,28 @@ class BP_Group_Extension { */ /** - * The content of the group tab + * The content of the group tab. + * + * @since 1.1.0 * - * @param int|null $group_id + * @param int|null $group_id ID of the group to display. */ public function display( $group_id = null ) {} /** - * Content displayed in a widget sidebar, if applicable + * Content displayed in a widget sidebar, if applicable. + * + * @since 1.1.0 */ public function widget_display() {} - // *_screen() displays the settings form for the given context - // *_screen_save() processes data submitted via the settings form - // The settings_* methods are generic fallbacks, which can optionally - // be overridden by the more specific edit_*, create_*, and admin_* - // versions. + /* + * *_screen() displays the settings form for the given context + * *_screen_save() processes data submitted via the settings form + * The settings_* methods are generic fallbacks, which can optionally + * be overridden by the more specific edit_*, create_*, and admin_* + * versions. + */ public function settings_screen( $group_id = null ) {} public function settings_screen_save( $group_id = null ) {} public function edit_screen( $group_id = null ) {} @@ -318,7 +310,7 @@ class BP_Group_Extension { /** Setup *************************************************************/ /** - * Initialize the extension, using your config settings + * Initialize the extension, using your config settings. * * Your plugin should call this method at the very end of its * constructor, like so: @@ -333,67 +325,59 @@ class BP_Group_Extension { * parent::init( $args ); * } * - * @since BuddyPress (1.8.0) - * @since BuddyPress (2.1.0) Added 'access' and 'show_tab' arguments - * to $args. + * @since 1.8.0 + * @since 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. + * @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 + // 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() + // with those passed to init(). $this->parse_legacy_properties(); $args = $this->parse_args_r( $args, $this->legacy_properties_converted ); - // Parse with defaults + // Parse with defaults. $this->params = $this->parse_args_r( $args, array( 'slug' => $this->slug, 'name' => $this->name, @@ -423,20 +407,20 @@ class BP_Group_Extension { * is called automatically at the right point in the load order by * bp_register_group_extension(). * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ public function _register() { - // Detect and parse properties set by legacy extensions + // Detect and parse properties set by legacy extensions. $this->parse_legacy_properties(); // Initialize, if necessary. This should only happen for - // legacy extensions that don't call parent::init() themselves + // legacy extensions that don't call parent::init() themselves. if ( true !== $this->initialized ) { $this->init(); } - // Set some config values, based on the parsed params + // Set some config values, based on the parsed params. $this->group_id = $this->get_group_id(); $this->slug = $this->params['slug']; $this->name = $this->params['name']; @@ -446,17 +430,17 @@ class BP_Group_Extension { $this->display_hook = $this->params['display_hook']; $this->template_file = $this->params['template_file']; - // Configure 'screens': create, admin, and edit contexts + // Configure 'screens': create, admin, and edit contexts. $this->setup_screens(); - // Configure access-related settings + // Configure access-related settings. $this->setup_access_settings(); // Mirror configuration data so it's accessible to plugins - // that look for it in its old locations + // that look for it in its old locations. $this->setup_legacy_properties(); - // Hook the extension into BuddyPress + // Hook the extension into BuddyPress. $this->setup_display_hooks(); $this->setup_create_hooks(); $this->setup_edit_hooks(); @@ -470,7 +454,7 @@ class BP_Group_Extension { * ReflectionClass that is used in get_screen_callback() to determine * whether your extension overrides certain callback methods. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function setup_class_info() { if ( empty( $this->class_name ) ) { @@ -490,29 +474,29 @@ class BP_Group_Extension { * - new group * - group admin * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @return int */ public static function get_group_id() { - // Usually this will work + // Usually this will work. $group_id = bp_get_current_group_id(); - // On the admin, get the group id out of the $_GET params + // On the admin, get the group id out of the $_GET params. if ( empty( $group_id ) && is_admin() && ( isset( $_GET['page'] ) && ( 'bp-groups' === $_GET['page'] ) ) && ! empty( $_GET['gid'] ) ) { $group_id = (int) $_GET['gid']; } // This fallback will only be hit when the create step is very - // early + // early. if ( empty( $group_id ) && bp_get_new_group_id() ) { $group_id = bp_get_new_group_id(); } // On some setups, the group id has to be fetched out of the // $_POST array - // @todo Figure out why this is happening during group creation + // @todo Figure out why this is happening during group creation. if ( empty( $group_id ) && isset( $_POST['group_id'] ) ) { $group_id = (int) $_POST['group_id']; } @@ -523,7 +507,7 @@ class BP_Group_Extension { /** * Gather configuration data about your screens. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @return array */ @@ -558,7 +542,7 @@ class BP_Group_Extension { /** * Set up screens array based on params. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function setup_screens() { foreach ( (array) $this->params['screens'] as $context => $screen ) { @@ -577,24 +561,24 @@ class BP_Group_Extension { /** * Set up access-related settings for this extension. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ protected function setup_access_settings() { - // Bail if no group ID is available + // Bail if no group ID is available. if ( empty( $this->group_id ) ) { return; } - // Backward compatibility + // Backward compatibility. if ( isset( $this->params['enable_nav_item'] ) ) { $this->enable_nav_item = (bool) $this->params['enable_nav_item']; } - // Tab Access + // Tab Access. $this->user_can_visit = false; // Backward compatibility for components that do not provide - // explicit 'access' parameter + // explicit 'access' parameter. if ( empty( $this->params['access'] ) ) { if ( false === $this->enable_nav_item ) { $this->params['access'] = 'noone'; @@ -604,23 +588,23 @@ class BP_Group_Extension { ) ); if ( ! empty( $group->status ) && 'public' === $group->status ) { - // Tabs in public groups are accessible to anyone by default + // Tabs in public groups are accessible to anyone by default. $this->params['access'] = 'anyone'; } else { - // All other groups have members-only as the default + // All other groups have members-only as the default. $this->params['access'] = 'member'; } } } - // Parse multiple access conditions into an array + // 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 + // get access. foreach ( $access_conditions as $access_condition ) { if ( $this->user_meets_access_condition( $access_condition ) ) { $this->user_can_visit = true; @@ -628,23 +612,23 @@ class BP_Group_Extension { } } - // Tab Visibility + // Tab Visibility. $this->user_can_see_nav_item = false; // Backward compatibility for components that do not provide - // explicit 'show_tab' parameter + // explicit 'show_tab' parameter. if ( empty( $this->params['show_tab'] ) ) { if ( false === $this->params['enable_nav_item'] ) { - // enable_nav_item is only false if it's been + // The enable_nav_item index is only false if it's been // defined explicitly as such in the - // constructor. So we always trust this value + // constructor. So we always trust this value. $this->params['show_tab'] = 'noone'; } 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 + // visibility=private implies members-only. if ( 'public' !== $this->visibility ) { $this->params['show_tab'] = 'member'; } else { @@ -653,19 +637,19 @@ class BP_Group_Extension { } else { // No show_tab or enable_nav_item value is - // available, so match the value of 'access' + // available, so match the value of 'access'. $this->params['show_tab'] = $this->params['access']; } } - // Parse multiple access conditions into an array + // Parse multiple access conditions into an array. $access_conditions = $this->params['show_tab']; if ( ! is_array( $access_conditions ) ) { $access_conditions = explode( ',', $access_conditions ); } // If the current user meets at least one condition, the - // get access + // get access. foreach ( $access_conditions as $access_condition ) { if ( $this->user_meets_access_condition( $access_condition ) ) { $this->user_can_see_nav_item = true; @@ -677,8 +661,10 @@ class BP_Group_Extension { /** * Check whether the current user meets an access condition. * + * @since 2.1.0 + * * @param string $access_condition 'anyone', 'loggedin', 'member', - * 'mod', 'admin' or 'noone'. + * 'mod', 'admin' or 'noone'. * @return bool */ protected function user_meets_access_condition( $access_condition ) { @@ -721,26 +707,27 @@ class BP_Group_Extension { /** * Hook this extension's group tab into BuddyPress, if necessary. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function setup_display_hooks() { - // Bail if not a group + // Bail if not a group. if ( ! bp_is_group() ) { return; } - // Backward compatibility only + // Backward compatibility only. if ( ( 'public' !== $this->visibility ) && ! buddypress()->groups->current_group->user_has_access ) { return; } + // If the user can see the nav item, we create it. $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( + bp_core_create_subnav_link( array( 'name' => ! $this->nav_item_name ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => bp_get_current_group_slug(), @@ -751,8 +738,23 @@ class BP_Group_Extension { '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 the user can visit the screen, we register it. + $user_can_visit = $this->user_can_visit(); + + if ( $user_can_visit ) { + $group_permalink = bp_get_group_permalink( groups_get_current_group() ); + + bp_core_register_subnav_screen_function( array( + 'slug' => $this->slug, + 'parent_slug' => bp_get_current_group_slug(), + 'screen_function' => array( &$this, '_display_hook' ), + 'user_has_access' => $user_can_visit, + '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 ) . '";' ) ); @@ -760,14 +762,16 @@ class BP_Group_Extension { } } - // Hook the group home widget + // Hook the group home widget. if ( ! bp_current_action() && bp_is_current_action( 'home' ) ) { add_action( $this->display_hook, array( &$this, 'widget_display' ) ); } } /** - * Hook the main display method, and loads the template file + * Hook the main display method, and loads the template file. + * + * @since 1.1.0 */ public function _display_hook() { add_action( 'bp_template_content', array( &$this, 'call_display' ) ); @@ -775,7 +779,7 @@ class BP_Group_Extension { /** * Filters the template to load for the main display method. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template_file Path to the template to load. */ @@ -788,7 +792,7 @@ class BP_Group_Extension { * We use this wrapper so that we can pass the group_id to the * display() callback. * - * @since BuddyPress (2.1.1) + * @since 2.1.1 */ public function call_display() { $this->display( $this->group_id ); @@ -800,8 +804,9 @@ class BP_Group_Extension { * 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) + * @since 2.1.0 * + * @param bool $user_can_see_nav_item Whether or not the user can see the nav item. * @return bool */ public function user_can_see_nav_item( $user_can_see_nav_item = false ) { @@ -815,8 +820,9 @@ class BP_Group_Extension { /** * Determine whether the current user has access to visit this tab. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * + * @param bool $user_can_visit Whether or not the user can visit the tab. * @return bool */ public function user_can_visit( $user_can_visit = false ) { @@ -834,10 +840,10 @@ class BP_Group_Extension { * circumstances where the bp_core_no_access() arguments need to be * modified before the redirect takes place. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param bool $user_can_visit - * @param array $no_access_args + * @param bool $user_can_visit Whether or not the user can visit the tab. + * @param array $no_access_args Array of args to help determine access. * @return bool */ public function group_access_protection( $user_can_visit, &$no_access_args ) { @@ -862,7 +868,7 @@ class BP_Group_Extension { /** * Hook this extension's Create step into BuddyPress, if necessary. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function setup_create_hooks() { if ( ! $this->is_screen_enabled( 'create' ) ) { @@ -871,7 +877,7 @@ class BP_Group_Extension { $screen = $this->screens['create']; - // Insert the group creation step for the new group extension + // Insert the group creation step for the new group extension. buddypress()->groups->group_creation_steps[ $screen['slug'] ] = array( 'name' => $screen['name'], 'slug' => $screen['slug'], @@ -882,7 +888,7 @@ class BP_Group_Extension { // 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 + // 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' ) ); } @@ -890,7 +896,7 @@ class BP_Group_Extension { /** * Call the create_screen() method, if we're on the right page. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ public function maybe_create_screen() { if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) { @@ -901,14 +907,14 @@ class BP_Group_Extension { $this->nonce_field( 'create' ); // The create screen requires an additional nonce field - // due to a quirk in the way the templates are built + // due to a quirk in the way the templates are built. wp_nonce_field( 'groups_create_save_' . bp_get_groups_current_create_step(), '_wpnonce', false ); } /** * Call the create_screen_save() method, if we're on the right page. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ public function maybe_create_screen_save() { if ( ! bp_is_group_creation_step( $this->screens['create']['slug'] ) ) { @@ -924,15 +930,15 @@ class BP_Group_Extension { /** * Hook this extension's Edit panel into BuddyPress, if necessary. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function setup_edit_hooks() { - // Bail if not in a group + // Bail if not in a group. if ( ! bp_is_group() ) { return; } - // Bail if not an edit screen + // Bail if not an edit screen. if ( ! $this->is_screen_enabled( 'edit' ) || ! bp_is_item_admin() ) { return; } @@ -955,22 +961,22 @@ class BP_Group_Extension { 'screen_function' => 'groups_screen_group_admin', ); - // Should we add a menu to the Group's WP Admin Bar + // Should we add a menu to the Group's WP Admin Bar. if ( ! empty( $screen['show_in_admin_bar'] ) ) { $subnav_args['show_in_admin_bar'] = true; } - // Add the tab to the manage navigation + // Add the tab to the manage navigation. bp_core_new_subnav_item( $subnav_args ); - // Catch the edit screen and forward it to the plugin template + // Catch the edit screen and forward it to the plugin template. if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $screen['slug'], 0 ) ) { $this->call_edit_screen_save( $this->group_id ); add_action( 'groups_custom_edit_steps', array( &$this, 'call_edit_screen' ) ); // Determine the proper template and save for later - // loading + // loading. if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) { $this->edit_screen_template = '/groups/single/home'; } else { @@ -980,7 +986,7 @@ class BP_Group_Extension { } // We load the template at bp_screens, to give all - // extensions a chance to load + // extensions a chance to load. add_action( 'bp_screens', array( $this, 'call_edit_screen_template_loader' ) ); } } @@ -998,7 +1004,7 @@ class BP_Group_Extension { * 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) + * @since 1.8.0 */ public function call_edit_screen() { ob_start(); @@ -1014,7 +1020,7 @@ class BP_Group_Extension { /** * Check the nonce, and call the edit_screen_save() method. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ public function call_edit_screen_save() { if ( empty( $_POST ) ) { @@ -1022,7 +1028,7 @@ class BP_Group_Extension { } // When DOING_AJAX, the POST global will be populated, but we - // should assume it's a save + // should assume it's a save. if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return; } @@ -1030,16 +1036,16 @@ class BP_Group_Extension { $this->check_nonce( 'edit' ); // Detect whether the screen_save_callback is performing a - // redirect, so that we don't do one of our own + // redirect, so that we don't do one of our own. add_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) ); - // Call the extension's save routine + // Call the extension's save routine. call_user_func( $this->screens['edit']['screen_save_callback'], $this->group_id ); - // Clean up detection filters + // Clean up detection filters. remove_filter( 'wp_redirect', array( $this, 'detect_post_save_redirect' ) ); - // Perform a redirect only if one has not already taken place + // Perform a redirect only if one has not already taken place. if ( empty( $this->post_save_redirect ) ) { /** @@ -1047,7 +1053,7 @@ class BP_Group_Extension { * * Only runs if a redirect has not already occurred. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $value URL to redirect to. */ @@ -1067,8 +1073,7 @@ class BP_Group_Extension { * * Hooked to 'bp_screens'. * - * @since BuddyPress (1.8.0) - * @access public So that do_action() has access. Do not call directly. + * @since 1.8.0 * * @see BP_Group_Extension::setup_edit_hooks() */ @@ -1086,11 +1091,10 @@ class BP_Group_Extension { * use on both the Create and Edit screens - BP will provide the button * if one is not found. * - * @since BuddyPress (1.8.0) + * @since 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 = '' ) { @@ -1109,7 +1113,7 @@ class BP_Group_Extension { /** * Does the given markup have a submit button? * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $screen The markup to check. * @return bool True if a Submit button is found, otherwise false. @@ -1123,10 +1127,9 @@ class BP_Group_Extension { /** * Detect redirects hardcoded into edit_screen_save() callbacks. * - * @since BuddyPress (2.1.0) - * - * @param string $redirect + * @since 2.1.0 * + * @param string $redirect Redirect string. * @return string */ public function detect_post_save_redirect( $redirect = '' ) { @@ -1142,27 +1145,27 @@ class BP_Group_Extension { /** * Hook this extension's Admin metabox into BuddyPress, if necessary. * - * @since BuddyPress (1.8.0) + * @since 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 + // Hook the admin screen markup function to the content hook. add_action( 'bp_groups_admin_meta_box_content_' . $this->slug, array( $this, 'call_admin_screen' ) ); - // Initialize the metabox + // Initialize the metabox. add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) ); - // Catch the metabox save + // Catch the metabox save. add_action( 'bp_group_admin_edit_after', array( $this, 'call_admin_screen_save' ), 10 ); } /** * Call the admin_screen() method, and add a nonce field. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ public function call_admin_screen() { call_user_func( $this->screens['admin']['screen_callback'], $this->group_id ); @@ -1170,9 +1173,9 @@ class BP_Group_Extension { } /** - * Check the nonce, and call the admin_screen_save() method + * Check the nonce, and call the admin_screen_save() method. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ public function call_admin_screen_save() { $this->check_nonce( 'admin' ); @@ -1182,7 +1185,7 @@ class BP_Group_Extension { /** * Create the Dashboard meta box for this extension. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function _meta_box_display_callback() { $group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0; @@ -1210,7 +1213,7 @@ class BP_Group_Extension { * more than one extension may generate nonces on the same page, and we * must avoid name clashes. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $context Screen context. 'create', 'edit', or 'admin'. */ @@ -1221,7 +1224,7 @@ class BP_Group_Extension { /** * Check the nonce on a submitted settings form. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $context Screen context. 'create', 'edit', or 'admin'. */ @@ -1236,7 +1239,7 @@ class BP_Group_Extension { * (legacy: $this->enable_create_step, etc), and its screen_callback * must also exist and be callable. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $context Screen context. 'create', 'edit', or 'admin'. * @return bool True if the screen is enabled, otherwise false. @@ -1283,17 +1286,17 @@ class BP_Group_Extension { * The get_screen_callback() method uses a ReflectionClass object to * determine whether your extension has provided a given callback. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $context Screen context. 'create', 'edit', or 'admin'. - * @param string $type Screen type. 'screen' or 'screen_save'. Default: - * 'screen'. + * @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 + // Try the context-specific callback first. $method = $context . '_' . $type; $rmethod = $this->class_reflection->getMethod( $method ); if ( isset( $rmethod->class ) && $this->class_name === $rmethod->class ) { @@ -1333,7 +1336,7 @@ class BP_Group_Extension { * in unexpected results when used with data in the wild. See, eg, * https://core.trac.wordpress.org/ticket/19888 * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param array $a First set of arguments. * @param array $b Second set of arguments. @@ -1377,7 +1380,7 @@ class BP_Group_Extension { * The legacy_properties array is set up in * self::setup_legacy_properties(). * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $key Property name. * @return mixed The value if found, otherwise null. @@ -1401,7 +1404,7 @@ class BP_Group_Extension { * class needs to check whether any legacy keys have been put into the * $this->data array. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $key Property name. * @return bool True if the value is set, otherwise false. @@ -1424,10 +1427,10 @@ class BP_Group_Extension { * a value to an object property that no longer exists, such as * $this->enable_create_step. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param string $key Property name. - * @param mixed $value Property value. + * @param mixed $value Property value. */ public function __set( $key, $value ) { @@ -1452,7 +1455,7 @@ class BP_Group_Extension { $this->screens['create']['position'] = $value; break; - // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin' + // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'. case 'admin_name' : $this->screens['edit']['name'] = $value; break; @@ -1489,7 +1492,7 @@ class BP_Group_Extension { * The legacy implementation of BP_Group_Extension used all of these * object properties for configuration. Some have been moved. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @return array List of legacy property keys. */ @@ -1525,28 +1528,28 @@ class BP_Group_Extension { * legacy plugins, we slurp up legacy properties, and later on we'll * parse them into the new init() array. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ protected function parse_legacy_properties() { - // Only run this one time + // Only run this one time. if ( ! empty( $this->legacy_properties_converted ) ) { return; } $properties = $this->get_legacy_property_list(); - // By-reference variable for convenience + // By-reference variable for convenience. $lpc =& $this->legacy_properties_converted; foreach ( $properties as $property ) { - // No legacy config exists for this key + // No legacy config exists for this key. if ( ! isset( $this->{$property} ) ) { continue; } - // Grab the value and record it as appropriate + // Grab the value and record it as appropriate. $value = $this->{$property}; switch ( $property ) { @@ -1566,7 +1569,7 @@ class BP_Group_Extension { $lpc['screens']['create']['position'] = $value; break; - // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin' + // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'. case 'admin_name' : $lpc['screens']['edit']['name'] = $value; break; @@ -1606,13 +1609,13 @@ class BP_Group_Extension { * they remain available to plugins that reference the variables at * their old locations. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @see BP_Group_Extension::__get() */ protected function setup_legacy_properties() { - // Only run this one time + // Only run this one time. if ( ! empty( $this->legacy_properties ) ) { return; } @@ -1639,7 +1642,7 @@ class BP_Group_Extension { $lp['create_step_position'] = $params['screens']['create']['position']; break; - // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin' + // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'. case 'admin_name' : $lp['admin_name'] = $params['screens']['edit']['name']; break; @@ -1665,10 +1668,10 @@ class BP_Group_Extension { break; default : - // All other items get moved over + // All other items get moved over. $lp[ $property ] = $params[ $property ]; - // Also reapply to the object, for backpat + // Also reapply to the object, for backpat. $this->{$property} = $params[ $property ]; break; @@ -1680,7 +1683,9 @@ class BP_Group_Extension { /** * Register a new Group Extension. * - * @param string Name of the Extension class. + * @since 1.1.0 + * + * @param string $group_extension_class Name of the Extension class. * @return false|null Returns false on failure, otherwise null. */ function bp_register_group_extension( $group_extension_class = '' ) { 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 index 8c6b8e05f4c1562e15028857ba6a446f2b1d6ccd..e6a55dbdc93b903a284e6ed7b92560ec7c870dfc 100644 --- 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 @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage GroupsClasses + * @since 1.8.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -22,7 +23,7 @@ defined( 'ABSPATH' ) || exit; * - *Membership requests* are entries with is_confirmed = 0 and * inviter_id = 0 (and invite_sent = 0). * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param array $args { * Array of arguments. Accepts all arguments from @@ -44,8 +45,7 @@ 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 + * @since 1.8.1 * @var null|array Null if not yet defined, otherwise an array of ints. */ protected $group_member_ids; @@ -53,20 +53,20 @@ class BP_Group_Member_Query extends BP_User_Query { /** * Set up action hooks. * - * @since BuddyPress (1.8.0) + * @since 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 + // trusts our order and does not try to apply its own. if ( empty( $this->query_vars_raw['type'] ) ) { $this->query_vars_raw['type'] = 'last_joined'; } - // Set the sort order + // Set the sort order. add_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) ); - // Set up our populate_extras method + // Set up our populate_extras method. add_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 ); } @@ -76,7 +76,7 @@ class BP_Group_Member_Query extends BP_User_Query { * Overrides BP_User_Query::get_include_ids(), adding our additional * group-member logic. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param array $include Existing group IDs in the $include parameter, * as calculated in BP_User_Query. @@ -100,7 +100,7 @@ class BP_Group_Member_Query extends BP_User_Query { $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 + // array that will guarantee no matches for BP_User_Query. if ( empty( $group_member_ids ) ) { return array( 0 ); } @@ -115,7 +115,7 @@ class BP_Group_Member_Query extends BP_User_Query { /** * Get the members of the queried group. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @return array $ids User IDs of relevant group member ids. */ @@ -134,36 +134,36 @@ class BP_Group_Member_Query extends BP_User_Query { 'order' => '', ); - /** WHERE clauses *****************************************************/ + /* WHERE clauses *****************************************************/ - // Group id + // Group id. $sql['where'][] = $wpdb->prepare( "group_id = %d", $this->query_vars['group_id'] ); - // is_confirmed + // If is_confirmed. $is_confirmed = ! empty( $this->query_vars['is_confirmed'] ) ? 1 : 0; $sql['where'][] = $wpdb->prepare( "is_confirmed = %d", $is_confirmed ); - // invite_sent + // If invite_sent. if ( ! is_null( $this->query_vars['invite_sent'] ) ) { $invite_sent = ! empty( $this->query_vars['invite_sent'] ) ? 1 : 0; $sql['where'][] = $wpdb->prepare( "invite_sent = %d", $invite_sent ); } - // inviter_id + // If inviter_id. if ( ! is_null( $this->query_vars['inviter_id'] ) ) { $inviter_id = $this->query_vars['inviter_id']; - // Empty: inviter_id = 0. (pass false, 0, or empty array) + // Empty: inviter_id = 0. (pass false, 0, or empty array). if ( empty( $inviter_id ) ) { $sql['where'][] = "inviter_id = 0"; - // The string 'any' matches any non-zero value (inviter_id != 0) + // The string 'any' matches any non-zero value (inviter_id != 0). } elseif ( 'any' === $inviter_id ) { $sql['where'][] = "inviter_id != 0"; - // Assume that a list of inviter IDs has been passed + // Assume that a list of inviter IDs has been passed. } else { - // Parse and sanitize + // Parse and sanitize. $inviter_ids = wp_parse_id_list( $inviter_id ); if ( ! empty( $inviter_ids ) ) { $inviter_ids_sql = implode( ',', $inviter_ids ); @@ -180,7 +180,7 @@ class BP_Group_Member_Query extends BP_User_Query { $roles = explode( ',', $roles ); } - // Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid + // Sanitize: Only 'admin', 'mod', 'member', and 'banned' are valid. $allowed_roles = array( 'admin', 'mod', 'member', 'banned' ); foreach ( $roles as $role_key => $role_value ) { if ( ! in_array( $role_value, $allowed_roles ) ) { @@ -192,7 +192,7 @@ class BP_Group_Member_Query extends BP_User_Query { // When querying for a set of roles containing 'member' (for // which there is no dedicated is_ column), figure out a list - // of columns *not* to match + // of columns *not* to match. $roles_sql = ''; if ( in_array( 'member', $roles ) ) { $role_columns = array(); @@ -205,7 +205,7 @@ class BP_Group_Member_Query extends BP_User_Query { } // When querying for a set of roles *not* containing 'member', - // simply construct a list of is_* = 1 clauses + // simply construct a list of is_* = 1 clauses. } else { $role_columns = array(); foreach ( $roles as $role ) { @@ -226,7 +226,7 @@ class BP_Group_Member_Query extends BP_User_Query { // 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() + // BP_Group_Member_Query::set_orderby(). $sql['orderby'] = "ORDER BY date_modified"; $sql['order'] = 'first_joined' === $this->query_vars['type'] ? 'ASC' : 'DESC'; @@ -238,7 +238,7 @@ class BP_Group_Member_Query extends BP_User_Query { * Use this filter to build a custom query (such as when you've * defined a custom 'type'). * - * @since BuddyPress (2.0.0) + * @since 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. @@ -254,6 +254,8 @@ class BP_Group_Member_Query extends BP_User_Query { * We only override BP_User_Query's native ordering in case of the * 'last_joined' and 'first_joined' $type parameters. * + * @since 1.8.1 + * * @param BP_User_Query $query BP_User_Query object. */ public function set_orderby( $query ) { @@ -272,12 +274,12 @@ class BP_Group_Member_Query extends 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 + // Group Activity DESC. if ( 'group_activity' == $query->query_vars['type'] ) { $gm_ids = $this->get_gm_ids_ordered_by_activity( $query, $gm_ids ); } - // The first param in the FIELD() clause is the sort column id + // The first param in the FIELD() clause is the sort column id. $gm_ids = array_merge( array( 'u.id' ), wp_parse_id_list( $gm_ids ) ); $gm_ids_sql = implode( ',', $gm_ids ); @@ -285,7 +287,7 @@ class BP_Group_Member_Query extends BP_User_Query { } // Prevent this filter from running on future BP_User_Query - // instances on the same page + // instances on the same page. remove_action( 'bp_pre_user_query', array( $this, 'set_orderby' ) ); } @@ -293,11 +295,10 @@ class BP_Group_Member_Query extends BP_User_Query { * Fetch additional data required in bp_group_has_members() loops. * * Additional data fetched: - * * - is_banned * - date_modified * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param BP_User_Query $query BP_User_Query object. Because we're * filtering the current object, we use @@ -313,7 +314,7 @@ class BP_Group_Member_Query extends BP_User_Query { foreach ( (array) $extras as $extra ) { if ( isset( $this->results[ $extra->user_id ] ) ) { - // user_id is provided for backward compatibility + // The user_id is provided for backward compatibility. $this->results[ $extra->user_id ]->user_id = (int) $extra->user_id; $this->results[ $extra->user_id ]->is_admin = (int) $extra->is_admin; $this->results[ $extra->user_id ]->is_mod = (int) $extra->is_mod; @@ -328,18 +329,17 @@ class BP_Group_Member_Query extends BP_User_Query { } } - // Don't filter other BP_User_Query objects on the same page + // Don't filter other BP_User_Query objects on the same page. remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 ); } /** * Sort user IDs by how recently they have generated activity within a given group. * - * @since BuddyPress (2.1.0) + * @since 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() ) { diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-component.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-component.php new file mode 100644 index 0000000000000000000000000000000000000000..f2196294087689e0cd10e797a0c6d8456ead0611 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-component.php @@ -0,0 +1,814 @@ +<?php +/** + * BuddyPress Groups Component Class. + * + * @package BuddyPress + * @subpackage GroupsLoader + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Creates our Groups component. + * + * @since 1.5.0 + */ +class BP_Groups_Component extends BP_Component { + + /** + * Auto-join group when non group member performs group activity. + * + * @since 1.5.0 + * @var bool + */ + public $auto_join; + + /** + * The group being currently accessed. + * + * @since 1.5.0 + * @var BP_Groups_Group + */ + public $current_group; + + /** + * Default group extension. + * + * @since 1.6.0 + * @todo Is this used anywhere? Is this a duplicate of $default_extension? + * @var string + */ + var $default_component; + + /** + * Default group extension. + * + * @since 1.6.0 + * @var string + */ + public $default_extension; + + /** + * Illegal group names/slugs. + * + * @since 1.5.0 + * @var array + */ + public $forbidden_names; + + /** + * Group creation/edit steps (e.g. Details, Settings, Avatar, Invites). + * + * @since 1.5.0 + * @var array + */ + public $group_creation_steps; + + /** + * Types of group statuses (Public, Private, Hidden). + * + * @since 1.5.0 + * @var array + */ + public $valid_status; + + /** + * Start the groups component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'groups', + _x( 'User Groups', 'Group screen page <title>', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 70, + 'search_query_arg' => 'groups_search', + ) + ); + } + + /** + * Include Groups component files. + * + * @since 1.5.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes( $includes = array() ) { + $includes = array( + 'cache', + 'forums', + 'actions', + 'filters', + 'screens', + 'classes', + 'widgets', + 'activity', + 'template', + 'adminbar', + 'functions', + 'notifications' + ); + + if ( is_admin() ) { + $includes[] = 'admin'; + } + + parent::includes( $includes ); + } + + /** + * Set up component global data. + * + * The BP_GROUPS_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @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_GROUPS_SLUG' ) ) { + define( 'BP_GROUPS_SLUG', $this->id ); + } + + // Global tables for groups component. + $global_tables = array( + 'table_name' => $bp->table_prefix . 'bp_groups', + 'table_name_members' => $bp->table_prefix . 'bp_groups_members', + 'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta' + ); + + // Metadata tables for groups component. + $meta_tables = array( + 'group' => $bp->table_prefix . 'bp_groups_groupmeta', + ); + + // All globals for groups component. + // Note that global_tables is included in this array. + $args = array( + 'slug' => BP_GROUPS_SLUG, + 'root_slug' => isset( $bp->pages->groups->slug ) ? $bp->pages->groups->slug : BP_GROUPS_SLUG, + 'has_directory' => true, + 'directory_title' => _x( 'Groups', 'component directory title', 'buddypress' ), + 'notification_callback' => 'groups_format_notifications', + 'search_string' => _x( 'Search Groups...', 'Component directory search', 'buddypress' ), + 'global_tables' => $global_tables, + 'meta_tables' => $meta_tables, + ); + + parent::setup_globals( $args ); + + /* Single Group Globals **********************************************/ + + // Are we viewing a single group? + 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 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' ) { + $this->current_group = groups_get_group( array( + 'group_id' => $group_id, + 'populate_extras' => true, + ) ); + + } else { + + /** + * Filters the current group object being instantiated from previous filter. + * + * @since 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 ) ); + } + + // When in a single group, the first action is bumped down one because of the + // group name, so we need to adjust this and set the group name to current_item. + $bp->current_item = bp_current_action(); + $bp->current_action = bp_action_variable( 0 ); + array_shift( $bp->action_variables ); + + // Using "item" not "group" for generic support in other components. + if ( bp_current_user_can( 'bp_moderate' ) ) { + bp_update_is_item_admin( true, 'groups' ); + } else { + bp_update_is_item_admin( groups_is_user_admin( bp_loggedin_user_id(), $this->current_group->id ), 'groups' ); + } + + // If the user is not an admin, check if they are a moderator. + if ( ! bp_is_item_admin() ) { + bp_update_is_item_mod ( groups_is_user_mod ( bp_loggedin_user_id(), $this->current_group->id ), 'groups' ); + } + + // Is the logged in user a member of the group? + if ( ( is_user_logged_in() && groups_is_user_member( bp_loggedin_user_id(), $this->current_group->id ) ) ) { + $this->current_group->is_user_member = true; + } else { + $this->current_group->is_user_member = false; + } + + // Should this group be visible to the logged in user? + if ( 'public' == $this->current_group->status || $this->current_group->is_user_member ) { + $this->current_group->is_visible = true; + } else { + $this->current_group->is_visible = false; + } + + // If this is a private or hidden group, does the user have access? + if ( 'private' == $this->current_group->status || 'hidden' == $this->current_group->status ) { + if ( $this->current_group->is_user_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) ) { + $this->current_group->user_has_access = true; + } else { + $this->current_group->user_has_access = false; + } + } else { + $this->current_group->user_has_access = true; + } + + // Check once if the current group has a custom front template. + $this->current_group->front_template = bp_groups_get_front_template( $this->current_group ); + + // Set current_group to 0 to prevent debug errors. + } else { + $this->current_group = 0; + } + + /** + * Filters the list of illegal groups names/slugs. + * + * @since 1.0.0 + * + * @param array $value Array of illegal group names/slugs. + */ + $this->forbidden_names = apply_filters( 'groups_forbidden_names', array( + 'my-groups', + 'create', + 'invites', + 'send-invites', + 'forum', + 'delete', + 'add', + 'admin', + 'request-membership', + 'members', + 'settings', + 'avatar', + $this->slug, + $this->root_slug, + ) ); + + // If the user was attempting to access a group, but no group by that name was found, 404. + if ( bp_is_groups_component() && empty( $this->current_group ) && bp_current_action() && !in_array( bp_current_action(), $this->forbidden_names ) ) { + bp_do_404(); + return; + } + + /** + * Filters the preconfigured groups creation steps. + * + * @since 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' ), + 'position' => 0 + ), + 'group-settings' => array( + 'name' => _x( 'Settings', 'Group screen nav', 'buddypress' ), + 'position' => 10 + ) + ) ); + + // If avatar uploads are not disabled, add avatar option. + $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads(); + if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) { + $this->group_creation_steps['group-avatar'] = array( + 'name' => _x( 'Photo', 'Group screen nav', 'buddypress' ), + 'position' => 20 + ); + } + + if ( bp_group_use_cover_image_header() ) { + $this->group_creation_steps['group-cover-image'] = array( + 'name' => _x( 'Cover Image', 'Group screen nav', 'buddypress' ), + 'position' => 25 + ); + } + + // If friends component is active, add invitations. + if ( bp_is_active( 'friends' ) ) { + $this->group_creation_steps['group-invites'] = array( + 'name' => _x( 'Invites', 'Group screen nav', 'buddypress' ), + 'position' => 30 + ); + } + + /** + * Filters the list of valid groups statuses. + * + * @since 1.1.0 + * + * @param array $value Array of valid group statuses. + */ + $this->valid_status = apply_filters( 'groups_valid_status', array( + 'public', + 'private', + 'hidden' + ) ); + + // Auto join group when non group member performs group activity. + $this->auto_join = defined( 'BP_DISABLE_AUTO_GROUP_JOIN' ) && BP_DISABLE_AUTO_GROUP_JOIN ? false : true; + } + + /** + * Set up canonical stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() { + if ( ! bp_is_groups_component() ) { + return; + } + + if ( empty( $this->current_group ) ) { + return; + } + + /** + * Filters the default groups extension. + * + * @since 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' ); + + $bp = buddypress(); + + // If the activity component is not active and the current group has no custom front, members are displayed in the home nav. + if ( 'members' === $this->default_extension && ! bp_is_active( 'activity' ) && ! $this->current_group->front_template ) { + $this->default_extension = 'home'; + } + + if ( ! bp_current_action() ) { + $bp->current_action = $this->default_extension; + } + + // Prepare for a redirect to the canonical URL. + $bp->canonical_stack['base_url'] = bp_get_group_permalink( $this->current_group ); + + if ( bp_current_action() ) { + $bp->canonical_stack['action'] = bp_current_action(); + } + + /** + * If there's no custom front.php template for the group, we need to make sure the canonical stack action + * is set to 'home' in these 2 cases: + * + * - the current action is 'activity' (eg: site.url/groups/single/activity) and the Activity component is active + * - the current action is 'members' (eg: site.url/groups/single/members) and the Activity component is *not* active. + */ + if ( ! $this->current_group->front_template && ( bp_is_current_action( 'activity' ) || ( ! bp_is_active( 'activity' ) && bp_is_current_action( 'members' ) ) ) ) { + $bp->canonical_stack['action'] = 'home'; + } + + if ( ! empty( $bp->action_variables ) ) { + $bp->canonical_stack['action_variables'] = bp_action_variables(); + } + + // When viewing the default extension, the canonical URL should not have + // that extension's slug, unless more has been tacked onto the URL via + // action variables. + if ( bp_is_current_action( $this->default_extension ) && empty( $bp->action_variables ) ) { + unset( $bp->canonical_stack['action'] ); + } + } + + /** + * Set up component navigation. + * + * @since 1.5.0 + * + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + $user_domain = false; + } + + // Only grab count if we're on a user page. + if ( bp_is_user() ) { + $class = ( 0 === groups_total_groups_for_user( bp_displayed_user_id() ) ) ? 'no-count' : 'count'; + $nav_name = sprintf( _x( 'Groups <span class="%s">%s</span>', 'Group screen nav with counter', 'buddypress' ), esc_attr( $class ), bp_get_total_group_count_for_user() ); + } else { + $nav_name = _x( 'Groups', 'Group screen nav without counter', 'buddypress' ); + } + + $slug = bp_get_groups_slug(); + + // Add 'Groups' to the main navigation. + $main_nav = array( + 'name' => $nav_name, + 'slug' => $slug, + 'position' => 70, + 'screen_function' => 'groups_screen_my_groups', + 'default_subnav_slug' => 'my-groups', + 'item_css_id' => $this->id + ); + + if ( ! empty( $user_domain ) ) { + $access = bp_core_can_edit_settings(); + $groups_link = trailingslashit( $user_domain . $slug ); + + // Add the My Groups nav item. + $sub_nav[] = array( + 'name' => __( 'Memberships', 'buddypress' ), + 'slug' => 'my-groups', + 'parent_url' => $groups_link, + 'parent_slug' => $slug, + 'screen_function' => 'groups_screen_my_groups', + 'position' => 10, + 'item_css_id' => 'groups-my-groups' + ); + + // Add the Group Invites nav item. + $sub_nav[] = array( + 'name' => __( 'Invitations', 'buddypress' ), + 'slug' => 'invites', + 'parent_url' => $groups_link, + 'parent_slug' => $slug, + 'screen_function' => 'groups_screen_group_invites', + 'user_has_access' => $access, + 'position' => 30 + ); + + parent::setup_nav( $main_nav, $sub_nav ); + } + + if ( bp_is_groups_component() && bp_is_single_item() ) { + + // Reset sub nav. + $sub_nav = array(); + + // Add 'Groups' to the main navigation. + $main_nav = array( + 'name' => __( 'Memberships', 'buddypress' ), + 'slug' => $this->current_group->slug, + 'position' => -1, // Do not show in BuddyBar. + 'screen_function' => 'groups_screen_group_home', + 'default_subnav_slug' => $this->default_extension, + 'item_css_id' => $this->id + ); + + $group_link = bp_get_group_permalink( $this->current_group ); + + // Add the "Home" subnav item, as this will always be present. + $sub_nav[] = array( + 'name' => _x( 'Home', 'Group screen navigation title', 'buddypress' ), + 'slug' => 'home', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_home', + 'position' => 10, + 'item_css_id' => 'home' + ); + + // If this is a private group, and the user is not a + // member and does not have an outstanding invitation, + // show a "Request Membership" nav item. + if ( is_user_logged_in() && + ! $this->current_group->is_user_member && + ! groups_check_for_membership_request( bp_loggedin_user_id(), $this->current_group->id ) && + $this->current_group->status == 'private' && + ! groups_check_user_has_invite( bp_loggedin_user_id(), $this->current_group->id ) + ) { + + $sub_nav[] = array( + 'name' => _x( 'Request Membership','Group screen nav', 'buddypress' ), + 'slug' => 'request-membership', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_request_membership', + 'position' => 30 + ); + } + + // Forums are enabled and turned on. + if ( $this->current_group->enable_forum && bp_is_active( 'forums' ) ) { + $sub_nav[] = array( + 'name' => _x( 'Forum', 'My Group screen nav', 'buddypress' ), + 'slug' => 'forum', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_forum', + 'position' => 40, + 'user_has_access' => $this->current_group->user_has_access, + 'item_css_id' => 'forums' + ); + } + + if ( $this->current_group->front_template || bp_is_active( 'activity' ) ) { + /** + * If the theme is using a custom front, create activity subnav. + */ + if ( $this->current_group->front_template && bp_is_active( 'activity' ) ) { + $sub_nav[] = array( + 'name' => _x( 'Activity', 'My Group screen nav', 'buddypress' ), + 'slug' => 'activity', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_activity', + 'position' => 11, + 'user_has_access' => $this->current_group->user_has_access, + 'item_css_id' => 'activity', + 'no_access_url' => $group_link, + ); + } + + /** + * Only add the members subnav if it's not the home's nav. + */ + $sub_nav[] = array( + 'name' => sprintf( _x( 'Members %s', 'My Group screen nav', 'buddypress' ), '<span>' . number_format( $this->current_group->total_member_count ) . '</span>' ), + 'slug' => 'members', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_members', + 'position' => 60, + 'user_has_access' => $this->current_group->user_has_access, + 'item_css_id' => 'members', + 'no_access_url' => $group_link, + ); + } + + if ( bp_is_active( 'friends' ) && bp_groups_user_can_send_invites() ) { + $sub_nav[] = array( + 'name' => _x( 'Send Invites', 'My Group screen nav', 'buddypress' ), + 'slug' => 'send-invites', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_invite', + 'item_css_id' => 'invite', + 'position' => 70, + 'user_has_access' => $this->current_group->user_has_access, + 'no_access_url' => $group_link, + ); + } + + // If the user is a group admin, then show the group admin nav item. + if ( bp_is_item_admin() ) { + $sub_nav[] = array( + 'name' => _x( 'Manage', 'My Group screen nav', 'buddypress' ), + 'slug' => 'admin', + 'parent_url' => $group_link, + 'parent_slug' => $this->current_group->slug, + 'screen_function' => 'groups_screen_group_admin', + 'position' => 1000, + 'user_has_access' => true, + '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 ); + } + + if ( bp_group_use_cover_image_header() ) { + $sub_nav[] = array_merge( array( + 'name' => __( 'Cover Image', 'buddypress' ), + 'slug' => 'group-cover-image', + 'position' => 25, + ), $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 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'); + } + } + + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.5.0 + * + * @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. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $groups_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ); + + // Pending group invites. + $count = groups_get_invite_count_for_user(); + $title = _x( 'Groups', 'My Account Groups', 'buddypress' ); + $pending = _x( 'No Pending Invites', 'My Account Groups sub nav', 'buddypress' ); + + if ( ! empty( $count['total'] ) ) { + $title = sprintf( _x( 'Groups <span class="count">%s</span>', 'My Account Groups nav', 'buddypress' ), bp_core_number_format( $count ) ); + $pending = sprintf( _x( 'Pending Invites <span class="count">%s</span>', 'My Account Groups sub nav', 'buddypress' ), bp_core_number_format( $count ) ); + } + + // Add the "My Account" sub menus. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => $title, + 'href' => $groups_link + ); + + // My Groups. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-memberships', + 'title' => _x( 'Memberships', 'My Account Groups sub nav', 'buddypress' ), + 'href' => $groups_link, + 'position' => 10 + ); + + // Invitations. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-invites', + 'title' => $pending, + 'href' => trailingslashit( $groups_link . 'invites' ), + 'position' => 30 + ); + + // Create a Group. + if ( bp_user_can_create_groups() ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-create', + 'title' => _x( 'Create a Group', 'My Account Groups sub nav', 'buddypress' ), + 'href' => trailingslashit( bp_get_groups_directory_permalink() . 'create' ), + 'position' => 90 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + * + * @since 1.5.0 + */ + public function setup_title() { + + if ( bp_is_groups_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() && !bp_is_single_item() ) { + $bp->bp_options_title = _x( 'Memberships', 'My Groups page <title>', 'buddypress' ); + + } 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', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + + // We are viewing a single group, so set up the + // group navigation menu using the $this->current_group global. + } 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, + 'object' => 'group', + 'type' => 'thumb', + 'avatar_dir' => 'group-avatars', + 'alt' => __( 'Group Profile Photo', 'buddypress' ) + ) ); + + if ( empty( $bp->bp_options_avatar ) ) { + $bp->bp_options_avatar = '<img src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Profile Photo', 'buddypress' ) . '" class="avatar" />'; + } + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups + * + * @since 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/classes/class-bp-groups-group-members-template.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-group-members-template.php new file mode 100644 index 0000000000000000000000000000000000000000..7d60913bdb1c983db27118071bc8bed18cecf90c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-group-members-template.php @@ -0,0 +1,278 @@ +<?php +/** + * BuddyPress Groups group members loop template class. + * + * @package BuddyPress + * @since 1.1.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Group Members Loop template class. + * + * @since 1.0.0 + */ +class BP_Groups_Group_Members_Template { + + /** + * @since 1.0.0 + * @var int + */ + public $current_member = -1; + + /** + * @since 1.0.0 + * @var int + */ + public $member_count; + + /** + * @since 1.0.0 + * @var array + */ + public $members; + + /** + * @since 1.0.0 + * @var object + */ + public $member; + + /** + * @since 1.0.0 + * @var bool + */ + public $in_the_loop; + + /** + * @since 1.0.0 + * @var int + */ + public $pag_page; + + /** + * @since 1.0.0 + * @var int + */ + public $pag_num; + + /** + * @since 1.0.0 + * @var array|string|void + */ + public $pag_links; + + /** + * @since 1.0.0 + * @var int + */ + public $total_group_count; + + /** + * Constructor. + * + * @since 1.5.0 + * + * @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 $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. + * } + */ + 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); + + $old_args_keys = array( + 0 => 'group_id', + 1 => 'per_page', + 2 => 'max', + 3 => 'exclude_admins_mods', + 4 => 'exclude_banned', + 5 => 'exclude', + 6 => 'group_role', + ); + + $func_args = func_get_args(); + $args = bp_core_parse_args_array( $old_args_keys, $func_args ); + } + + $r = wp_parse_args( $args, array( + 'group_id' => bp_get_current_group_id(), + 'page' => 1, + 'per_page' => 20, + 'page_arg' => 'mlpage', + 'max' => false, + 'exclude' => false, + 'exclude_admins_mods' => 1, + 'exclude_banned' => 1, + 'group_role' => false, + 'search_terms' => false, + 'type' => 'last_joined', + ) ); + + $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 ( empty( $current_group ) || ( $current_group && $current_group->id !== bp_get_current_group_id() ) ) { + $current_group = groups_get_group( array( 'group_id' => $r['group_id'] ) ); + } + + // Assemble the base URL for pagination. + $base_url = trailingslashit( bp_get_group_permalink( $current_group ) . bp_current_action() ); + if ( bp_action_variable() ) { + $base_url = trailingslashit( $base_url . bp_action_variable() ); + } + + $members_args = $r; + + $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 ( empty( $r['max'] ) || ( $r['max'] >= (int) $this->members['count'] ) ) { + $this->total_member_count = (int) $this->members['count']; + } else { + $this->total_member_count = (int) $r['max']; + } + + // Reset members array for subsequent looping. + $this->members = $this->members['members']; + + if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->members ) ) ) { + $this->member_count = (int) count( $this->members ); + } else { + $this->member_count = (int) $r['max']; + } + + $this->pag_links = paginate_links( array( + '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' => '←', + 'next_text' => '→', + 'mid_size' => 1, + 'add_args' => array(), + ) ); + } + + /** + * Whether or not there are members to display. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_members() { + if ( ! empty( $this->member_count ) ) { + return true; + } + + return false; + } + + /** + * Increments to the next member to display. + * + * @since 1.0.0 + * + * @return object + */ + public function next_member() { + $this->current_member++; + $this->member = $this->members[ $this->current_member ]; + + return $this->member; + } + + /** + * Rewinds to the first member to display. + * + * @since 1.0.0 + */ + public function rewind_members() { + $this->current_member = -1; + if ( $this->member_count > 0 ) { + $this->member = $this->members[0]; + } + } + + /** + * Finishes up the members for display. + * + * @since 1.0.0 + * + * @return bool + */ + public function members() { + $tick = intval( $this->current_member + 1 ); + if ( $tick < $this->member_count ) { + return true; + } elseif ( $tick == $this->member_count ) { + + /** + * Fires right before the rewinding of members list. + * + * @since 1.0.0 + * @since 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(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Sets up the member to display. + * + * @since 1.0.0 + */ + public function the_member() { + $this->in_the_loop = true; + $this->member = $this->next_member(); + + // Loop has just started. + if ( 0 == $this->current_member ) { + + /** + * Fires if the current member item is the first in the members list. + * + * @since 1.0.0 + * @since 2.3.0 `$this` parameter added. + * + * @param BP_Groups_Group_Members_Template $this Instance of the current Members template. + */ + do_action( 'loop_start', $this ); + } + } +} 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 index bd77987fc4892d8cf95ef07f7bc40d4c8edb8c82..8d29b0ec933c0a5295151639efc2b8bc9408bc88 100644 --- 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 @@ -1,23 +1,26 @@ <?php /** - * BuddyPress Groups Classes + * BuddyPress Groups Classes. * * @package BuddyPress * @subpackage GroupsClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * BuddyPress Group object. + * + * @since 1.6.0 */ class BP_Groups_Group { /** * ID of the group. * - * @access public + * @since 1.6.0 * @var int */ public $id; @@ -25,7 +28,7 @@ class BP_Groups_Group { /** * User ID of the group's creator. * - * @access public + * @since 1.6.0 * @var int */ public $creator_id; @@ -33,7 +36,7 @@ class BP_Groups_Group { /** * Name of the group. * - * @access public + * @since 1.6.0 * @var string */ public $name; @@ -41,7 +44,7 @@ class BP_Groups_Group { /** * Group slug. * - * @access public + * @since 1.6.0 * @var string */ public $slug; @@ -49,7 +52,7 @@ class BP_Groups_Group { /** * Group description. * - * @access public + * @since 1.6.0 * @var string */ public $description; @@ -59,7 +62,7 @@ class BP_Groups_Group { * * Core statuses are 'public', 'private', and 'hidden'. * - * @access public + * @since 1.6.0 * @var string */ public $status; @@ -67,7 +70,7 @@ class BP_Groups_Group { /** * Should (legacy) bbPress forums be enabled for this group? * - * @access public + * @since 1.6.0 * @var int */ public $enable_forum; @@ -75,7 +78,7 @@ class BP_Groups_Group { /** * Date the group was created. * - * @access public + * @since 1.6.0 * @var string */ public $date_created; @@ -83,7 +86,7 @@ class BP_Groups_Group { /** * Data about the group's admins. * - * @access public + * @since 1.6.0 * @var array */ public $admins; @@ -91,7 +94,7 @@ class BP_Groups_Group { /** * Data about the group's moderators. * - * @access public + * @since 1.6.0 * @var array */ public $mods; @@ -99,7 +102,7 @@ class BP_Groups_Group { /** * Total count of group members. * - * @access public + * @since 1.6.0 * @var int */ public $total_member_count; @@ -107,7 +110,7 @@ class BP_Groups_Group { /** * Is the current user a member of this group? * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var bool */ public $is_member; @@ -115,7 +118,7 @@ class BP_Groups_Group { /** * Does the current user have an outstanding invitation to this group? * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * @var bool */ public $is_invited; @@ -123,7 +126,7 @@ class BP_Groups_Group { /** * Does the current user have a pending membership request to this group? * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * @var bool */ public $is_pending; @@ -131,7 +134,7 @@ class BP_Groups_Group { /** * Timestamp of the last activity that happened in this group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var string */ public $last_activity; @@ -139,7 +142,7 @@ class BP_Groups_Group { /** * If this is a private or hidden group, does the current user have access? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @var bool */ public $user_has_access; @@ -147,7 +150,7 @@ class BP_Groups_Group { /** * Raw arguments passed to the constructor. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * @var array */ public $args; @@ -155,13 +158,15 @@ class BP_Groups_Group { /** * 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. + * @since 1.6.0 + * + * @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. + * @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() ) { @@ -177,30 +182,32 @@ class BP_Groups_Group { /** * Set up data about the current group. + * + * @since 1.6.0 */ public function populate() { global $wpdb; - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - // Check cache for group data + // Check cache for group data. $group = wp_cache_get( $this->id, 'bp_groups' ); - // Cache missed, so query the DB + // Cache missed, so query the DB. if ( false === $group ) { $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ); wp_cache_set( $this->id, $group, 'bp_groups' ); } - // No group found so set the ID and bail + // No group found so set the ID and bail. if ( empty( $group ) || is_wp_error( $group ) ) { $this->id = 0; return; } - // Group found so setup the object variables + // Group found so setup the object variables. $this->id = $group->id; $this->creator_id = $group->creator_id; $this->name = stripslashes( $group->name ); @@ -216,13 +223,13 @@ class BP_Groups_Group { /** * Filters the SQL prepared statement used to fetch group admins and mods. * - * @since BuddyPress (1.5.0) + * @since 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 + // Add admins and moderators to their respective arrays. foreach ( (array) $admin_mods as $user ) { if ( !empty( $user->is_admin ) ) { $this->admins[] = $user; @@ -232,11 +239,11 @@ class BP_Groups_Group { } // Set up some specific group vars from meta. Excluded - // from the bp_groups cache because it's cached independently + // from the bp_groups cache because it's cached independently. $this->last_activity = groups_get_groupmeta( $this->id, 'last_activity' ); $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' ); - // Set user-specific data + // Set user-specific data. $user_id = bp_loggedin_user_id(); $this->is_member = BP_Groups_Member::check_is_member( $user_id, $this->id ); $this->is_invited = BP_Groups_Member::check_has_invite( $user_id, $this->id ); @@ -245,10 +252,10 @@ class BP_Groups_Group { // 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 + // Assume user does not have access to hidden/private groups. $this->user_has_access = false; - // Group members or community moderators have access + // Group members or community moderators have access. if ( ( $this->is_member && is_user_logged_in() ) || bp_current_user_can( 'bp_moderate' ) ) { $this->user_has_access = true; } @@ -261,6 +268,8 @@ class BP_Groups_Group { /** * Save the current group to the database. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function save() { @@ -270,9 +279,9 @@ class BP_Groups_Group { $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->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->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 ); @@ -281,28 +290,28 @@ class BP_Groups_Group { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 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 + // Groups need at least a name. if ( empty( $this->name ) ) { return false; } - // Set slug with group title if not passed + // Set slug with group title if not passed. if ( empty( $this->slug ) ) { $this->slug = sanitize_title( $this->name ); } - // Sanity check + // Sanity check. if ( empty( $this->slug ) ) { return false; } - // Check for slug conflicts if creating new group + // Check for slug conflicts if creating new group. if ( empty( $this->id ) ) { $this->slug = groups_check_slug( $this->slug ); } @@ -361,7 +370,7 @@ class BP_Groups_Group { /** * Fires after the current group item has been saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Groups_Group $this Current instance of the group item that was saved. Passed by reference. */ @@ -375,28 +384,30 @@ class BP_Groups_Group { /** * Delete the current group. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function delete() { global $wpdb; - // Delete groupmeta for the group + // Delete groupmeta for the group. groups_delete_groupmeta( $this->id ); - // Fetch the user IDs of all the members of the group + // Fetch the user IDs of all the members of the group. $user_ids = BP_Groups_Member::get_group_member_ids( $this->id ); $user_id_str = esc_sql( implode( ',', wp_parse_id_list( $user_ids ) ) ); - // Modify group count usermeta for members + // Modify group count usermeta for members. $wpdb->query( "UPDATE {$wpdb->usermeta} SET meta_value = meta_value - 1 WHERE meta_key = 'total_group_count' AND user_id IN ( {$user_id_str} )" ); - // Now delete all group member entries + // Now delete all group member entries. BP_Groups_Member::delete_all( $this->id ); /** * Fires before the deletion of a group. * - * @since BuddyPress (1.2.0) + * @since 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. @@ -407,7 +418,7 @@ class BP_Groups_Group { $bp = buddypress(); - // Finally remove the group entry from the DB + // Finally remove the group entry from the DB. if ( !$wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name} WHERE id = %d", $this->id ) ) ) return false; @@ -419,10 +430,11 @@ class BP_Groups_Group { /** * Get whether a group exists for a given slug. * + * @since 1.6.0 + * * @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 ) { @@ -442,6 +454,8 @@ class BP_Groups_Group { * * Alias of {@link BP_Groups_Group::group_exists()}. * + * @since 1.6.0 + * * @param string $slug See {@link BP_Groups_Group::group_exists()}. * @return string|null See {@link BP_Groups_Group::group_exists()}. */ @@ -452,10 +466,12 @@ class BP_Groups_Group { /** * Get IDs of users with outstanding invites to a given group from a specified user. * + * @since 1.6.0 + * * @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. + * user but have not yet accepted. */ public static function get_invites( $user_id, $group_id ) { global $wpdb; @@ -468,18 +484,20 @@ class BP_Groups_Group { /** * 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). + * @since 1.6.0 + * + * @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. + * @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 ) { @@ -514,18 +532,20 @@ class BP_Groups_Group { /** * 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). + * @since 1.6.0 + * + * @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). + * @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. + * @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 ) { @@ -558,6 +578,8 @@ class BP_Groups_Group { /** * Check for the existence of a slug. * + * @since 1.6.0 + * * @param string $slug Slug to check. * @return string|null The slug, if found. Otherwise null. */ @@ -572,6 +594,8 @@ class BP_Groups_Group { /** * Get the slug for a given group ID. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return string|null The slug, if found. Otherwise null. */ @@ -586,6 +610,8 @@ class BP_Groups_Group { /** * Check whether a given group has any members. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return bool True if the group has members, otherwise false. */ @@ -605,9 +631,11 @@ class BP_Groups_Group { /** * Check whether a group has outstanding membership requests. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return int|null The number of outstanding requests, or null if - * none are found. + * none are found. */ public static function has_membership_requests( $group_id ) { global $wpdb; @@ -620,15 +648,17 @@ class BP_Groups_Group { /** * 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). + * @since 1.6.0 + * + * @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. + * @type int $total Total number of requests outstanding for the + * group. * } */ public static function get_membership_requests( $group_id, $limit = null, $page = null ) { @@ -652,55 +682,52 @@ class BP_Groups_Group { * @see WP_Meta_Query::queries for a description of the 'meta_query' * parameter format. * - * @param array { + * @since 1.6.0 + * + * @param array $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 $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. + * @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 $value 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. + * 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 + // 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__ ) ); @@ -791,19 +818,19 @@ class BP_Groups_Group { $sql['exclude'] = " AND g.id NOT IN ({$exclude})"; } - /** Order/orderby ********************************************/ + /* 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 + // '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) + * @since 2.1.0 * * @param array $value Converted 'type' value for order and orderby. * @param string $value Parsed 'type' value for the get method. @@ -812,7 +839,7 @@ class BP_Groups_Group { // If an invalid type is passed, $order_orderby will be // an array with empty values. In this case, we stick - // with the default values of $order and $orderby + // with the default values of $order and $orderby. if ( ! empty( $order_orderby['order'] ) ) { $order = $order_orderby['order']; } @@ -822,13 +849,13 @@ class BP_Groups_Group { } } - // Sanitize 'order' + // Sanitize 'order'. $order = bp_esc_sql_order( $order ); /** * Filters the converted 'orderby' term. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $value Converted 'orderby' term. * @param string $orderby Original orderby value. @@ -836,7 +863,7 @@ class BP_Groups_Group { */ $orderby = apply_filters( 'bp_groups_get_orderby_converted_by_term', self::convert_orderby_to_order_by_term( $orderby ), $orderby, $r['type'] ); - // Random order is a special case + // Random order is a special case. if ( 'rand()' === $orderby ) { $sql[] = "ORDER BY rand()"; } else { @@ -850,7 +877,7 @@ class BP_Groups_Group { /** * Filters the pagination SQL statement. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Concatenated SQL statement. * @param array $sql Array of SQL parts before concatenation. @@ -878,22 +905,22 @@ class BP_Groups_Group { } // Temporary implementation of meta_query for total count - // See #5099 + // See #5099. if ( ! empty( $meta_query_sql['where'] ) ) { - // Join the groupmeta table + // Join the groupmeta table. $total_sql['select'] .= ", ". substr( $meta_query_sql['join'], 0, -2 ); - // Modify the meta_query clause from paged_sql for our syntax + // Modify the meta_query clause from paged_sql for our syntax. $meta_query_clause = preg_replace( '/^\s*AND/', '', $meta_query_sql['where'] ); $total_sql['where'][] = $meta_query_clause; } - // Already escaped in the paginated results block + // Already escaped in the paginated results block. if ( ! empty( $include ) ) { $total_sql['where'][] = "g.id IN ({$include})"; } - // Already escaped in the paginated results block + // Already escaped in the paginated results block. if ( ! empty( $exclude ) ) { $total_sql['where'][] = "g.id NOT IN ({$exclude})"; } @@ -910,7 +937,7 @@ class BP_Groups_Group { /** * Filters the SQL used to retrieve total group results. * - * @since BuddyPress (1.5.0) + * @since 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. @@ -924,12 +951,12 @@ class BP_Groups_Group { $group_ids[] = $group->id; } - // Populate some extra information instead of querying each time in the loop + // Populate some extra information instead of querying each time in the loop. if ( !empty( $r['populate_extras'] ) ) { $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $r['type'] ); } - // Grab all groupmeta + // Grab all groupmeta. if ( ! empty( $r['update_meta_cache'] ) ) { bp_groups_update_meta_cache( $group_ids ); } @@ -948,11 +975,10 @@ class BP_Groups_Group { * 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 + * @since 1.8.0 * * @param array $meta_query An array of meta_query filters. See the - * documentation for {@link WP_Meta_Query} for details. + * 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() ) { @@ -967,7 +993,7 @@ class BP_Groups_Group { $groups_meta_query = new WP_Meta_Query( $meta_query ); // WP_Meta_Query expects the table name at - // $wpdb->group + // $wpdb->group. $wpdb->groupmeta = buddypress()->groups->table_name_groupmeta; $meta_sql = $groups_meta_query->get_sql( 'group', 'g', 'id' ); @@ -979,7 +1005,7 @@ class BP_Groups_Group { // // @todo It may be better in the long run to refactor // the more general query syntax to accord better with - // BP/WP convention + // BP/WP convention. preg_match_all( '/JOIN (.+?) ON/', $meta_sql['join'], $matches_a ); preg_match_all( '/ON \((.+?)\)/', $meta_sql['join'], $matches_b ); @@ -995,13 +1021,13 @@ class BP_Groups_Group { /** * Convert the 'type' parameter to 'order' and 'orderby'. * - * @since BuddyPress (1.8.0) - * @access protected + * @since 1.8.0 * * @param string $type The 'type' shorthand param. + * * @return array { - * @type string $order SQL-friendly order string. - * @type string $orderby SQL-friendly orderby column name. + * @type string $order SQL-friendly order string. + * @type string $orderby SQL-friendly orderby column name. * } */ protected static function convert_type_to_order_orderby( $type = '' ) { @@ -1037,64 +1063,28 @@ class BP_Groups_Group { 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. + * @since 1.6.0 + * + * @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. + * 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 ) { @@ -1144,24 +1134,63 @@ class BP_Groups_Group { return array( 'groups' => $paged_groups, 'total' => $total_groups ); } + /** + * Convert the 'orderby' param into a proper SQL term/column. + * + * @since 1.8.0 + * + * @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 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. + * @since 1.6.0 + * + * @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 $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. + * 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 ) { @@ -1214,20 +1243,22 @@ class BP_Groups_Group { /** * 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. + * @since 1.6.0 + * + * @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. + * 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 ) { @@ -1235,7 +1266,7 @@ class BP_Groups_Group { $pag_sql = $hidden_sql = $exclude_sql = ''; - // Multibyte compliance + // Multibyte compliance. if ( function_exists( 'mb_strlen' ) ) { if ( mb_strlen( $letter, 'UTF-8' ) > 1 || is_numeric( $letter ) || !$letter ) { return false; @@ -1281,23 +1312,25 @@ class BP_Groups_Group { * * 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. + * @since 1.6.0 + * + * @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. + * 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 ) { @@ -1350,14 +1383,15 @@ class BP_Groups_Group { * $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. + * @since 1.6.0 + * + * @param array $paged_groups Array of groups. + * @param string|array $group_ids 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 ) { @@ -1368,17 +1402,17 @@ class BP_Groups_Group { $bp = buddypress(); - // Sanitize group IDs + // Sanitize group IDs. $group_ids = implode( ',', wp_parse_id_list( $group_ids ) ); - // Fetch the logged-in user's status within each group + // Fetch the logged-in user's status within each group. if ( is_user_logged_in() ) { $user_status_results = $wpdb->get_results( $wpdb->prepare( "SELECT group_id, is_confirmed, invite_sent FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id IN ( {$group_ids} ) AND is_banned = 0", bp_loggedin_user_id() ) ); } else { $user_status_results = array(); } - // Reindex + // Reindex. $user_status = array(); foreach ( $user_status_results as $user_status_result ) { $user_status[ $user_status_result->group_id ] = $user_status_result; @@ -1390,15 +1424,15 @@ class BP_Groups_Group { if ( isset( $user_status[ $gid ] ) ) { - // is_confirmed means the user is a member + // The is_confirmed means the user is a member. if ( $user_status[ $gid ]->is_confirmed ) { $is_member = '1'; - // invite_sent means the user has been invited + // The invite_sent means the user has been invited. } elseif ( $user_status[ $gid ]->invite_sent ) { $is_invited = '1'; - // User has sent request, but has not been confirmed + // User has sent request, but has not been confirmed. } else { $is_pending = '1'; } @@ -1431,10 +1465,11 @@ class BP_Groups_Group { /** * Delete all invitations to a given group. * - * @param int $group_id ID of the group whose invitations are being - * deleted. + * @since 1.6.0 + * + * @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. + * failure. */ public static function delete_all_invites( $group_id ) { global $wpdb; @@ -1450,6 +1485,8 @@ class BP_Groups_Group { * Will include hidden groups in the count only if * current_user_can( 'bp_moderate' ). * + * @since 1.6.0 + * * @return int Group count. */ public static function get_total_group_count() { @@ -1467,8 +1504,10 @@ class BP_Groups_Group { /** * Get global count of forum topics in public groups (legacy forums). * + * @since 1.6.0 + * * @param string $type Optional. If 'unreplied', count will be limited to - * those topics that have received no replies. + * those topics that have received no replies. * @return int Forum topic count. */ public static function get_global_forum_topic_count( $type ) { @@ -1482,16 +1521,16 @@ class BP_Groups_Group { /** * Filters the portion of the SQL related to global count of forum topics in public groups. * - * https://buddypress.trac.wordpress.org/ticket/4306. + * See https://buddypress.trac.wordpress.org/ticket/4306. * - * @since BuddyPress (1.6.0) + * @since 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 + // Make sure the $extra_sql begins with an AND. if ( 'AND' != substr( trim( strtoupper( $extra_sql ) ), 0, 3 ) ) $extra_sql = ' AND ' . $extra_sql; @@ -1501,6 +1540,8 @@ class BP_Groups_Group { /** * Get the member count for a group. * + * @since 1.6.0 + * * @param int $group_id Group ID. * @return int Count of confirmed members for the group. */ @@ -1513,14 +1554,13 @@ class BP_Groups_Group { } /** - * Get a total count of all topics of a given status, across groups/forums + * Get a total count of all topics of a given status, across groups/forums. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param string $status Which group type to count. 'public', 'private', - * 'hidden', or 'all'. Default: 'public'. + * @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 ) { @@ -1567,7 +1607,7 @@ class BP_Groups_Group { * A bit of a kludge workaround for some issues * with bp_has_groups(). * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @return array */ diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-invite-template.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-invite-template.php new file mode 100644 index 0000000000000000000000000000000000000000..86c7a3c382dc4fa388a2d02f6df80b080f2543eb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-invite-template.php @@ -0,0 +1,270 @@ +<?php +/** + * BuddyPress Groups Invitation template loop class. + * + * @package BuddyPress + * @since 1.1.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Group invitation template loop class. + * + * @since 1.1.0 + */ +class BP_Groups_Invite_Template { + + /** + * @since 1.1.0 + * @var int + */ + public $current_invite = -1; + + /** + * @since 1.1.0 + * @var int + */ + public $invite_count; + + /** + * @since 1.1.0 + * @var array + */ + public $invites; + + /** + * @since 1.1.0 + * @var object + */ + public $invite; + + /** + * @since 1.1.0 + * @var bool + */ + public $in_the_loop; + + /** + * @since 1.1.0 + * @var int + */ + public $pag_page; + + /** + * @since 1.1.0 + * @var int + */ + public $pag_num; + + /** + * @since 1.1.0 + * @var string + */ + public $pag_links; + + /** + * @since 1.1.0 + * @var int + */ + public $total_invite_count; + + /** + * BP_Groups_Invite_Template constructor. + * + * @since 1.5.0 + * + * @param array $args + */ + 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); + + $old_args_keys = array( + 0 => 'user_id', + 1 => 'group_id', + ); + + $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' => 'invitepage', + 'user_id' => bp_loggedin_user_id(), + 'group_id' => bp_get_current_group_id(), + ) ); + + $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'], + 'type' => 'first_joined', + 'per_page' => $this->pag_num, + 'page' => $this->pag_page, + + // These filters ensure we get only pending invites. + 'is_confirmed' => false, + 'inviter_id' => $r['user_id'], + ) ); + + $this->invite_data = $iquery->results; + $this->total_invite_count = $iquery->total_users; + $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( $this->pag_arg, '%#%' ), + 'format' => '', + 'total' => ceil( $this->total_invite_count / $this->pag_num ), + 'current' => $this->pag_page, + 'prev_text' => '←', + 'next_text' => '→', + 'mid_size' => 1, + 'add_args' => array(), + ) ); + } else { + $this->pag_links = ''; + } + } + + /** + * Whether or not there are invites to show. + * + * @since 1.1.0 + * + * @return bool + */ + public function has_invites() { + if ( ! empty( $this->invite_count ) ) { + return true; + } + + return false; + } + + /** + * Increments up to the next invite to show. + * + * @since 1.1.0 + * + * @return object + */ + public function next_invite() { + $this->current_invite++; + $this->invite = $this->invites[ $this->current_invite ]; + + return $this->invite; + } + + /** + * Rewinds to the first invite to show. + * + * @since 1.1.0 + */ + public function rewind_invites() { + $this->current_invite = -1; + if ( $this->invite_count > 0 ) { + $this->invite = $this->invites[0]; + } + } + + /** + * Finishes up the invites to show. + * + * @since 1.1.0 + * + * @return bool + */ + public function invites() { + $tick = intval( $this->current_invite + 1 ); + if ( $tick < $this->invite_count ) { + return true; + } elseif ( $tick == $this->invite_count ) { + + /** + * Fires right before the rewinding of invites list. + * + * @since 1.1.0 + * @since 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(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Sets up the invite to show. + * + * @since 1.1.0 + */ + 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 method previously populated the user object with + // BP_Core_User. We manually configure BP_Core_User data for + // backward compatibility. + if ( bp_is_active( 'xprofile' ) ) { + $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_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; + $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login ); + $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}' title='{$this->invite->user->fullname}'>{$this->invite->user->fullname}</a>"; + $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'active %s', 'buddypress' ) ); + + if ( bp_is_active( 'groups' ) ) { + $total_groups = BP_Groups_Member::total_group_count( $user_id ); + $this->invite->user->total_groups = sprintf( _n( '%d group', '%d groups', $total_groups, 'buddypress' ), $total_groups ); + } + + if ( bp_is_active( 'friends' ) ) { + $this->invite->user->total_friends = BP_Friends_Friendship::total_friend_count( $user_id ); + } + + $this->invite->user->total_blogs = null; + + // 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 1.1.0 + * @since 2.3.0 `$this` parameter added. + * + * @param BP_Groups_Invite_Template $this Instance of the current Invites template. + */ + do_action( 'loop_start', $this ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-list-table.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-list-table.php new file mode 100644 index 0000000000000000000000000000000000000000..d2b860d332244276664dd25884a448732ba8a60b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-list-table.php @@ -0,0 +1,641 @@ +<?php +/** + * BuddyPress Groups admin list table class. + * + * Props to WordPress core for the Comments admin screen, and its contextual + * help text, on which this implementation is heavily based. + * + * @package BuddyPress + * @subpackage Groups + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * List table class for the Groups component admin page. + * + * @since 1.7.0 + */ +class BP_Groups_List_Table extends WP_List_Table { + + /** + * The type of view currently being displayed. + * + * E.g. "All", "Pending", "Approved", "Spam"... + * + * @since 1.7.0 + * @var string + */ + public $view = 'all'; + + /** + * Group counts for each group type. + * + * @since 1.7.0 + * @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 + * + * @since 1.7.0 + */ + public function __construct() { + + // Define singular and plural labels, as well as whether we support AJAX. + parent::__construct( array( + 'ajax' => false, + 'plural' => 'groups', + 'singular' => 'group', + ) ); + } + + /** + * 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 1.7.0 + */ + public function prepare_items() { + global $groups_template; + + $screen = get_current_screen(); + + // Option defaults. + $include_id = false; + $search_terms = false; + + // Set current page. + $page = $this->get_pagenum(); + + // Set per page from the screen options. + $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) ); + + // Sort order. + $order = 'DESC'; + if ( !empty( $_REQUEST['order'] ) ) { + $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC'; + } + + // Order by - default to newest. + $orderby = 'last_activity'; + if ( ! empty( $_REQUEST['orderby'] ) ) { + switch ( $_REQUEST['orderby'] ) { + case 'name' : + $orderby = 'name'; + break; + case 'id' : + $orderby = 'date_created'; + break; + case 'members' : + $orderby = 'total_member_count'; + break; + case 'last_active' : + $orderby = 'last_activity'; + break; + } + } + + // Are we doing a search? + if ( !empty( $_REQUEST['s'] ) ) + $search_terms = $_REQUEST['s']; + + // Check if user has clicked on a specific group (if so, fetch only that group). + if ( !empty( $_REQUEST['gid'] ) ) + $include_id = (int) $_REQUEST['gid']; + + // Set the current view. + if ( isset( $_GET['group_status'] ) && in_array( $_GET['group_status'], array( 'public', 'private', 'hidden' ) ) ) { + $this->view = $_GET['group_status']; + } + + // We'll use the ids of group types for the 'include' param. + $this->group_type_ids = BP_Groups_Group::get_group_type_ids(); + + // Pass a dummy array if there are no groups of this type. + $include = false; + if ( 'all' != $this->view && isset( $this->group_type_ids[ $this->view ] ) ) { + $include = ! empty( $this->group_type_ids[ $this->view ] ) ? $this->group_type_ids[ $this->view ] : array( 0 ); + } + + // Get group type counts for display in the filter tabs. + $this->group_counts = array(); + foreach ( $this->group_type_ids as $group_type => $group_ids ) { + $this->group_counts[ $group_type ] = count( $group_ids ); + } + + // 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 { + $groups_args = array( + 'include' => $include, + 'per_page' => $per_page, + 'page' => $page, + 'orderby' => $orderby, + 'order' => $order + ); + + $groups = array(); + if ( bp_has_groups( $groups_args ) ) { + while ( bp_groups() ) { + bp_the_group(); + $groups[] = (array) $groups_template->group; + } + } + } + + // Set raw data to display. + $this->items = $groups; + + // Store information needed for handling table pagination. + $this->set_pagination_args( array( + 'per_page' => $per_page, + 'total_items' => $groups_template->total_group_count, + 'total_pages' => ceil( $groups_template->total_group_count / $per_page ) + ) ); + } + + /** + * Get an array of all the columns on the page. + * + * @since 1.7.0 + * + * @return array Array of column headers. + */ + public function get_column_info() { + $this->_column_headers = array( + $this->get_columns(), + array(), + $this->get_sortable_columns(), + $this->get_default_primary_column_name(), + ); + + return $this->_column_headers; + } + + /** + * Get name of default primary column + * + * @since 2.3.3 + * + * @return string + */ + protected function get_default_primary_column_name() { + // Comment column is mapped to Group's name. + return 'comment'; + } + + /** + * Display a message on screen when no items are found ("No groups found"). + * + * @since 1.7.0 + */ + public function no_items() { + _e( 'No groups found.', 'buddypress' ); + } + + /** + * Output the Groups data table. + * + * @since 1.7.0 + */ + public function display() { + $this->display_tablenav( 'top' ); ?> + + <h2 class="screen-reader-text"><?php _e( 'Groups list', 'buddypress' ); ?></h2> + + <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> + <thead> + <tr> + <?php $this->print_column_headers(); ?> + </tr> + </thead> + + <tfoot> + <tr> + <?php $this->print_column_headers( false ); ?> + </tr> + </tfoot> + + <tbody id="the-comment-list"> + <?php $this->display_rows_or_placeholder(); ?> + </tbody> + </table> + <?php + + $this->display_tablenav( 'bottom' ); + } + + /** + * Generate content for a single row of the table. + * + * @since 1.7.0 + * + * @param object|array $item The current group item in the loop. + */ + public function single_row( $item = array() ) { + static $even = false; + + $row_classes = array(); + + if ( $even ) { + $row_classes = array( 'even' ); + } else { + $row_classes = array( 'alternate', 'odd' ); + } + + /** + * Filters the classes applied to a single row in the groups list table. + * + * @since 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 ) . '"'; + + echo '<tr' . $row_class . ' id="group-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">'; + echo $this->single_row_columns( $item ); + echo '</tr>'; + + $even = ! $even; + } + + /** + * Get the list of views available on this table (e.g. "all", "public"). + * + * @since 1.7.0 + */ + public function get_views() { + $url_base = bp_get_admin_url( 'admin.php?page=bp-groups' ); ?> + + <h2 class="screen-reader-text"><?php _e( 'Filter groups list', 'buddypress' ); ?></h2> + + <ul class="subsubsub"> + <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 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 + } + + /** + * Get bulk actions for single group row. + * + * @since 1.7.0 + * + * @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 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' ) + ) ); + } + + /** + * Get the table column titles. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @return array Array of column titles. + */ + public function get_columns() { + + /** + * Filters the titles for the columns for the groups list table. + * + * @since 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' ), + 'description' => _x( 'Description', 'Groups admin Group Description column header', 'buddypress' ), + 'status' => _x( 'Status', 'Groups admin Privacy Status column header', 'buddypress' ), + 'members' => _x( '# Members', 'Groups admin Members column header', 'buddypress' ), + 'last_active' => _x( 'Last Active', 'Groups admin Last Active column header', 'buddypress' ) + ) ); + } + + /** + * 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 + * last_active to be desc_first (since you're generally interested in + * the *most* recently active group, not the *least*). But because + * the default sort for the Groups admin screen is DESC by last_active, + * we want the first click on the Last Active column header to switch + * the sort order - ie, to make it ASC. Thus last_active is set to + * $desc_first = false. + * + * @since 1.7.0 + * + * @return array Array of sortable column names. + */ + public function get_sortable_columns() { + return array( + 'gid' => array( 'gid', false ), + 'comment' => array( 'name', false ), + 'members' => array( 'members', false ), + 'last_active' => array( 'last_active', false ), + ); + } + + /** + * Override WP_List_Table::row_actions(). + * + * Basically a duplicate of the row_actions() method, but removes the + * unnecessary <button> addition. + * + * @since 2.3.3 + * @since 2.3.4 Visibility set to public for compatibility with WP < 4.0.0. + * + * @param array $actions The list of actions. + * @param bool $always_visible Whether the actions should be always visible. + * @return string + */ + public function row_actions( $actions, $always_visible = false ) { + $action_count = count( $actions ); + $i = 0; + + if ( !$action_count ) + return ''; + + $out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; + foreach ( $actions as $action => $link ) { + ++$i; + ( $i == $action_count ) ? $sep = '' : $sep = ' | '; + $out .= "<span class='$action'>$link$sep</span>"; + } + $out .= '</div>'; + + return $out; + } + + /** + * Markup for the Checkbox column. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_cb( $item = array() ) { + printf( '<label class="screen-reader-text" for="gid-%1$d">' . __( 'Select group %1$d', 'buddypress' ) . '</label><input type="checkbox" name="gid[]" value="%1$d" id="gid-%1$d" />', $item['id'] ); + } + + /** + * Markup for the Group ID column. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_gid( $item = array() ) { + echo '<strong>' . absint( $item['id'] ) . '</strong>'; + } + + /** + * Name column, and "quick admin" rollover actions. + * + * Called "comment" in the CSS so we can re-use some WP core CSS. + * + * @since 1.7.0 + * + * @see WP_List_Table::single_row_columns() + * + * @param array $item A singular item (one full row). + */ + public function column_comment( $item = array() ) { + + // Preorder items: Edit | Delete | View. + $actions = array( + 'edit' => '', + 'delete' => '', + 'view' => '', + ); + + // We need the group object for some BP functions. + $item_obj = (object) $item; + + // Build actions URLs. + $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&gid=' . $item['id'] ); + $delete_url = wp_nonce_url( $base_url . "&action=delete", 'bp-groups-delete' ); + $edit_url = $base_url . '&action=edit'; + $view_url = bp_get_group_permalink( $item_obj ); + + /** + * Filters the group name for a group's column content. + * + * @since 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. + // Edit. + $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) ); + + // Delete. + $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) ); + + // Visit. + $actions['view'] = sprintf( '<a href="%s">%s</a>', esc_url( $view_url ), __( 'View', 'buddypress' ) ); + + /** + * Filters the actions that will be shown for the column content. + * + * @since 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. + $avatar = ''; + + if ( buddypress()->avatar->show_avatars ) { + $avatar = bp_core_fetch_avatar( array( + 'item_id' => $item['id'], + 'object' => 'group', + 'type' => 'thumb', + 'avatar_dir' => 'group-avatars', + 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $group_name ), + 'width' => '32', + 'height' => '32', + 'title' => $group_name + ) ); + } + + $content = sprintf( '<strong><a href="%s">%s</a></strong>', esc_url( $edit_url ), $group_name ); + + echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions ); + } + + /** + * Markup for the Description column. + * + * @since 1.7.0 + * + * @param array $item Information about the current row. + */ + public function column_description( $item = array() ) { + + /** + * Filters the markup for the Description column. + * + * @since 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 ) ); + } + + /** + * Markup for the Status column. + * + * @since 1.7.0 + * + * @param array $item Information about the current row. + */ + public function column_status( $item = array() ) { + $status = $item['status']; + $status_desc = ''; + + // @todo This should be abstracted out somewhere for the whole + // Groups component. + switch ( $status ) { + case 'public' : + $status_desc = __( 'Public', 'buddypress' ); + break; + case 'private' : + $status_desc = __( 'Private', 'buddypress' ); + break; + case 'hidden' : + $status_desc = __( 'Hidden', 'buddypress' ); + break; + } + + /** + * Filters the markup for the Status column. + * + * @since 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 ) ); + } + + /** + * Markup for the Number of Members column. + * + * @since 1.7.0 + * + * @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 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 ) ); + } + + /** + * Markup for the Last Active column. + * + * @since 1.7.0 + * + * @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 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 custom column. + * + * @since 2.0.0 + * + * @param array $item Information about the current row. + * @param string $column_name 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 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/classes/class-bp-groups-member-suggestions.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-member-suggestions.php index 8f2375d3271e303c78c421622cfc37b1598e3e1d..f008e0c62262997bc7428fb0439fa8f7f33664b8 100644 --- 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 @@ -4,23 +4,23 @@ * * @package BuddyPress * @subpackage GroupsClasses + * @since 2.1.0 */ -// Exit if accessed directly +// 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) + * @since 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 + * @since 2.1.0 * @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. @@ -42,7 +42,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Validate and sanitise the parameters for the suggestion service query. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return true|WP_Error If validation fails, return a WP_Error object. On success, return true (bool). */ @@ -52,7 +52,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Filters the arguments used to validate and sanitize suggestion service query. * - * @since BuddyPress (2.1.0) + * @since 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. @@ -77,7 +77,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Filters the validation results for the suggestion service query. * - * @since BuddyPress (2.1.0) + * @since 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. @@ -88,13 +88,13 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Find and return a list of username suggestions that match the query. * - * @since BuddyPress (2.1.0) + * @since 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 + 'count_total' => '', // Prevents total count. 'populate_extras' => false, 'type' => 'alphabetical', @@ -117,7 +117,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { // Negative Group IDs will restrict the search to members in every other group. } else { $group_query = array( - 'count_total' => '', // Prevents total count + 'count_total' => '', // Prevents total count. 'populate_extras' => false, 'type' => 'alphabetical', @@ -137,7 +137,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Filters the arguments for the user query for the Suggestion API. * - * @since BuddyPress (2.1.0) + * @since 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. @@ -167,7 +167,7 @@ class BP_Groups_Member_Suggestions extends BP_Members_Suggestions { /** * Filters the results of the member suggestions user query. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $results Array of member suggestions. * @param BP_Groups_Member_Suggestions $this Instance of the current suggestion class. 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 index dfd0ab5a271e58177a3a30baee82d341d7983a21..68d315ef6af74234577373e3cdc925eea15183fa 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Groups Classes + * BuddyPress Groups Classes. * * @package BuddyPress * @subpackage GroupsClasses + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -17,7 +18,7 @@ class BP_Groups_Member { /** * ID of the membership. * - * @access public + * @since 1.6.0 * @var int */ var $id; @@ -25,7 +26,7 @@ class BP_Groups_Member { /** * ID of the group associated with the membership. * - * @access public + * @since 1.6.0 * @var int */ var $group_id; @@ -33,7 +34,7 @@ class BP_Groups_Member { /** * ID of the user associated with the membership. * - * @access public + * @since 1.6.0 * @var int */ var $user_id; @@ -41,7 +42,7 @@ class BP_Groups_Member { /** * ID of the user whose invitation initiated the membership. * - * @access public + * @since 1.6.0 * @var int */ var $inviter_id; @@ -49,7 +50,7 @@ class BP_Groups_Member { /** * Whether the member is an admin of the group. * - * @access public + * @since 1.6.0 * @var int */ var $is_admin; @@ -57,7 +58,7 @@ class BP_Groups_Member { /** * Whether the member is a mod of the group. * - * @access public + * @since 1.6.0 * @var int */ var $is_mod; @@ -65,7 +66,7 @@ class BP_Groups_Member { /** * Whether the member is banned from the group. * - * @access public + * @since 1.6.0 * @var int */ var $is_banned; @@ -75,7 +76,7 @@ class BP_Groups_Member { * * Eg, 'Group Admin'. * - * @access public + * @since 1.6.0 * @var int */ var $user_title; @@ -85,7 +86,7 @@ class BP_Groups_Member { * * This value is updated when, eg, invitations are accepted. * - * @access public + * @since 1.6.0 * @var string */ var $date_modified; @@ -93,7 +94,7 @@ class BP_Groups_Member { /** * Whether the membership has been confirmed. * - * @access public + * @since 1.6.0 * @var int */ var $is_confirmed; @@ -104,7 +105,7 @@ class BP_Groups_Member { * In BP core, these are limited to the optional message users can * include when requesting membership to a private group. * - * @access public + * @since 1.6.0 * @var string */ var $comments; @@ -117,7 +118,7 @@ class BP_Groups_Member { * Invites), but the Send button has not been pressed, so the * invitee has not yet been notified. * - * @access public + * @since 1.6.0 * @var int */ var $invite_sent; @@ -125,7 +126,7 @@ class BP_Groups_Member { /** * WP_User object representing the membership's user. * - * @access public + * @since 1.6.0 * @var WP_User */ var $user; @@ -133,17 +134,19 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 + * + * @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 + // 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; @@ -153,7 +156,7 @@ class BP_Groups_Member { } } - // ID is not empty + // ID is not empty. if ( !empty( $id ) ) { $this->id = $id; @@ -165,6 +168,8 @@ class BP_Groups_Member { /** * Populate the object's properties. + * + * @since 1.6.0 */ public function populate() { global $wpdb; @@ -200,6 +205,8 @@ class BP_Groups_Member { /** * Save the membership data to the database. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function save() { @@ -224,16 +231,21 @@ class BP_Groups_Member { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 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 ) ); + // The following properties are required; bail if not met. + if ( empty( $this->user_id ) || empty( $this->group_id ) ) { + return false; + } + 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 + // 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; } @@ -246,10 +258,10 @@ class BP_Groups_Member { $this->id = $wpdb->insert_id; - // Update the user's group count + // Update the user's group count. self::refresh_total_group_count_for_user( $this->user_id ); - // Update the group's member count + // Update the group's member count. self::refresh_total_member_count_for_group( $this->group_id ); /** @@ -257,7 +269,7 @@ class BP_Groups_Member { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Groups_Member $this Current instance of the group membership item has been saved. Passed by reference. */ @@ -269,6 +281,8 @@ class BP_Groups_Member { /** * Promote a member to a new status. * + * @since 1.6.0 + * * @param string $status The new status. 'mod' or 'admin'. * @return bool True on success, false on failure. */ @@ -291,6 +305,8 @@ class BP_Groups_Member { /** * Demote membership to Member status (non-admin, non-mod). * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function demote() { @@ -304,6 +320,8 @@ class BP_Groups_Member { /** * Ban the user from the group. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function ban() { @@ -319,6 +337,8 @@ class BP_Groups_Member { /** * Unban the user from the group. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function unban() { @@ -332,6 +352,8 @@ class BP_Groups_Member { /** * Mark a pending invitation as accepted. + * + * @since 1.6.0 */ public function accept_invite() { $this->inviter_id = 0; @@ -341,6 +363,8 @@ class BP_Groups_Member { /** * Confirm a membership request. + * + * @since 1.6.0 */ public function accept_request() { $this->is_confirmed = 1; @@ -350,6 +374,8 @@ class BP_Groups_Member { /** * Remove the current membership. * + * @since 1.6.0 + * * @return bool True on success, false on failure. */ public function remove() { @@ -358,7 +384,7 @@ class BP_Groups_Member { /** * Fires before a member is removed from a group. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param BP_Groups_Member $this Current group membership object. */ @@ -370,16 +396,16 @@ class BP_Groups_Member { if ( !$result = $wpdb->query( $sql ) ) return false; - // Update the user's group count + // Update the user's group count. self::refresh_total_group_count_for_user( $this->user_id ); - // Update the group's member count + // Update the group's member count. self::refresh_total_member_count_for_group( $this->group_id ); /** * Fires after a member is removed from a group. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param BP_Groups_Member $this Current group membership object. */ @@ -393,7 +419,7 @@ class BP_Groups_Member { /** * Refresh the total_group_count for a user. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param int $user_id ID of the user. * @return bool True on success, false on failure. @@ -405,7 +431,7 @@ class BP_Groups_Member { /** * Refresh the total_member_count for a group. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 * * @param int $group_id ID of the group. * @return bool True on success, false on failure. @@ -417,7 +443,9 @@ class BP_Groups_Member { /** * Delete a membership, based on user + group IDs. * - * @param int $user_id ID of the user. + * @since 1.6.0 + * + * @param int $user_id ID of the user. * @param int $group_id ID of the group. * @return True on success, false on failure. */ @@ -427,7 +455,7 @@ class BP_Groups_Member { /** * Fires before a group membership is deleted. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. @@ -437,16 +465,16 @@ class BP_Groups_Member { $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 + // Update the user's group count. self::refresh_total_group_count_for_user( $user_id ); - // Update the group's member count + // Update the group's member count. self::refresh_total_member_count_for_group( $group_id ); /** * Fires after a member is removed from a group. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $user_id ID of the user. * @param int $group_id ID of the group. @@ -459,14 +487,16 @@ class BP_Groups_Member { /** * 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). + * @since 1.6.0 + * + * @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. + * @type int $total Count of groups matching query. * } */ public static function get_group_ids( $user_id, $limit = false, $page = false ) { @@ -478,7 +508,7 @@ class BP_Groups_Member { $bp = buddypress(); - // If the user is logged in and viewing their own groups, we can show hidden and private groups + // If the user is logged in and viewing their own groups, we can show hidden and private groups. if ( $user_id != bp_loggedin_user_id() ) { $group_sql = $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0{$pag_sql}", $user_id ); $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 ) ); @@ -495,16 +525,18 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 + * + * @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. + * @type int $total Count of groups matching query. * } */ public static function get_recently_joined( $user_id, $limit = false, $page = false, $filter = false ) { @@ -536,16 +568,18 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 + * + * @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. + * @type int $total Count of groups matching query. * } */ public static function get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false ) { @@ -577,16 +611,18 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 + * + * @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. + * @type int $total Count of groups matching query. * } */ public static function get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false ) { @@ -615,9 +651,55 @@ class BP_Groups_Member { return array( 'groups' => $paged_groups, 'total' => $total_groups ); } + /** + * Get the groups of which a specified user is banned from. + * + * @since 2.4.0 + * + * @param int $user_id ID of the user. + * @param int|bool $limit Optional. Max number of results to return. + * Default: false (no limit). + * @param int|bool $page Optional. Page offset of results to return. + * Default: false (no limit). + * @param string|bool $filter Optional. Limit results to groups whose name or + * description field matches search terms. + * @return array { + * @type array $groups Array of groups returned by paginated query. + * @type int $total Count of groups matching query. + * } + */ + public static function get_is_banned_of( $user_id, $limit = false, $page = false, $filter = false ) { + global $wpdb; + + $bp = buddypress(); + + $user_id_sql = $pag_sql = $hidden_sql = $filter_sql = ''; + $user_id_sql = $wpdb->prepare( 'm.user_id = %d', $user_id ); + + if ( $limit && $page ) { + $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit ), intval( $limit ) ); + } + + if ( $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() && ! bp_current_user_can( 'bp_moderate' ) ) { + $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_banned = 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_banned = 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. * + * @since 1.6.0 + * * @param int $user_id Optional. Default: ID of the displayed user. * @return int Group count. */ @@ -630,25 +712,27 @@ class BP_Groups_Member { $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 ) ); + return (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 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 ) ); + return (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.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). + * @since 1.6.0 + * + * @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. + * 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. + * @type int $total Count of groups matching query. * } */ public static function get_invites( $user_id, $limit = false, $page = false, $exclude = false ) { @@ -673,9 +757,9 @@ class BP_Groups_Member { /** * Gets the total group invite count for a user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $user_id The user ID + * @param int $user_id The user ID. * @return int */ public static function get_invite_count_for_user( $user_id = 0 ) { @@ -696,11 +780,12 @@ class BP_Groups_Member { /** * 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'. + * @since 1.6.0 + * + * @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' ) { @@ -721,6 +806,8 @@ class BP_Groups_Member { /** * Delete an invitation, by specifying user ID and group ID. * + * @since 1.6.0 + * * @global WPDB $wpdb * * @param int $user_id ID of the user. @@ -750,7 +837,9 @@ class BP_Groups_Member { /** * Delete an unconfirmed membership request, by user ID and group ID. * - * @param int $user_id ID of the user. + * @since 1.6.0 + * + * @param int $user_id ID of the user. * @param int $group_id ID of the group. * @return int Number of records deleted. */ @@ -762,17 +851,16 @@ class BP_Groups_Member { $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 ) ); + 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. + * @since 1.6.0 * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. * @return mixed */ public static function check_is_admin( $user_id, $group_id ) { @@ -789,11 +877,10 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. * @return mixed */ public static function check_is_mod( $user_id, $group_id ) { @@ -810,11 +897,10 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. * @return mixed */ public static function check_is_member( $user_id, $group_id ) { @@ -831,11 +917,10 @@ class BP_Groups_Member { /** * 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. + * @since 1.6.0 * + * @param int $user_id ID of the user. + * @param int $group_id ID of the group. * @return mixed */ public static function check_is_banned( $user_id, $group_id ) { @@ -852,12 +937,12 @@ class BP_Groups_Member { /** * Is the specified user the creator of the group? * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * - * @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 group if the user is the creator, - * otherwise false. + * otherwise false. */ public static function check_is_creator( $user_id, $group_id ) { global $wpdb; @@ -873,7 +958,9 @@ class BP_Groups_Member { /** * Check whether a user has an outstanding membership request for a given group. * - * @param int $user_id ID of the user. + * @since 1.6.0 + * + * @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. */ @@ -891,7 +978,9 @@ class BP_Groups_Member { /** * Get a list of randomly selected IDs of groups that the member belongs to. * - * @param int $user_id ID of the user. + * @since 1.6.0 + * + * @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. */ @@ -900,7 +989,7 @@ class BP_Groups_Member { $bp = buddypress(); - // If the user is logged in and viewing their random groups, we can show hidden and private groups + // If the user is logged in and viewing their random groups, we can show hidden and private groups. if ( bp_is_my_profile() ) { return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT %d", $user_id, $total_groups ) ); } else { @@ -911,6 +1000,8 @@ class BP_Groups_Member { /** * Get the IDs of all a given group's members. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return array IDs of all group members. */ @@ -925,6 +1016,8 @@ class BP_Groups_Member { /** * Get a list of all a given group's admins. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return array Info about group admins (user_id + date_modified). */ @@ -946,6 +1039,8 @@ class BP_Groups_Member { /** * Get a list of all a given group's moderators. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return array Info about group mods (user_id + date_modified). */ @@ -960,6 +1055,8 @@ class BP_Groups_Member { /** * Get the IDs users with outstanding membership requests to the group. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return array IDs of users with outstanding membership requests. */ @@ -974,15 +1071,14 @@ class BP_Groups_Member { /** * 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 + * @deprecated 1.6.0 * + * @param int $group_id ID of the group being queried for. + * @param bool|int $limit Max amount to return. + * @param bool|int $page Pagination value. + * @param bool $exclude_admins_mods Whether or not to exclude admins and moderators. + * @param bool $exclude_banned Whether or not to exclude banned members. + * @param bool|array $exclude Array of user IDs to exclude. * @return mixed */ public static function get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) { @@ -1015,7 +1111,7 @@ class BP_Groups_Member { /** * Filters the SQL prepared statement used to fetch group members. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value SQL prepared statement for fetching group members. */ @@ -1037,14 +1133,14 @@ class BP_Groups_Member { /** * Filters the SQL prepared statement used to fetch group members total count. * - * @since BuddyPress (1.5.0) + * @since 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 + // Fetch whether or not the user is a friend. foreach ( (array) $members as $user ) $user_ids[] = $user->user_id; @@ -1067,6 +1163,8 @@ class BP_Groups_Member { /** * Delete all memberships for a given group. * + * @since 1.6.0 + * * @param int $group_id ID of the group. * @return int Number of records deleted. */ @@ -1081,10 +1179,9 @@ class BP_Groups_Member { /** * Delete all group membership information for the specified user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id ID of the user. - * * @return mixed */ public static function delete_all_for_user( $user_id ) { @@ -1092,12 +1189,12 @@ class BP_Groups_Member { $bp = buddypress(); - // Get all the group ids for the current user's groups and update counts + // Get all the group ids for the current user's groups and update counts. $group_ids = BP_Groups_Member::get_group_ids( $user_id ); foreach ( $group_ids['groups'] as $group_id ) { groups_update_groupmeta( $group_id, 'total_member_count', groups_get_total_member_count( $group_id ) - 1 ); - // If current user is the creator of a group and is the sole admin, delete that group to avoid counts going out-of-sync + // If current user is the creator of a group and is the sole admin, delete that group to avoid counts going out-of-sync. if ( groups_is_user_admin( $user_id, $group_id ) && count( groups_get_group_admins( $group_id ) ) < 2 && groups_is_user_creator( $user_id, $group_id ) ) groups_delete_group( $group_id ); } diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-membership-requests-template.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-membership-requests-template.php new file mode 100644 index 0000000000000000000000000000000000000000..00148404734b318f1c13cbb6adf1859d7ded58c6 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-membership-requests-template.php @@ -0,0 +1,255 @@ +<?php +/** + * BuddyPress Groups membership request template loop class. + * + * @package BuddyPress + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Membership request template loop class. + * + * @since 1.0.0 + */ +class BP_Groups_Membership_Requests_Template { + + /** + * @since 1.0.0 + * @var int + */ + public $current_request = -1; + + /** + * @since 1.0.0 + * @var int + */ + public $request_count; + + /** + * @since 1.0.0 + * @var array + */ + public $requests; + + /** + * @since 1.0.0 + * @var object + */ + public $request; + + /** + * @sine 1.0.0 + * @var bool + */ + public $in_the_loop; + + /** + * @since 1.0.0 + * @var int + */ + public $pag_page; + + /** + * @since 1.0.0 + * @var int + */ + public $pag_num; + + /** + * @since 1.0.0 + * @var array|string|void + */ + public $pag_links; + + /** + * @since 1.0.0 + * @var int + */ + public $total_request_count; + + /** + * Constructor method. + * + * @since 1.5.0 + * + * @param array $args { + * @type int $group_id ID of the group whose membership requests + * 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) + * } + */ + 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.0.0', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); + + $old_args_keys = array( + 0 => 'group_id', + 1 => 'per_page', + 2 => 'max', + ); + + $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' => 'mrpage', + 'max' => false, + 'type' => 'first_joined', + 'group_id' => bp_get_current_group_id(), + ) ); + + $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'], + 'type' => $r['type'], + 'per_page' => $this->pag_num, + 'page' => $this->pag_page, + + // These filters ensure we only get pending requests. + 'is_confirmed' => false, + 'inviter_id' => 0, + ) ); + + $this->requests = array_values( $mquery->results ); + $this->request_count = count( $this->requests ); + + // Compatibility with legacy format of request data objects. + foreach ( $this->requests as $rk => $rv ) { + // For legacy reasons, the 'id' property of each + // request must match the membership id, not the ID of + // the user (as it's returned by BP_Group_Member_Query). + $this->requests[ $rk ]->user_id = $rv->ID; + $this->requests[ $rk ]->id = $rv->membership_id; + + // Miscellaneous values. + $this->requests[ $rk ]->group_id = $r['group_id']; + } + + if ( empty( $r['max'] ) || ( $r['max'] >= (int) $mquery->total_users ) ) { + $this->total_request_count = (int) $mquery->total_users; + } else { + $this->total_request_count = (int) $r['max']; + } + + if ( empty( $r['max'] ) || ( $r['max'] >= count( $this->requests ) ) ) { + $this->request_count = count( $this->requests ); + } else { + $this->request_count = (int) $r['max']; + } + + $this->pag_links = paginate_links( array( + 'base' => add_query_arg( $this->pag_arg, '%#%' ), + 'format' => '', + 'total' => ceil( $this->total_request_count / $this->pag_num ), + 'current' => $this->pag_page, + 'prev_text' => '←', + 'next_text' => '→', + 'mid_size' => 1, + 'add_args' => array(), + ) ); + } + + /** + * Whether or not there are requests to show. + * + * @since 1.0.0 + * + * @return bool + */ + public function has_requests() { + if ( ! empty( $this->request_count ) ) { + return true; + } + + return false; + } + + /** + * Moves up to the next request. + * + * @since 1.0.0 + * + * @return object + */ + public function next_request() { + $this->current_request++; + $this->request = $this->requests[ $this->current_request ]; + + return $this->request; + } + + /** + * Rewinds the requests to the first in the list. + * + * @since 1.0.0 + */ + public function rewind_requests() { + $this->current_request = -1; + + if ( $this->request_count > 0 ) { + $this->request = $this->requests[0]; + } + } + + /** + * Finishes up the requests to display. + * + * @since 1.0.0 + * + * @return bool + */ + public function requests() { + $tick = intval( $this->current_request + 1 ); + if ( $tick < $this->request_count ) { + return true; + } elseif ( $tick == $this->request_count ) { + + /** + * Fires right before the rewinding of group membership requests list. + * + * @since 1.5.0 + */ + do_action( 'group_request_loop_end' ); + // Do some cleaning up after the loop. + $this->rewind_requests(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Sets up the request to display. + * + * @since 1.0.0 + */ + public function the_request() { + $this->in_the_loop = true; + $this->request = $this->next_request(); + + // Loop has just started. + if ( 0 == $this->current_request ) { + + /** + * Fires if the current group membership request item is the first in the loop. + * + * @since 1.1.0 + */ + do_action( 'group_request_loop_start' ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-template.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-template.php new file mode 100644 index 0000000000000000000000000000000000000000..cf3f4621a527b6d80ca45be862b33b5dcaef198e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-template.php @@ -0,0 +1,397 @@ +<?php +/** + * BuddyPress Groups Template loop class. + * + * @package BuddyPress + * @since 1.2.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main Groups template loop class. + * + * Responsible for loading a group of groups into a loop for display. + * + * @since 1.2.0 + */ +class BP_Groups_Template { + + /** + * The loop iterator. + * + * @var int + * @since 1.2.0 + */ + public $current_group = -1; + + /** + * The number of groups returned by the paged query. + * + * @var int + * @since 1.2.0 + */ + public $group_count; + + /** + * Array of groups located by the query. + * + * @var array + * @since 1.2.0 + */ + public $groups; + + /** + * The group object currently being iterated on. + * + * @var object + * @since 1.2.0 + */ + public $group; + + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + * @since 1.2.0 + */ + public $in_the_loop; + + /** + * The page number being requested. + * + * @var string + * @since 1.2.0 + */ + public $pag_page; + + /** + * The number of items being requested per page. + * + * @var string + * @since 1.2.0 + */ + public $pag_num; + + /** + * An HTML string containing pagination links. + * + * @var string + * @since 1.2.0 + */ + public $pag_links; + + /** + * The total number of groups matching the query parameters. + * + * @var int + * @since 1.2.0 + */ + public $total_group_count; + + /** + * Whether the template loop is for a single group page. + * + * @var bool + * @since 1.2.0 + */ + public $single_group = false; + + /** + * Field to sort by. + * + * @var string + * @since 1.2.0 + */ + public $sort_by; + + /** + * Sort order. + * + * @var string + * @since 1.2.0 + */ + public $order; + + /** + * Constructor method. + * + * @see BP_Groups_Group::get() for an in-depth description of arguments. + * + * @param array $args { + * Array of arguments. Accepts all arguments accepted by + * {@link BP_Groups_Group::get()}. In cases where the default + * values of the params differ, they have been discussed below. + * @type int $per_page Default: 20. + * @type int $page Default: 1. + * } + */ + function __construct( $args = array() ){ + + // 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 => 'user_id', + 1 => 'type', + 2 => 'page', + 3 => 'per_page', + 4 => 'max', + 5 => 'slug', + 6 => 'search_terms', + 7 => 'populate_extras', + 8 => 'include', + 9 => 'exclude', + 10 => 'show_hidden', + 11 => 'page_arg', + ); + + $func_args = func_get_args(); + $args = bp_core_parse_args_array( $old_args_keys, $func_args ); + } + + $defaults = array( + '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_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 ); + } elseif ( 'single-group' == $type ) { + $this->single_group = true; + + if ( groups_get_current_group() ) { + $group = groups_get_current_group(); + + } else { + $group = groups_get_group( array( + 'group_id' => BP_Groups_Group::get_id_from_slug( $r['slug'] ), + 'populate_extras' => $r['populate_extras'], + ) ); + } + + // Backwards compatibility - the 'group_id' variable is not part of the + // BP_Groups_Group object, but we add it here for devs doing checks against it + // + // @see https://buddypress.trac.wordpress.org/changeset/3540 + // + // this is subject to removal in a future release; devs should check against + // $group->id instead. + $group->group_id = $group->id; + + $this->groups = array( $group ); + + } else { + $this->groups = groups_get_groups( array( + 'type' => $type, + 'order' => $order, + 'orderby' => $orderby, + 'per_page' => $this->pag_num, + 'page' => $this->pag_page, + 'user_id' => $user_id, + 'search_terms' => $search_terms, + 'meta_query' => $meta_query, + 'include' => $include, + 'exclude' => $exclude, + 'populate_extras' => $populate_extras, + 'update_meta_cache' => $update_meta_cache, + 'show_hidden' => $show_hidden + ) ); + } + + if ( 'invites' == $type ) { + $this->total_group_count = (int) $this->groups['total']; + $this->group_count = (int) $this->groups['total']; + $this->groups = $this->groups['groups']; + } elseif ( 'single-group' == $type ) { + if ( empty( $group->id ) ) { + $this->total_group_count = 0; + $this->group_count = 0; + } else { + $this->total_group_count = 1; + $this->group_count = 1; + } + } else { + if ( empty( $max ) || $max >= (int) $this->groups['total'] ) { + $this->total_group_count = (int) $this->groups['total']; + } else { + $this->total_group_count = (int) $max; + } + + $this->groups = $this->groups['groups']; + + if ( !empty( $max ) ) { + if ( $max >= count( $this->groups ) ) { + $this->group_count = count( $this->groups ); + } else { + $this->group_count = (int) $max; + } + } else { + $this->group_count = count( $this->groups ); + } + } + + // Build pagination links. + if ( (int) $this->total_group_count && (int) $this->pag_num ) { + $pag_args = array( + $this->pag_arg => '%#%' + ); + + if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { + $base = remove_query_arg( 's', wp_get_referer() ); + } else { + $base = ''; + } + + $add_args = array( + 'num' => $this->pag_num, + 'sortby' => $this->sort_by, + 'order' => $this->order, + ); + + if ( ! empty( $search_terms ) ) { + $query_arg = bp_core_get_component_search_query_arg( 'groups' ); + $add_args[ $query_arg ] = urlencode( $search_terms ); + } + + $this->pag_links = paginate_links( array( + 'base' => add_query_arg( $pag_args, $base ), + 'format' => '', + 'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ), + 'current' => $this->pag_page, + 'prev_text' => _x( '←', 'Group pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Group pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => $add_args, + ) ); + } + } + + /** + * Whether there are groups available in the loop. + * + * @since 1.2.0 + * + * @see bp_has_groups() + * + * @return bool True if there are items in the loop, otherwise false. + */ + function has_groups() { + if ( $this->group_count ) { + return true; + } + + return false; + } + + /** + * Set up the next group and iterate index. + * + * @since 1.2.0 + * + * @return object The next group to iterate over. + */ + function next_group() { + $this->current_group++; + $this->group = $this->groups[$this->current_group]; + + return $this->group; + } + + /** + * Rewind the groups and reset member index. + * + * @since 1.2.0 + */ + function rewind_groups() { + $this->current_group = -1; + if ( $this->group_count > 0 ) { + $this->group = $this->groups[0]; + } + } + + /** + * Whether there are groups left in the loop to iterate over. + * + * This method is used by {@link bp_groups()} as part of the while loop + * that controls iteration inside the groups loop, eg: + * while ( bp_groups() ) { ... + * + * @since 1.2.0 + * + * @see bp_groups() + * + * @return bool True if there are more groups to show, otherwise false. + */ + function groups() { + 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 1.5.0 + */ + do_action('group_loop_end'); + // Do some cleaning up after the loop. + $this->rewind_groups(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current group inside the loop. + * + * Used by {@link bp_the_group()} to set up the current group data + * while looping, so that template tags used during that iteration make + * reference to the current member. + * + * @since 1.2.0 + * + * @see bp_the_group() + */ + function the_group() { + $this->in_the_loop = true; + $this->group = $this->next_group(); + + if ( 0 == $this->current_group ) { + + /** + * Fires if the current group item is the first in the loop. + * + * @since 1.1.0 + */ + do_action( 'group_loop_start' ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-theme-compat.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..cf201933c3c985428268a722bc921d482f094c06 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-theme-compat.php @@ -0,0 +1,263 @@ +<?php +/** + * BuddyPress Groups Theme Compat. + * + * @package BuddyPress + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main theme compat class for BuddyPress Groups. + * + * 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 1.7.0 + */ +class BP_Groups_Theme_Compat { + + /** + * Set up theme compatibility for the Groups component. + * + * @since 1.7.0 + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_group' ) ); + } + + /** + * Are we looking at something that needs group theme compatibility? + * + * @since 1.7.0 + */ + public function is_group() { + + // Bail if not looking at a group. + if ( ! bp_is_groups_component() ) + return; + + // Group Directory. + if ( ! bp_current_action() && ! bp_current_item() ) { + bp_update_is_directory( true, 'groups' ); + + /** + * Fires at the start of the group theme compatibility setup. + * + * @since 1.1.0 + */ + do_action( 'groups_directory_groups_setup' ); + + add_filter( 'bp_get_buddypress_template', array( $this, 'directory_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Creating a group. + } elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) { + add_filter( 'bp_get_buddypress_template', array( $this, 'create_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); + + // Group page. + } elseif ( bp_is_single_item() ) { + add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_content' ) ); + + } + } + + /** Directory *********************************************************/ + + /** + * Add template hierarchy to theme compat for the group directory page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the Groups directory page template hierarchy based on priority. + * + * @since 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' + ) ); + + // Merge new templates with existing stack. + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => bp_get_directory_title( 'groups' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part. + * + * @since 1.7.0 + */ + public function directory_content() { + return bp_buffer_template_part( 'groups/index', null, false ); + } + + /** Create ************************************************************/ + + /** + * Add custom template hierarchy to theme compat for the group create page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 ) { + + /** + * Filters the Groups create page template hierarchy based on priority. + * + * @since 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' + ) ); + + // Merge new templates with existing stack. + // @see bp_get_theme_compat_templates(). + $templates = array_merge( $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with create screen data. + * + * @since 1.7.0 + */ + public function create_dummy_post() { + + $title = _x( 'Groups', 'Group creation page', 'buddypress' ); + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the create screen template part. + * + * @since 1.7.0 + */ + public function create_content() { + return bp_buffer_template_part( 'groups/create', null, false ); + } + + /** Single ************************************************************/ + + /** + * Add custom template hierarchy to theme compat for group pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 some variables we're going to reference in our custom templates. + $group = groups_get_current_group(); + + /** + * Filters the Groups single pages template hierarchy based on priority. + * + * @since 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', + 'groups/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php', + 'groups/single/index-status-' . sanitize_file_name( $group->status ) . '.php', + 'groups/single/index.php' + ) ); + + // Merge new templates with existing stack. + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with single group data. + * + * @since 1.7.0 + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => bp_get_current_group_name(), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the single group template part. + * + * @since 1.7.0 + */ + public function single_content() { + return bp_buffer_template_part( 'groups/single/home', null, false ); + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-widget.php b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..e7ff6e026085b0aa3185ed0f6b52db3cf03dc2f0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/classes/class-bp-groups-widget.php @@ -0,0 +1,221 @@ +<?php +/** + * BuddyPress Groups Widget. + * + * @package BuddyPress + * @subpackage GroupsWidgets + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Groups widget. + * + * @since 1.0.3 + */ +class BP_Groups_Widget extends WP_Widget { + + /** + * Working as a group, we get things done better. + * + * @since 1.0.3 + */ + public function __construct() { + $widget_ops = array( + 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ), + 'classname' => 'widget_bp_groups_widget buddypress widget', + ); + parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops ); + + if ( is_active_widget( false, false, $this->id_base ) && ! is_admin() && ! is_network_admin() ) { + $min = bp_core_get_minified_asset_suffix(); + wp_enqueue_script( 'groups_widget_groups_list-js', buddypress()->plugin_url . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); + } + } + + /** + * Extends our frontend output method. + * + * @since 1.0.3 + * + * @param array $args Array of arguments for the widget. + * @param array $instance Widget instance data. + */ + public function widget( $args, $instance ) { + global $groups_template; + + /** + * Filters the user ID to use with the widget instance. + * + * @since 1.5.0 + * + * @param string $value Empty user ID. + */ + $user_id = apply_filters( 'bp_group_widget_user_id', '0' ); + + extract( $args ); + + if ( empty( $instance['group_default'] ) ) { + $instance['group_default'] = 'popular'; + } + + if ( empty( $instance['title'] ) ) { + $instance['title'] = __( 'Groups', 'buddypress' ); + } + + /** + * Filters the title of the Groups widget. + * + * @since 1.8.0 + * @since 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 ); + + /** + * Filters the separator of the group widget links. + * + * @since 2.4.0 + * + * @param string $separator Separator string. Default '|'. + */ + $separator = apply_filters( 'bp_groups_widget_separator', '|' ); + + echo $before_widget; + + $title = ! empty( $instance['link_title'] ) ? '<a href="' . bp_get_groups_directory_permalink() . '">' . $title . '</a>' : $title; + + echo $before_title . $title . $after_title; + + $max_groups = ! empty( $instance['max_groups'] ) ? (int) $instance['max_groups'] : 5; + + $group_args = array( + 'user_id' => $user_id, + 'type' => $instance['group_default'], + 'per_page' => $max_groups, + 'max' => $max_groups, + ); + + // Back up the global. + $old_groups_template = $groups_template; + + ?> + + <?php if ( bp_has_groups( $group_args ) ) : ?> + <div class="item-options" id="groups-list-options"> + <a href="<?php bp_groups_directory_permalink(); ?>" id="newest-groups"<?php if ( $instance['group_default'] == 'newest' ) : ?> class="selected"<?php endif; ?>><?php _e("Newest", 'buddypress') ?></a> + <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> + <a href="<?php bp_groups_directory_permalink(); ?>" id="recently-active-groups"<?php if ( $instance['group_default'] == 'active' ) : ?> class="selected"<?php endif; ?>><?php _e("Active", 'buddypress') ?></a> + <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> + <a href="<?php bp_groups_directory_permalink(); ?>" id="popular-groups" <?php if ( $instance['group_default'] == 'popular' ) : ?> class="selected"<?php endif; ?>><?php _e("Popular", 'buddypress') ?></a> + </div> + + <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() ?>" title="<?php bp_group_name() ?>"><?php bp_group_avatar_thumb() ?></a> + </div> + + <div class="item"> + <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> + <div class="item-meta"> + <span class="activity"> + <?php + if ( 'newest' == $instance['group_default'] ) { + printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); + } elseif ( 'active' == $instance['group_default'] ) { + printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); + } elseif ( 'popular' == $instance['group_default'] ) { + bp_group_member_count(); + } + ?> + </span> + </div> + </div> + </li> + + <?php endwhile; ?> + </ul> + <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?> + <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $max_groups ); ?>" /> + + <?php else: ?> + + <div class="widget-error"> + <?php _e('There are no groups to display.', 'buddypress') ?> + </div> + + <?php endif; ?> + + <?php echo $after_widget; + + // Restore the global. + $groups_template = $old_groups_template; + } + + /** + * Extends our update method. + * + * @since 1.0.3 + * + * @param array $new_instance New instance data. + * @param array $old_instance Original instance data. + * @return array + */ + public function update( $new_instance, $old_instance ) { + $instance = $old_instance; + + $instance['title'] = strip_tags( $new_instance['title'] ); + $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); + $instance['group_default'] = strip_tags( $new_instance['group_default'] ); + $instance['link_title'] = (bool) $new_instance['link_title']; + + return $instance; + } + + /** + * Extends our form method. + * + * @since 1.0.3 + * + * @param array $instance Current instance. + * @return mixed + */ + public function form( $instance ) { + $defaults = array( + 'title' => __( 'Groups', 'buddypress' ), + 'max_groups' => 5, + 'group_default' => 'active', + 'link_title' => false + ); + $instance = wp_parse_args( (array) $instance, $defaults ); + + $title = strip_tags( $instance['title'] ); + $max_groups = strip_tags( $instance['max_groups'] ); + $group_default = strip_tags( $instance['group_default'] ); + $link_title = (bool) $instance['link_title']; + ?> + + <p><label for="<?php echo $this->get_field_id( '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_id('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" id="<?php echo $this->get_field_id('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p> + + <p><label for="<?php echo $this->get_field_id( 'max_groups' ); ?>"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p> + + <p> + <label for="<?php echo $this->get_field_id( 'group_default' ); ?>"><?php _e('Default groups to show:', 'buddypress'); ?></label> + <select name="<?php echo $this->get_field_name( 'group_default' ); ?>" id="<?php echo $this->get_field_id( 'group_default' ); ?>"> + <option value="newest" <?php selected( $group_default, 'newest' ); ?>><?php _e( 'Newest', 'buddypress' ) ?></option> + <option value="active" <?php selected( $group_default, 'active' ); ?>><?php _e( 'Active', 'buddypress' ) ?></option> + <option value="popular" <?php selected( $group_default, 'popular' ); ?>><?php _e( 'Popular', 'buddypress' ) ?></option> + </select> + </p> + <?php + } +} 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 c07a5b98a23c7e50f90aafe7b0132bacee9cbf5e..31110db86ecba531996293d4dd8b37d751c74ead 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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 680b493696432f48771f10dfacb2dff4cd24babc..b165b6a46a149f67feb73667637e414d6baed1c9 100644 --- a/wp-content/plugins/buddypress/bp-loader.php +++ b/wp-content/plugins/buddypress/bp-loader.php @@ -1,20 +1,21 @@ <?php /** - * The BuddyPress Plugin + * The BuddyPress Plugin. * * BuddyPress is social networking software with a twist from the creators of WordPress. * * @package BuddyPress * @subpackage Main + * @since 1.0.0 */ /** * Plugin Name: BuddyPress * 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. + * Description: BuddyPress helps you build any type of community website using WordPress, with member profiles, activity streams, user groups, messaging, and more. * Author: The BuddyPress Community * Author URI: https://buddypress.org/ - * Version: 2.3.5 + * Version: 2.5.3 * Text Domain: buddypress * Domain Path: /bp-languages/ * License: GPLv2 or later (license.txt) @@ -27,11 +28,11 @@ defined( 'ABSPATH' ) || exit; if ( !class_exists( 'BuddyPress' ) ) : /** - * Main BuddyPress Class + * Main BuddyPress Class. * * Tap tap tap... Is this thing on? * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ class BuddyPress { @@ -112,14 +113,14 @@ class BuddyPress { /** * Main BuddyPress Instance. * - * BuddyPress is great - * Please load it only one time - * For this, we thank you + * BuddyPress is great. + * Please load it only one time. + * For this, we thank you. * * Insures that only one instance of BuddyPress exists in memory at any * one time. Also prevents needing to define globals all over the place. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @static object $instance * @uses BuddyPress::constants() Setup the constants (mostly deprecated). @@ -157,7 +158,7 @@ class BuddyPress { /** * A dummy constructor to prevent BuddyPress from being loaded more than once. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * @see BuddyPress::instance() * @see buddypress() */ @@ -166,49 +167,67 @@ class BuddyPress { /** * A dummy magic method to prevent BuddyPress from being cloned. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'buddypress' ), '1.7' ); } /** * A dummy magic method to prevent BuddyPress from being unserialized. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'buddypress' ), '1.7' ); } /** * Magic method for checking the existence of a certain custom field. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $key Key to check the set status for. + * + * @return bool */ public function __isset( $key ) { return isset( $this->data[$key] ); } /** * Magic method for getting BuddyPress variables. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $key Key to return the value for. + * + * @return mixed */ public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; } /** * Magic method for setting BuddyPress variables. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $key Key to set a value for. + * @param mixed $value Value to set. */ public function __set( $key, $value ) { $this->data[$key] = $value; } /** * Magic method for unsetting BuddyPress variables. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $key Key to unset a value for. */ public function __unset( $key ) { if ( isset( $this->data[$key] ) ) unset( $this->data[$key] ); } /** * Magic method to prevent notices and errors from invalid method calls. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 + * + * @param string $name + * @param array $args + * + * @return null */ public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; } @@ -217,7 +236,7 @@ class BuddyPress { /** * Bootstrap constants. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses is_multisite() * @uses get_current_site() @@ -298,8 +317,7 @@ class BuddyPress { /** * Component global variables. * - * @since BuddyPress (1.6.0) - * @access private + * @since 1.6.0 * * @uses plugin_dir_path() To generate BuddyPress plugin path. * @uses plugin_dir_url() To generate BuddyPress plugin url. @@ -309,24 +327,24 @@ class BuddyPress { /** Versions **********************************************************/ - $this->version = '2.3.5'; - $this->db_version = 10071; + $this->version = '2.5.3'; + $this->db_version = 10469; /** Loading ***********************************************************/ /** * Filters the load_deprecated property value. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param constant BP_IGNORE_DEPRECATED Whether or not to ignore deprecated functionality. + * @const constant BP_IGNORE_DEPRECATED Whether or not to ignore deprecated functionality. */ $this->load_deprecated = ! apply_filters( 'bp_ignore_deprecated', BP_IGNORE_DEPRECATED ); /** Toolbar ***********************************************************/ /** - * @var string The primary toolbar ID + * @var string The primary toolbar ID. */ $this->my_account_menu_id = ''; @@ -346,34 +364,33 @@ class BuddyPress { /** Components ********************************************************/ /** - * @var string Name of the current BuddyPress component (primary) + * @var string Name of the current BuddyPress component (primary). */ $this->current_component = ''; /** - * @var string Name of the current BuddyPress item (secondary) + * @var string Name of the current BuddyPress item (secondary). */ $this->current_item = ''; /** - * @var string Name of the current BuddyPress action (tertiary) + * @var string Name of the current BuddyPress action (tertiary). */ $this->current_action = ''; /** - * @var bool Displaying custom 2nd level navigation menu (I.E a group) + * @var bool Displaying custom 2nd level navigation menu (I.E a group). */ $this->is_single_item = false; /** Root **************************************************************/ - // BuddyPress Root blog ID /** * Filters the BuddyPress Root blog ID. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @param constant BP_ROOT_BLOG BuddyPress Root blog ID. + * @const constant BP_ROOT_BLOG BuddyPress Root blog ID. */ $this->root_blog_id = (int) apply_filters( 'bp_get_root_blog_id', BP_ROOT_BLOG ); @@ -405,6 +422,10 @@ class BuddyPress { $this->current_user = new stdClass(); $this->displayed_user = new stdClass(); + + /** Post types and taxonomies *****************************************/ + $this->email_post_type = apply_filters( 'bp_email_post_type', 'bp-email' ); + $this->email_taxonomy_type = apply_filters( 'bp_email_tax_type', 'bp-email-type' ); } /** @@ -413,7 +434,7 @@ class BuddyPress { * Try to avoid using these. Their values have been moved into variables * in the instance, and have matching functions to get/set their values. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ private function legacy_constants() { @@ -431,8 +452,7 @@ class BuddyPress { /** * Include required files. * - * @since BuddyPress (1.6.0) - * @access private + * @since 1.6.0 * * @uses is_admin() If in WordPress admin, load additional file. */ @@ -451,27 +471,28 @@ class BuddyPress { 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-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' ); + 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' ); + require( $this->plugin_dir . 'bp-core/bp-core-customizer-email.php' ); // Skip or load deprecated content if ( false !== $this->load_deprecated ) { @@ -484,14 +505,15 @@ class BuddyPress { 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' ); + require( $this->plugin_dir . 'bp-core/deprecated/2.4.php' ); + require( $this->plugin_dir . 'bp-core/deprecated/2.5.php' ); } } /** * Set up the default hooks and actions. * - * @since BuddyPress (1.6.0) - * @access private + * @since 1.6.0 * * @uses register_activation_hook() To register the activation hook. * @uses register_deactivation_hook() To register the deactivation hook. @@ -535,7 +557,7 @@ class BuddyPress { * * Includes bbp-core-hooks.php. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param BuddyPress $this. Current BuddyPress instance. Passed by reference. */ @@ -545,7 +567,7 @@ class BuddyPress { /** * Private method to align the active and database versions. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ private function versions() { @@ -582,7 +604,7 @@ class BuddyPress { * Sites using bp-default (or a child theme of bp-default) will * continue to have bp-themes registered as before. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @todo Move bp-default to wordpress.org/extend/themes and remove this. */ @@ -601,7 +623,7 @@ class BuddyPress { * the bp-legacy folders, it's fine to hardcode these here. If at a * later date we need to automate this, an API will need to be built. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function register_theme_packages() { @@ -623,7 +645,7 @@ class BuddyPress { /** * Set up the default BuddyPress theme compatibility location. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ public function setup_theme() { @@ -652,7 +674,7 @@ function buddypress() { } /** - * Hook BuddyPress early onto the 'plugins_loaded' action.. + * Hook BuddyPress early onto the 'plugins_loaded' action. * * This gives all other plugins the chance to load before BuddyPress, to get * their actions, filters, and overrides setup without BuddyPress being in the 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 index 2f9e6d543fcfee78b47c6eccae867635d5a94568..96e339e7aa5f89cd9a6212291c9cc9e6239dd1c8 100644 --- 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 @@ -1,785 +1,19 @@ <?php - /** - * BuddyPress Members List Classes + * BuddyPress Members List Classes. * * @package BuddyPress * @subpackage MembersAdminClasses + * @since 2.3.0 */ -// Exit if accessed directly +// 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 ) { - - // Avoid a notice error appearing since 4.3.0 - if ( isset( $signup_object->id ) ) { - $signup_object->ID = $signup_object->id; - } - - $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 ); - } +if ( class_exists( 'WP_Users_List_Table' ) ) { + require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-list-table.php'; } -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 ) { - - // Avoid a notice error appearing since 4.3.0 - if ( isset( $signup_object->id ) ) { - $signup_object->ID = $signup_object->id; - } - - $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>'; - } - - /** - * Prevents regular users row actions to be output - * - * @since BuddyPress (2.3.3) - * @access protected - * - * @param object $signup_object Signup being acted upon. - * @param string $column_name Current column name. - * @param string $primary Primary column name. - */ - protected function handle_row_actions( $signup_object = null, $column_name = '', $primary = '' ) { - return ''; - } - - /** - * 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 ); - } +if ( class_exists( 'WP_MS_Users_List_Table' ) ) { + require dirname( dirname( __FILE__ ) ) . '/classes/class-bp-members-ms-list-table.php'; } - -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 a1de09cf5081b4daa72406733e45fe34dde6f3b8..7217557c0b2755e8c2cb3a7b18c7cd041e1887b2 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 @@ -1,7 +1,8 @@ /**** BP Members Profile Administration Screens ****/ div#profile-page.wrap form#your-profile { - position:relative; + position: relative; + padding-top: 50px; } div#profile-page.wrap form#your-profile h3:first-of-type { @@ -10,7 +11,7 @@ div#profile-page.wrap form#your-profile h3:first-of-type { div#profile-page.wrap form#your-profile #profile-nav { position: absolute; - top: -3.65em; + top: 0; width: 97%; } 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 baa0bdb205405ece62cfc6a7eefdd7e5d08ccc63..c194e8517ec2b39b16c40c235f2efd4202ddd9f6 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 +1 @@ -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 +div#profile-page.wrap form#your-profile{position:relative;padding-top:50px}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:0;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 c780cf90533284b1f5bd7e45df321543af4ea03f..647e7a480fdf74bad934f4fa1174d6975dbd8e43 100644 --- a/wp-content/plugins/buddypress/bp-members/admin/css/admin.css +++ b/wp-content/plugins/buddypress/bp-members/admin/css/admin.css @@ -1,7 +1,8 @@ /**** BP Members Profile Administration Screens ****/ div#profile-page.wrap form#your-profile { - position:relative; + position: relative; + padding-top: 50px; } div#profile-page.wrap form#your-profile h3:first-of-type { @@ -10,7 +11,7 @@ div#profile-page.wrap form#your-profile h3:first-of-type { div#profile-page.wrap form#your-profile #profile-nav { position: absolute; - top: -3.65em; + top: 0; width: 97%; } 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 d4174e7a016eb208d3f464852d94acacc3f702eb..b1fb6f3884127d727d08a0386c2426386558c3cd 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 +1 @@ -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 +div#profile-page.wrap form#your-profile{position:relative;padding-top:50px}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:0;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.js b/wp-content/plugins/buddypress/bp-members/admin/js/admin.js index 9aed8a8d083af971e3e215a35c359fd8d0c3b928..1f2148673e04f0f1f0785fc369be65a4409d6fbb 100644 --- a/wp-content/plugins/buddypress/bp-members/admin/js/admin.js +++ b/wp-content/plugins/buddypress/bp-members/admin/js/admin.js @@ -29,7 +29,7 @@ * Deselects any select options or input options for the specified field element. * * @param {String} container HTML ID of the field - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ function clear( container ) { container = document.getElementById( container ); 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 190627cc9808956bdc96fe2babc96a38a04a4f8d..2aa60274267f5fd1b2ca09927faaffb1ff839551 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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 a502f6ea2cc6a9a386ae787b86b55307ca22c107..826ad09fa74943b3bb3f117e7ebc8cac7e7f8ae0 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Members Actions + * BuddyPress Members 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 user @@ -9,9 +8,10 @@ * * @package BuddyPress * @subpackage MembersActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -28,27 +28,27 @@ defined( 'ABSPATH' ) || exit; function bp_core_action_set_spammer_status( $user_id = 0 ) { // Only super admins can currently spam users (but they can't spam - // themselves) + // themselves). if ( ! is_super_admin() || bp_is_my_profile() ) { return; } - // Use displayed user if it's not yourself + // Use displayed user if it's not yourself. if ( empty( $user_id ) ) $user_id = bp_displayed_user_id(); if ( bp_is_current_component( 'admin' ) && ( in_array( bp_current_action(), array( 'mark-spammer', 'unmark-spammer' ) ) ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'mark-unmark-spammer' ); - // To spam or not to spam + // To spam or not to spam. $status = bp_is_current_action( 'mark-spammer' ) ? 'spam' : 'ham'; - // The heavy lifting + // The heavy lifting. bp_core_process_spammer_status( $user_id, $status ); - // Add feedback message. @todo - Error reporting + // Add feedback message. @todo - Error reporting. if ( 'spam' == $status ) { bp_core_add_message( __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) ); } else { @@ -59,12 +59,15 @@ function bp_core_action_set_spammer_status( $user_id = 0 ) { $is_spam = 'spam' == $status; do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $is_spam ); - // Redirect back to where we came from + // Redirect back to where we came from. bp_core_redirect( wp_get_referer() ); } } -// Unhooked in BuddyPress (1.6.0) - moved to settings -//add_action( 'bp_actions', 'bp_core_action_set_spammer_status' ); + +/* + * Unhooked in 1.6.0 - moved to settings. + * add_action( 'bp_actions', 'bp_core_action_set_spammer_status' ); + */ /** * Process user deletion requests. @@ -78,7 +81,7 @@ function bp_core_action_delete_user() { if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'delete-user' ); $errors = false; @@ -99,13 +102,16 @@ function bp_core_action_delete_user() { bp_core_redirect( bp_loggedin_user_domain() ); } } -// Unhooked in BuddyPress (1.6.0) - moved to settings -//add_action( 'bp_actions', 'bp_core_action_delete_user' ); + +/* + * Unhooked in 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.0) + * @since 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 index 88715ecba7c8d389f12a621c5498226bf051d525..9ad596c5688ec330c508354d744fdbcded03c909 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-activity.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-activity.php @@ -1,19 +1,19 @@ <?php - /** * BuddyPress Member Activity * * @package BuddyPress * @subpackage MembersActivity + * @since 2.2.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Register the 'new member' activity type. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @uses bp_activity_set_action() * @uses buddypress() @@ -32,7 +32,7 @@ function bp_members_register_activity_actions() { /** * Fires after the default 'new member' activity types are registered. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ do_action( 'bp_members_register_activity_actions' ); } @@ -41,18 +41,17 @@ add_action( 'bp_register_activity_actions', 'bp_members_register_activity_action /** * Format 'new_member' activity actions. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $action Static activity action. * @param object $activity Activity object. - * - * @return string + * @return string $action */ 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 + // 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 ); } @@ -60,7 +59,7 @@ function bp_members_format_activity_action_new_member( $action, $activity ) { /** * Filters the formatted 'new member' activity actions. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $action Static activity action. * @param object $activity Activity object. @@ -72,7 +71,6 @@ function 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 ) { 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 9175086f51fb79420600cb9d349e52e16271fd01..dbc77b5e11f9c2e715a6dabc81e606cddefba648 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-admin.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-admin.php @@ -1,2011 +1,16 @@ <?php - -// Exit if accessed directly -defined( 'ABSPATH' ) || exit; - -if ( !class_exists( 'BP_Members_Admin' ) ) : /** - * Load Members admin area. + * BuddyPress Members Admin * * @package BuddyPress - * @subpackage membersAdministration - * - * @since BuddyPress (2.0.0) + * @subpackage MembersAdmin + * @since 2.0.0 */ -class BP_Members_Admin { - - /** Directory *************************************************************/ - - /** - * Path to the BP Members Admin directory. - * - * @var string $admin_dir - */ - public $admin_dir = ''; - - /** URLs ******************************************************************/ - - /** - * URL to the BP Members Admin directory. - * - * @var string $admin_url - */ - public $admin_url = ''; - - /** - * URL to the BP Members Admin CSS directory. - * - * @var string $css_url - */ - public $css_url = ''; - - /** - * URL to the BP Members Admin JS directory. - * - * @var string - */ - public $js_url = ''; - - /** Other *****************************************************************/ - - /** - * Screen id for edit user's profile page. - * - * @access public - * @var string - */ - public $user_page = ''; - - /** - * Setup BP Members Admin. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @uses buddypress() to get BuddyPress main instance. - */ - public static function register_members_admin() { - if ( ! is_admin() ) { - return; - } - - $bp = buddypress(); - - if ( empty( $bp->members->admin ) ) { - $bp->members->admin = new self; - } - - return $bp->members->admin; - } - - /** - * Constructor method. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function __construct() { - $this->setup_globals(); - $this->setup_actions(); - } - - /** - * Set admin-related globals. - * - * @access private - * @since BuddyPress (2.0.0) - */ - private function setup_globals() { - $bp = buddypress(); - - // Paths and URLs - $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-members/admin' ); // Admin path - $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-members/admin' ); // Admin URL - $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin CSS URL - $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin CSS URL - - // Capability depends on config - $this->capability = bp_core_do_network_admin() ? 'manage_network_users' : 'edit_users'; - - // The Edit Profile Screen id - $this->user_page = ''; - - // The Show Profile Screen id - $this->user_profile = is_network_admin() ? 'users' : 'profile'; - - // The current user id - $this->current_user_id = get_current_user_id(); - - // The user id being edited - $this->user_id = 0; - - // Is a member editing their own profile - $this->is_self_profile = false; - - // The screen ids to load specific css for - $this->screen_id = array(); - - // The stats metabox default position - $this->stats_metabox = new StdClass(); - - // BuddyPress edit user's profile args - $this->edit_profile_args = array( 'page' => 'bp-profile-edit' ); - $this->edit_profile_url = ''; - $this->edit_url = ''; - - // Data specific to signups - $this->users_page = ''; - $this->signups_page = ''; - $this->users_url = bp_get_admin_url( 'users.php' ); - $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users'; - - // Specific config: BuddyPress is not network activated - $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated(); - - // When BuddyPress is not network activated, only Super Admin can moderate signups - if ( ! empty( $this->subsite_activated ) ) { - $this->capability = 'manage_network_users'; - } - } - - /** - * Set admin-related actions and filters. - * - * @access private - * @since BuddyPress (2.0.0) - */ - private function setup_actions() { - - /** Extended Profile **************************************************/ - - // Enqueue all admin JS and CSS - add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); - - // Add some page specific output to the <head> - add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); - - // Add menu item to all users menu - add_action( 'admin_menu', array( $this, 'admin_menus' ), 5 ); - add_action( 'network_admin_menu', array( $this, 'admin_menus' ), 5 ); - add_action( 'user_admin_menu', array( $this, 'user_profile_menu' ), 5 ); - - // Create the Profile Navigation (Profile/Extended Profile) - add_action( 'edit_user_profile', array( $this, 'profile_nav' ), 99, 1 ); - add_action( 'show_user_profile', array( $this, 'profile_nav' ), 99, 1 ); - - // Editing users of a specific site - add_action( "admin_head-site-users.php", array( $this, 'profile_admin_head' ) ); - - // Add a row action to users listing - if ( bp_core_do_network_admin() ) { - add_filter( 'ms_user_row_actions', array( $this, 'row_actions' ), 10, 2 ); - add_action( 'admin_init', array( $this, 'add_edit_profile_url_filter' ) ); - add_action( 'wp_after_admin_bar_render', array( $this, 'remove_edit_profile_url_filter' ) ); - } - - // 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() ) { - - // Filter non multisite user query to remove sign-up users - if ( ! is_multisite() ) { - add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query' ), 10, 1 ); - } - - // Reorganise the views navigation in users.php and signups page - if ( current_user_can( $this->capability ) ) { - add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); - add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); - } - } - } - - /** - * 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. - * - * @since BuddyPress (2.1.0) - * - * @return int - */ - private function get_user_id() { - if ( ! empty( $this->user_id ) ) { - return $this->user_id; - } - - $this->user_id = (int) get_current_user_id(); - - // We'll need a user ID when not on self profile - if ( ! empty( $_GET['user_id'] ) ) { - $this->user_id = (int) $_GET['user_id']; - } - - return $this->user_id; - } - - /** - * Can the current user edit the one displayed. - * - * self profile editing / or bp_moderate check. - * This might be replaced by more granular capabilities - * in the future. - * - * @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; - - // Bail if no user ID was passed - if ( empty( $user_id ) ) { - return $retval; - } - - // Member can edit if they are viewing their own profile - if ( $this->current_user_id === $user_id ) { - $retval = true; - - // Trust the 'bp_moderate' capability - } else { - $retval = bp_current_user_can( 'bp_moderate' ); - } - - return $retval; - } - - /** - * Get admin notice when saving a user or member profile. - * - * @since BuddyPress (2.1.0) - * - * @return array - */ - private function get_user_notice() { - - // Setup empty notice for return value - $notice = array(); - - // Updates - if ( ! empty( $_REQUEST['updated'] ) ) { - switch ( $_REQUEST['updated'] ) { - case 'avatar': - $notice = array( - 'class' => 'updated', - 'message' => __( 'Profile photo was deleted.', 'buddypress' ) - ); - break; - case 'ham' : - $notice = array( - 'class' => 'updated', - 'message' => __( 'User removed as spammer.', 'buddypress' ) - ); - break; - case 'spam' : - $notice = array( - 'class' => 'updated', - 'message' => __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) - ); - break; - case 1 : - $notice = array( - 'class' => 'updated', - 'message' => __( 'Profile updated.', 'buddypress' ) - ); - break; - } - } - - // Errors - if ( ! empty( $_REQUEST['error'] ) ) { - switch ( $_REQUEST['error'] ) { - case 'avatar': - $notice = array( - 'class' => 'error', - 'message' => __( 'There was a problem deleting that profile photo. Please try again.', 'buddypress' ) - ); - break; - case 'ham' : - $notice = array( - 'class' => 'error', - 'message' => __( 'User could not be removed as spammer.', 'buddypress' ) - ); - break; - case 'spam' : - $notice = array( - 'class' => 'error', - 'message' => __( 'User could not be marked as spammer.', 'buddypress' ) - ); - break; - case 1 : - $notice = array( - 'class' => 'error', - 'message' => __( 'An error occurred while trying to update the profile.', 'buddypress' ) - ); - break; - case 2: - $notice = array( - 'class' => 'error', - 'message' => __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ) - ); - break; - case 3: - $notice = array( - 'class' => 'error', - 'message' => __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ) - ); - break; - } - } - - return $notice; - } - - /** - * Create the /user/ admin Profile submenus for all members. - * - * @access public - * @since BuddyPress (2.1.0) - * - * @uses add_submenu_page() To add the Edit Profile page in Profile section. - */ - public function user_profile_menu() { - - // Setup the hooks array - $hooks = array(); - - // Add the faux "Edit Profile" submenu page - $hooks['user'] = $this->user_page = add_submenu_page( - 'profile.php', - __( 'Edit Profile', 'buddypress' ), - __( 'Edit Profile', 'buddypress' ), - 'exist', - 'bp-profile-edit', - array( $this, 'user_admin' ) - ); - - // Setup the screen ID's - $this->screen_id = array( - $this->user_page . '-user', - $this->user_profile . '-user' - ); - - // Loop through new hooks and add method actions - foreach ( $hooks as $key => $hook ) { - add_action( "load-{$hook}", array( $this, $key . '_admin_load' ) ); - } - - // Add the profile_admin_head method to proper admin_head actions - add_action( "admin_head-{$this->user_page}", array( $this, 'profile_admin_head' ) ); - add_action( "admin_head-profile.php", array( $this, 'profile_admin_head' ) ); - } - - /** - * Create the All Users / Profile > Edit Profile and All Users Signups submenus. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @uses add_submenu_page() To add the Edit Profile page in Users/Profile section. - */ - public function admin_menus() { - - // Setup the hooks array - $hooks = array(); - - // Manage user's profile - $hooks['user'] = $this->user_page = add_submenu_page( - $this->user_profile . '.php', - __( 'Edit Profile', 'buddypress' ), - __( 'Edit Profile', 'buddypress' ), - 'read', - 'bp-profile-edit', - array( $this, 'user_admin' ) - ); - - // Only show sign-ups where they belong - if ( ! is_multisite() || is_network_admin() ) { - - // Manage signups - $hooks['signups'] = $this->signups_page = add_users_page( - __( 'Manage Signups', 'buddypress' ), - __( 'Manage Signups', 'buddypress' ), - $this->capability, - 'bp-signups', - array( $this, 'signups_admin' ) - ); - } - - $edit_page = 'user-edit'; - $profile_page = 'profile'; - $this->users_page = 'users'; - - // Self profile check is needed for this pages - $page_head = array( - $edit_page . '.php', - $profile_page . '.php', - $this->user_page, - $this->users_page . '.php', - ); - - // Append '-network' to each array item if in network admin - if ( is_network_admin() ) { - $edit_page .= '-network'; - $profile_page .= '-network'; - $this->user_page .= '-network'; - $this->users_page .= '-network'; - $this->signups_page .= '-network'; - } - - // Setup the screen ID's - $this->screen_id = array( - $edit_page, - $this->user_page, - $profile_page - ); - - // Loop through new hooks and add method actions - foreach ( $hooks as $key => $hook ) { - add_action( "load-{$hook}", array( $this, $key . '_admin_load' ) ); - } - - // Add the profile_admin_head method to proper admin_head actions - foreach ( $page_head as $head ) { - add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) ); - } - } - - /** - * Highlight the Users menu if on Edit Profile and check if on the user's admin profile. - * - * @access public - * @since BuddyPress (2.1.0) - */ - public function profile_admin_head() { - global $submenu_file, $parent_file; - - // Is the user editing their own profile? - if ( is_user_admin() || ( defined( 'IS_PROFILE_PAGE' ) && IS_PROFILE_PAGE ) ) { - $this->is_self_profile = true; - - // Is the user attempting to edit their own profile - } 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 ); - } - - // Force the parent file to users.php to open the correct top level menu - // but only if not editing a site via the network site editing page. - if ( 'sites.php' !== $parent_file ) { - $parent_file = 'users.php'; - $submenu_file = 'users.php'; - } - - // Editing your own profile, so recheck some vars - if ( true === $this->is_self_profile ) { - - // Use profile.php as the edit page - $edit_page = 'profile.php'; - - // Set profile.php as the parent & sub files to correct the menu nav - if ( is_blog_admin() || is_user_admin() ) { - $parent_file = 'profile.php'; - $submenu_file = 'profile.php'; - } - - // Not editing yourself, so use user-edit.php - } else { - $edit_page = 'user-edit.php'; - } - - if ( is_user_admin() ) { - $this->edit_profile_url = add_query_arg( $this->edit_profile_args, user_admin_url( 'profile.php' ) ); - $this->edit_url = user_admin_url( 'profile.php' ); - - } elseif ( is_blog_admin() ) { - $this->edit_profile_url = add_query_arg( $this->edit_profile_args, admin_url( 'users.php' ) ); - $this->edit_url = admin_url( $edit_page ); - - } elseif ( is_network_admin() ) { - $this->edit_profile_url = add_query_arg( $this->edit_profile_args, network_admin_url( 'users.php' ) ); - $this->edit_url = network_admin_url( $edit_page ); - } - } - - /** - * Remove the Edit Profile page. - * - * We add these pages in order to integrate with WP's Users panel, but - * we want them to show up as a row action of the WP panel, not as separate - * subnav items under the Users menu. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function admin_head() { - remove_submenu_page( 'users.php', 'bp-profile-edit' ); - remove_submenu_page( 'profile.php', 'bp-profile-edit' ); - } - - /** Community Profile *****************************************************/ - - /** - * Add some specific styling to the Edit User and Edit User's Profile page. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function enqueue_scripts() { - if ( ! in_array( get_current_screen()->id, $this->screen_id ) ) { - return; - } - - $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() ); - - wp_style_add_data( 'bp-members-css', 'rtl', true ); - if ( $min ) { - wp_style_add_data( 'bp-members-css', 'suffix', $min ); - } - - // 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 ); - } - - /** - * 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 ); - } - - /** - * Create the Profile navigation in Edit User & Edit Profile pages. - * - * @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' ) { - - // Bail if no user ID exists here - if ( empty( $user->ID ) ) { - return; - } - - // 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 { - $query_args = array(); - } - - // Conditionally add a referer if it exists in the existing request - if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { - $query_args['wp_http_referer'] = urlencode( stripslashes_deep( $_REQUEST['wp_http_referer'] ) ); - } - - // Setup the two distinct "edit" URL's - $community_url = add_query_arg( $query_args, $this->edit_profile_url ); - $wordpress_url = add_query_arg( $query_args, $this->edit_url ); - - $bp_active = false; - $wp_active = ' nav-tab-active'; - if ( 'BuddyPress' === $active ) { - $bp_active = ' nav-tab-active'; - $wp_active = false; - } ?> - - <h2 id="profile-nav" class="nav-tab-wrapper"> - <?php - /** - * In configs where BuddyPress is not network activated, as regular - * admins do not have the capacity to edit other users, we must add - * this check. - */ - if ( current_user_can( 'edit_user', $user->ID ) ) : ?> - - <a class="nav-tab<?php echo esc_attr( $wp_active ); ?>" href="<?php echo esc_url( $wordpress_url );?>"><?php _e( 'Profile', 'buddypress' ); ?></a> - - <?php endif; ?> - - <a class="nav-tab<?php echo esc_attr( $bp_active ); ?>" href="<?php echo esc_url( $community_url );?>"><?php _e( 'Extended Profile', 'buddypress' ); ?></a> - </h2> - - <?php - } - - /** - * Set up the user's profile admin page. - * - * Loaded before the page is rendered, this function does all initial - * setup, including: processing form requests, registering contextual - * help, and setting up screen options. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function user_admin_load() { - - // Get the user ID - $user_id = $this->get_user_id(); - - // can current user edit this profile ? - if ( ! $this->member_can_edit( $user_id ) ) { - wp_die( __( 'You cannot edit the requested user.', 'buddypress' ) ); - } - - // Build redirection URL - $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham', 'delete_avatar' ), $_SERVER['REQUEST_URI'] ); - $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; - - if ( ! empty( $_REQUEST['user_status'] ) ) { - $spam = (bool) ( 'spam' === $_REQUEST['user_status'] ); - - if ( $spam !== bp_is_user_spammer( $user_id ) ) { - $doaction = $_REQUEST['user_status']; - } - } - - /** - * 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 ) ); - - /** - * 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 - if ( ! in_array( $doaction, $allowed_actions ) ) { - add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); - - get_current_screen()->add_help_tab( array( - 'id' => 'bp-profile-edit-overview', - 'title' => __( 'Overview', 'buddypress' ), - 'content' => - '<p>' . __( 'This is the admin view of a user's profile.', 'buddypress' ) . '</p>' . - '<p>' . __( 'In the main column, you can edit the fields of the user's extended profile.', 'buddypress' ) . '</p>' . - '<p>' . __( 'In the right-hand column, you can update the user's status, delete the user's avatar, and view recent statistics.', 'buddypress' ) . '</p>' - ) ); - - // Help panel - sidebar links - get_current_screen()->set_help_sidebar( - '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></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. - add_meta_box( - 'submitdiv', - _x( 'Status', 'members user-admin edit screen', 'buddypress' ), - array( $this, 'user_admin_status_metabox' ), - get_current_screen()->id, - 'side', - 'core' - ); - - // In case xprofile is not active - $this->stats_metabox->context = 'normal'; - $this->stats_metabox->priority = 'core'; - - /** - * 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 ) ); - - // If xProfile is inactive, difficult to know what's profile we're on - if ( 'normal' === $this->stats_metabox->context ) { - $display_name = bp_core_get_user_displayname( $user_id ); - } else { - $display_name = __( 'Member', 'buddypress' ); - } - - // User Stat metabox - add_meta_box( - 'bp_members_admin_user_stats', - sprintf( _x( "%s's Stats", 'members user-admin edit screen', 'buddypress' ), $display_name ), - array( $this, 'user_admin_stats_metabox' ), - get_current_screen()->id, - sanitize_key( $this->stats_metabox->context ), - 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' - ); - } - - /** - * 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 JavaScript files - wp_enqueue_script( 'postbox' ); - wp_enqueue_script( 'dashboard' ); - - // Spam or Ham user - } elseif ( in_array( $doaction, array( 'spam', 'ham' ) ) && empty( $this->is_self_profile ) ) { - - check_admin_referer( 'edit-bp-profile_' . $user_id ); - - if ( bp_core_process_spammer_status( $user_id, $doaction ) ) { - $redirect_to = add_query_arg( 'updated', $doaction, $redirect_to ); - } else { - $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - - // Update other stuff once above ones are done - } 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 ); - } - } - - /** - * Display the user's profile. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function user_admin() { - - if ( ! bp_current_user_can( 'bp_moderate' ) && empty( $this->is_self_profile ) ) { - die( '-1' ); - } - - // Get the user ID - $user_id = $this->get_user_id(); - $user = get_user_to_edit( $user_id ); - - // Construct title - if ( true === $this->is_self_profile ) { - $title = __( 'Profile', 'buddypress' ); - } else { - $title = __( 'Edit User', 'buddypress' ); - } - - // Construct URL for form - $request_url = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham' ), $_SERVER['REQUEST_URI'] ); - $form_action_url = add_query_arg( 'action', 'update', $request_url ); - $wp_http_referer = false; - if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { - $wp_http_referer = remove_query_arg( array( 'action', 'updated' ), $_REQUEST['wp_http_referer'] ); - } - - // Prepare notice for admin - $notice = $this->get_user_notice(); - - if ( ! empty( $notice ) ) : ?> - - <div <?php if ( 'updated' === $notice['class'] ) : ?>id="message" <?php endif; ?>class="<?php echo esc_attr( $notice['class'] ); ?>"> - - <p><?php echo esc_html( $notice['message'] ); ?></p> - - <?php if ( !empty( $wp_http_referer ) && ( 'updated' === $notice['class'] ) ) : ?> - - <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php esc_html_e( '← Back to Users', 'buddypress' ); ?></a></p> - - <?php endif; ?> - - </div> - - <?php endif; ?> - - <div class="wrap" id="community-profile-page"> - <?php screen_icon( 'users' ); ?> - <h2><?php echo esc_html( $title ); ?> - - <?php if ( empty( $this->is_self_profile ) ) : ?> - - <?php if ( current_user_can( 'create_users' ) ) : ?> - - <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a> - - <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?> - - <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a> - - <?php endif; ?> - - <?php endif; ?> - </h2> - - <?php if ( ! empty( $user ) ) : - - $this->profile_nav( $user, 'BuddyPress' ); ?> - - <form action="<?php echo esc_url( $form_action_url ); ?>" id="your-profile" 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="postbox-container-1" class="postbox-container"> - <?php do_meta_boxes( get_current_screen()->id, 'side', $user ); ?> - </div> - - <div id="postbox-container-2" class="postbox-container"> - <?php do_meta_boxes( get_current_screen()->id, 'normal', $user ); ?> - <?php do_meta_boxes( get_current_screen()->id, 'advanced', $user ); ?> - </div> - </div><!-- #post-body --> - - </div><!-- #poststuff --> - - <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> - <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> - <?php wp_nonce_field( 'edit-bp-profile_' . $user->ID ); ?> - - </form> - - <?php else : ?> - - <p><?php printf( __( 'No user found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'users.php' ) ) ); ?></p> - - <?php endif; ?> - - </div><!-- .wrap --> - <?php - } - - /** - * Render the Status metabox for user's profile screen. - * - * Actions are: - * - Update profile fields if xProfile component is active - * - Spam/Unspam user - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object to be edited. - */ - public function user_admin_status_metabox( $user = null ) { - - // Bail if no user id or if the user has not activated their account yet - if ( empty( $user->ID ) ) { - return; - } - - // 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/> - - <?php return; - - endif; ?> - - <div class="submitbox" id="submitcomment"> - <div id="minor-publishing"> - <div id="misc-publishing-actions"> - <?php - - // Get the spam status once here to compare against below - $is_spammer = bp_is_user_spammer( $user->ID ); - - /** - * In configs where BuddyPress is not network activated, - * regular admins cannot mark a user as a spammer on front - * end. This prevent them to do it in backend. - * - * Also prevent admins from marking themselves or other - * admins as spammers. - */ - if ( ( empty( $this->is_self_profile ) && ( ! in_array( $user->user_login, get_super_admins() ) ) && empty( $this->subsite_activated ) ) || ( ! empty( $this->subsite_activated ) && current_user_can( 'manage_network_users' ) ) ) : ?> - - <div class="misc-pub-section" id="comment-status-radio"> - <label class="approved"><input type="radio" name="user_status" value="ham" <?php checked( $is_spammer, false ); ?>><?php esc_html_e( 'Active', 'buddypress' ); ?></label><br /> - <label class="spam"><input type="radio" name="user_status" value="spam" <?php checked( $is_spammer, true ); ?>><?php esc_html_e( 'Spammer', 'buddypress' ); ?></label> - </div> - - <?php endif ;?> - - <div class="misc-pub-section curtime misc-pub-section-last"> - <?php - - // translators: Publish box date format, see http://php.net/date - $datef = __( 'M j, Y @ G:i', 'buddypress' ); - $date = date_i18n( $datef, strtotime( $user->user_registered ) ); - ?> - <span id="timestamp"><?php printf( __( 'Registered on: <strong>%1$s</strong>', 'buddypress' ), $date ); ?></span> - </div> - </div> <!-- #misc-publishing-actions --> - - <div class="clear"></div> - </div><!-- #minor-publishing --> - - <div id="major-publishing-actions"> - - <div id="publishing-action"> - <a class="button bp-view-profile" href="<?php echo esc_url( bp_core_get_user_domain( $user->ID ) ); ?>" target="_blank"><?php esc_html_e( 'View Profile', 'buddypress' ); ?></a> - <?php submit_button( esc_html__( 'Update Profile', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?> - </div> - <div class="clear"></div> - </div><!-- #major-publishing-actions --> - </div><!-- #submitcomment --> - - <?php - } - - /** - * Render the fallback metabox in case a user has been marked as a spammer. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object to be edited. - */ - public function user_admin_spammer_metabox( $user = null ) { - ?> - <p><?php printf( __( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) ) ;?></p> - <?php - } - - /** - * Render the Stats metabox to moderate inappropriate images. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object to be edited. - */ - public function user_admin_stats_metabox( $user = null ) { - - // Bail if no user ID - if ( empty( $user->ID ) ) { - return; - } - - // If account is not activated last activity is the time user registered - if ( isset( $user->user_status ) && 2 == $user->user_status ) { - $last_active = $user->user_registered; - - // Account is activated, getting user's last activity - } else { - $last_active = bp_get_user_last_activity( $user->ID ); - } - - $datef = __( 'M j, Y @ G:i', 'buddypress' ); - $date = date_i18n( $datef, strtotime( $last_active ) ); ?> - - <ul> - <li class="bp-members-profile-stats"><?php printf( __( 'Last active: %1$s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></li> - - <?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 ); - } - ?> - </ul> - - <?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|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 ) { - - // Bail if no user ID - if ( empty( $user->ID ) ) { - return; - } - - // Setup args array - $args = array(); - - // Add the user ID if it's not for the current user - if ( $user->ID !== $this->current_user_id ) { - $args['user_id'] = $user->ID; - } - - // Add the referer - $args['wp_http_referer'] = urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ); - - // Add the "Extended" link if the current user can edit this user - if ( current_user_can( 'edit_user', $user->ID ) || bp_current_user_can( 'bp_moderate' ) ) { - - // Add query args and setup the Extended link - $edit_profile = add_query_arg( $args, $this->edit_profile_url ); - $edit_profile_link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $edit_profile ), esc_html__( 'Extended', 'buddypress' ) ); - - /** - * Check the edit action is available - * and preserve the order edit | profile | remove/delete - */ - if ( ! empty( $actions['edit'] ) ) { - $edit_action = $actions['edit']; - unset( $actions['edit'] ); - - $new_edit_actions = array( - 'edit' => $edit_action, - 'edit-profile' => $edit_profile_link, - ); - - // If not available simply add the edit profile action - } else { - $new_edit_actions = array( 'edit-profile' => $edit_profile_link ); - } - - $actions = array_merge( $new_edit_actions, $actions ); - } - - return $actions; - } - - /** - * Add a filter to edit profile url in WP Admin Bar. - * - * @access public - * @since BuddyPress (2.1.0) - */ - public function add_edit_profile_url_filter() { - add_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10, 3 ); - } - - /** - * 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() ) { - $profile_link = user_admin_url( 'profile.php' ); - } - return $profile_link; - } - - /** - * Remove the filter to edit profile url in WP Admin Bar. - * - * @access public - * @since BuddyPress (2.1.0) - */ - public function remove_edit_profile_url_filter() { - remove_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10, 3 ); - } - - /** Signups Management ****************************************************/ - - /** - * Display the admin preferences about signups pagination. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @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 ) { - return $value; - } - - // Per page - $new_value = (int) $new_value; - if ( $new_value < 1 || $new_value > 999 ) { - return $value; - } - - return $new_value; - } - - /** - * Make sure no signups will show in users list. - * - * This is needed to handle signups that may have not been activated - * before the 2.0.0 upgrade. - * - * @since BuddyPress (2.0.0) - * - * @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 ) { - global $wpdb; - - // Bail if this is an ajax request - if ( defined( 'DOING_AJAX' ) ) { - return; - } - - // Bail if updating BuddyPress - if ( bp_is_update() ) { - return; - } - - // Bail if there is no current admin screen - if ( ! function_exists( 'get_current_screen' ) || ! get_current_screen() ) { - return; - } - - // Get current screen - $current_screen = get_current_screen(); - - // Bail if not on a users page - if ( ! isset( $current_screen->id ) || $this->users_page !== $current_screen->id ) { - return; - } - - // Bail if already querying by an existing role - if ( ! empty( $query->query_vars['role'] ) ) { - return; - } - - $query->query_where .= " AND {$wpdb->users}.user_status != 2"; - } - - /** - * Filter the WP Users List Table views to include 'bp-signups'. - * - * @since BuddyPress (2.0.0) - * - * @param array $views WP List Table views. - * - * @return array The views with the signup view added. - */ - public function signup_filter_view( $views = array() ) { - - // Remove the 'current' class from All if we're on the signups view - if ( $this->signups_page == get_current_screen()->id ) { - $views['all'] = str_replace( 'class="current"', '', $views['all'] ); - $class = 'current'; - } else { - $class = ''; - } - - $signups = BP_Signup::count_signups(); - $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>', esc_url( $url ), $class, $text ); - - return $views; - } - - /** - * Load the Signup WP Users List table. - * - * @since BuddyPress (2.0.0) - * - * @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 = '' ) { - if ( empty( $class ) ) { - return; - } - - if ( ! empty( $required ) ) { - require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' ); - require_once( buddypress()->members->admin->admin_dir . 'bp-members-admin-classes.php' ); - } - - return new $class(); - } - - /** - * Set up the signups admin page. - * - * Loaded before the page is rendered, this function does all initial - * setup, including: processing form requests, registering contextual - * help, and setting up screen options. - * - * @since BuddyPress (2.0.0) - * - * @global $bp_members_signup_list_table - */ - public function signups_admin_load() { - global $bp_members_signup_list_table; - - // Build redirection URL - $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(); - - /** - * 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 ); - - /** - * 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 - if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) { - - if ( bp_core_do_network_admin() ) { - $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_MS_List_Table', 'ms-users' ); - } else { - $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_List_Table', 'users' ); - } - - // per_page screen option - add_screen_option( 'per_page', array( 'label' => _x( 'Pending Accounts', 'Pending Accounts per page (screen options)', 'buddypress' ) ) ); - - get_current_screen()->add_help_tab( array( - 'id' => 'bp-signups-overview', - 'title' => __( 'Overview', 'buddypress' ), - 'content' => - '<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>' - ) ); - - get_current_screen()->add_help_tab( array( - 'id' => 'bp-signups-actions', - 'title' => __( 'Actions', 'buddypress' ), - 'content' => - '<p>' . __( '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:', 'buddypress' ) . '</p>' . - '<ul><li>' . __( '"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.', 'buddypress' ) . '</li>' . - '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' . - '<p>' . __( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . - '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>' - ) ); - - // Help panel - sidebar links - get_current_screen()->set_help_sidebar( - '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . - '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' - ); - } else { - if ( ! empty( $_REQUEST['signup_ids' ] ) ) { - $signups = wp_parse_id_list( $_REQUEST['signup_ids' ] ); - } - - // Handle resent activation links - if ( 'do_resend' == $doaction ) { - - // nonce check - check_admin_referer( 'signups_resend' ); - - $resent = BP_Signup::resend( $signups ); - - if ( empty( $resent ) ) { - $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); - } else { - $query_arg = array( 'updated' => 'resent' ); - - if ( ! empty( $resent['resent'] ) ) { - $query_arg['resent'] = count( $resent['resent'] ); - } - - if ( ! empty( $resent['errors'] ) ) { - $query_arg['notsent'] = count( $resent['errors'] ); - set_transient( '_bp_admin_signups_errors', $resent['errors'], 30 ); - } - - $redirect_to = add_query_arg( $query_arg, $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - - // Handle activated accounts - } elseif ( 'do_activate' == $doaction ) { - - // nonce check - check_admin_referer( 'signups_activate' ); - - $activated = BP_Signup::activate( $signups ); - - if ( empty( $activated ) ) { - $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); - } else { - $query_arg = array( 'updated' => 'activated' ); - - if ( ! empty( $activated['activated'] ) ) { - $query_arg['activated'] = count( $activated['activated'] ); - } - - if ( ! empty( $activated['errors'] ) ) { - $query_arg['notactivated'] = count( $activated['errors'] ); - set_transient( '_bp_admin_signups_errors', $activated['errors'], 30 ); - } - - $redirect_to = add_query_arg( $query_arg, $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - - // Handle sign-ups delete - } elseif ( 'do_delete' == $doaction ) { - - // nonce check - check_admin_referer( 'signups_delete' ); - - $deleted = BP_Signup::delete( $signups ); - - if ( empty( $deleted ) ) { - $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); - } else { - $query_arg = array( 'updated' => 'deleted' ); - - if ( ! empty( $deleted['deleted'] ) ) { - $query_arg['deleted'] = count( $deleted['deleted'] ); - } - - if ( ! empty( $deleted['errors'] ) ) { - $query_arg['notdeleted'] = count( $deleted['errors'] ); - set_transient( '_bp_admin_signups_errors', $deleted['errors'], 30 ); - } - - $redirect_to = add_query_arg( $query_arg, $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - - // Plugins can update other stuff from here - } 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 ); - } - } - } - - /** - * Display any activation errors. - * - * @since BuddyPress (2.0.0) - */ - public function signups_display_errors() { - - // Look for sign-up errors - $errors = get_transient( '_bp_admin_signups_errors' ); - - // Bail if no activation errors - if ( empty( $errors ) ) { - return; - } - - // Loop through errors and display them - foreach ( $errors as $error ) : ?> - - <li><?php echo esc_html( $error[0] );?>: <?php echo esc_html( $error[1] );?></li> - - <?php endforeach; - - // Delete the redirect transient - delete_transient( '_bp_admin_signups_errors' ); - } - - /** - * Get admin notice when viewing the sign-up page. - * - * @since BuddyPress (2.1.0) - * - * @return array - */ - private function get_signup_notice() { - - // Setup empty notice for return value - $notice = array(); - - // Updates - if ( ! empty( $_REQUEST['updated'] ) ) { - switch ( $_REQUEST['updated'] ) { - case 'resent': - $notice = array( - 'class' => 'updated', - 'message' => '' - ); - - if ( ! empty( $_REQUEST['resent'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s activation email successfully sent! ', '%s activation emails successfully sent! ', - absint( $_REQUEST['resent'] ), - 'signup resent', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['resent'] ) ) - ); - } - - if ( ! empty( $_REQUEST['notsent'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s activation email was not sent.', '%s activation emails were not sent.', - absint( $_REQUEST['notsent'] ), - 'signup notsent', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['notsent'] ) ) - ); - - if ( empty( $_REQUEST['resent'] ) ) { - $notice['class'] = 'error'; - } - } - - break; - - case 'activated': - $notice = array( - 'class' => 'updated', - 'message' => '' - ); - - if ( ! empty( $_REQUEST['activated'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s account successfully activated! ', '%s accounts successfully activated! ', - absint( $_REQUEST['activated'] ), - 'signup resent', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['activated'] ) ) - ); - } - - if ( ! empty( $_REQUEST['notactivated'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s account was not activated.', '%s accounts were not activated.', - absint( $_REQUEST['notactivated'] ), - 'signup notsent', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['notactivated'] ) ) - ); - - if ( empty( $_REQUEST['activated'] ) ) { - $notice['class'] = 'error'; - } - } - - break; - - case 'deleted': - $notice = array( - 'class' => 'updated', - 'message' => '' - ); - - if ( ! empty( $_REQUEST['deleted'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s sign-up successfully deleted!', '%s sign-ups successfully deleted!', - absint( $_REQUEST['deleted'] ), - 'signup deleted', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['deleted'] ) ) - ); - } - - if ( ! empty( $_REQUEST['notdeleted'] ) ) { - $notice['message'] .= sprintf( - _nx( '%s sign-up was not deleted.', '%s sign-ups were not deleted.', - absint( $_REQUEST['notdeleted'] ), - 'signup notdeleted', - 'buddypress' - ), - number_format_i18n( absint( $_REQUEST['notdeleted'] ) ) - ); - - if ( empty( $_REQUEST['deleted'] ) ) { - $notice['class'] = 'error'; - } - } - - break; - } - } - - // Errors - if ( ! empty( $_REQUEST['error'] ) ) { - switch ( $_REQUEST['error'] ) { - case 'do_resend': - $notice = array( - 'class' => 'error', - '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' ), - ); - break; - - case 'do_delete': - $notice = array( - 'class' => 'error', - 'message' => esc_html__( 'There was a problem deleting sign-ups. Please try again.', 'buddypress' ), - ); - break; - } - } - - return $notice; - } - - /** - * 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. - * - * Also prepare the admin notices. - * - * @since BuddyPress (2.0.0) - */ - public function signups_admin() { - $doaction = bp_admin_list_table_current_bulk_action(); - - // Prepare notices for admin - $notice = $this->get_signup_notice(); - - // Display notices - if ( ! empty( $notice ) ) : - if ( 'updated' === $notice['class'] ) : ?> - - <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?>"> - - <?php else: ?> - - <div class="<?php echo esc_attr( $notice['class'] ); ?>"> - - <?php endif; ?> - - <p><?php echo $notice['message']; ?></p> - - <?php if ( ! empty( $_REQUEST['notactivated'] ) || ! empty( $_REQUEST['notdeleted'] ) || ! empty( $_REQUEST['notsent'] ) ) :?> - - <ul><?php $this->signups_display_errors();?></ul> - - <?php endif ;?> - - </div> - - <?php endif; - - // Show the proper screen - switch ( $doaction ) { - case 'activate' : - case 'delete' : - case 'resend' : - $this->signups_admin_manage( $doaction ); - break; - - default: - $this->signups_admin_index(); - break; - - } - } - - /** - * This is the list of the Pending accounts (signups). - * - * @since BuddyPress (2.0.0) - * - * @global $plugin_page - * @global $bp_members_signup_list_table - */ - public function signups_admin_index() { - global $plugin_page, $bp_members_signup_list_table; - - $usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; - - // Prepare the group items for display - $bp_members_signup_list_table->prepare_items(); - - $form_url = add_query_arg( - array( - 'page' => 'bp-signups', - ), - bp_get_admin_url( 'users.php' ) - ); - - $search_form_url = remove_query_arg( - array( - 'action', - 'deleted', - 'notdeleted', - 'error', - 'updated', - 'delete', - 'activate', - 'activated', - 'notactivated', - 'resend', - 'resent', - 'notresent', - 'do_delete', - 'do_activate', - 'do_resend', - 'action2', - '_wpnonce', - 'signup_ids' - ), $_SERVER['REQUEST_URI'] - ); - - ?> - - <div class="wrap"> - <?php screen_icon( 'users' ); ?> - <h2><?php _e( 'Users', 'buddypress' ); ?> - - <?php if ( current_user_can( 'create_users' ) ) : ?> - - <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a> - - <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?> - - <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a> - - <?php endif; - - if ( $usersearch ) { - printf( '<span class="subtitle">' . __( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) ); - } - - ?> - </h2> - - <?php // Display each signups on its own row ?> - <?php $bp_members_signup_list_table->views(); ?> - - <form id="bp-signups-search-form" action="<?php echo esc_url( $search_form_url ) ;?>"> - <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" /> - <?php $bp_members_signup_list_table->search_box( __( 'Search Pending Users', 'buddypress' ), 'bp-signups' ); ?> - </form> - - <form id="bp-signups-form" action="<?php echo esc_url( $form_url );?>" method="post"> - <?php $bp_members_signup_list_table->display(); ?> - </form> - </div> - <?php - } - - /** - * This is the confirmation screen for actions. - * - * @since BuddyPress (2.0.0) - * - * @param string $action Delete, activate, or resend activation link. - * - * @return string - */ - public function signups_admin_manage( $action = '' ) { - if ( ! current_user_can( $this->capability ) || empty( $action ) ) { - die( '-1' ); - } - - // Get the user IDs from the URL - $ids = false; - if ( ! empty( $_POST['allsignups'] ) ) { - $ids = wp_parse_id_list( $_POST['allsignups'] ); - } elseif ( ! empty( $_GET['signup_id'] ) ) { - $ids = absint( $_GET['signup_id'] ); - } - - if ( empty( $ids ) ) { - return false; - } - - // Query for signups, and filter out those IDs that don't - // correspond to an actual signup - $signups_query = BP_Signup::get( array( - 'include' => $ids, - ) ); - - $signups = $signups_query['signups']; - $signup_ids = wp_list_pluck( $signups, 'signup_id' ); - - // Set up strings - switch ( $action ) { - case 'delete' : - $header_text = __( 'Delete Pending Accounts', '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' ); - 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' ); - 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; - } - - // These arguments are added to all URLs - $url_args = array( 'page' => 'bp-signups' ); - - // These arguments are only added when performing an action - $action_args = array( - 'action' => 'do_' . $action, - 'signup_ids' => implode( ',', $signup_ids ) - ); - - $cancel_url = add_query_arg( $url_args, bp_get_admin_url( 'users.php' ) ); - $action_url = wp_nonce_url( - add_query_arg( - array_merge( $url_args, $action_args ), - bp_get_admin_url( 'users.php' ) - ), - 'signups_' . $action - ); - - ?> - - <div class="wrap"> - <?php screen_icon( 'users' ); ?> - <h2><?php echo esc_html( $header_text ); ?></h2> - <p><?php echo esc_html( $helper_text ); ?></p> - - <ol class="bp-signups-list"> - <?php foreach ( $signups as $signup ) : - - $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); ?> - - <li> - <?php echo esc_html( $signup->user_name ) ?> - <?php echo sanitize_email( $signup->user_email );?> - - <?php if ( 'resend' == $action ) : ?> - - <p class="description"> - <?php printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified ) ;?> - - <?php if ( ! empty( $signup->recently_sent ) ) : ?> - - <span class="attention wp-ui-text-notification"> <?php esc_html_e( '(less than 24 hours ago)', 'buddypress' ); ?></span> - - <?php endif; ?> - </p> - - <?php endif; ?> - - </li> - - <?php endforeach; ?> - </ol> - - <?php if ( 'delete' === $action ) : ?> - - <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p> - - <?php endif ; ?> - - <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>"><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a> - <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a> - </div> +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; - <?php - } -} -endif; // class_exists check +require dirname( __FILE__ ) . '/classes/class-bp-members-admin.php'; -// Load the BP Members admin +// Load the BP Members admin. add_action( 'bp_init', array( 'BP_Members_Admin', 'register_members_admin' ) ); 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 edd47e476b821b7af98078090c1259add2e77fff..48a9361d0c18c57394a2e31e1d2d9271141f2116 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Members Toolbar. * @@ -7,34 +6,35 @@ * * @package BuddyPress * @subpackage MembersAdminBar + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Add the "My Account" menu and all submenus. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support + * @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support. */ function bp_members_admin_bar_my_account_menu() { global $wp_admin_bar; - // Bail if this is an ajax request + // Bail if this is an ajax request. if ( defined( 'DOING_AJAX' ) ) return; - // Logged in user + // Logged in user. if ( is_user_logged_in() ) { $bp = buddypress(); - // Stored in the global so we can add menus easily later on + // Stored in the global so we can add menus easily later on. $bp->my_account_menu_id = 'my-account-buddypress'; - // Create the main 'My Account' menu + // Create the main 'My Account' menu. $wp_admin_bar->add_menu( array( 'id' => $bp->my_account_menu_id, 'group' => true, @@ -44,19 +44,19 @@ function bp_members_admin_bar_my_account_menu() { 'class' => 'ab-sub-secondary' ) ) ); - // Show login and sign-up links + // Show login and sign-up links. } elseif ( !empty( $wp_admin_bar ) ) { add_filter ( 'show_admin_bar', '__return_true' ); - // Create the main 'My Account' menu + // Create the main 'My Account' menu. $wp_admin_bar->add_menu( array( 'id' => 'bp-login', 'title' => __( 'Log in', 'buddypress' ), 'href' => wp_login_url( bp_get_requested_url() ) ) ); - // Sign up + // Sign up. if ( bp_get_signup_allowed() ) { $wp_admin_bar->add_menu( array( 'id' => 'bp-register', @@ -71,25 +71,25 @@ add_action( 'bp_setup_admin_bar', 'bp_members_admin_bar_my_account_menu', 4 ); /** * Add the User Admin top-level menu to user pages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_members_admin_bar_user_admin_menu() { global $wp_admin_bar; - // Only show if viewing a user + // Only show if viewing a user. if ( !bp_is_user() ) return false; - // Don't show this menu to non site admins or if you're viewing your own profile + // 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; $bp = buddypress(); - // Unique ID for the 'My Account' menu + // Unique ID for the 'My Account' menu. $bp->user_admin_menu_id = 'user-admin'; - // Add the top-level User Admin button + // Add the top-level User Admin button. $wp_admin_bar->add_menu( array( 'id' => $bp->user_admin_menu_id, 'title' => __( 'Edit Member', 'buddypress' ), @@ -97,7 +97,7 @@ function bp_members_admin_bar_user_admin_menu() { ) ); if ( bp_is_active( 'xprofile' ) ) { - // User Admin > Edit this user's profile + // User Admin > Edit this user's profile. $wp_admin_bar->add_menu( array( 'parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-edit-profile', @@ -105,7 +105,7 @@ function bp_members_admin_bar_user_admin_menu() { 'href' => bp_get_members_component_link( 'profile', 'edit' ) ) ); - // User Admin > Edit this user's avatar + // User Admin > Edit this user's avatar. if ( buddypress()->avatar->show_avatars ) { $wp_admin_bar->add_menu( array( 'parent' => $bp->user_admin_menu_id, @@ -115,10 +115,20 @@ function bp_members_admin_bar_user_admin_menu() { ) ); } + // User Admin > Edit this user's cover image. + if ( bp_displayed_user_use_cover_image_header() ) { + $wp_admin_bar->add_menu( array( + 'parent' => $bp->user_admin_menu_id, + 'id' => $bp->user_admin_menu_id . '-change-cover-image', + 'title' => __( 'Edit Cover Image', 'buddypress' ), + 'href' => bp_get_members_component_link( 'profile', 'change-cover-image' ) + ) ); + } + } if ( bp_is_active( 'settings' ) ) { - // User Admin > Spam/unspam + // User Admin > Spam/unspam. $wp_admin_bar->add_menu( array( 'parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-user-capabilities', @@ -126,7 +136,7 @@ function bp_members_admin_bar_user_admin_menu() { 'href' => bp_displayed_user_domain() . 'settings/capabilities/' ) ); - // User Admin > Delete Account + // User Admin > Delete Account. $wp_admin_bar->add_menu( array( 'parent' => $bp->user_admin_menu_id, 'id' => $bp->user_admin_menu_id . '-delete-user', @@ -142,11 +152,13 @@ add_action( 'admin_bar_menu', 'bp_members_admin_bar_user_admin_menu', 99 ); /** * Build the "Notifications" dropdown. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * + * @return bool */ function bp_members_admin_bar_notifications_menu() { - // Bail if notifications is not active + // Bail if notifications is not active. if ( ! bp_is_active( 'notifications' ) ) { return false; } @@ -158,7 +170,7 @@ add_action( 'admin_bar_menu', 'bp_members_admin_bar_notifications_menu', 90 ); /** * Remove rogue WP core Edit menu when viewing a single user. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_members_remove_edit_page_menu() { if ( bp_is_user() ) { diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-cache.php b/wp-content/plugins/buddypress/bp-members/bp-members-cache.php index 7bd949c27b785450b81c68fabb880c2a5dfb9772..7bb4a9a653d18ab6bbe90995f9a32c6b9a643038 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-cache.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-cache.php @@ -1,15 +1,19 @@ <?php - /** * Caching functions specific to BuddyPress Members. * - * @since BuddyPress (2.2.0) + * @package BuddyPress + * @subpackage MembersCache + * @since 2.2.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** * Pre-fetch member type data when initializing a Members loop. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_User_Query $bp_user_query BP_User_Query object. */ 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 e281b2d875b9b8f7260e24e848b33091b0f48cbb..41227024c73060e87a690e0c014b1130b6eb8807 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-classes.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-classes.php @@ -4,9 +4,10 @@ * * @package BuddyPress * @subpackage MembersClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; 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 b4556268e071564e494963ffcca1be90d083ae9c..c76731d74ab26d87ca265ba856fb6b7459fa2a5d 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Members Filters. * @@ -7,9 +6,10 @@ * * @package BuddyPress * @subpackage MembersFilters + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -29,11 +29,11 @@ add_filter( 'register_url', 'bp_get_signup_page' ); * however, it is highly recommended that you leave these in place for the * safety of your network. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_members_signup_sanitization() { - // Filters on sign-up fields + // Filters on sign-up fields. $fields = array ( 'bp_get_signup_username_value', 'bp_get_signup_email_value', @@ -44,14 +44,14 @@ function bp_members_signup_sanitization() { 'bp_get_signup_avatar_dir_value', ); - // Add the filters to each field + // Add the filters to each field. foreach( $fields as $filter ) { add_filter( $filter, 'esc_html', 1 ); add_filter( $filter, 'wp_filter_kses', 2 ); add_filter( $filter, 'stripslashes', 3 ); } - // Sanitize email + // Sanitize email. add_filter( 'bp_get_signup_email_value', 'sanitize_email' ); } add_action( 'bp_loaded', 'bp_members_signup_sanitization' ); @@ -64,10 +64,9 @@ add_action( 'bp_loaded', 'bp_members_signup_sanitization' ); * 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 2.1.0 * + * @param array $illegal_names Array of illiegal names. * @return array $illegal_names */ function bp_members_signup_with_subdirectory_blog( $illegal_names = array() ) { @@ -98,21 +97,20 @@ add_filter( 'subdirectory_reserved_names', 'bp_members_signup_with_subdirectory_ /** * Filter the user profile URL to point to BuddyPress profile edit. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $url WP profile edit URL. * @param int $user_id ID of the user. - * @param string $scheme - * + * @param string $scheme Scheme to use. * @return string */ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) { - // If xprofile is active, use profile domain link + // If xprofile is active, use profile domain link. if ( ! is_admin() && bp_is_active( 'xprofile' ) ) { - $profile_link = trailingslashit( bp_core_get_user_domain( $user_id ) . buddypress()->profile->slug . '/edit' ); + $profile_link = trailingslashit( bp_core_get_user_domain( $user_id ) . bp_get_profile_slug() . '/edit' ); - // Default to $url + // Default to $url. } else { $profile_link = $url; } @@ -120,7 +118,7 @@ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) { /** * Filters the user profile URL to point to BuddyPress profile edit. * - * @since BuddyPress (1.5.2) + * @since 1.5.2 * * @param string $url WP profile edit URL. * @param int $user_id ID of the user. 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 08a0314f49832c3f2d51bd428c826df43d6c7747..bc99698bd60f25bd589172d1bad4e24aca56b916 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Functions. * @@ -7,15 +6,16 @@ * * @package BuddyPress * @subpackage MembersFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Check for the existence of a Members directory page. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return bool True if found, otherwise false. */ @@ -39,7 +39,7 @@ function bp_members_has_directory() { function bp_core_define_slugs() { $bp = buddypress(); - // No custom members slug + // No custom members slug. if ( !defined( 'BP_MEMBERS_SLUG' ) ) { if ( !empty( $bp->pages->members ) ) { define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug ); @@ -48,7 +48,7 @@ function bp_core_define_slugs() { } } - // No custom registration slug + // No custom registration slug. if ( !defined( 'BP_REGISTER_SLUG' ) ) { if ( !empty( $bp->pages->register ) ) { define( 'BP_REGISTER_SLUG', $bp->pages->register->slug ); @@ -57,7 +57,7 @@ function bp_core_define_slugs() { } } - // No custom activation slug + // No custom activation slug. if ( !defined( 'BP_ACTIVATION_SLUG' ) ) { if ( !empty( $bp->pages->activate ) ) { define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug ); @@ -78,37 +78,42 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 ); * @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 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'. + * @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 array|string $member_type__in Array or comma-separated string of member types. + * `$member_type` takes precedence over this parameter. + * @type array|string $member_type__not_in Array or comma-separated string of member types to be excluded. + * @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 */ function bp_core_get_users( $args = '' ) { - // Parse the user query arguments + // Parse the user query arguments. $r = bp_parse_args( $args, array( - 'type' => 'active', // active, newest, alphabetical, random or popular - 'user_id' => false, // Pass a user_id to limit to only friend connections for this user - 'exclude' => false, // Users to exclude from results - '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 - 'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update - 'count_total' => 'count_query' // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false + 'type' => 'active', // Active, newest, alphabetical, random or popular. + 'user_id' => false, // Pass a user_id to limit to only friend connections for this user. + 'exclude' => false, // Users to exclude from results. + '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' => '', + 'member_type__in' => '', + 'member_type__not_in' => '', + '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. + 'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update. + 'count_total' => 'count_query' // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false. ), 'core_get_users' ); // For legacy users. Use of BP_Core_User::get_users() is deprecated. @@ -126,7 +131,7 @@ function bp_core_get_users( $args = '' ) { $r['meta_value'] ); - // Default behavior as of BuddyPress 1.7 + // Default behavior as of BuddyPress 1.7.0. } else { // Get users like we were asked to do... @@ -142,7 +147,7 @@ function bp_core_get_users( $args = '' ) { /** * Filters the results of the user query. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $retval Array of users for the current query. * @param array $r Array of parsed query arguments. @@ -156,7 +161,6 @@ function bp_core_get_users( $args = '' ) { * @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 ) { @@ -181,7 +185,7 @@ function bp_core_get_user_domain( $user_id = 0, $user_nicename = false, $user_lo /** * Filters the domain for the passed user. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string $domain Domain for the passed user. * @param int $user_id ID of the passed user. @@ -195,7 +199,6 @@ 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 ) { @@ -211,7 +214,7 @@ function bp_core_get_core_userdata( $user_id = 0 ) { /** * Filters the userdata for a passed user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param array $userdata Array of user data for a passed user. */ @@ -226,7 +229,6 @@ 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 ) { @@ -236,10 +238,9 @@ function bp_core_get_displayed_userid( $user_login ) { /** * Return the user ID based on a user's user_login. * - * @since BuddyPress (1.0.0) + * @since 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 = '' ) { @@ -252,7 +253,7 @@ function bp_core_get_userid( $username = '' ) { /** * Filters the ID of a user, based on user_login. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param int|null $value ID of the user or null. * @param string $username User login to check. @@ -263,10 +264,9 @@ function bp_core_get_userid( $username = '' ) { /** * Return the user ID based on a user's user_nicename. * - * @since BuddyPress (1.2.3) + * @since 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 = '' ) { @@ -279,7 +279,7 @@ function bp_core_get_userid_from_nicename( $user_nicename = '' ) { /** * Filters the user ID based on user_nicename. * - * @since BuddyPress (1.2.3) + * @since 1.2.3 * * @param int|null $value ID of the user or null. * @param string $user_nicename User nicename to check. @@ -296,73 +296,72 @@ function bp_core_get_userid_from_nicename( $user_nicename = '' ) { * @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 ) { $bp = buddypress(); - // Check cache for user nicename + // Check cache for user nicename. $username = wp_cache_get( 'bp_user_username_' . $user_id, 'bp' ); if ( false === $username ) { - // Cache not found so prepare to update it + // Cache not found so prepare to update it. $update_cache = true; - // Nicename and login were not passed + // Nicename and login were not passed. if ( empty( $user_nicename ) && empty( $user_login ) ) { - // User ID matches logged in user + // User ID matches logged in user. if ( bp_loggedin_user_id() == $user_id ) { $userdata = &$bp->loggedin_user->userdata; - // User ID matches displayed in user + // User ID matches displayed in user. } elseif ( bp_displayed_user_id() == $user_id ) { $userdata = &$bp->displayed_user->userdata; - // No user ID match + // No user ID match. } else { $userdata = false; } - // No match so go dig + // No match so go dig. if ( empty( $userdata ) ) { - // User not found so return false + // User not found so return false. if ( !$userdata = bp_core_get_core_userdata( $user_id ) ) { return false; } } - // Update the $user_id for later + // Update the $user_id for later. $user_id = $userdata->ID; - // Two possible options + // Two possible options. $user_nicename = $userdata->user_nicename; $user_login = $userdata->user_login; } - // Pull an audible and maybe use the login over the nicename + // Pull an audible and maybe use the login over the nicename. $username = bp_is_username_compatibility_mode() ? $user_login : $user_nicename; - // Username found in cache so don't update it again + // Username found in cache so don't update it again. } else { $update_cache = false; } - // Add this to cache + // Add this to cache. if ( ( true === $update_cache ) && !empty( $username ) ) { wp_cache_set( 'bp_user_username_' . $user_id, $username, 'bp' ); // @todo bust this cache if no $username found? - //} else { - // wp_cache_delete( 'bp_user_username_' . $user_id ); + // } else { + // wp_cache_delete( 'bp_user_username_' . $user_id ); } /** * Filters the username based on originally provided user ID. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string $username Username determined by user ID. */ @@ -375,12 +374,11 @@ function bp_core_get_username( $user_id = 0, $user_nicename = false, $user_login * This should be used for linking to user profiles and anywhere else a * sanitized and unique slug to a user is needed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @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 ) { @@ -389,37 +387,37 @@ function bp_members_get_user_nicename( $user_id ) { if ( !$user_nicename = wp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) { $update_cache = true; - // User ID matches logged in user + // User ID matches logged in user. if ( bp_loggedin_user_id() == $user_id ) { $userdata = &$bp->loggedin_user->userdata; - // User ID matches displayed in user + // User ID matches displayed in user. } elseif ( bp_displayed_user_id() == $user_id ) { $userdata = &$bp->displayed_user->userdata; - // No user ID match + // No user ID match. } else { $userdata = false; } - // No match so go dig + // No match so go dig. if ( empty( $userdata ) ) { - // User not found so return false + // User not found so return false. if ( !$userdata = bp_core_get_core_userdata( $user_id ) ) { return false; } } - // User nicename found + // User nicename found. $user_nicename = $userdata->user_nicename; - // Nicename found in cache so don't update it again + // Nicename found in cache so don't update it again. } else { $update_cache = false; } - // Add this to cache + // Add this to cache. if ( true == $update_cache && !empty( $user_nicename ) ) { wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' ); } @@ -427,7 +425,7 @@ function bp_members_get_user_nicename( $user_id ) { /** * Filters the user_nicename based on originally provided user ID. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $username User nice name determined by user ID. */ @@ -438,7 +436,6 @@ 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. */ @@ -446,12 +443,12 @@ function bp_core_get_user_email( $uid ) { if ( !$email = wp_cache_get( 'bp_user_email_' . $uid, 'bp' ) ) { - // User exists + // User exists. $ud = bp_core_get_core_userdata( $uid ); if ( ! empty( $ud ) ) { $email = $ud->user_email; - // User was deleted + // User was deleted. } else { $email = ''; } @@ -462,7 +459,7 @@ function bp_core_get_user_email( $uid ) { /** * Filters the user email for user based on user ID. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string $email Email determined for the user. */ @@ -472,7 +469,7 @@ function bp_core_get_user_email( $uid ) { /** * Return a HTML formatted link for a user with the user's full name as the link text. * - * eg: <a href="http://andy.example.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. * @@ -481,7 +478,6 @@ function bp_core_get_user_email( $uid ) { * Default: false. * @param bool $just_link Disable full name and HTML and just return the URL * text. Default false. - * * @return string|bool The link text based on passed parameters, or false on * no match. */ @@ -507,7 +503,7 @@ function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false /** * Filters the link text for the passed in user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Link text based on passed parameters. * @param int $user_id ID of the user to check. @@ -521,18 +517,17 @@ function bp_core_get_userlink( $user_id, $no_anchor = false, $just_link = false * Uses the 'Name' field in xprofile if available. Falls back on WP * display_name, and then user_nicename. * - * @since BuddyPress (2.0.0) - * - * @param array $user_ids + * @since 2.0.0 * + * @param array $user_ids Array of user IDs to get display names for. * @return array */ function bp_core_get_user_displaynames( $user_ids ) { - // Sanitize + // Sanitize. $user_ids = wp_parse_id_list( $user_ids ); - // Remove dupes and empties + // Remove dupes and empties. $user_ids = array_unique( array_filter( $user_ids ) ); if ( empty( $user_ids ) ) { @@ -546,12 +541,12 @@ function bp_core_get_user_displaynames( $user_ids ) { } } - // Prime caches + // Prime caches. if ( ! empty( $uncached_ids ) ) { if ( bp_is_active( 'xprofile' ) ) { $fullname_data = BP_XProfile_ProfileData::get_value_byid( 1, $uncached_ids ); - // Key by user_id + // Key by user_id. $fullnames = array(); foreach ( $fullname_data as $fd ) { if ( ! empty( $fd->value ) ) { @@ -560,7 +555,7 @@ function bp_core_get_user_displaynames( $user_ids ) { } // If xprofiledata is not found for any users, we'll look - // them up separately + // them up separately. $no_xprofile_ids = array_diff( $uncached_ids, array_keys( $fullnames ) ); } else { $fullnames = array(); @@ -568,7 +563,7 @@ function bp_core_get_user_displaynames( $user_ids ) { } if ( ! empty( $no_xprofile_ids ) ) { - // Use WP_User_Query because we don't need BP information + // Use WP_User_Query because we don't need BP information. $query = new WP_User_Query( array( 'include' => $no_xprofile_ids, 'fields' => array( 'ID', 'user_nicename', 'display_name', ), @@ -580,7 +575,7 @@ function bp_core_get_user_displaynames( $user_ids ) { $fullnames[ $qr->ID ] = ! empty( $qr->display_name ) ? $qr->display_name : $qr->user_nicename; // If xprofile is active, set this value as the - // xprofile display name as well + // xprofile display name as well. if ( bp_is_active( 'xprofile' ) ) { xprofile_set_field_data( 1, $qr->ID, $fullnames[ $qr->ID ] ); } @@ -603,8 +598,7 @@ 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. - * + * @param int|string|bool $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. */ @@ -634,7 +628,7 @@ function bp_core_get_user_displayname( $user_id_or_username ) { /** * Filters the display name for the passed in user. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string $fullname Display name for the user. * @param int $user_id ID of the user to check. @@ -650,7 +644,6 @@ 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 ) { @@ -659,7 +652,7 @@ function bp_core_get_userlink_by_email( $email ) { /** * Filters the user link for the user based on user email address. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string|bool $value URL for the user if found, otherwise false. */ @@ -672,7 +665,6 @@ function bp_core_get_userlink_by_email( $email ) { * @param string $username If BP_ENABLE_USERNAME_COMPATIBILITY_MODE is set, * 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 ) { @@ -685,7 +677,7 @@ function bp_core_get_userlink_by_username( $username ) { /** * Filters the user link for the user based on username. * - * @since BuddyPress (1.0.1) + * @since 1.0.1 * * @param string|bool $value URL for the user if found, otherwise false. */ @@ -715,7 +707,7 @@ function bp_core_get_total_member_count() { /** * Filters the total number of members for the installation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $count Total number of members. */ @@ -734,7 +726,7 @@ function bp_core_get_active_member_count() { if ( false === $count ) { $bp = buddypress(); - // Avoid a costly join by splitting the lookup + // Avoid a costly join by splitting the lookup. if ( is_multisite() ) { $sql = "SELECT ID FROM {$wpdb->users} WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)"; } else { @@ -751,7 +743,7 @@ function bp_core_get_active_member_count() { /** * Filters the total number of members for the installation limited to those with last_activity. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $count Total number of active members. */ @@ -767,7 +759,7 @@ function bp_core_get_active_member_count() { * - by bp_core_mark_user_spam_admin() (from wp-admin) * - bp_core_mark_user_ham_admin() (from wp-admin) * - * @since BuddyPress (1.6.0) + * @since 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. @@ -776,70 +768,69 @@ function bp_core_get_active_member_count() { * 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 ) { global $wpdb; - // Bail if no user ID + // Bail if no user ID. if ( empty( $user_id ) ) { return; } - // Bail if user ID is super admin + // Bail if user ID is super admin. if ( is_super_admin( $user_id ) ) { return; } - // Get the functions file + // Get the functions file. if ( is_multisite() ) { require_once( ABSPATH . 'wp-admin/includes/ms.php' ); } $is_spam = ( 'spam' == $status ); - // Only you can prevent infinite loops + // Only you can prevent infinite loops. remove_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' ); remove_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' ); - // force the cleanup of WordPress content and status for multisite configs + // Force the cleanup of WordPress content and status for multisite configs. if ( $do_wp_cleanup ) { - // Get the blogs for the user + // Get the blogs for the user. $blogs = get_blogs_of_user( $user_id, true ); foreach ( (array) array_values( $blogs ) as $details ) { - // Do not mark the main or current root blog as spam + // Do not mark the main or current root blog as spam. if ( 1 == $details->userblog_id || bp_get_root_blog_id() == $details->userblog_id ) { continue; } - // Update the blog status + // Update the blog status. update_blog_status( $details->userblog_id, 'spam', $is_spam ); } - // Finally, mark this user as a spammer + // Finally, mark this user as a spammer. if ( is_multisite() ) { update_user_status( $user_id, 'spam', $is_spam ); } } - // Update the user status + // Update the user status. $wpdb->update( $wpdb->users, array( 'user_status' => $is_spam ), array( 'ID' => $user_id ) ); - // Clean user cache + // Clean user cache. clean_user_cache( $user_id ); if ( ! is_multisite() ) { - // Call multisite actions in single site mode for good measure + // Call multisite actions in single site mode for good measure. if ( true === $is_spam ) { /** * Fires at end of processing spammer in Dashboard if not multisite and user is spam. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value user ID. */ @@ -849,7 +840,7 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru /** * Fires at end of processing spammer in Dashboard if not multisite and user is not spam. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value user ID. */ @@ -857,18 +848,18 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru } } - // Hide this user's activity + // Hide this user's activity. if ( ( true === $is_spam ) && bp_is_active( 'activity' ) ) { bp_activity_hide_user_activity( $user_id ); } - // We need a special hook for is_spam so that components can delete data at spam time + // We need a special hook for is_spam so that components can delete data at spam time. if ( true === $is_spam ) { /** * Fires at the end of the process spammer process if the user is spam. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Displayed user ID. */ @@ -878,7 +869,7 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru /** * Fires at the end of the process spammer process if the user is not spam. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Displayed user ID. */ @@ -888,14 +879,14 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru /** * Fires at the end of the process for hanlding spammer status. * - * @since BuddyPress (1.5.5) + * @since 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 + // Put things back how we found them. add_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' ); add_action( 'make_ham_user', 'bp_core_mark_user_ham_admin' ); @@ -904,7 +895,7 @@ function bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = tru /** * Hook to WP's make_spam_user and run our custom BP spam functions. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $user_id The user ID passed from the make_spam_user hook. */ @@ -916,7 +907,7 @@ add_action( 'make_spam_user', 'bp_core_mark_user_spam_admin' ); /** * Hook to WP's make_ham_user and run our custom BP spam functions. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $user_id The user ID passed from the make_ham_user hook. */ @@ -929,25 +920,24 @@ 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 ) { - // No user to check + // No user to check. if ( empty( $user_id ) ) { return false; } $bp = buddypress(); - // Assume user is not spam + // Assume user is not spam. $is_spammer = false; - // Setup our user + // Setup our user. $user = false; - // Get locally-cached data if available + // Get locally-cached data if available. switch ( $user_id ) { case bp_loggedin_user_id() : $user = ! empty( $bp->loggedin_user->userdata ) ? $bp->loggedin_user->userdata : false; @@ -958,19 +948,19 @@ function bp_is_user_spammer( $user_id = 0 ) { break; } - // Manually get userdata if still empty + // Manually get userdata if still empty. if ( empty( $user ) ) { $user = get_userdata( $user_id ); } - // No user found + // No user found. if ( empty( $user ) ) { $is_spammer = false; - // User found + // User found. } else { - // Check if spam + // Check if spam. if ( !empty( $user->spam ) ) { $is_spammer = true; } @@ -983,7 +973,7 @@ function bp_is_user_spammer( $user_id = 0 ) { /** * Filters whether a user is marked as a spammer. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $is_spammer Whether or not user is marked as spammer. */ @@ -994,25 +984,24 @@ 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 ) { - // No user to check + // No user to check. if ( empty( $user_id ) ) { return false; } $bp = buddypress(); - // Assume user is not deleted + // Assume user is not deleted. $is_deleted = false; - // Setup our user + // Setup our user. $user = false; - // Get locally-cached data if available + // Get locally-cached data if available. switch ( $user_id ) { case bp_loggedin_user_id() : $user = ! empty( $bp->loggedin_user->userdata ) ? $bp->loggedin_user->userdata : false; @@ -1023,19 +1012,19 @@ function bp_is_user_deleted( $user_id = 0 ) { break; } - // Manually get userdata if still empty + // Manually get userdata if still empty. if ( empty( $user ) ) { $user = get_userdata( $user_id ); } - // No user found + // No user found. if ( empty( $user ) ) { $is_deleted = true; - // User found + // User found. } else { - // Check if deleted + // Check if deleted. if ( !empty( $user->deleted ) ) { $is_deleted = true; } @@ -1048,7 +1037,7 @@ function bp_is_user_deleted( $user_id = 0 ) { /** * Filters whether a user is marked as deleted. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param bool $is_deleted Whether or not user is marked as deleted. */ @@ -1058,7 +1047,7 @@ function bp_is_user_deleted( $user_id = 0 ) { /** * Check whether a user is "active", ie neither deleted nor spammer. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @uses is_user_logged_in() To check if user is logged in * @uses bp_loggedin_user_id() To get current user ID @@ -1066,39 +1055,38 @@ 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 ) { - // Default to current user + // Default to current user. if ( empty( $user_id ) && is_user_logged_in() ) { $user_id = bp_loggedin_user_id(); } - // No user to check + // No user to check. if ( empty( $user_id ) ) { return false; } - // Check spam + // Check spam. if ( bp_is_user_spammer( $user_id ) ) { return false; } - // Check deleted + // Check deleted. if ( bp_is_user_deleted( $user_id ) ) { return false; } - // Assume true if not spam or deleted + // Assume true if not spam or deleted. return true; } /** * Check whether user is not active. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @todo No need for the user fallback checks, since they're done in * bp_is_user_active(). @@ -1108,48 +1096,46 @@ function bp_is_user_active( $user_id = 0 ) { * @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 ) { - // Default to current user + // Default to current user. if ( empty( $user_id ) && is_user_logged_in() ) { $user_id = bp_loggedin_user_id(); } - // No user to check + // No user to check. if ( empty( $user_id ) ) { return false; } - // Return the inverse of active + // Return the inverse of active. return !bp_is_user_active( $user_id ); } /** * Update a user's last activity. * - * @since BuddyPress (1.9.0) + * @since 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. - * * @return bool True on success, false on failure. */ function bp_update_user_last_activity( $user_id = 0, $time = '' ) { - // Fall back on current user + // Fall back on current user. if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } - // Bail if the user id is 0, as there's nothing to update + // Bail if the user id is 0, as there's nothing to update. if ( empty( $user_id ) ) { return false; } - // Fall back on current time + // Fall back on current time. if ( empty( $time ) ) { $time = bp_core_current_time(); } @@ -1174,21 +1160,20 @@ function bp_update_user_last_activity( $user_id = 0, $time = '' ) { * serves two purposes: it warns plugin authors of the change, and it returns * the data from the proper location. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @access private For internal use only. * - * @param null $retval + * @param null $retval Null retval value. * @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; if ( 'last_activity' === $meta_key ) { - // Don't send the warning more than once per pageload + // Don't send the warning more than once per pageload. if ( false === $warned ) { _doing_it_wrong( 'get_user_meta( $user_id, \'last_activity\' )', __( 'User last_activity data is no longer stored in usermeta. Use bp_get_user_last_activity() instead.', 'buddypress' ), '2.0.0' ); $warned = true; @@ -1209,7 +1194,7 @@ add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, * serves two purposes: it warns plugin authors of the change, and it updates * the data in the proper location. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @access private For internal use only. * @@ -1230,7 +1215,6 @@ 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. */ @@ -1245,7 +1229,7 @@ function bp_get_user_last_activity( $user_id = 0 ) { /** * Filters the last activity for a given user. * - * @since BuddyPress (1.9.0) + * @since 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. @@ -1260,7 +1244,9 @@ function bp_get_user_last_activity( $user_id = 0 ) { * Generally, this function is only run when BP is upgraded to 2.0. It can also * be called directly from the BuddyPress Tools panel. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @return bool */ function bp_last_activity_migrate() { global $wpdb; @@ -1269,7 +1255,7 @@ function bp_last_activity_migrate() { // Wipe out existing last_activity data in the activity table - // this helps to prevent duplicates when pulling from the usermeta - // table + // table. $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->members->table_name_last_activity} WHERE component = %s AND type = 'last_activity'", $bp->members->id ) ); $sql = "INSERT INTO {$bp->members->table_name_last_activity} (`user_id`, `component`, `type`, `action`, `content`, `primary_link`, `item_id`, `date_recorded` ) ( @@ -1290,7 +1276,6 @@ 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 ) { @@ -1314,25 +1299,25 @@ function bp_core_get_all_posts_for_user( $user_id = 0 ) { */ function bp_core_delete_account( $user_id = 0 ) { - // Use logged in user ID if none is passed + // Use logged in user ID if none is passed. if ( empty( $user_id ) ) { $user_id = bp_loggedin_user_id(); } - // Site admins cannot be deleted + // Site admins cannot be deleted. if ( is_super_admin( $user_id ) ) { return false; } - // Extra checks if user is not deleting themselves + // Extra checks if user is not deleting themselves. if ( bp_loggedin_user_id() !== absint( $user_id ) ) { - // Bail if current user cannot delete any users + // Bail if current user cannot delete any users. if ( ! bp_current_user_can( 'delete_users' ) ) { return false; } - // Bail if current user cannot delete this user + // Bail if current user cannot delete this user. if ( ! current_user_can_for_blog( bp_get_root_blog_id(), 'delete_user', $user_id ) ) { return false; } @@ -1341,20 +1326,20 @@ function bp_core_delete_account( $user_id = 0 ) { /** * Fires before the processing of an account deletion. * - * @since BuddyPress (1.6.0) + * @since 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 + // Specifically handle multi-site environment. if ( is_multisite() ) { require_once( ABSPATH . '/wp-admin/includes/ms.php' ); require_once( ABSPATH . '/wp-admin/includes/user.php' ); $retval = wpmu_delete_user( $user_id ); - // Single site user deletion + // Single site user deletion. } else { require_once( ABSPATH . '/wp-admin/includes/user.php' ); $retval = wp_delete_user( $user_id ); @@ -1363,7 +1348,7 @@ function bp_core_delete_account( $user_id = 0 ) { /** * Fires after the deletion of an account. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param int $user_id ID of the user account that was deleted. */ @@ -1375,10 +1360,9 @@ function bp_core_delete_account( $user_id = 0 ) { /** * Delete a user's avatar when the user is deleted. * - * @since BuddyPress (1.9.0) + * @since 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 ) { @@ -1396,7 +1380,6 @@ 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 ) { @@ -1414,28 +1397,27 @@ function bp_core_ucfirst( $str ) { * When a user logs in, check if they have been marked as a spammer. If yes * then simply redirect them to the home page and stop them from logging in. * - * @since BuddyPress (1.1.2) + * @since 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. - * * @return WP_User|WP_Error If the user is not a spammer, return the WP_User * object. Otherwise a new WP_Error object. */ function bp_core_boot_spammer( $user ) { - // check to see if the $user has already failed logging in, if so return $user as-is + // Check to see if the $user has already failed logging in, if so return $user as-is. if ( is_wp_error( $user ) || empty( $user ) ) { return $user; } - // the user exists; now do a check to see if the user is a spammer + // The user exists; now do a check to see if the user is a spammer // if the user is a spammer, stop them in their tracks! if ( is_a( $user, 'WP_User' ) && ( ( is_multisite() && (int) $user->spam ) || 1 == $user->user_status ) ) { return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ) ); } - // user is good to go! + // User is good to go! return $user; } add_filter( 'authenticate', 'bp_core_boot_spammer', 30 ); @@ -1447,10 +1429,10 @@ add_filter( 'authenticate', 'bp_core_boot_spammer', 30 ); */ function bp_core_remove_data( $user_id ) { - // Remove last_activity data + // Remove last_activity data. BP_Core_User::delete_last_activity( $user_id ); - // Flush the cache to remove the user from all cached objects + // Flush the cache to remove the user from all cached objects. wp_cache_flush(); } add_action( 'wpmu_delete_user', 'bp_core_remove_data' ); @@ -1494,12 +1476,11 @@ function bp_core_flush_illegal_names() { * @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 = '' ) { - // Make sure $value is array + // Make sure $value is array. if ( empty( $value ) ) { $db_illegal_names = array(); } @@ -1526,7 +1507,7 @@ function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) { 'activate' ); - // Core constants + // Core constants. $slug_constants = array( 'BP_GROUPS_SLUG', 'BP_MEMBERS_SLUG', @@ -1550,22 +1531,22 @@ function bp_core_get_illegal_names( $value = '', $oldvalue = '' ) { /** * Filters the array of default illegal usernames. * - * @since BuddyPress (1.2.2) + * @since 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 + // Merge the arrays together. $merged_names = array_merge( (array) $filtered_illegal_names, (array) $db_illegal_names ); - // Remove duplicates + // Remove duplicates. $illegal_names = array_unique( (array) $merged_names ); /** * Filters the array of default illegal names. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param array $value Merged and unique array of illegal names. */ @@ -1582,10 +1563,9 @@ add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', * - If there's an email domain blacklist, is the current domain on it? * - If there's an email domain whitelest, is the current domain on it? * - * @since BuddyPress (1.6.2) + * @since 1.6.2 * * @param string $user_email The email being checked. - * * @return bool|array True if the address passes all checks; otherwise an array * of error codes. */ @@ -1600,13 +1580,13 @@ function bp_core_validate_email_address( $user_email ) { } // Is the email on the Banned Email Domains list? - // Note: This check only works on Multisite + // Note: This check only works on Multisite. if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) ) { $errors['domain_banned'] = 1; } // Is the email on the Limited Email Domains list? - // Note: This check only works on Multisite + // Note: This check only works on Multisite. $limited_email_domains = get_site_option( 'limited_email_domains' ); if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); @@ -1632,7 +1612,7 @@ function bp_core_validate_email_address( $user_email ) { * of error codes. bp_core_add_validation_error_messages() takes this array and * parses, adding the appropriate error messages to the WP_Error object. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @see bp_core_validate_email_address() * @@ -1663,12 +1643,11 @@ function bp_core_add_validation_error_messages( WP_Error $errors, $validation_re * * @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 ) { - // Make sure illegal names include BuddyPress slugs and values + // Make sure illegal names include BuddyPress slugs and values. bp_core_flush_illegal_names(); // WordPress Multisite has its own validation. Use it, so that we @@ -1678,36 +1657,36 @@ function bp_core_validate_user_signup( $user_name, $user_email ) { // When not running Multisite, we perform our own validation. What // follows reproduces much of the logic of wpmu_validate_user_signup(), - // minus the multisite-specific restrictions on user_login + // minus the multisite-specific restrictions on user_login. } else { $errors = new WP_Error(); /** * Filters the username before being validated. * - * @since BuddyPress (1.5.5) + * @since 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 + // User name can't be empty. if ( empty( $user_name ) ) { $errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) ); } - // user name can't be on the blacklist + // User name can't be on the blacklist. $illegal_names = get_site_option( 'illegal_names' ); if ( in_array( $user_name, (array) $illegal_names ) ) { $errors->add( 'user_name', __( 'That username is not allowed', 'buddypress' ) ); } - // User name must pass WP's validity check + // User name must pass WP's validity check. if ( ! validate_username( $user_name ) ) { $errors->add( 'user_name', __( 'Usernames can contain only letters, numbers, ., -, and @', 'buddypress' ) ); } - // Minimum of 4 characters + // Minimum of 4 characters. if ( strlen( $user_name ) < 4 ) { $errors->add( 'user_name', __( 'Username must be at least 4 characters', 'buddypress' ) ); } @@ -1724,7 +1703,7 @@ function bp_core_validate_user_signup( $user_name, $user_email ) { $errors->add( 'user_name', __( 'Sorry, usernames must have letters too!', 'buddypress' ) ); } - // Check into signups + // Check into signups. $signups = BP_Signup::get( array( 'user_login' => $user_name, ) ); @@ -1737,29 +1716,29 @@ function bp_core_validate_user_signup( $user_name, $user_email ) { } // Validate the email address and process the validation results into - // error messages + // error messages. $validate_email = bp_core_validate_email_address( $user_email ); bp_core_add_validation_error_messages( $errors, $validate_email ); - // Assemble the return array + // Assemble the return array. $result = array( 'user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors, ); - // Apply WPMU legacy filter + // Apply WPMU legacy filter. $result = apply_filters( 'wpmu_validate_user_signup', $result ); } /** * Filters the result of the user signup validation. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * * @param array $result Results of user validation including errors, if any. */ - return apply_filters( 'bp_core_validate_user_signup', $result ); + return apply_filters( 'bp_core_validate_user_signup', $result ); } /** @@ -1769,7 +1748,6 @@ function bp_core_validate_user_signup( $user_name, $user_email ) { * * @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 ) { @@ -1780,7 +1758,7 @@ function bp_core_validate_blog_signup( $blog_url, $blog_title ) { /** * Filters the validated blog url and title provided at signup. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * * @param array $value Array with the new site data and error messages. */ @@ -1797,24 +1775,23 @@ function bp_core_validate_blog_signup( $blog_url, $blog_title ) { * @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 ) { $bp = buddypress(); - // We need to cast $user_id to pass to the filters + // We need to cast $user_id to pass to the filters. $user_id = false; - // Multisite installs have their own install procedure + // Multisite installs have their own install procedure. if ( is_multisite() ) { wpmu_signup_user( $user_login, $user_email, $usermeta ); } else { - // Format data + // Format data. $user_login = preg_replace( '/\s+/', '', sanitize_user( $user_login, true ) ); $user_email = sanitize_email( $user_email ); - $activation_key = substr( md5( time() . rand() . $user_email ), 0, 16 ); + $activation_key = wp_generate_password( 32, false ); /** * WordPress's default behavior is to create user accounts @@ -1836,7 +1813,6 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet return $user_id; } - $activation_key = wp_hash( $user_id ); bp_update_user_meta( $user_id, 'activation_key', $activation_key ); } @@ -1852,7 +1828,7 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet /** * Filters if BuddyPress should send an activation key for a new signup. * - * @since BuddyPress (1.2.3) + * @since 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. @@ -1862,7 +1838,7 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet * 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 ); + bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key, $user_login ); } } @@ -1871,7 +1847,7 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet /** * Fires at the end of the process to sign up a user. * - * @since BuddyPress (1.2.2) + * @since 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. @@ -1894,7 +1870,6 @@ function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet * @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 ) { @@ -1903,12 +1878,12 @@ function bp_core_signup_blog( $blog_domain, $blog_path, $blog_title, $user_name, } /** - * Filters the result of wpmu_signup_blog() + * Filters the result of wpmu_signup_blog(). * * This filter provides no value and is retained for * backwards compatibility. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * * @param void $value */ @@ -1919,7 +1894,6 @@ 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 ) { @@ -1927,11 +1901,11 @@ function bp_core_activate_signup( $key ) { $user = false; - // Multisite installs have their own activation routine + // Multisite installs have their own activation routine. if ( is_multisite() ) { $user = wpmu_activate_signup( $key ); - // If there were errors, add a message and redirect + // If there were errors, add a message and redirect. if ( ! empty( $user->errors ) ) { return $user; } @@ -1957,21 +1931,21 @@ function bp_core_activate_signup( $key ) { } } - // password is hashed again in wp_insert_user + // Password is hashed again in wp_insert_user. $password = wp_generate_password( 12, false ); $user_id = username_exists( $signup->user_login ); - // Create the user + // Create the user. This should only be necessary if BP_SIGNUPS_SKIP_USER_CREATION is true. if ( ! $user_id ) { $user_id = wp_create_user( $signup->user_login, $password, $signup->user_email ); - // If a user ID is found, this may be a legacy signup, or one - // created locally for backward compatibility. Process it. - } elseif ( $key == wp_hash( $user_id ) ) { - // Change the user's status so they become active + // Otherwise, update the existing user's status. + } elseif ( $key === bp_get_user_meta( $user_id, 'activation_key', true ) || $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' ) ); + return new WP_Error( 'invalid_key', __( 'Invalid activation key.', 'buddypress' ) ); } bp_delete_user_meta( $user_id, 'activation_key' ); @@ -1989,28 +1963,28 @@ function bp_core_activate_signup( $key ) { return new WP_Error( 'create_user', __( 'Could not create user', 'buddypress' ), $signup ); } - // Fetch the signup so we have the data later on + // Fetch the signup so we have the data later on. $signups = BP_Signup::get( array( 'activation_key' => $key, ) ); $signup = isset( $signups['signups'] ) && ! empty( $signups['signups'][0] ) ? $signups['signups'][0] : false; - // Activate the signup + // Activate the signup. BP_Signup::validate( $key ); if ( isset( $user_already_exists ) ) { return new WP_Error( 'user_already_exists', __( 'That username is already activated.', 'buddypress' ), $signup ); } - // Set up data to pass to the legacy filter + // Set up data to pass to the legacy filter. $user = array( 'user_id' => $user_id, 'password' => $signup->meta['password'], 'meta' => $signup->meta, ); - // Notify the site admin of a new user registration + // Notify the site admin of a new user registration. wp_new_user_notification( $user_id ); if ( isset( $user_already_created ) ) { @@ -2018,7 +1992,7 @@ function bp_core_activate_signup( $key ) { /** * Fires if the user has already been created. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * * @param int $user_id ID of the user being checked. * @param string $key Activation key. @@ -2029,7 +2003,7 @@ function bp_core_activate_signup( $key ) { } } - // Set any profile data + // Set any profile data. if ( bp_is_active( 'xprofile' ) ) { if ( ! empty( $user['meta']['profile_field_ids'] ) ) { $profile_field_ids = explode( ',', $user['meta']['profile_field_ids'] ); @@ -2041,20 +2015,20 @@ function bp_core_activate_signup( $key ) { xprofile_set_field_data( $field_id, $user_id, $current_field ); } - // Save the visibility level + // Save the visibility level. $visibility_level = ! empty( $user['meta']['field_' . $field_id . '_visibility'] ) ? $user['meta']['field_' . $field_id . '_visibility'] : 'public'; xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); } } } - // Update the display_name + // Update the display_name. wp_update_user( array( 'ID' => $user_id, 'display_name' => bp_core_get_user_displayname( $user_id ), ) ); - // Set the password on multisite installs + // Set the password on multisite installs. if ( ! empty( $user['meta']['password'] ) ) { $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_pass = %s WHERE ID = %d", $user['meta']['password'], $user_id ) ); } @@ -2062,7 +2036,7 @@ function bp_core_activate_signup( $key ) { /** * Fires at the end of the user activation process. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 * * @param int $user_id ID of the user being checked. * @param string $key Activation key. @@ -2076,7 +2050,7 @@ function bp_core_activate_signup( $key ) { /** * Migrate signups from pre-2.0 configuration to wp_signups. * - * @since BuddyPress (2.0.1) + * @since 2.0.1 */ function bp_members_migrate_signups() { global $wpdb; @@ -2097,11 +2071,11 @@ function bp_members_migrate_signups() { ) ); // Fetch activation keys separately, to avoid the all_with_meta - // overhead + // overhead. $status_2_ids_sql = implode( ',', $status_2_ids ); $ak_data = $wpdb->get_results( "SELECT user_id, meta_value FROM {$wpdb->usermeta} WHERE meta_key = 'activation_key' AND user_id IN ({$status_2_ids_sql})" ); - // Rekey + // Rekey. $activation_keys = array(); foreach ( $ak_data as $ak_datum ) { $activation_keys[ intval( $ak_datum->user_id ) ] = $ak_datum->meta_value; @@ -2109,14 +2083,14 @@ function bp_members_migrate_signups() { unset( $status_2_ids_sql, $status_2_ids, $ak_data ); - // Merge + // Merge. foreach ( $signups as &$signup ) { if ( isset( $activation_keys[ $signup->ID ] ) ) { $signup->activation_key = $activation_keys[ $signup->ID ]; } } - // Reset the signup var as we're using it to process the migration + // Reset the signup var as we're using it to process the migration. unset( $signup ); } else { @@ -2126,9 +2100,9 @@ function bp_members_migrate_signups() { foreach ( $signups as $signup ) { $meta = array(); - // Rebuild the activation key, if missing + // Rebuild the activation key, if missing. if ( empty( $signup->activation_key ) ) { - $signup->activation_key = wp_hash( $signup->ID ); + $signup->activation_key = wp_generate_password( 32, false ); } if ( bp_is_active( 'xprofile' ) ) { @@ -2148,7 +2122,7 @@ function bp_members_migrate_signups() { 'meta' => $meta ) ); - // Deleting these options will remove signups from users count + // Deleting these options will remove signups from users count. delete_user_option( $signup->ID, 'capabilities' ); delete_user_option( $signup->ID, 'user_level' ); } @@ -2161,7 +2135,6 @@ function bp_members_migrate_signups() { * 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 ) { @@ -2171,7 +2144,7 @@ function bp_core_map_user_registration( $user_id ) { return false; } - // Add the user's fullname to Xprofile + // Add the user's fullname to Xprofile. if ( bp_is_active( 'xprofile' ) ) { $firstname = bp_get_user_meta( $user_id, 'first_name', true ); $lastname = ' ' . bp_get_user_meta( $user_id, 'last_name', true ); @@ -2208,7 +2181,7 @@ function bp_core_signup_avatar_upload_dir() { /** * Filters the avatar storage directory for use during registration. * - * @since BuddyPress (1.1.1) + * @since 1.1.1 * * @param array $value Array of path and URL values for created storage directory. */ @@ -2225,77 +2198,44 @@ function bp_core_signup_avatar_upload_dir() { /** * Send activation email to a newly registered 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. - */ -function bp_core_signup_send_validation_email( $user_id, $user_email, $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' ) ) ); - - /** - * 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 ); + * @since 2.5.0 Add the $user_login parameter. + * + * @param int|bool $user_id ID of the new user, false if BP_SIGNUPS_SKIP_USER_CREATION is true. + * @param string $user_email Email address of the new user. + * @param string $key Activation key. + * @param string $user_login Optional. The user login name. + */ +function bp_core_signup_send_validation_email( $user_id, $user_email, $key, $user_login = '' ) { + $args = array( + 'tokens' => array( + 'activate.url' => esc_url( trailingslashit( bp_get_activation_page() ) . "{$key}/" ), + 'key' => $key, + 'user.email' => $user_email, + 'user.id' => $user_id, + ), + ); - wp_mail( $to, $subject, $message ); + if ( $user_id ) { + $to = $user_id; + } else { + $to = array( array( $user_email => $user_login ) ); + } - /** - * 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 ); + bp_send_email( 'core-user-registration', $to, $args ); } /** * Display a "resend email" link when an unregistered user attempts to log in. * - * @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. + * @since 1.2.2 * + * @param WP_User|WP_Error|null $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 + // Login form not used. if ( empty( $username ) && empty( $password ) ) { return $user; } @@ -2307,16 +2247,16 @@ function bp_core_signup_disable_inactive( $user = null, $username = '', $passwor $user_login = $user->user_login; // If no WP_User is found corresponding to the username, this - // is a potential signup + // is a potential signup. } elseif ( is_wp_error( $user ) && 'invalid_username' == $user->get_error_code() ) { $user_login = $username; - // This is an activated user, so bail + // This is an activated user, so bail. } else { return $user; } - // Look for the unactivated signup corresponding to the login name + // Look for the unactivated signup corresponding to the login name. $signup = BP_Signup::get( array( 'user_login' => sanitize_user( $user_login ) ) ); // No signup or more than one, something is wrong. Let's bail. @@ -2325,7 +2265,7 @@ function bp_core_signup_disable_inactive( $user = null, $username = '', $passwor } // Unactivated user account found! - // Set up the feedback message + // Set up the feedback message. $signup_id = $signup['signups'][0]->signup_id; $resend_url_params = array( @@ -2347,7 +2287,7 @@ add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30, 3 ); /** * On the login screen, resends the activation email for a user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @see bp_core_signup_disable_inactive() */ @@ -2358,18 +2298,18 @@ function bp_members_login_resend_activation_email() { return; } - // verify nonce + // Verify nonce. if ( ! wp_verify_nonce( $_GET['_wpnonce'], 'bp-resend-activation' ) ) { die( 'Security check' ); } $signup_id = (int) $_GET['id']; - // resend the activation email - // also updates the 'last sent' and '# of emails sent' values + // Resend the activation email. + // also updates the 'last sent' and '# of emails sent' values. $resend = BP_Signup::resend( array( $signup_id ) ); - // add feedback message + // Add feedback message. if ( ! empty( $resend['errors'] ) ) { $error = __( '<strong>ERROR</strong>: Your account has already been activated.', 'buddypress' ); } else { @@ -2383,14 +2323,14 @@ add_action( 'login_form_bp-resend-activation', 'bp_members_login_resend_activati */ function bp_core_wpsignup_redirect() { - // Bail in admin or if custom signup page is broken + // Bail in admin or if custom signup page is broken. if ( is_admin() || ! bp_has_custom_signup_page() ) { return; } $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; - // Not at the WP core signup page and action is not register + // Not at the WP core signup page and action is not register. if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) ) { return; } @@ -2418,10 +2358,10 @@ add_action( 'bp_init', 'bp_core_wpsignup_redirect' ); * * This is important as the $bp->loggedin_user object is setup at priority 4. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ function bp_stop_live_spammer() { - // if we're on the login page, stop now to prevent redirect loop + // 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' ) ) ) { $is_login = true; @@ -2433,32 +2373,32 @@ function bp_stop_live_spammer() { return; } - // user isn't logged in, so stop! + // User isn't logged in, so stop! if ( ! is_user_logged_in() ) { return; } - // if spammer, redirect to wp-login.php and reauthorize + // If spammer, redirect to wp-login.php and reauthorize. if ( bp_is_user_spammer( bp_loggedin_user_id() ) ) { - // setup login args + // Setup login args. $args = array( - // custom action used to throw an error message + // Custom action used to throw an error message. 'action' => 'bp-spam', - // reauthorize user to login + // Reauthorize user to login. 'reauth' => 1 ); /** * Filters the url used for redirection for a logged in user marked as spam. * - * @since BuddyPress (1.8.0) + * @since 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 + // Redirect user to login page. wp_redirect( $login_url ); die(); } @@ -2468,14 +2408,14 @@ add_action( 'bp_init', 'bp_stop_live_spammer', 5 ); /** * Show a custom error message when a logged-in user is marked as a spammer. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ function bp_live_spammer_login_error() { global $error; $error = __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ); - // shake shake shake! + // Shake shake shake! add_action( 'login_head', 'wp_shake_js', 12 ); } add_action( 'login_form_bp-spam', 'bp_live_spammer_login_error' ); @@ -2485,7 +2425,7 @@ add_action( 'login_form_bp-spam', 'bp_live_spammer_login_error' ); /** * Register a member type. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $member_type Unique string identifier for the member type. * @param array $args { @@ -2518,6 +2458,22 @@ function bp_register_member_type( $member_type, $args = array() ) { $member_type = sanitize_key( $member_type ); + /** + * Filters the list of illegal member type names. + * + * - 'any' is a special pseudo-type, representing items unassociated with any member type. + * - 'null' is a special pseudo-type, representing users without any type. + * - '_none' is used internally to denote an item that should not apply to any member types. + * + * @since 2.4.0 + * + * @param array $illegal_names Array of illegal names. + */ + $illegal_names = apply_filters( 'bp_member_type_illegal_names', array( 'any', 'null', '_none' ) ); + if ( in_array( $member_type, $illegal_names, true ) ) { + return new WP_Error( 'bp_member_type_illegal_name', __( 'You may not register a member type with this name.', 'buddypress' ), $member_type ); + } + // Store the post type name as data in the object (not just as the array key). $r['name'] = $member_type; @@ -2550,7 +2506,7 @@ function bp_register_member_type( $member_type, $args = array() ) { /** * Fires after a member type is registered. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $member_type Member type identifier. * @param object $type Member type object. @@ -2563,10 +2519,9 @@ function bp_register_member_type( $member_type, $args = array() ) { /** * Retrieve a member type object by name. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -2582,7 +2537,7 @@ function bp_get_member_type_object( $member_type ) { /** * Get a list of all registered member type objects. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see bp_register_member_type() for accepted arguments. * @@ -2593,7 +2548,6 @@ function bp_get_member_type_object( $member_type ) { * @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' ) { @@ -2607,7 +2561,7 @@ function bp_get_member_types( $args = array(), $output = 'names', $operator = 'a * 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) + * @since 2.2.0 * * @param array $types Member type objects, keyed by name. * @param array $args Array of key=>value arguments for filtering. @@ -2625,13 +2579,13 @@ function bp_get_member_types( $args = array(), $output = 'names', $operator = 'a /** * Set type for a member. * - * @since BuddyPress (2.2.0) + * @since 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()}. + * @return array $retval 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. @@ -2648,7 +2602,7 @@ function bp_set_member_type( $user_id, $member_type, $append = false ) { /** * Fires just after a user's member type has been changed. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $user_id ID of the user whose member type has been updated. * @param string $member_type Member type. @@ -2663,11 +2617,10 @@ function bp_set_member_type( $user_id, $member_type, $append = false ) { /** * Remove type for a member. * - * @since BuddyPress (2.3.0) + * @since 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 ) { @@ -2685,7 +2638,7 @@ function bp_remove_member_type( $user_id, $member_type ) { /** * Fires just after a user's member type has been removed. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $user_id ID of the user whose member type has been updated. * @param string $member_type Member type. @@ -2699,12 +2652,11 @@ function bp_remove_member_type( $user_id, $member_type ) { /** * 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. + * @since 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. */ @@ -2732,7 +2684,7 @@ function bp_get_member_type( $user_id, $single = true ) { /** * Filters a user's member type(s). * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $type Member type. * @param int $user_id ID of the user. @@ -2744,11 +2696,10 @@ function bp_get_member_type( $user_id, $single = true ) { /** * Check whether the given user has a certain member type. * - * @since BuddyPress (2.3.0) + * @since 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 ) { @@ -2770,11 +2721,10 @@ function bp_has_member_type( $user_id, $member_type ) { /** * Delete a user's member type when the user when the user is deleted. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $user_id ID of the user. - * - * @return See {@see bp_set_member_type()}. + * @return array $value See {@see bp_set_member_type()}. */ function bp_remove_member_type_on_user_delete( $user_id ) { return bp_set_member_type( $user_id, '' ); @@ -2785,7 +2735,7 @@ 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) + * @since 2.3.0 * * @return string */ 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 3a3795d7321644fea9b0bc4d4f63a79e9d41cd5f..4962e82dca1536c1c0d3af221c5cb404ca79be80 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php @@ -1,300 +1,16 @@ <?php - /** * BuddyPress Member Loader. * * @package BuddyPress * @subpackage Members + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. 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. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'members', - __( 'Members', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 20 - ) - ); - } - - /** - * Include bp-members files. - * - * @see BP_Component::includes() for description of parameters. - * - * @param array $includes See {@link BP_Component::includes()}. - */ - public function includes( $includes = array() ) { - - // Always include these files - $includes = array( - 'actions', - 'classes', - 'filters', - 'screens', - 'template', - 'adminbar', - 'functions', - 'widgets', - 'cache', - ); - - if ( bp_is_active( 'activity' ) ) { - $includes[] = 'activity'; - } - - // Include these only if in admin - if ( is_admin() ) { - $includes[] = 'admin'; - } - - parent::includes( $includes ); - } - - /** - * Set up bp-members global settings. - * - * The BP_MEMBERS_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @see BP_Component::setup_globals() for description of parameters. - * - * @param array $args See {@link BP_Component::setup_globals()}. - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - /** Component Globals *************************************************/ - - // Define a slug, as a fallback for backpat - if ( !defined( 'BP_MEMBERS_SLUG' ) ) { - define( 'BP_MEMBERS_SLUG', $this->id ); - } - - // Override any passed args - $args = array( - 'slug' => BP_MEMBERS_SLUG, - 'root_slug' => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, - 'has_directory' => true, - 'directory_title' => _x( 'Members', 'component directory title', 'buddypress' ), - 'search_string' => __( 'Search Members...', 'buddypress' ), - 'global_tables' => array( - 'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity', - 'table_name_signups' => bp_core_get_table_prefix() . 'signups', - ) - ); - - parent::setup_globals( $args ); - - /** Logged in user ****************************************************/ - - // The core userdata of the user who is currently logged in. - $bp->loggedin_user->userdata = bp_core_get_core_userdata( bp_loggedin_user_id() ); - - // Fetch the full name for the logged in user - $bp->loggedin_user->fullname = isset( $bp->loggedin_user->userdata->display_name ) ? $bp->loggedin_user->userdata->display_name : ''; - - // 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://example.com/members/andy - $bp->loggedin_user->domain = bp_core_get_user_domain( bp_loggedin_user_id() ); - - /** Displayed user ****************************************************/ - - // The core userdata of the user who is currently being displayed - $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); - - // Fetch the full name displayed user - $bp->displayed_user->fullname = isset( $bp->displayed_user->userdata->display_name ) ? $bp->displayed_user->userdata->display_name : ''; - - // The domain for the user currently being displayed - $bp->displayed_user->domain = bp_core_get_user_domain( bp_displayed_user_id() ); - - /** Signup ************************************************************/ - - $bp->signup = new stdClass; - - /** Profiles Fallback *************************************************/ - - if ( !bp_is_active( 'xprofile' ) ) { - $bp->profile = new stdClass; - $bp->profile->slug = 'profile'; - $bp->profile->id = 'profile'; - } - } - - /** - * Set up canonical stack for this component. - * - * @since BuddyPress (2.1.0) - */ - public function setup_canonical_stack() { - $bp = buddypress(); - - /** Default Profile Component *****************************************/ - - if ( defined( 'BP_DEFAULT_COMPONENT' ) && BP_DEFAULT_COMPONENT ) { - $bp->default_component = BP_DEFAULT_COMPONENT; - } else { - if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { - $bp->default_component = bp_get_activity_slug(); - } else { - $bp->default_component = ( 'xprofile' === $bp->profile->id ) ? 'profile' : $bp->profile->id; - } - } - - /** Canonical Component Stack *****************************************/ - - if ( bp_displayed_user_id() ) { - $bp->canonical_stack['base_url'] = bp_displayed_user_domain(); - - if ( bp_current_component() ) { - $bp->canonical_stack['component'] = bp_current_component(); - } - - if ( bp_current_action() ) { - $bp->canonical_stack['action'] = bp_current_action(); - } - - if ( !empty( $bp->action_variables ) ) { - $bp->canonical_stack['action_variables'] = bp_action_variables(); - } - - // Looking at the single member root/home, so assume the default - if ( ! bp_current_component() ) { - $bp->current_component = $bp->default_component; - - // The canonical URL will not contain the default component - } elseif ( bp_is_current_component( $bp->default_component ) && ! bp_current_action() ) { - unset( $bp->canonical_stack['component'] ); - } - - // if we're on a spammer's profile page, only users with the 'bp_moderate' cap - // can view subpages on the spammer's profile - // - // users without the cap trying to access a spammer's subnav page will get - // redirected to the root of the spammer's profile page. this occurs by - // by removing the component in the canonical stack. - if ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) { - unset( $bp->canonical_stack['component'] ); - } - } - } - - /** - * Set up fall-back component navigation if XProfile is inactive. - * - * @since BuddyPress (1.5.0) - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Bail if XProfile component is active - if ( bp_is_active( 'xprofile' ) ) { - return; - } - - // Don't set up navigation if there's no member - if ( ! is_user_logged_in() && ! bp_is_user() ) { - return; - } - - $bp = buddypress(); - - // Setup the main navigation - $main_nav = array( - 'name' => _x( 'Profile', 'Member profile main navigation', 'buddypress' ), - 'slug' => $bp->profile->slug, - 'position' => 20, - 'screen_function' => 'bp_members_screen_display_profile', - 'default_subnav_slug' => 'public', - 'item_css_id' => $bp->profile->id - ); - - // User links - $user_domain = bp_displayed_user_domain() ? bp_displayed_user_domain() : bp_loggedin_user_domain(); - $profile_link = trailingslashit( $user_domain . $bp->profile->slug ); - - // Setup the subnav items for the member profile - $sub_nav[] = array( - 'name' => _x( 'View', 'Member profile view', 'buddypress' ), - 'slug' => 'public', - 'parent_url' => $profile_link, - 'parent_slug' => $bp->profile->slug, - 'screen_function' => 'bp_members_screen_display_profile', - 'position' => 10 - ); - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the title for pages and <title>. - */ - public function setup_title() { - $bp = buddypress(); - - if ( bp_is_my_profile() ) { - $bp->bp_options_title = __( 'You', 'buddypress' ); - } elseif ( bp_is_user() ) { - $bp->bp_options_title = bp_get_displayed_user_fullname(); - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->bp_options_title ) - ) ); - } - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-members-component.php'; /** * Set up the bp-members component. 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 2377fdc1b6434d5eb27be884db71a2eb155da0fc..6b6cdd42093a8eb06e9dfe8d6e99d6da6e88167d 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Screens. * @@ -7,11 +6,15 @@ * * @package BuddyPress * @subpackage MembersScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-members-theme-compat.php'; +require dirname( __FILE__ ) . '/classes/class-bp-registration-theme-compat.php'; + /** * Handle the display of the profile page by loading the correct template file. */ @@ -20,14 +23,14 @@ function bp_members_screen_display_profile() { /** * Fires right before the loading of the Member profile screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $template Path to the Member template to load. */ @@ -44,14 +47,14 @@ function bp_members_screen_index() { /** * Fires right before the loading of the Member directory index screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $value Path to the member directory template to load. */ @@ -69,10 +72,10 @@ function bp_core_screen_signup() { if ( ! bp_is_current_component( 'register' ) || bp_current_action() ) return; - // Not a directory + // Not a directory. bp_update_is_directory( false, 'register' ); - // If the user is logged in, redirect away from here + // If the user is logged in, redirect away from here. if ( is_user_logged_in() ) { $redirect_to = bp_is_component_front_page( 'register' ) @@ -82,7 +85,7 @@ function bp_core_screen_signup() { /** * Filters the URL to redirect logged in users to when visiting registration page. * - * @since BuddyPress (1.5.1) + * @since 1.5.1 * * @param string $redirect_to URL to redirect user to. */ @@ -93,75 +96,75 @@ function bp_core_screen_signup() { $bp->signup->step = 'request-details'; - if ( !bp_get_signup_allowed() ) { + if ( !bp_get_signup_allowed() ) { $bp->signup->step = 'registration-disabled'; - // If the signup page is submitted, validate and save + // 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) + * @since 2.0.0 */ do_action( 'bp_signup_pre_validate' ); - // Check the base account details for problems + // Check the base account details for problems. $account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] ); - // If there are errors with account details, set them for display + // If there are errors with account details, set them for display. if ( !empty( $account_details['errors']->errors['user_name'] ) ) $bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0]; if ( !empty( $account_details['errors']->errors['user_email'] ) ) $bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0]; - // Check that both password fields are filled in + // Check that both password fields are filled in. if ( empty( $_POST['signup_password'] ) || empty( $_POST['signup_password_confirm'] ) ) $bp->signup->errors['signup_password'] = __( 'Please make sure you enter your password twice', 'buddypress' ); - // Check that the passwords match + // Check that the passwords match. if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] ) $bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' ); $bp->signup->username = $_POST['signup_username']; $bp->signup->email = $_POST['signup_email']; - // Now we've checked account details, we can check profile information + // Now we've checked account details, we can check profile information. if ( bp_is_active( 'xprofile' ) ) { - // Make sure hidden field is passed and populated + // Make sure hidden field is passed and populated. if ( isset( $_POST['signup_profile_field_ids'] ) && !empty( $_POST['signup_profile_field_ids'] ) ) { - // Let's compact any profile field info into an array + // Let's compact any profile field info into an array. $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); - // Loop through the posted fields formatting any datebox values then validate the field + // Loop through the posted fields formatting any datebox values then validate the field. foreach ( (array) $profile_field_ids as $field_id ) { if ( !isset( $_POST['field_' . $field_id] ) ) { if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $_POST['field_' . $field_id . '_day'] . $_POST['field_' . $field_id . '_month'] . $_POST['field_' . $field_id . '_year'] ) ); } - // Create errors for required fields without values - if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST['field_' . $field_id] ) ) + // Create errors for required fields without values. + if ( xprofile_check_is_required_field( $field_id ) && empty( $_POST[ 'field_' . $field_id ] ) && ! bp_current_user_can( 'bp_moderate' ) ) $bp->signup->errors['field_' . $field_id] = __( 'This is a required field', 'buddypress' ); } - // This situation doesn't naturally occur so bounce to website root + // This situation doesn't naturally occur so bounce to website root. } else { bp_core_redirect( bp_get_root_domain() ); } } - // Finally, let's check the blog details, if the user wants a blog and blog creation is enabled + // 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_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'] ); - // If there are errors with blog details, set them for display + // If there are errors with blog details, set them for display. if ( !empty( $blog_details['errors']->errors['blogname'] ) ) $bp->signup->errors['signup_blog_url'] = $blog_details['errors']->errors['blogname'][0]; @@ -173,20 +176,22 @@ function bp_core_screen_signup() { /** * Fires after the validation of a new signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_signup_validate' ); // Add any errors to the action for the field in the template for display. if ( !empty( $bp->signup->errors ) ) { foreach ( (array) $bp->signup->errors as $fieldname => $error_message ) { - // addslashes() and stripslashes() to avoid create_function() - // syntax errors when the $error_message contains quotes + /* + * The addslashes() and stripslashes() used to avoid create_function() + * syntax errors when the $error_message contains quotes. + */ /** * Filters the error message in the loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Error message wrapped in html. */ @@ -200,20 +205,20 @@ function bp_core_screen_signup() { if ( 'none' != $active_signup ) { - // Make sure the extended profiles module is enabled + // Make sure the extended profiles module is enabled. if ( bp_is_active( 'xprofile' ) ) { - // Let's compact any profile field info into usermeta + // Let's compact any profile field info into usermeta. $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); - // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile() + // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile(). foreach ( (array) $profile_field_ids as $field_id ) { if ( ! isset( $_POST['field_' . $field_id] ) ) { if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { - // Concatenate the values + // Concatenate the values. $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; - // Turn the concatenated value into a timestamp + // Turn the concatenated value into a timestamp. $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); } } @@ -225,27 +230,27 @@ function bp_core_screen_signup() { $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility']; } - // Store the profile field ID's in usermeta + // Store the profile field ID's in usermeta. $usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids']; } - // Hash and store the password + // Hash and store the password. $usermeta['password'] = wp_hash_password( $_POST['signup_password'] ); - // If the user decided to create a blog, save those details to usermeta + // If the user decided to create a blog, save those details to usermeta. 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) + * @since 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 + // Finally, sign up the user and/or blog. if ( isset( $_POST['signup_with_blog'] ) && is_multisite() ) $wp_user_id = bp_core_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta ); else @@ -262,7 +267,7 @@ function bp_core_screen_signup() { /** * Fires after the completion of a new signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_complete_signup' ); } @@ -272,14 +277,14 @@ function bp_core_screen_signup() { /** * Fires right before the loading of the Member registration screen template file. * - * @since BuddyPress (1.5.0) + * @since 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) + * @since 1.5.0 * * @param string $value Path to the Member registration template to load. */ @@ -294,12 +299,12 @@ add_action( 'bp_screens', 'bp_core_screen_signup' ); */ function bp_core_screen_activation() { - // Bail if not viewing the activation page + // Bail if not viewing the activation page. if ( ! bp_is_current_component( 'activate' ) ) { return false; } - // If the user is already logged in, redirect away from here + // If the user is already logged in, redirect away from here. if ( is_user_logged_in() ) { // If activation page is also front page, set to members directory to @@ -308,60 +313,52 @@ function bp_core_screen_activation() { ? bp_get_members_directory_permalink() : bp_get_root_domain(); - // Trailing slash it, as we expect these URL's to be + // 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) + * @since 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 + // Redirect away from the activation page. bp_core_redirect( $redirect_to ); } - // grab the key (the old way) + // Grab the key (the old way). $key = isset( $_GET['key'] ) ? $_GET['key'] : ''; - // grab the key (the new way) + // Grab the key (the new way). if ( empty( $key ) ) { $key = bp_current_action(); } - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - // we've got a key; let's attempt to activate the signup + // We've got a key; let's attempt to activate the signup. if ( ! empty( $key ) ) { /** * Filters the activation signup. * - * @since BuddyPress (1.1.0) + * @since 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 there were errors, add a message and redirect. 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( $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; } @@ -369,7 +366,7 @@ function bp_core_screen_activation() { /** * Filters the template to load for the Member activation page screen. * - * @since BuddyPress (1.1.1) + * @since 1.1.1 * * @param string $value Path to the Member activation template to load. */ @@ -379,333 +376,5 @@ add_action( 'bp_screens', 'bp_core_screen_activation' ); /** Theme Compatibility *******************************************************/ -/** - * The main theme compat class for BuddyPress Members. - * - * This class sets up the necessary theme compatibility actions to safely output - * member template parts to the_title and the_content areas of a theme. - * - * @since BuddyPress (1.7.0) - */ -class BP_Members_Theme_Compat { - - /** - * Set up the members component theme compatibility. - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - add_action( 'bp_setup_theme_compat', array( $this, 'is_members' ) ); - } - - /** - * Are we looking at something that needs members theme compatibility? - * - * @since BuddyPress (1.7.0) - */ - 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() ) { - 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' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); - - // 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() ) { - 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' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); - - } - } - - /** Directory *************************************************************/ - - /** - * Add template hierarchy to theme compat for the members directory page. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @since BuddyPress (1.8.0) - * - * @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() ) { - - /** - * 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' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with directory data. - * - * @since BuddyPress (1.7.0) - */ - public function directory_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => bp_get_directory_title( 'members' ), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the members index template part. - * - * @since BuddyPress (1.7.0) - */ - public function directory_content() { - return bp_buffer_template_part( 'members/index', null, false ); - } - - /** Single ****************************************************************/ - - /** - * Add custom template hierarchy to theme compat for member pages. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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 some variables we're going to reference in our custom templates - $user_nicename = buddypress()->displayed_user->userdata->user_nicename; - - /** - * 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', - 'members/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php', - 'members/single/index-component-' . sanitize_file_name( bp_current_component() ) . '.php', - 'members/single/index.php' - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with the displayed user's data. - * - * @since BuddyPress (1.7.0) - */ - public function single_dummy_post() { - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => bp_get_displayed_user_fullname(), - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with the members' single home template part. - * - * @since BuddyPress (1.7.0) - */ - public function single_dummy_content() { - return bp_buffer_template_part( 'members/single/home', null, false ); - } -} new BP_Members_Theme_Compat(); - -/** - * The main theme compat class for BuddyPress Registration. - * - * 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) - */ -class BP_Registration_Theme_Compat { - - /** - * Setup the groups component theme compatibility. - * - * @since BuddyPress (1.7.0) - */ - public function __construct() { - add_action( 'bp_setup_theme_compat', array( $this, 'is_registration' ) ); - } - - /** - * Are we looking at either the registration or activation pages? - * - * @since BuddyPress (1.7.0) - */ - public function is_registration() { - - // Bail if not looking at the registration or activation page - if ( ! bp_is_register_page() && ! bp_is_activation_page() ) { - return; - } - - // Not a directory - bp_update_is_directory( false, 'register' ); - - // Setup actions - add_filter( 'bp_get_buddypress_template', array( $this, 'template_hierarchy' ) ); - add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) ); - add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) ); - } - - /** Template ***********************************************************/ - - /** - * Add template hierarchy to theme compat for registration/activation pages. - * - * This is to mirror how WordPress has - * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. - * - * @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() ); - - /** - * 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" - ) ); - - // Merge new templates with existing stack - // @see bp_get_theme_compat_templates() - $templates = array_merge( (array) $new_templates, $templates ); - - return $templates; - } - - /** - * Update the global $post with dummy data. - * - * @since BuddyPress (1.7.0) - */ - public function dummy_post() { - // Registration page - if ( bp_is_register_page() ) { - $title = __( 'Create an Account', 'buddypress' ); - - if ( 'completed-confirmation' == bp_get_current_signup_step() ) { - $title = __( 'Check Your Email To Activate Your Account!', 'buddypress' ); - } - - // Activation page - } else { - $title = __( 'Activate your Account', 'buddypress' ); - - if ( bp_account_was_activated() ) { - $title = __( 'Account Activated', 'buddypress' ); - } - } - - bp_theme_compat_reset_post( array( - 'ID' => 0, - 'post_title' => $title, - 'post_author' => 0, - 'post_date' => 0, - 'post_content' => '', - 'post_type' => 'page', - 'post_status' => 'publish', - 'is_page' => true, - 'comment_status' => 'closed' - ) ); - } - - /** - * Filter the_content with either the register or activate templates. - * - * @since BuddyPress (1.7.0) - */ - public function dummy_content() { - if ( bp_is_register_page() ) { - return bp_buffer_template_part( 'members/register', null, false ); - } else { - return bp_buffer_template_part( 'members/activate', null, false ); - } - } -} new BP_Registration_Theme_Compat(); 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 728f59a36dba04cdebe6311b974632bc30ca8e53..23b5ccec269d939dacc216e4955561ec635f7295 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-template.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-template.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Template Tags. * @@ -7,15 +6,47 @@ * * @package BuddyPress * @subpackage Members + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-core-members-template.php'; + +/** + * Output the profile component slug. + * + * @since 2.4.0 + * + * @uses bp_get_profile_slug() + */ +function bp_profile_slug() { + echo bp_get_profile_slug(); +} + /** + * Return the profile component slug. + * + * @since 2.4.0 + * + * @return string + */ + function bp_get_profile_slug() { + + /** + * Filters the profile component slug. + * + * @since 2.4.0 + * + * @param string $slug Profile component slug. + */ + return apply_filters( 'bp_get_profile_slug', buddypress()->profile->slug ); + } + /** * Output the members component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_members_slug() */ @@ -25,7 +56,7 @@ function bp_members_slug() { /** * Return the members component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -34,7 +65,7 @@ function bp_members_slug() { /** * Filters the Members component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Members component slug. */ @@ -44,7 +75,7 @@ function bp_members_slug() { /** * Output the members component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_members_root_slug() */ @@ -54,7 +85,7 @@ function bp_members_root_slug() { /** * Return the members component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -63,17 +94,47 @@ function bp_members_root_slug() { /** * Filters the Members component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Members component root slug. */ return apply_filters( 'bp_get_members_root_slug', buddypress()->members->root_slug ); } +/** + * Output the member type base slug. + * + * @since 2.5.0 + */ +function bp_members_member_type_base() { + echo esc_url( bp_get_members_member_type_base() ); +} + /** + * Get the member type base slug. + * + * The base slug is the string used as the base prefix when generating member type directory URLs. + * For example, in example.com/members/type/foo/, 'foo' is the member type and 'type' is the + * base slug. + * + * @since 2.5.0 + * + * @return string + */ + function bp_get_members_member_type_base() { + /** + * Filters the member type URL base. + * + * @since 2.3.0 + * + * @param string $base + */ + return apply_filters( 'bp_members_member_type_base', _x( 'type', 'member type URL base', 'buddypress' ) ); + } + /** * Output member directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_members_directory_permalink() */ @@ -83,7 +144,7 @@ function bp_members_directory_permalink() { /** * Return member directory permalink. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -92,17 +153,65 @@ function bp_members_directory_permalink() { /** * Filters the member directory permalink. * - * @since BuddyPress (1.5.0) + * @since 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() ) ); } +/** + * Output member type directory permalink. + * + * @since 2.5.0 + * + * @uses bp_get_member_type_directory_permalink() + * + * @param string $member_type Optional. Member type. + */ +function bp_member_type_directory_permalink( $member_type = '' ) { + echo esc_url( bp_get_member_type_directory_permalink( $member_type ) ); +} + /** + * Return member type directory permalink. + * + * @since 2.5.0 + * + * @param string $member_type Optional. Member type. Defaults to current member type. + * @return string Member type directory URL on success, an empty string on failure. + */ + function bp_get_member_type_directory_permalink( $member_type = '' ) { + + if ( $member_type ) { + $_member_type = $member_type; + } else { + // Fall back on the current member type. + $_member_type = bp_get_current_member_type(); + } + + $type = bp_get_member_type_object( $_member_type ); + + // Bail when member type is not found or has no directory. + if ( ! $type || ! $type->has_directory ) { + return ''; + } + + /** + * Filters the member type directory permalink. + * + * @since 2.5.0 + * + * @param string $value Member type directory permalink. + * @param object $type Member type object. + * @param string $member_type Member type name, as passed to the function. + */ + return apply_filters( 'bp_get_member_type_directory_permalink', trailingslashit( bp_get_members_directory_permalink() . bp_get_members_member_type_base() . '/' . $type->directory_slug ), $type, $member_type ); + } + /** * Output the sign-up slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_signup_slug() */ @@ -112,7 +221,7 @@ function bp_signup_slug() { /** * Return the sign-up slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -130,7 +239,7 @@ function bp_signup_slug() { /** * Filters the sign-up slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Sign-up slug. */ @@ -140,7 +249,7 @@ function bp_signup_slug() { /** * Output the activation slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activate_slug() */ @@ -150,7 +259,7 @@ function bp_activate_slug() { /** * Return the activation slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -168,295 +277,13 @@ function bp_activate_slug() { /** * Filters the activation slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Activation slug. */ return apply_filters( 'bp_get_activate_slug', $slug ); } -/** - * The main member template loop class. - * - * Responsible for loading a group of members into a loop for display. - */ -class BP_Core_Members_Template { - - /** - * The loop iterator. - * - * @access public - * @var int - */ - public $current_member = -1; - - /** - * The number of members returned by the paged query. - * - * @access public - * @var int - */ - public $member_count; - - /** - * Array of members located by the query. - * - * @access public - * @var array - */ - public $members; - - /** - * The member object currently being iterated on. - * - * @access public - * @var object - */ - public $member; - - /** - * A flag for whether the loop is currently being iterated. - * - * @access public - * @var bool - */ - 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 string - */ - public $pag_page; - - /** - * The number of items being requested per page. - * - * @access public - * @var string - */ - public $pag_num; - - /** - * An HTML string containing pagination links. - * - * @access public - * @var string - */ - public $pag_links; - - /** - * The total number of members matching the query parameters. - * - * @access public - * @var int - */ - 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 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, 'member_type' => $member_type ) ); - - if ( !$max || $max >= (int) $this->members['total'] ) - $this->total_member_count = (int) $this->members['total']; - else - $this->total_member_count = (int) $max; - - $this->members = $this->members['users']; - - if ( $max ) { - if ( $max >= count( $this->members ) ) { - $this->member_count = count( $this->members ); - } else { - $this->member_count = (int) $max; - } - } else { - $this->member_count = count( $this->members ); - } - - if ( (int) $this->total_member_count && (int) $this->pag_num ) { - $pag_args = array( - $this->pag_arg => '%#%', - ); - - if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { - $base = remove_query_arg( 's', wp_get_referer() ); - } else { - $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 ) ) { - $add_args['s'] = urlencode( $search_terms ); - } - - $this->pag_links = paginate_links( array( - 'base' => add_query_arg( $pag_args, $base ), - 'format' => '', - 'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ), - 'current' => (int) $this->pag_page, - 'prev_text' => _x( '←', 'Member pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Member pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => $add_args, - ) ); - } - } - - /** - * Whether there are members available in the loop. - * - * @see bp_has_members() - * - * @return bool True if there are items in the loop, otherwise false. - */ - function has_members() { - if ( $this->member_count ) - return true; - - return false; - } - - /** - * Set up the next member and iterate index. - * - * @return object The next member to iterate over. - */ - function next_member() { - $this->current_member++; - $this->member = $this->members[$this->current_member]; - - return $this->member; - } - - /** - * Rewind the members and reset member index. - */ - function rewind_members() { - $this->current_member = -1; - if ( $this->member_count > 0 ) { - $this->member = $this->members[0]; - } - } - - /** - * Whether there are members left in the loop to iterate over. - * - * This method is used by {@link bp_members()} as part of the while loop - * that controls iteration inside the members loop, eg: - * while ( bp_members() ) { ... - * - * @see bp_members() - * - * @return bool True if there are more members to show, otherwise false. - */ - function members() { - 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current member inside the loop. - * - * Used by {@link bp_the_member()} to set up the current member data - * while looping, so that template tags used during that iteration make - * reference to the current member. - * - * @see bp_the_member() - */ - function the_member() { - - $this->in_the_loop = true; - $this->member = $this->next_member(); - - // loop has just started - 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' ); - } - - } -} - -/** - * Rewind the members and reset member index. - */ -function bp_rewind_members() { - global $members_template; - - return $members_template->rewind_members(); -} - /** * Initialize the members loop. * @@ -476,41 +303,48 @@ 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. 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. + * @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|array $member_type__in Array or comma-separated list of member types to limit + * results to. + * @type string|array $member_type__not_in Array or comma-separated list of member types to exclude + * from results. + * @type string $search_terms Limit results by a search term. Default: value of + * `$_REQUEST['members_search']` or `$_REQUEST['s']`, if present. + * Otherwise false. + * @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. */ function bp_has_members( $args = '' ) { global $members_template; - // Default user ID + // Default user ID. $user_id = 0; - // User filtering + // User filtering. if ( bp_is_user_friends() && ! bp_is_user_friend_requests() ) { $user_id = bp_displayed_user_id(); } @@ -525,26 +359,34 @@ function bp_has_members( $args = '' ) { } } - // type: active ( default ) | random | newest | popular | online | alphabetical + $search_terms_default = null; + $search_query_arg = bp_core_get_component_search_query_arg( 'members' ); + if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) { + $search_terms_default = stripslashes( $_REQUEST[ $search_query_arg ] ); + } + + // Type: active ( default ) | random | newest | popular | online | alphabetical. $r = bp_parse_args( $args, array( - 'type' => 'active', - 'page' => 1, - 'per_page' => 20, - 'max' => false, + 'type' => 'active', + 'page' => 1, + 'per_page' => 20, + 'max' => false, - 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679 + 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679. - 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users - 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users + 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users. + '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 + 'user_id' => $user_id, // Pass a user_id to only show friends of this user. + 'member_type' => $member_type, + 'member_type__in' => '', + 'member_type__not_in' => '', + 'search_terms' => $search_terms_default, - 'meta_key' => false, // Only return users with this usermeta - 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key + 'meta_key' => false, // Only return users with this usermeta. + 'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key. - 'populate_extras' => true // Fetch usermeta? Friend count, last active etc. + 'populate_extras' => true // Fetch usermeta? Friend count, last active etc. ), 'has_members' ); // Pass a filter if ?s= is set. @@ -556,12 +398,12 @@ function bp_has_members( $args = '' ) { } } - // Set per_page to max if max is larger than per_page + // Set per_page to max if max is larger than per_page. if ( !empty( $r['max'] ) && ( $r['per_page'] > $r['max'] ) ) { $r['per_page'] = $r['max']; } - // Query for members and populate $members_template global + // Query for members and populate $members_template global. $members_template = new BP_Core_Members_Template( $r['type'], $r['page'], @@ -575,13 +417,15 @@ function bp_has_members( $args = '' ) { $r['meta_key'], $r['meta_value'], $r['page_arg'], - $r['member_type'] + $r['member_type'], + $r['member_type__in'], + $r['member_type__not_in'] ); /** * Filters whether or not BuddyPress has members to iterate over. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param bool $value Whether or not there are members to iterate over. * @param array $members_template Populated $members_template global. @@ -660,7 +504,7 @@ function bp_members_pagination_count() { /** * Filters the members pagination count. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $pag Pagination count string. */ @@ -684,7 +528,7 @@ function bp_members_pagination_links() { /** * Filters the members pagination link. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $pag_links HTML markup for pagination links. */ @@ -711,7 +555,7 @@ function bp_member_user_id() { /** * Filters the ID of the current member in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $member_id ID of the member being iterated over. */ @@ -721,9 +565,9 @@ function bp_member_user_id() { /** * Output the row class of the current member in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param array $classes Array of custom classes + * @param array $classes Array of custom classes. */ function bp_member_class( $classes = array() ) { echo bp_get_member_class( $classes ); @@ -731,29 +575,29 @@ function bp_member_class( $classes = array() ) { /** * Return the row class of the current member in the loop. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param array $classes Array of custom classes + * @param array $classes Array of custom classes. * * @return string Row class of the member */ function bp_get_member_class( $classes = array() ) { global $members_template; - // Add even/odd classes, but only if there's more than 1 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 member in the loop, don't bother with odd and even + // If we've only one member in the loop, don't bother with odd and even. } else { $classes[] = 'bp-single-member'; } - // Maybe add 'is-online' class + // Maybe add 'is-online' class. if ( ! empty( $members_template->member->last_activity ) ) { - // Calculate some times + // 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 ); @@ -764,7 +608,7 @@ function bp_member_class( $classes = array() ) { } } - // Add current user class + // Add current user class. if ( bp_loggedin_user_id() === (int) $members_template->member->id ) { $classes[] = 'is-current-user'; } @@ -772,7 +616,7 @@ function bp_member_class( $classes = array() ) { /** * Filters the determined classes to add to the HTML element. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $classes Classes to be added to the HTML element. */ @@ -800,7 +644,7 @@ function bp_member_user_nicename() { /** * Filters the nicename of the current member in the loop. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param string $user_nicename Nicename for the current member. */ @@ -824,7 +668,7 @@ function bp_member_user_login() { /** * Filters the login of the current member in the loop. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param string $user_login Login for the current member. */ @@ -848,7 +692,7 @@ function bp_member_user_email() { /** * Filters the email address of the current member in the loop. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param string $user_email Email address for the current member. */ @@ -866,7 +710,7 @@ function bp_member_is_loggedin_user() { /** * Filters whether the current member in the loop is the logged-in user. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param bool $value Whether current member in the loop is logged in. */ @@ -885,10 +729,9 @@ function bp_member_avatar( $args = '' ) { /** * Filters a members avatar. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * - * @param string $value Formatted HTML <img> element, - * or raw avatar URL based on $html arg. + * @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 ) ); } @@ -932,10 +775,9 @@ function bp_member_avatar( $args = '' ) { /** * Filters a members avatar. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * - * @param string $value Formatted HTML <img> element, - * or raw avatar URL based on $html arg. + * @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 ) ) ); } @@ -957,7 +799,7 @@ function bp_member_permalink() { /** * Filters the permalink for the current member in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Permalink for the current member in the loop. */ @@ -982,7 +824,7 @@ function bp_member_name() { /** * Filters the display name of current member in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Display name for current member. */ @@ -1001,9 +843,9 @@ function bp_member_name() { function bp_get_member_name() { global $members_template; - // Generally, this only fires when xprofile is disabled + // Generally, this only fires when xprofile is disabled. if ( empty( $members_template->member->fullname ) ) { - // Our order of preference for alternative fullnames + // Our order of preference for alternative fullnames. $name_stack = array( 'display_name', 'user_nicename', @@ -1012,8 +854,7 @@ function bp_member_name() { foreach ( $name_stack as $source ) { if ( !empty( $members_template->member->{$source} ) ) { - // When a value is found, set it as fullname and be done - // with it + // When a value is found, set it as fullname and be done with it. $members_template->member->fullname = $members_template->member->{$source}; break; } @@ -1023,7 +864,7 @@ function bp_member_name() { /** * Filters the display name of current member in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $fullname Display name for current member. */ @@ -1057,25 +898,25 @@ function bp_member_last_active( $args = array() ) { function bp_get_member_last_active( $args = array() ) { global $members_template; - // Parse the activity format + // Parse the activity format. $r = bp_parse_args( $args, array( 'active_format' => true ) ); - // Backwards compatibility 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' ); } - // Member has logged in at least one time + // Member has logged in at least one time. if ( isset( $members_template->member->last_activity ) ) { - // Backwards compatibility for pre 1.5 'ago' strings + // Backwards compatibility for pre 1.5 'ago' strings. $last_activity = ! empty( $r['active_format'] ) ? bp_core_get_last_activity( $members_template->member->last_activity, $r['active_format'] ) : bp_core_time_since( $members_template->member->last_activity ); - // Member has never logged in or been active + // Member has never logged in or been active. } else { $last_activity = __( 'Never active', 'buddypress' ); } @@ -1083,7 +924,7 @@ function bp_member_last_active( $args = array() ) { /** * Filters the current members last active time. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $last_activity Formatted time since last activity. * @param array $r Array of parsed arguments for query. @@ -1094,7 +935,7 @@ function bp_member_last_active( $args = array() ) { /** * Output the latest update of the current member in the loop. * - * @param array|string $args + * @param array|string $args Array of arguments for latest update. */ function bp_member_latest_update( $args = '' ) { echo bp_get_member_latest_update( $args ); @@ -1127,7 +968,7 @@ function bp_member_latest_update( $args = '' ) { /** * Filters the excerpt of the latest update for current member in the loop. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param string $value Excerpt of the latest update for current member in the loop. */ @@ -1146,7 +987,7 @@ function bp_member_latest_update( $args = '' ) { /** * Filters the latest update from the current member in the loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $update_content Formatted latest update for current member. */ @@ -1186,10 +1027,10 @@ function bp_member_profile_data( $args = '' ) { return false; } - // Declare local variables + // Declare local variables. $data = false; - // Guess at default $user_id + // Guess at default $user_id. $default_user_id = 0; if ( ! empty( $members_template->member->id ) ) { $default_user_id = $members_template->member->id; @@ -1204,23 +1045,23 @@ function bp_member_profile_data( $args = '' ) { $r = wp_parse_args( $args, $defaults ); - // If we're in a members loop, get the data from the global + // If we're in a members loop, get the data from the global. if ( ! empty( $members_template->member->profile_data ) ) { $profile_data = $members_template->member->profile_data; } - // Otherwise query for the data + // Otherwise query for the data. if ( empty( $profile_data ) && method_exists( 'BP_XProfile_ProfileData', 'get_all_for_user' ) ) { $profile_data = BP_XProfile_ProfileData::get_all_for_user( $r['user_id'] ); } // If we're in the members loop, but the profile data has not - // been loaded into the global, cache it there for later use + // been loaded into the global, cache it there for later use. if ( ! empty( $members_template->member ) && empty( $members_template->member->profile_data ) ) { $members_template->member->profile_data = $profile_data; } - // Get the data for the specific field requested + // Get the data for the specific field requested. if ( ! empty( $profile_data ) && ! empty( $profile_data[ $r['field'] ]['field_type'] ) && ! empty( $profile_data[ $r['field'] ]['field_data'] ) ) { $data = xprofile_format_profile_field( $profile_data[ $r['field'] ]['field_type'], $profile_data[ $r['field'] ]['field_data'] ); } @@ -1228,7 +1069,7 @@ function bp_member_profile_data( $args = '' ) { /** * Filters resulting piece of member profile data. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string|bool $data Profile data if found, otherwise false. */ @@ -1254,7 +1095,7 @@ function bp_member_registered() { /** * Filters the 'registered [x days ago]' string for the current member. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $registered The 'registered [x days ago]' string. */ @@ -1278,14 +1119,19 @@ function bp_member_random_profile_data() { * Output hidden input for preserving member search params on form submit. */ function bp_member_hidden_fields() { - if ( isset( $_REQUEST['s'] ) ) - echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />'; + $query_arg = bp_core_get_component_search_query_arg( 'members' ); - if ( isset( $_REQUEST['letter'] ) ) + if ( isset( $_REQUEST[ $query_arg ] ) ) { + echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST[ $query_arg ] ) . '" name="search_terms" />'; + } + + if ( isset( $_REQUEST['letter'] ) ) { echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />'; + } - if ( isset( $_REQUEST['members_search'] ) ) + if ( isset( $_REQUEST['members_search'] ) ) { echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['members_search'] ) . '" name="search_terms" />'; + } } /** @@ -1293,18 +1139,23 @@ function bp_member_hidden_fields() { */ function bp_directory_members_search_form() { - $default_search_value = bp_get_search_default_text( 'members' ); - $search_value = !empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : $default_search_value; + $query_arg = bp_core_get_component_search_query_arg( 'members' ); + + if ( ! empty( $_REQUEST[ $query_arg ] ) ) { + $search_value = stripslashes( $_REQUEST[ $query_arg ] ); + } else { + $search_value = bp_get_search_default_text( 'members' ); + } $search_form_html = '<form action="" method="get" id="search-members-form"> - <label><input type="text" name="s" id="members_search" placeholder="'. esc_attr( $search_value ) .'" /></label> + <label for="members_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="members_search" placeholder="'. esc_attr( $search_value ) .'" /></label> <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) + * @since 1.9.0 * * @param string $search_form_html HTML markup for the member search form. */ @@ -1327,7 +1178,7 @@ function bp_total_site_member_count() { /** * Filters the total site member count. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $value Number-formatted total site member count. */ @@ -1354,7 +1205,7 @@ function bp_total_site_member_count() { function bp_get_loggedin_user_nav() { $bp = buddypress(); - // Loop through each navigation item + // Loop through each navigation item. foreach( (array) $bp->bp_nav as $nav_item ) { $selected = ''; @@ -1380,11 +1231,11 @@ function bp_get_loggedin_user_nav() { } } - // echo out the final list item + // Echo out the final list item. echo apply_filters_ref_array( 'bp_get_loggedin_user_nav_' . $nav_item['css_id'], array( '<li id="li-nav-' . $nav_item['css_id'] . '" ' . $selected . '><a id="my-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a></li>', &$nav_item ) ); } - // Always add a log out list item to the end of the navigation + // Always add a log out list item to the end of the navigation. $logout_link = '<li><a id="wp-logout" href="' . wp_logout_url( bp_get_root_domain() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>'; echo apply_filters( 'bp_logout_nav_link', $logout_link ); @@ -1416,7 +1267,7 @@ function bp_get_displayed_user_nav() { * * This is a dynamic filter that is dependent on the navigation tab component being rendered. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -1426,6 +1277,20 @@ function bp_get_displayed_user_nav() { } } +/** Cover image ***************************************************************/ + +/** + * Should we use the cover image header + * + * @since 2.4.0 + * + * @return bool True if the displayed user has a cover image, + * False otherwise + */ +function bp_displayed_user_use_cover_image_header() { + return (bool) bp_is_active( 'xprofile', 'cover_image' ) && ! bp_disable_cover_image_uploads() && bp_attachments_is_wp_version_supported(); +} + /** Avatars *******************************************************************/ /** @@ -1433,7 +1298,7 @@ function bp_get_displayed_user_nav() { * * @see bp_get_loggedin_user_avatar() for a description of params. * - * @param array|string $args + * @param array|string $args Array of arguments for logged in user avatar. */ function bp_loggedin_user_avatar( $args = '' ) { echo bp_get_loggedin_user_avatar( $args ); @@ -1470,7 +1335,7 @@ function bp_loggedin_user_avatar( $args = '' ) { /** * Filters the logged in user's avatar. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value User avatar string. */ @@ -1482,7 +1347,7 @@ function bp_loggedin_user_avatar( $args = '' ) { * * @see bp_get_displayed_user_avatar() for a description of params. * - * @param array|string $args + * @param array|string $args Array of arguments for displayed user avatar. */ function bp_displayed_user_avatar( $args = '' ) { echo bp_get_displayed_user_avatar( $args ); @@ -1519,7 +1384,7 @@ function bp_displayed_user_avatar( $args = '' ) { /** * Filters the displayed user's avatar. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value User avatar string. */ @@ -1540,7 +1405,7 @@ function bp_displayed_user_email() { function bp_get_displayed_user_email() { $bp = buddypress(); - // If displayed user exists, return email address + // If displayed user exists, return email address. if ( isset( $bp->displayed_user->userdata->user_email ) ) $retval = $bp->displayed_user->userdata->user_email; else @@ -1549,7 +1414,7 @@ function bp_displayed_user_email() { /** * Filters the email address of the displayed user. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $retval Email address for displayed user. */ @@ -1568,7 +1433,7 @@ function bp_last_activity( $user_id = 0 ) { /** * Filters the 'active [x days ago]' string for a user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Formatted 'active [x days ago]' string. */ @@ -1578,7 +1443,6 @@ function bp_last_activity( $user_id = 0 ) { * 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 ) { @@ -1591,7 +1455,7 @@ function bp_last_activity( $user_id = 0 ) { /** * Filters the 'active [x days ago]' string for a user. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Formatted 'active [x days ago]' string. */ @@ -1616,11 +1480,11 @@ function bp_user_firstname() { */ function bp_get_user_firstname( $name = false ) { - // Try to get displayed user + // Try to get displayed user. if ( empty( $name ) ) $name = bp_get_displayed_user_fullname(); - // Fall back on logged in user + // Fall back on logged in user. if ( empty( $name ) ) $name = bp_get_loggedin_user_fullname(); @@ -1629,7 +1493,7 @@ function bp_user_firstname() { /** * Filters the first name of a user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value First name of user. * @param string $fullname Full name of user. @@ -1653,7 +1517,7 @@ function bp_loggedin_user_link() { /** * Filters the link for the logged-in user's profile. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value Link for the logged-in user's profile. */ @@ -1676,7 +1540,7 @@ function bp_displayed_user_link() { /** * Filters the link for the displayed user's profile. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 * * @param string $value Link for the displayed user's profile. */ @@ -1706,7 +1570,7 @@ function bp_displayed_user_domain() { /** * Filters the generated link for the displayed user's profile. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Generated link for the displayed user's profile. */ @@ -1724,7 +1588,7 @@ function bp_loggedin_user_domain() { /** * Filters the generated link for the logged-in user's profile. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Generated link for the logged-in user's profile. */ @@ -1748,7 +1612,7 @@ function bp_displayed_user_fullname() { /** * Filters the displayed user's display name. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $value Displayed user's display name. */ @@ -1778,7 +1642,7 @@ function bp_loggedin_user_fullname() { /** * Filters the logged-in user's display name. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Logged-in user's display name. */ @@ -1808,7 +1672,7 @@ function bp_displayed_user_username() { /** * Filters the username of the displayed user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $username Username of the displayed user. */ @@ -1838,7 +1702,7 @@ function bp_loggedin_user_username() { /** * Filters the username of the logged-in user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $username Username of the logged-in user. */ @@ -1847,7 +1711,7 @@ function bp_loggedin_user_username() { /** * Echo the current member type message. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_current_member_type_message() { echo bp_get_current_member_type_message(); @@ -1855,7 +1719,7 @@ function bp_current_member_type_message() { /** * Generate the current member type message. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @return string */ @@ -1872,10 +1736,11 @@ function bp_current_member_type_message() { /** * Do we have a working custom sign up page? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_signup_slug() To make sure there is a slug assigned to the page. * @uses bp_locate_template() To make sure a template exists to provide output. + * * @return bool True if page and template exist, false if not. */ function bp_has_custom_signup_page() { @@ -1908,7 +1773,7 @@ function bp_signup_page() { /** * Filters the URL to the signup page. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $page URL to the signup page. */ @@ -1918,7 +1783,7 @@ function bp_signup_page() { /** * Do we have a working custom activation page? * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_activate_slug() To make sure there is a slug assigned to the page. * @uses bp_locate_template() To make sure a template exists to provide output. @@ -1954,7 +1819,7 @@ function bp_activation_page() { /** * Filters the URL of the activation page. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param string $page URL to the activation page. */ @@ -1982,7 +1847,7 @@ function bp_signup_username_value() { /** * Filters the username submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Username submitted during signup. */ @@ -2010,7 +1875,7 @@ function bp_signup_email_value() { /** * Filters the email address submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Email address submitted during signup. */ @@ -2036,7 +1901,7 @@ function bp_signup_with_blog_value() { /** * Filters the 'signup_with_blog' value submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value 'signup_with_blog' value submitted during signup. */ @@ -2064,7 +1929,7 @@ function bp_signup_blog_url_value() { /** * Filters the 'signup_blog_url' value submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value 'signup_blog_url' value submitted during signup. */ @@ -2074,7 +1939,7 @@ function bp_signup_blog_url_value() { /** * Output the base URL for subdomain installations of WordPress Multisite. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_signup_subdomain_base() { echo bp_signup_get_subdomain_base(); @@ -2084,20 +1949,20 @@ function bp_signup_subdomain_base() { * * Replaces bp_blogs_get_subdomain_base() * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com. */ function bp_signup_get_subdomain_base() { global $current_site; - // In case plugins are still using this filter + // 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) + * @since 2.1.0 * * @param string $subdomain_base The base URL - eg, 'example.com' for * site_url() example.com or www.example.com. @@ -2126,7 +1991,7 @@ function bp_signup_blog_title_value() { /** * Filters the 'signup_blog_title' value submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value 'signup_blog_title' value submitted during signup. */ @@ -2154,7 +2019,7 @@ function bp_signup_blog_privacy_value() { /** * Filters the 'signup_blog_privacy' value submitted during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value 'signup_blog_privacy' value submitted during signup. */ @@ -2175,22 +2040,22 @@ function bp_signup_avatar_dir_value() { function bp_get_signup_avatar_dir_value() { $bp = buddypress(); - // Check if signup_avatar_dir is passed + // Check if signup_avatar_dir is passed. if ( !empty( $_POST['signup_avatar_dir'] ) ) $signup_avatar_dir = $_POST['signup_avatar_dir']; - // If not, check if global is set + // If not, check if global is set. elseif ( !empty( $bp->signup->avatar_dir ) ) $signup_avatar_dir = $bp->signup->avatar_dir; - // If not, set false + // If not, set false. else $signup_avatar_dir = false; /** * Filters the avatar dir used during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string|bool $signup_avatar_dir Avatar dir used during signup or false. */ @@ -2248,7 +2113,7 @@ function bp_signup_avatar( $args = '' ) { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - // Avatar DIR is found + // Avatar DIR is found. if ( $signup_avatar_dir = bp_get_signup_avatar_dir_value() ) { $gravatar_img = bp_core_fetch_avatar( array( 'item_id' => $signup_avatar_dir, @@ -2261,10 +2126,10 @@ function bp_signup_avatar( $args = '' ) { 'class' => $class ) ); - // No avatar DIR was found + // No avatar DIR was found. } else { - // Set default gravatar type + // Set default gravatar type. if ( empty( $bp->grav_default->user ) ) $default_grav = 'wavatar'; elseif ( 'mystery' == $bp->grav_default->user ) @@ -2275,7 +2140,7 @@ function bp_signup_avatar( $args = '' ) { /** * Filters the base Gravatar url used for signup avatars when no avatar dir found. * - * @since BuddyPress (1.0.2) + * @since 1.0.2 * * @param string $value Gravatar url to use. */ @@ -2287,7 +2152,7 @@ function bp_signup_avatar( $args = '' ) { /** * Filters the user avatar during signup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $gravatar_img Avatar HTML image tag. * @param array $args Array of parsed args for avatar query. @@ -2329,7 +2194,7 @@ function bp_signup_allowed() { /** * Filters whether or not new signups are allowed. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param bool $signup_allowed Whether or not new signups are allowed. */ @@ -2339,7 +2204,7 @@ function bp_signup_allowed() { /** * Hook member activity feed to <head>. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_members_activity_feed() { if ( !bp_is_active( 'activity' ) || !bp_is_user() ) @@ -2378,22 +2243,22 @@ function bp_members_component_link( $component, $action = '', $query_args = '', */ function bp_get_members_component_link( $component, $action = '', $query_args = '', $nonce = false ) { - // Must be displayed user + // Must be displayed user. if ( !bp_displayed_user_id() ) return; $bp = buddypress(); - // Append $action to $url if there is no $type + // Append $action to $url if there is no $type. if ( !empty( $action ) ) $url = bp_displayed_user_domain() . $bp->{$component}->slug . '/' . $action; else $url = bp_displayed_user_domain() . $bp->{$component}->slug; - // Add a slash at the end of our user url + // Add a slash at the end of our user url. $url = trailingslashit( $url ); - // Add possible query arg + // Add possible query arg. if ( !empty( $query_args ) && is_array( $query_args ) ) $url = add_query_arg( $query_args, $url ); @@ -2403,7 +2268,7 @@ function bp_members_component_link( $component, $action = '', $query_args = '', elseif ( is_string( $nonce ) ) $url = wp_nonce_url( $url, $nonce ); - // Return the url, if there is one + // Return the url, if there is one. if ( !empty( $url ) ) return $url; } diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php b/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php index c02c9da7e3ff464a7c9970d24f05825a4b2c5a6e..fcb54ff022df71608c43ecce99417073bfc60d1e 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-widgets.php @@ -3,17 +3,23 @@ * BuddyPress Members Widgets. * * @package BuddyPress + * @subpackage MembersWidgets + * @since 2.2.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-core-members-widget.php'; +require dirname( __FILE__ ) . '/classes/class-bp-core-whos-online-widget.php'; +require dirname( __FILE__ ) . '/classes/class-bp-core-recently-active-widget.php'; + /** * Register bp-members widgets. * * Previously, these widgets were registered in bp-core. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_members_register_widgets() { add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Members_Widget");' ) ); @@ -22,527 +28,10 @@ function bp_members_register_widgets() { } 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) + * @since 1.0.0 * * @see BP_Core_Members_Widget */ @@ -550,19 +39,19 @@ function bp_core_ajax_widget_members() { check_ajax_referer( 'bp_core_widget_members' ); - // Setup some variables to check + // 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 + // Determine the type of members query to perform. switch ( $filter ) { - // Newest activated + // Newest activated. case 'newest-members' : $type = 'newest'; break; - // Popular by friends + // Popular by friends. case 'popular-members' : if ( bp_is_active( 'friends' ) ) { $type = 'popular'; @@ -571,14 +60,14 @@ function bp_core_ajax_widget_members() { } break; - // Default + // Default. case 'recently-active-members' : default : $type = 'active'; break; } - // Setup args for querying members + // Setup args for querying members. $members_args = array( 'user_id' => 0, 'type' => $type, @@ -588,9 +77,9 @@ function bp_core_ajax_widget_members() { 'search_terms' => false, ); - // Query for members + // Query for members. if ( bp_has_members( $members_args ) ) : ?> - <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?> + <?php echo '0[[SPLIT]]'; // Return valid result. TODO: remove this. ?> <?php while ( bp_members() ) : bp_the_member(); ?> <li class="vcard"> <div class="item-avatar"> diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-template.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-template.php new file mode 100644 index 0000000000000000000000000000000000000000..6d7d700bca30caca1688124a75df8b2280d97a7c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-template.php @@ -0,0 +1,276 @@ +<?php +/** + * BuddyPress Member Template loop class. + * + * @package BuddyPress + * @subpackage Members + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main member template loop class. + * + * Responsible for loading a group of members into a loop for display. + */ +class BP_Core_Members_Template { + + /** + * The loop iterator. + * + * @var int + */ + public $current_member = -1; + + /** + * The number of members returned by the paged query. + * + * @var int + */ + public $member_count; + + /** + * Array of members located by the query. + * + * @var array + */ + public $members; + + /** + * The member object currently being iterated on. + * + * @var object + */ + public $member; + + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop; + + /** + * The type of member being requested. Used for ordering results. + * + * @var string + */ + public $type; + + /** + * The unique string used for pagination queries. + * + * @var string + */ + public $pag_arg; + + /** + * The page number being requested. + * + * @var string + */ + public $pag_page; + + /** + * The number of items being requested per page. + * + * @var string + */ + public $pag_num; + + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links; + + /** + * The total number of members matching the query parameters. + * + * @var int + */ + 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 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. + * @param array|string $member_type__in Array or comma-separated string of member types to limit results to. + * @param array|string $member_type__not_in Array or comma-separated string of member types to exclude + * from results. + */ + 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 = '', $member_type__in = '', $member_type__not_in = '' ) { + + $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, 'member_type' => $member_type, 'member_type__in' => $member_type__in, 'member_type__not_in' => $member_type__not_in ) ); + + if ( !$max || $max >= (int) $this->members['total'] ) + $this->total_member_count = (int) $this->members['total']; + else + $this->total_member_count = (int) $max; + + $this->members = $this->members['users']; + + if ( $max ) { + if ( $max >= count( $this->members ) ) { + $this->member_count = count( $this->members ); + } else { + $this->member_count = (int) $max; + } + } else { + $this->member_count = count( $this->members ); + } + + if ( (int) $this->total_member_count && (int) $this->pag_num ) { + $pag_args = array( + $this->pag_arg => '%#%', + ); + + if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { + $base = remove_query_arg( 's', wp_get_referer() ); + } else { + $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 ) ) { + $query_arg = bp_core_get_component_search_query_arg( 'members' ); + $add_args[ $query_arg ] = urlencode( $search_terms ); + } + + $this->pag_links = paginate_links( array( + 'base' => add_query_arg( $pag_args, $base ), + 'format' => '', + 'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ), + 'current' => (int) $this->pag_page, + 'prev_text' => _x( '←', 'Member pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Member pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => $add_args, + ) ); + } + } + + /** + * Whether there are members available in the loop. + * + * @see bp_has_members() + * + * @return bool True if there are items in the loop, otherwise false. + */ + function has_members() { + if ( $this->member_count ) + return true; + + return false; + } + + /** + * Set up the next member and iterate index. + * + * @return object The next member to iterate over. + */ + function next_member() { + $this->current_member++; + $this->member = $this->members[$this->current_member]; + + return $this->member; + } + + /** + * Rewind the members and reset member index. + */ + function rewind_members() { + $this->current_member = -1; + if ( $this->member_count > 0 ) { + $this->member = $this->members[0]; + } + } + + /** + * Whether there are members left in the loop to iterate over. + * + * This method is used by {@link bp_members()} as part of the while loop + * that controls iteration inside the members loop, eg: + * while ( bp_members() ) { ... + * + * @see bp_members() + * + * @return bool True if there are more members to show, otherwise false. + */ + function members() { + 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 1.5.0 + */ + do_action('member_loop_end'); + // Do some cleaning up after the loop. + $this->rewind_members(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current member inside the loop. + * + * Used by {@link bp_the_member()} to set up the current member data + * while looping, so that template tags used during that iteration make + * reference to the current member. + * + * @see bp_the_member() + */ + function the_member() { + + $this->in_the_loop = true; + $this->member = $this->next_member(); + + // Loop has just started. + if ( 0 == $this->current_member ) { + + /** + * Fires if the current member is the first in the loop. + * + * @since 1.5.0 + */ + do_action( 'member_loop_start' ); + } + + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-widget.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..7d45698f47ae3a77ed481fd3c52395824c6a0909 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-members-widget.php @@ -0,0 +1,244 @@ +<?php +/** + * BuddyPress Members Widget. + * + * @package BuddyPress + * @subpackage MembersWidgets + * @since 1.0.3 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Members Widget. + * + * @since 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 ) { + global $members_template; + + // Get widget settings. + $settings = $this->parse_settings( $instance ); + + /** + * Filters the title of the Members widget. + * + * @since 1.8.0 + * @since 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; + + /** + * Filters the separator of the member widget links. + * + * @since 2.4.0 + * + * @param string $separator Separator string. Default '|'. + */ + $separator = apply_filters( 'bp_members_widget_separator', '|' ); + + // 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, + ); + + // Back up the global. + $old_members_template = $members_template; + + ?> + + <?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> + <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> + <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' ) ) : ?> + <span class="bp-separator" role="separator"><?php echo esc_html( $separator ); ?></span> + <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']; + + // Restore the global. + $members_template = $old_members_template; + } + + /** + * 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 void + */ + 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="<?php echo $this->get_field_id( '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_id( 'link_title' ) ?>"> + <input type="checkbox" name="<?php echo $this->get_field_name( 'link_title' ) ?>" id="<?php echo $this->get_field_id( 'link_title' ) ?>" value="1" <?php checked( $link_title ) ?> /> + <?php esc_html_e( 'Link widget title to Members directory', 'buddypress' ); ?> + </label> + </p> + + <p> + <label for="<?php echo $this->get_field_id( 'max_members' ); ?>"> + <?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="<?php echo $this->get_field_id( 'member_default' ) ?>"><?php esc_html_e( 'Default members to show:', 'buddypress' ); ?></label> + <select name="<?php echo $this->get_field_name( 'member_default' ) ?>" id="<?php echo $this->get_field_id( '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> + </p> + + <?php + } + + /** + * Merge the widget settings into defaults array. + * + * @since 2.3.0 + * + * @uses bp_parse_args() To merge widget settings into defaults. + * + * @param array $instance Widget instance settings. + * @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' ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-recently-active-widget.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-recently-active-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..34e156c5fb74ef2416c3a290f1e17211429b5138 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-recently-active-widget.php @@ -0,0 +1,167 @@ +<?php +/** + * BuddyPress Members Recently Active widget. + * + * @package BuddyPress + * @subpackage MembersWidgets + * @since 1.0.3 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Recently Active Members Widget. + * + * @since 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 ) { + global $members_template; + + // Get widget settings. + $settings = $this->parse_settings( $instance ); + + /** + * Filters the title of the Recently Active widget. + * + * @since 1.8.0 + * @since 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, + ); + + // Back up global. + $old_members_template = $members_template; + + ?> + + <?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']; + + // Restore the global. + $members_template = $old_members_template; + } + + /** + * 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 void + */ + 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="<?php echo $this->get_field_id( '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_id( 'max_members' ); ?>"> + <?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 2.3.0 + * + * @uses bp_parse_args() To merge widget settings into defaults. + * + * @param array $instance Widget instance settings. + * @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' ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-whos-online-widget.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-whos-online-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..105b63a4011eafa18cd11b86bb00081434534e06 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-core-whos-online-widget.php @@ -0,0 +1,167 @@ +<?php +/** + * BuddyPress Members Who's Online Widget. + * + * @package BuddyPress + * @subpackage MembersWidgets + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Who's Online Widget. + * + * @since 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 ) { + global $members_template; + + // Get widget settings. + $settings = $this->parse_settings( $instance ); + + /** + * Filters the title of the Who's Online widget. + * + * @since 1.8.0 + * @since 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, + ); + + // Back up global. + $old_members_template = $members_template; + + ?> + + <?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']; + + // Restore the global. + $members_template = $old_members_template; + } + + /** + * 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 void + */ + 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="<?php echo $this->get_field_id( '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_id( 'max_members' ); ?>"> + <?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 2.3.0 + * + * @uses bp_parse_args() To merge widget settings into defaults. + * + * @param array $instance Widget instance settings. + * @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' ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php new file mode 100644 index 0000000000000000000000000000000000000000..8e43006928ad4a10055bdc849996289a76df7129 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php @@ -0,0 +1,2021 @@ +<?php +/** + * BuddyPress Members Admin + * + * @package BuddyPress + * @subpackage MembersAdmin + * @since 2.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +if ( !class_exists( 'BP_Members_Admin' ) ) : + +/** + * Load Members admin area. + * + * @since 2.0.0 + */ +class BP_Members_Admin { + + /** Directory *************************************************************/ + + /** + * Path to the BP Members Admin directory. + * + * @var string $admin_dir + */ + public $admin_dir = ''; + + /** URLs ******************************************************************/ + + /** + * URL to the BP Members Admin directory. + * + * @var string $admin_url + */ + public $admin_url = ''; + + /** + * URL to the BP Members Admin CSS directory. + * + * @var string $css_url + */ + public $css_url = ''; + + /** + * URL to the BP Members Admin JS directory. + * + * @var string + */ + public $js_url = ''; + + /** Other *****************************************************************/ + + /** + * Screen id for edit user's profile page. + * + * @var string + */ + public $user_page = ''; + + /** + * Setup BP Members Admin. + * + * @since 2.0.0 + * + * @uses buddypress() to get BuddyPress main instance. + */ + public static function register_members_admin() { + if ( ! is_admin() ) { + return; + } + + $bp = buddypress(); + + if ( empty( $bp->members->admin ) ) { + $bp->members->admin = new self; + } + + return $bp->members->admin; + } + + /** + * Constructor method. + * + * @since 2.0.0 + */ + public function __construct() { + $this->setup_globals(); + $this->setup_actions(); + } + + /** + * Set admin-related globals. + * + * @since 2.0.0 + */ + private function setup_globals() { + $bp = buddypress(); + + // Paths and URLs + $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-members/admin' ); // Admin path. + $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-members/admin' ); // Admin URL. + $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin CSS URL. + $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin CSS URL. + + // Capability depends on config. + $this->capability = bp_core_do_network_admin() ? 'manage_network_users' : 'edit_users'; + + // The Edit Profile Screen id. + $this->user_page = ''; + + // The Show Profile Screen id. + $this->user_profile = is_network_admin() ? 'users' : 'profile'; + + // The current user id. + $this->current_user_id = get_current_user_id(); + + // The user id being edited. + $this->user_id = 0; + + // Is a member editing their own profile. + $this->is_self_profile = false; + + // The screen ids to load specific css for. + $this->screen_id = array(); + + // The stats metabox default position. + $this->stats_metabox = new StdClass(); + + // BuddyPress edit user's profile args. + $this->edit_profile_args = array( 'page' => 'bp-profile-edit' ); + $this->edit_profile_url = ''; + $this->edit_url = ''; + + // Data specific to signups. + $this->users_page = ''; + $this->signups_page = ''; + $this->users_url = bp_get_admin_url( 'users.php' ); + $this->users_screen = bp_core_do_network_admin() ? 'users-network' : 'users'; + + // Specific config: BuddyPress is not network activated. + $this->subsite_activated = (bool) is_multisite() && ! bp_is_network_activated(); + + // When BuddyPress is not network activated, only Super Admin can moderate signups. + if ( ! empty( $this->subsite_activated ) ) { + $this->capability = 'manage_network_users'; + } + } + + /** + * Set admin-related actions and filters. + * + * @since 2.0.0 + */ + private function setup_actions() { + + /** Extended Profile ************************************************* + */ + + // Enqueue all admin JS and CSS. + add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + + // Add some page specific output to the <head>. + add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); + + // Add menu item to all users menu. + add_action( 'admin_menu', array( $this, 'admin_menus' ), 5 ); + add_action( 'network_admin_menu', array( $this, 'admin_menus' ), 5 ); + add_action( 'user_admin_menu', array( $this, 'user_profile_menu' ), 5 ); + + // Create the Profile Navigation (Profile/Extended Profile). + add_action( 'edit_user_profile', array( $this, 'profile_nav' ), 99, 1 ); + add_action( 'show_user_profile', array( $this, 'profile_nav' ), 99, 1 ); + + // Editing users of a specific site. + add_action( "admin_head-site-users.php", array( $this, 'profile_admin_head' ) ); + + // Add a row action to users listing. + if ( bp_core_do_network_admin() ) { + add_filter( 'ms_user_row_actions', array( $this, 'row_actions' ), 10, 2 ); + add_action( 'admin_init', array( $this, 'add_edit_profile_url_filter' ) ); + add_action( 'wp_after_admin_bar_render', array( $this, 'remove_edit_profile_url_filter' ) ); + } + + // 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() ) { + + // Filter non multisite user query to remove sign-up users. + if ( ! is_multisite() ) { + add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query' ), 10, 1 ); + } + + // Reorganise the views navigation in users.php and signups page. + if ( current_user_can( $this->capability ) ) { + $user_screen = $this->users_screen; + + /** + * Users screen on multiblog is users, but signups + * need to be managed in the network for this case + */ + if ( bp_is_network_activated() && bp_is_multiblog_mode() && false === strpos( $user_screen, '-network' ) ) { + $user_screen .= '-network'; + } + + add_filter( "views_{$user_screen}", array( $this, 'signup_filter_view' ), 10, 1 ); + add_filter( 'set-screen-option', array( $this, 'signup_screen_options' ), 10, 3 ); + } + } + } + + /** + * 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. + * + * @since 2.1.0 + * + * @return int + */ + private function get_user_id() { + if ( ! empty( $this->user_id ) ) { + return $this->user_id; + } + + $this->user_id = (int) get_current_user_id(); + + // We'll need a user ID when not on self profile. + if ( ! empty( $_GET['user_id'] ) ) { + $this->user_id = (int) $_GET['user_id']; + } + + return $this->user_id; + } + + /** + * Can the current user edit the one displayed. + * + * Self profile editing / or bp_moderate check. + * This might be replaced by more granular capabilities + * in the future. + * + * @since 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; + + // Bail if no user ID was passed. + if ( empty( $user_id ) ) { + return $retval; + } + + // Member can edit if they are viewing their own profile. + if ( $this->current_user_id === $user_id ) { + $retval = true; + + // Trust the 'bp_moderate' capability. + } else { + $retval = bp_current_user_can( 'bp_moderate' ); + } + + return $retval; + } + + /** + * Get admin notice when saving a user or member profile. + * + * @since 2.1.0 + * + * @return array + */ + private function get_user_notice() { + + // Setup empty notice for return value. + $notice = array(); + + // Updates. + if ( ! empty( $_REQUEST['updated'] ) ) { + switch ( $_REQUEST['updated'] ) { + case 'avatar': + $notice = array( + 'class' => 'updated', + 'message' => __( 'Profile photo was deleted.', 'buddypress' ) + ); + break; + case 'ham' : + $notice = array( + 'class' => 'updated', + 'message' => __( 'User removed as spammer.', 'buddypress' ) + ); + break; + case 'spam' : + $notice = array( + 'class' => 'updated', + 'message' => __( 'User marked as spammer. Spam users are visible only to site admins.', 'buddypress' ) + ); + break; + case 1 : + $notice = array( + 'class' => 'updated', + 'message' => __( 'Profile updated.', 'buddypress' ) + ); + break; + } + } + + // Errors. + if ( ! empty( $_REQUEST['error'] ) ) { + switch ( $_REQUEST['error'] ) { + case 'avatar': + $notice = array( + 'class' => 'error', + 'message' => __( 'There was a problem deleting that profile photo. Please try again.', 'buddypress' ) + ); + break; + case 'ham' : + $notice = array( + 'class' => 'error', + 'message' => __( 'User could not be removed as spammer.', 'buddypress' ) + ); + break; + case 'spam' : + $notice = array( + 'class' => 'error', + 'message' => __( 'User could not be marked as spammer.', 'buddypress' ) + ); + break; + case 1 : + $notice = array( + 'class' => 'error', + 'message' => __( 'An error occurred while trying to update the profile.', 'buddypress' ) + ); + break; + case 2: + $notice = array( + 'class' => 'error', + 'message' => __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ) + ); + break; + case 3: + $notice = array( + 'class' => 'error', + 'message' => __( 'There was a problem updating some of your profile information. Please try again.', 'buddypress' ) + ); + break; + } + } + + return $notice; + } + + /** + * Create the /user/ admin Profile submenus for all members. + * + * @since 2.1.0 + * + * @uses add_submenu_page() To add the Edit Profile page in Profile section. + */ + public function user_profile_menu() { + + // Setup the hooks array. + $hooks = array(); + + // Add the faux "Edit Profile" submenu page. + $hooks['user'] = $this->user_page = add_submenu_page( + 'profile.php', + __( 'Edit Profile', 'buddypress' ), + __( 'Edit Profile', 'buddypress' ), + 'exist', + 'bp-profile-edit', + array( $this, 'user_admin' ) + ); + + // Setup the screen ID's. + $this->screen_id = array( + $this->user_page . '-user', + $this->user_profile . '-user' + ); + + // Loop through new hooks and add method actions. + foreach ( $hooks as $key => $hook ) { + add_action( "load-{$hook}", array( $this, $key . '_admin_load' ) ); + } + + // Add the profile_admin_head method to proper admin_head actions. + add_action( "admin_head-{$this->user_page}", array( $this, 'profile_admin_head' ) ); + add_action( "admin_head-profile.php", array( $this, 'profile_admin_head' ) ); + } + + /** + * Create the All Users / Profile > Edit Profile and All Users Signups submenus. + * + * @since 2.0.0 + * + * @uses add_submenu_page() To add the Edit Profile page in Users/Profile section. + */ + public function admin_menus() { + + // Setup the hooks array. + $hooks = array(); + + // Manage user's profile. + $hooks['user'] = $this->user_page = add_submenu_page( + $this->user_profile . '.php', + __( 'Edit Profile', 'buddypress' ), + __( 'Edit Profile', 'buddypress' ), + 'read', + 'bp-profile-edit', + array( $this, 'user_admin' ) + ); + + // Only show sign-ups where they belong. + if ( ( ! bp_is_network_activated() && ! is_network_admin() ) || ( is_network_admin() && bp_is_network_activated() ) ) { + + // Manage signups. + $hooks['signups'] = $this->signups_page = add_users_page( + __( 'Manage Signups', 'buddypress' ), + __( 'Manage Signups', 'buddypress' ), + $this->capability, + 'bp-signups', + array( $this, 'signups_admin' ) + ); + } + + $edit_page = 'user-edit'; + $profile_page = 'profile'; + $this->users_page = 'users'; + + // Self profile check is needed for this pages. + $page_head = array( + $edit_page . '.php', + $profile_page . '.php', + $this->user_page, + $this->users_page . '.php', + ); + + // Append '-network' to each array item if in network admin. + if ( is_network_admin() ) { + $edit_page .= '-network'; + $profile_page .= '-network'; + $this->user_page .= '-network'; + $this->users_page .= '-network'; + $this->signups_page .= '-network'; + } + + // Setup the screen ID's. + $this->screen_id = array( + $edit_page, + $this->user_page, + $profile_page + ); + + // Loop through new hooks and add method actions. + foreach ( $hooks as $key => $hook ) { + add_action( "load-{$hook}", array( $this, $key . '_admin_load' ) ); + } + + // Add the profile_admin_head method to proper admin_head actions. + foreach ( $page_head as $head ) { + add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) ); + } + } + + /** + * Highlight the Users menu if on Edit Profile and check if on the user's admin profile. + * + * @since 2.1.0 + */ + public function profile_admin_head() { + global $submenu_file, $parent_file; + + // Is the user editing their own profile? + if ( is_user_admin() || ( defined( 'IS_PROFILE_PAGE' ) && IS_PROFILE_PAGE ) ) { + $this->is_self_profile = true; + + // Is the user attempting to edit their own profile. + } 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 ); + } + + // Force the parent file to users.php to open the correct top level menu + // but only if not editing a site via the network site editing page. + if ( 'sites.php' !== $parent_file ) { + $parent_file = 'users.php'; + $submenu_file = 'users.php'; + } + + // Editing your own profile, so recheck some vars. + if ( true === $this->is_self_profile ) { + + // Use profile.php as the edit page. + $edit_page = 'profile.php'; + + // Set profile.php as the parent & sub files to correct the menu nav. + if ( is_blog_admin() || is_user_admin() ) { + $parent_file = 'profile.php'; + $submenu_file = 'profile.php'; + } + + // Not editing yourself, so use user-edit.php. + } else { + $edit_page = 'user-edit.php'; + } + + if ( is_user_admin() ) { + $this->edit_profile_url = add_query_arg( $this->edit_profile_args, user_admin_url( 'profile.php' ) ); + $this->edit_url = user_admin_url( 'profile.php' ); + + } elseif ( is_blog_admin() ) { + $this->edit_profile_url = add_query_arg( $this->edit_profile_args, admin_url( 'users.php' ) ); + $this->edit_url = admin_url( $edit_page ); + + } elseif ( is_network_admin() ) { + $this->edit_profile_url = add_query_arg( $this->edit_profile_args, network_admin_url( 'users.php' ) ); + $this->edit_url = network_admin_url( $edit_page ); + } + } + + /** + * Remove the Edit Profile page. + * + * We add these pages in order to integrate with WP's Users panel, but + * we want them to show up as a row action of the WP panel, not as separate + * subnav items under the Users menu. + * + * @since 2.0.0 + */ + public function admin_head() { + remove_submenu_page( 'users.php', 'bp-profile-edit' ); + remove_submenu_page( 'profile.php', 'bp-profile-edit' ); + } + + /** Community Profile *****************************************************/ + + /** + * Add some specific styling to the Edit User and Edit User's Profile page. + * + * @since 2.0.0 + */ + public function enqueue_scripts() { + if ( ! in_array( get_current_screen()->id, $this->screen_id ) ) { + return; + } + + $min = bp_core_get_minified_asset_suffix(); + $css = $this->css_url . "admin{$min}.css"; + + /** + * Filters the CSS URL to enqueue in the Members admin area. + * + * @since 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() ); + + wp_style_add_data( 'bp-members-css', 'rtl', true ); + if ( $min ) { + wp_style_add_data( 'bp-members-css', 'suffix', $min ); + } + + // 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 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 ); + } + + /** + * Fires after all of the members JavaScript and CSS are enqueued. + * + * @since 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 ); + } + + /** + * Create the Profile navigation in Edit User & Edit Profile pages. + * + * @since 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' ) { + + // Bail if no user ID exists here. + if ( empty( $user->ID ) ) { + return; + } + + // 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 { + $query_args = array(); + } + + // Conditionally add a referer if it exists in the existing request. + if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { + $query_args['wp_http_referer'] = urlencode( stripslashes_deep( $_REQUEST['wp_http_referer'] ) ); + } + + // Setup the two distinct "edit" URL's. + $community_url = add_query_arg( $query_args, $this->edit_profile_url ); + $wordpress_url = add_query_arg( $query_args, $this->edit_url ); + + $bp_active = false; + $wp_active = ' nav-tab-active'; + if ( 'BuddyPress' === $active ) { + $bp_active = ' nav-tab-active'; + $wp_active = false; + } ?> + + <h2 id="profile-nav" class="nav-tab-wrapper"> + <?php + /** + * In configs where BuddyPress is not network activated, as regular + * admins do not have the capacity to edit other users, we must add + * this check. + */ + if ( current_user_can( 'edit_user', $user->ID ) ) : ?> + + <a class="nav-tab<?php echo esc_attr( $wp_active ); ?>" href="<?php echo esc_url( $wordpress_url );?>"><?php _e( 'Profile', 'buddypress' ); ?></a> + + <?php endif; ?> + + <a class="nav-tab<?php echo esc_attr( $bp_active ); ?>" href="<?php echo esc_url( $community_url );?>"><?php _e( 'Extended Profile', 'buddypress' ); ?></a> + </h2> + + <?php + } + + /** + * Set up the user's profile admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 2.0.0 + */ + public function user_admin_load() { + + // Get the user ID. + $user_id = $this->get_user_id(); + + // Can current user edit this profile? + if ( ! $this->member_can_edit( $user_id ) ) { + wp_die( __( 'You cannot edit the requested user.', 'buddypress' ) ); + } + + // Build redirection URL. + $redirect_to = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham', 'delete_avatar' ), $_SERVER['REQUEST_URI'] ); + $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : false; + + if ( ! empty( $_REQUEST['user_status'] ) ) { + $spam = (bool) ( 'spam' === $_REQUEST['user_status'] ); + + if ( $spam !== bp_is_user_spammer( $user_id ) ) { + $doaction = $_REQUEST['user_status']; + } + } + + /** + * Fires at the start of the signups admin load. + * + * @since 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 ) ); + + /** + * Filters the allowed actions for use in the user admin page. + * + * @since 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. + if ( ! in_array( $doaction, $allowed_actions ) ) { + add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); + + get_current_screen()->add_help_tab( array( + 'id' => 'bp-profile-edit-overview', + 'title' => __( 'Overview', 'buddypress' ), + 'content' => + '<p>' . __( 'This is the admin view of a user's profile.', 'buddypress' ) . '</p>' . + '<p>' . __( 'In the main column, you can edit the fields of the user's extended profile.', 'buddypress' ) . '</p>' . + '<p>' . __( 'In the right-hand column, you can update the user's status, delete the user's avatar, and view recent statistics.', 'buddypress' ) . '</p>' + ) ); + + // Help panel - sidebar links. + get_current_screen()->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></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. + add_meta_box( + 'submitdiv', + _x( 'Status', 'members user-admin edit screen', 'buddypress' ), + array( $this, 'user_admin_status_metabox' ), + get_current_screen()->id, + 'side', + 'core' + ); + + // In case xprofile is not active. + $this->stats_metabox->context = 'normal'; + $this->stats_metabox->priority = 'core'; + + /** + * 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 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 ) ); + + // If xProfile is inactive, difficult to know what's profile we're on. + if ( 'normal' === $this->stats_metabox->context ) { + $display_name = bp_core_get_user_displayname( $user_id ); + } else { + $display_name = __( 'Member', 'buddypress' ); + } + + // User Stat metabox. + add_meta_box( + 'bp_members_admin_user_stats', + sprintf( _x( "%s's Stats", 'members user-admin edit screen', 'buddypress' ), $display_name ), + array( $this, 'user_admin_stats_metabox' ), + get_current_screen()->id, + sanitize_key( $this->stats_metabox->context ), + 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' + ); + } + + /** + * 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 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 JavaScript files. + wp_enqueue_script( 'postbox' ); + wp_enqueue_script( 'dashboard' ); + + // Spam or Ham user. + } elseif ( in_array( $doaction, array( 'spam', 'ham' ) ) && empty( $this->is_self_profile ) ) { + + check_admin_referer( 'edit-bp-profile_' . $user_id ); + + if ( bp_core_process_spammer_status( $user_id, $doaction ) ) { + $redirect_to = add_query_arg( 'updated', $doaction, $redirect_to ); + } else { + $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + + // Update other stuff once above ones are done. + } else { + $this->redirect = $redirect_to; + + /** + * Fires at end of user profile admin load if doaction does not match any available actions. + * + * @since 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 ); + } + } + + /** + * Display the user's profile. + * + * @since 2.0.0 + */ + public function user_admin() { + + if ( ! bp_current_user_can( 'bp_moderate' ) && empty( $this->is_self_profile ) ) { + die( '-1' ); + } + + // Get the user ID. + $user_id = $this->get_user_id(); + $user = get_user_to_edit( $user_id ); + + // Construct title. + if ( true === $this->is_self_profile ) { + $title = __( 'Profile', 'buddypress' ); + } else { + $title = __( 'Edit User', 'buddypress' ); + } + + // Construct URL for form. + $request_url = remove_query_arg( array( 'action', 'error', 'updated', 'spam', 'ham' ), $_SERVER['REQUEST_URI'] ); + $form_action_url = add_query_arg( 'action', 'update', $request_url ); + $wp_http_referer = false; + if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { + $wp_http_referer = remove_query_arg( array( 'action', 'updated' ), $_REQUEST['wp_http_referer'] ); + } + + // Prepare notice for admin. + $notice = $this->get_user_notice(); + + if ( ! empty( $notice ) ) : ?> + + <div <?php if ( 'updated' === $notice['class'] ) : ?>id="message" <?php endif; ?>class="<?php echo esc_attr( $notice['class'] ); ?>"> + + <p><?php echo esc_html( $notice['message'] ); ?></p> + + <?php if ( !empty( $wp_http_referer ) && ( 'updated' === $notice['class'] ) ) : ?> + + <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php esc_html_e( '← Back to Users', 'buddypress' ); ?></a></p> + + <?php endif; ?> + + </div> + + <?php endif; ?> + + <div class="wrap" id="community-profile-page"> + <h1><?php echo esc_html( $title ); ?> + + <?php if ( empty( $this->is_self_profile ) ) : ?> + + <?php if ( current_user_can( 'create_users' ) ) : ?> + + <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a> + + <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?> + + <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php endif; ?> + </h1> + + <?php if ( ! empty( $user ) ) : + + $this->profile_nav( $user, 'BuddyPress' ); ?> + + <form action="<?php echo esc_url( $form_action_url ); ?>" id="your-profile" 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="postbox-container-1" class="postbox-container"> + <?php do_meta_boxes( get_current_screen()->id, 'side', $user ); ?> + </div> + + <div id="postbox-container-2" class="postbox-container"> + <?php do_meta_boxes( get_current_screen()->id, 'normal', $user ); ?> + <?php do_meta_boxes( get_current_screen()->id, 'advanced', $user ); ?> + </div> + </div><!-- #post-body --> + + </div><!-- #poststuff --> + + <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> + <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> + <?php wp_nonce_field( 'edit-bp-profile_' . $user->ID ); ?> + + </form> + + <?php else : ?> + + <p><?php printf( __( 'No user found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'users.php' ) ) ); ?></p> + + <?php endif; ?> + + </div><!-- .wrap --> + <?php + } + + /** + * Render the Status metabox for user's profile screen. + * + * Actions are: + * - Update profile fields if xProfile component is active + * - Spam/Unspam user + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_status_metabox( $user = null ) { + + // Bail if no user id or if the user has not activated their account yet. + if ( empty( $user->ID ) ) { + return; + } + + // 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/> + + <?php return; + + endif; ?> + + <div class="submitbox" id="submitcomment"> + <div id="minor-publishing"> + <div id="misc-publishing-actions"> + <?php + + // Get the spam status once here to compare against below. + $is_spammer = bp_is_user_spammer( $user->ID ); + + /** + * In configs where BuddyPress is not network activated, + * regular admins cannot mark a user as a spammer on front + * end. This prevent them to do it in backend. + * + * Also prevent admins from marking themselves or other + * admins as spammers. + */ + if ( ( empty( $this->is_self_profile ) && ( ! in_array( $user->user_login, get_super_admins() ) ) && empty( $this->subsite_activated ) ) || ( ! empty( $this->subsite_activated ) && current_user_can( 'manage_network_users' ) ) ) : ?> + + <div class="misc-pub-section" id="comment-status-radio"> + <label class="approved"><input type="radio" name="user_status" value="ham" <?php checked( $is_spammer, false ); ?>><?php esc_html_e( 'Active', 'buddypress' ); ?></label><br /> + <label class="spam"><input type="radio" name="user_status" value="spam" <?php checked( $is_spammer, true ); ?>><?php esc_html_e( 'Spammer', 'buddypress' ); ?></label> + </div> + + <?php endif ;?> + + <div class="misc-pub-section curtime misc-pub-section-last"> + <?php + + // Translators: Publish box date format, see http://php.net/date. + $datef = __( 'M j, Y @ G:i', 'buddypress' ); + $date = date_i18n( $datef, strtotime( $user->user_registered ) ); + ?> + <span id="timestamp"><?php printf( __( 'Registered on: %s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></span> + </div> + </div> <!-- #misc-publishing-actions --> + + <div class="clear"></div> + </div><!-- #minor-publishing --> + + <div id="major-publishing-actions"> + + <div id="publishing-action"> + <a class="button bp-view-profile" href="<?php echo esc_url( bp_core_get_user_domain( $user->ID ) ); ?>" target="_blank"><?php esc_html_e( 'View Profile', 'buddypress' ); ?></a> + <?php submit_button( esc_html__( 'Update Profile', 'buddypress' ), 'primary', 'save', false ); ?> + </div> + <div class="clear"></div> + </div><!-- #major-publishing-actions --> + + </div><!-- #submitcomment --> + + <?php + } + + /** + * Render the fallback metabox in case a user has been marked as a spammer. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_spammer_metabox( $user = null ) { + ?> + <p><?php printf( __( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) ) ;?></p> + <?php + } + + /** + * Render the Stats metabox to moderate inappropriate images. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object to be edited. + */ + public function user_admin_stats_metabox( $user = null ) { + + // Bail if no user ID. + if ( empty( $user->ID ) ) { + return; + } + + // If account is not activated last activity is the time user registered. + if ( isset( $user->user_status ) && 2 == $user->user_status ) { + $last_active = $user->user_registered; + + // Account is activated, getting user's last activity. + } else { + $last_active = bp_get_user_last_activity( $user->ID ); + } + + $datef = __( 'M j, Y @ G:i', 'buddypress' ); + $date = date_i18n( $datef, strtotime( $last_active ) ); ?> + + <ul> + <li class="bp-members-profile-stats"><?php printf( __( 'Last active: %1$s', 'buddypress' ), '<strong>' . $date . '</strong>' ); ?></li> + + <?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 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 ); + } + ?> + </ul> + + <?php + } + + /** + * Render the Member Type metabox. + * + * @since 2.2.0 + * + * @param WP_User|null $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 ); + ?> + + <label for="bp-members-profile-member-type" class="screen-reader-text"><?php esc_html_e( 'Select member type', 'buddypress' ); ?></label> + <select name="bp-members-profile-member-type" id="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 2.2.0 + */ + 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. + * + * @since 2.0.0 + * + * @param array|string $actions WordPress row actions (edit, delete). + * @param object|null $user The object for the user row. + * @return array Merged actions. + */ + public function row_actions( $actions = '', $user = null ) { + + // Bail if no user ID. + if ( empty( $user->ID ) ) { + return; + } + + // Setup args array. + $args = array(); + + // Add the user ID if it's not for the current user. + if ( $user->ID !== $this->current_user_id ) { + $args['user_id'] = $user->ID; + } + + // Add the referer. + $args['wp_http_referer'] = urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ); + + // Add the "Extended" link if the current user can edit this user. + if ( current_user_can( 'edit_user', $user->ID ) || bp_current_user_can( 'bp_moderate' ) ) { + + // Add query args and setup the Extended link. + $edit_profile = add_query_arg( $args, $this->edit_profile_url ); + $edit_profile_link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $edit_profile ), esc_html__( 'Extended', 'buddypress' ) ); + + /** + * Check the edit action is available + * and preserve the order edit | profile | remove/delete. + */ + if ( ! empty( $actions['edit'] ) ) { + $edit_action = $actions['edit']; + unset( $actions['edit'] ); + + $new_edit_actions = array( + 'edit' => $edit_action, + 'edit-profile' => $edit_profile_link, + ); + + // If not available simply add the edit profile action. + } else { + $new_edit_actions = array( 'edit-profile' => $edit_profile_link ); + } + + $actions = array_merge( $new_edit_actions, $actions ); + } + + return $actions; + } + + /** + * Add a filter to edit profile url in WP Admin Bar. + * + * @since 2.1.0 + */ + public function add_edit_profile_url_filter() { + add_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10, 3 ); + } + + /** + * Filter the profile url. + * + * @since 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() ) { + $profile_link = user_admin_url( 'profile.php' ); + } + return $profile_link; + } + + /** + * Remove the filter to edit profile url in WP Admin Bar. + * + * @since 2.1.0 + */ + public function remove_edit_profile_url_filter() { + remove_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10, 3 ); + } + + /** Signups Management ****************************************************/ + + /** + * Display the admin preferences about signups pagination. + * + * @since 2.0.0 + * + * @param int $value Value for signup option. + * @param string $option Value for the option key. + * @param int $new_value Value for the saved option. + * @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 ) { + return $value; + } + + // Per page. + $new_value = (int) $new_value; + if ( $new_value < 1 || $new_value > 999 ) { + return $value; + } + + return $new_value; + } + + /** + * Make sure no signups will show in users list. + * + * This is needed to handle signups that may have not been activated + * before the 2.0.0 upgrade. + * + * @since 2.0.0 + * + * @param WP_User_Query|null $query The users query. + * @return WP_User_Query The users query without the signups. + */ + public function remove_signups_from_user_query( $query = null ) { + global $wpdb; + + // Bail if this is an ajax request. + if ( defined( 'DOING_AJAX' ) ) { + return; + } + + // Bail if updating BuddyPress. + if ( bp_is_update() ) { + return; + } + + // Bail if there is no current admin screen. + if ( ! function_exists( 'get_current_screen' ) || ! get_current_screen() ) { + return; + } + + // Get current screen. + $current_screen = get_current_screen(); + + // Bail if not on a users page. + if ( ! isset( $current_screen->id ) || $this->users_page !== $current_screen->id ) { + return; + } + + // Bail if already querying by an existing role. + if ( ! empty( $query->query_vars['role'] ) ) { + return; + } + + $query->query_where .= " AND {$wpdb->users}.user_status != 2"; + } + + /** + * Filter the WP Users List Table views to include 'bp-signups'. + * + * @since 2.0.0 + * + * @param array $views WP List Table views. + * @return array The views with the signup view added. + */ + public function signup_filter_view( $views = array() ) { + global $role; + + // Remove the 'current' class from All if we're on the signups view. + if ( 'registered' === $role ) { + $views['all'] = str_replace( 'class="current"', '', $views['all'] ); + $class = 'current'; + } else { + $class = ''; + } + + $signups = BP_Signup::count_signups(); + + if ( is_network_admin() ) { + $base_url = network_admin_url( 'users.php' ); + } else { + $base_url = bp_get_admin_url( 'users.php' ); + } + + $url = add_query_arg( 'page', 'bp-signups', $base_url ); + $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>', esc_url( $url ), $class, $text ); + + return $views; + } + + /** + * Load the Signup WP Users List table. + * + * @since 2.0.0 + * + * @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 = '' ) { + if ( empty( $class ) ) { + return; + } + + if ( ! empty( $required ) ) { + require_once( ABSPATH . 'wp-admin/includes/class-wp-' . $required . '-list-table.php' ); + require_once( buddypress()->members->admin->admin_dir . 'bp-members-admin-classes.php' ); + } + + return new $class(); + } + + /** + * Set up the signups admin page. + * + * Loaded before the page is rendered, this function does all initial + * setup, including: processing form requests, registering contextual + * help, and setting up screen options. + * + * @since 2.0.0 + * + * @global $bp_members_signup_list_table + */ + public function signups_admin_load() { + global $bp_members_signup_list_table; + + // Build redirection URL. + $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(); + + /** + * Fires at the start of the signups admin load. + * + * @since 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 ); + + /** + * Filters the allowed actions for use in the user signups admin page. + * + * @since 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. + if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) { + + if ( is_network_admin() ) { + $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_MS_List_Table', 'ms-users' ); + } else { + $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_List_Table', 'users' ); + } + + // The per_page screen option. + add_screen_option( 'per_page', array( 'label' => _x( 'Pending Accounts', 'Pending Accounts per page (screen options)', 'buddypress' ) ) ); + + get_current_screen()->add_help_tab( array( + 'id' => 'bp-signups-overview', + 'title' => __( 'Overview', 'buddypress' ), + 'content' => + '<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>' + ) ); + + get_current_screen()->add_help_tab( array( + 'id' => 'bp-signups-actions', + 'title' => __( 'Actions', 'buddypress' ), + 'content' => + '<p>' . __( '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:', 'buddypress' ) . '</p>' . + '<ul><li>' . __( '"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.', 'buddypress' ) . '</li>' . + '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' . + '<p>' . __( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . + '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>' + ) ); + + // Help panel - sidebar links. + get_current_screen()->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + + // Add accessible hidden headings and text for the Pending Users screen. + if ( bp_get_major_wp_version() >= 4.4 ) { + get_current_screen()->set_screen_reader_content( array( + 'heading_views' => __( 'Filter users list', 'buddypress' ), + 'heading_pagination' => __( 'Pending users list navigation', 'buddypress' ), + 'heading_list' => __( 'Pending users list', 'buddypress' ), + ) ); + } + + } else { + if ( ! empty( $_REQUEST['signup_ids' ] ) ) { + $signups = wp_parse_id_list( $_REQUEST['signup_ids' ] ); + } + + // Handle resent activation links. + if ( 'do_resend' == $doaction ) { + + // Nonce check. + check_admin_referer( 'signups_resend' ); + + $resent = BP_Signup::resend( $signups ); + + if ( empty( $resent ) ) { + $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); + } else { + $query_arg = array( 'updated' => 'resent' ); + + if ( ! empty( $resent['resent'] ) ) { + $query_arg['resent'] = count( $resent['resent'] ); + } + + if ( ! empty( $resent['errors'] ) ) { + $query_arg['notsent'] = count( $resent['errors'] ); + set_transient( '_bp_admin_signups_errors', $resent['errors'], 30 ); + } + + $redirect_to = add_query_arg( $query_arg, $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + + // Handle activated accounts. + } elseif ( 'do_activate' == $doaction ) { + + // Nonce check. + check_admin_referer( 'signups_activate' ); + + $activated = BP_Signup::activate( $signups ); + + if ( empty( $activated ) ) { + $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); + } else { + $query_arg = array( 'updated' => 'activated' ); + + if ( ! empty( $activated['activated'] ) ) { + $query_arg['activated'] = count( $activated['activated'] ); + } + + if ( ! empty( $activated['errors'] ) ) { + $query_arg['notactivated'] = count( $activated['errors'] ); + set_transient( '_bp_admin_signups_errors', $activated['errors'], 30 ); + } + + $redirect_to = add_query_arg( $query_arg, $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + + // Handle sign-ups delete. + } elseif ( 'do_delete' == $doaction ) { + + // Nonce check. + check_admin_referer( 'signups_delete' ); + + $deleted = BP_Signup::delete( $signups ); + + if ( empty( $deleted ) ) { + $redirect_to = add_query_arg( 'error', $doaction, $redirect_to ); + } else { + $query_arg = array( 'updated' => 'deleted' ); + + if ( ! empty( $deleted['deleted'] ) ) { + $query_arg['deleted'] = count( $deleted['deleted'] ); + } + + if ( ! empty( $deleted['errors'] ) ) { + $query_arg['notdeleted'] = count( $deleted['errors'] ); + set_transient( '_bp_admin_signups_errors', $deleted['errors'], 30 ); + } + + $redirect_to = add_query_arg( $query_arg, $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + + // Plugins can update other stuff from here. + } else { + $this->redirect = $redirect_to; + + /** + * Fires at end of signups admin load if doaction does not match any actions. + * + * @since 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 ); + } + } + } + + /** + * Display any activation errors. + * + * @since 2.0.0 + */ + public function signups_display_errors() { + + // Look for sign-up errors. + $errors = get_transient( '_bp_admin_signups_errors' ); + + // Bail if no activation errors. + if ( empty( $errors ) ) { + return; + } + + // Loop through errors and display them. + foreach ( $errors as $error ) : ?> + + <li><?php echo esc_html( $error[0] );?>: <?php echo esc_html( $error[1] );?></li> + + <?php endforeach; + + // Delete the redirect transient. + delete_transient( '_bp_admin_signups_errors' ); + } + + /** + * Get admin notice when viewing the sign-up page. + * + * @since 2.1.0 + * + * @return array + */ + private function get_signup_notice() { + + // Setup empty notice for return value. + $notice = array(); + + // Updates. + if ( ! empty( $_REQUEST['updated'] ) ) { + switch ( $_REQUEST['updated'] ) { + case 'resent': + $notice = array( + 'class' => 'updated', + 'message' => '' + ); + + if ( ! empty( $_REQUEST['resent'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s activation email successfully sent! ', '%s activation emails successfully sent! ', + absint( $_REQUEST['resent'] ), + 'signup resent', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['resent'] ) ) + ); + } + + if ( ! empty( $_REQUEST['notsent'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s activation email was not sent.', '%s activation emails were not sent.', + absint( $_REQUEST['notsent'] ), + 'signup notsent', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['notsent'] ) ) + ); + + if ( empty( $_REQUEST['resent'] ) ) { + $notice['class'] = 'error'; + } + } + + break; + + case 'activated': + $notice = array( + 'class' => 'updated', + 'message' => '' + ); + + if ( ! empty( $_REQUEST['activated'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s account successfully activated! ', '%s accounts successfully activated! ', + absint( $_REQUEST['activated'] ), + 'signup resent', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['activated'] ) ) + ); + } + + if ( ! empty( $_REQUEST['notactivated'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s account was not activated.', '%s accounts were not activated.', + absint( $_REQUEST['notactivated'] ), + 'signup notsent', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['notactivated'] ) ) + ); + + if ( empty( $_REQUEST['activated'] ) ) { + $notice['class'] = 'error'; + } + } + + break; + + case 'deleted': + $notice = array( + 'class' => 'updated', + 'message' => '' + ); + + if ( ! empty( $_REQUEST['deleted'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s sign-up successfully deleted!', '%s sign-ups successfully deleted!', + absint( $_REQUEST['deleted'] ), + 'signup deleted', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['deleted'] ) ) + ); + } + + if ( ! empty( $_REQUEST['notdeleted'] ) ) { + $notice['message'] .= sprintf( + _nx( '%s sign-up was not deleted.', '%s sign-ups were not deleted.', + absint( $_REQUEST['notdeleted'] ), + 'signup notdeleted', + 'buddypress' + ), + number_format_i18n( absint( $_REQUEST['notdeleted'] ) ) + ); + + if ( empty( $_REQUEST['deleted'] ) ) { + $notice['class'] = 'error'; + } + } + + break; + } + } + + // Errors. + if ( ! empty( $_REQUEST['error'] ) ) { + switch ( $_REQUEST['error'] ) { + case 'do_resend': + $notice = array( + 'class' => 'error', + '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' ), + ); + break; + + case 'do_delete': + $notice = array( + 'class' => 'error', + 'message' => esc_html__( 'There was a problem deleting sign-ups. Please try again.', 'buddypress' ), + ); + break; + } + } + + return $notice; + } + + /** + * 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. + * + * Also prepare the admin notices. + * + * @since 2.0.0 + */ + public function signups_admin() { + $doaction = bp_admin_list_table_current_bulk_action(); + + // Prepare notices for admin. + $notice = $this->get_signup_notice(); + + // Display notices. + if ( ! empty( $notice ) ) : + if ( 'updated' === $notice['class'] ) : ?> + + <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?>"> + + <?php else: ?> + + <div class="<?php echo esc_attr( $notice['class'] ); ?>"> + + <?php endif; ?> + + <p><?php echo $notice['message']; ?></p> + + <?php if ( ! empty( $_REQUEST['notactivated'] ) || ! empty( $_REQUEST['notdeleted'] ) || ! empty( $_REQUEST['notsent'] ) ) :?> + + <ul><?php $this->signups_display_errors();?></ul> + + <?php endif ;?> + + </div> + + <?php endif; + + // Show the proper screen. + switch ( $doaction ) { + case 'activate' : + case 'delete' : + case 'resend' : + $this->signups_admin_manage( $doaction ); + break; + + default: + $this->signups_admin_index(); + break; + + } + } + + /** + * This is the list of the Pending accounts (signups). + * + * @since 2.0.0 + * + * @global $plugin_page + * @global $bp_members_signup_list_table + */ + public function signups_admin_index() { + global $plugin_page, $bp_members_signup_list_table; + + $usersearch = ! empty( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; + + // Prepare the group items for display. + $bp_members_signup_list_table->prepare_items(); + + if ( is_network_admin() ) { + $form_url = network_admin_url( 'users.php' ); + } else { + $form_url = bp_get_admin_url( 'users.php' ); + } + + $form_url = add_query_arg( + array( + 'page' => 'bp-signups', + ), + $form_url + ); + + $search_form_url = remove_query_arg( + array( + 'action', + 'deleted', + 'notdeleted', + 'error', + 'updated', + 'delete', + 'activate', + 'activated', + 'notactivated', + 'resend', + 'resent', + 'notresent', + 'do_delete', + 'do_activate', + 'do_resend', + 'action2', + '_wpnonce', + 'signup_ids' + ), $_SERVER['REQUEST_URI'] + ); + + ?> + + <div class="wrap"> + <h1><?php _e( 'Users', 'buddypress' ); ?> + + <?php if ( current_user_can( 'create_users' ) ) : ?> + + <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a> + + <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?> + + <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a> + + <?php endif; + + if ( $usersearch ) { + printf( '<span class="subtitle">' . __( 'Search results for “%s”', 'buddypress' ) . '</span>', esc_html( $usersearch ) ); + } + + ?> + </h1> + + <?php // Display each signups on its own row. ?> + <?php $bp_members_signup_list_table->views(); ?> + + <form id="bp-signups-search-form" action="<?php echo esc_url( $search_form_url ) ;?>"> + <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" /> + <?php $bp_members_signup_list_table->search_box( __( 'Search Pending Users', 'buddypress' ), 'bp-signups' ); ?> + </form> + + <form id="bp-signups-form" action="<?php echo esc_url( $form_url );?>" method="post"> + <?php $bp_members_signup_list_table->display(); ?> + </form> + </div> + <?php + } + + /** + * This is the confirmation screen for actions. + * + * @since 2.0.0 + * + * @param string $action Delete, activate, or resend activation link. + * @return string + */ + public function signups_admin_manage( $action = '' ) { + if ( ! current_user_can( $this->capability ) || empty( $action ) ) { + die( '-1' ); + } + + // Get the user IDs from the URL. + $ids = false; + if ( ! empty( $_POST['allsignups'] ) ) { + $ids = wp_parse_id_list( $_POST['allsignups'] ); + } elseif ( ! empty( $_GET['signup_id'] ) ) { + $ids = absint( $_GET['signup_id'] ); + } + + if ( empty( $ids ) ) { + return false; + } + + // Query for signups, and filter out those IDs that don't + // correspond to an actual signup. + $signups_query = BP_Signup::get( array( + 'include' => $ids, + ) ); + + $signups = $signups_query['signups']; + $signup_ids = wp_list_pluck( $signups, 'signup_id' ); + + // Set up strings. + switch ( $action ) { + case 'delete' : + $header_text = __( 'Delete Pending Accounts', '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' ); + 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' ); + 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; + } + + // These arguments are added to all URLs. + $url_args = array( 'page' => 'bp-signups' ); + + // These arguments are only added when performing an action. + $action_args = array( + 'action' => 'do_' . $action, + 'signup_ids' => implode( ',', $signup_ids ) + ); + + if ( is_network_admin() ) { + $base_url = network_admin_url( 'users.php' ); + } else { + $base_url = bp_get_admin_url( 'users.php' ); + } + + $cancel_url = add_query_arg( $url_args, $base_url ); + $action_url = wp_nonce_url( + add_query_arg( + array_merge( $url_args, $action_args ), + $base_url + ), + 'signups_' . $action + ); + + ?> + + <div class="wrap"> + <h1><?php echo esc_html( $header_text ); ?></h1> + <p><?php echo esc_html( $helper_text ); ?></p> + + <ol class="bp-signups-list"> + <?php foreach ( $signups as $signup ) : + + $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); ?> + + <li> + <?php echo esc_html( $signup->user_name ) ?> - <?php echo sanitize_email( $signup->user_email );?> + + <?php if ( 'resend' == $action ) : ?> + + <p class="description"> + <?php printf( esc_html__( 'Last notified: %s', 'buddypress'), $last_notified ) ;?> + + <?php if ( ! empty( $signup->recently_sent ) ) : ?> + + <span class="attention wp-ui-text-notification"> <?php esc_html_e( '(less than 24 hours ago)', 'buddypress' ); ?></span> + + <?php endif; ?> + </p> + + <?php endif; ?> + + </li> + + <?php endforeach; ?> + </ol> + + <?php if ( 'delete' === $action ) : ?> + + <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p> + + <?php endif ; ?> + + <a class="button-primary" href="<?php echo esc_url( $action_url ); ?>"><?php esc_html_e( 'Confirm', 'buddypress' ); ?></a> + <a class="button" href="<?php echo esc_url( $cancel_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a> + </div> + + <?php + } +} +endif; // End class_exists check. diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-component.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-component.php new file mode 100644 index 0000000000000000000000000000000000000000..9c4a87355b6e055f92bcb4e1caaaac2b3c391ac7 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-component.php @@ -0,0 +1,315 @@ +<?php +/** + * BuddyPress Member Loader. + * + * @package BuddyPress + * @subpackage Members + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Defines the BuddyPress Members Component. + */ +class BP_Members_Component extends BP_Component { + + /** + * Member types. + * + * @see bp_register_member_type() + * + * @since 2.2.0 + * @var array + */ + public $types = array(); + + /** + * Start the members component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'members', + __( 'Members', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 20, + 'search_query_arg' => 'members_search', + ) + ); + } + + /** + * Include bp-members files. + * + * @see BP_Component::includes() for description of parameters. + * + * @param array $includes See {@link BP_Component::includes()}. + */ + public function includes( $includes = array() ) { + + // Always include these files. + $includes = array( + 'actions', + 'classes', + 'filters', + 'screens', + 'template', + 'adminbar', + 'functions', + 'widgets', + 'cache', + ); + + if ( bp_is_active( 'activity' ) ) { + $includes[] = 'activity'; + } + + // Include these only if in admin. + if ( is_admin() ) { + $includes[] = 'admin'; + } + + parent::includes( $includes ); + } + + /** + * Set up bp-members global settings. + * + * The BP_MEMBERS_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @see BP_Component::setup_globals() for description of parameters. + * + * @param array $args See {@link BP_Component::setup_globals()}. + */ + public function setup_globals( $args = array() ) { + global $wpdb; + + $bp = buddypress(); + + /** Component Globals ************************************************ + */ + + // Define a slug, as a fallback for backpat. + if ( !defined( 'BP_MEMBERS_SLUG' ) ) { + define( 'BP_MEMBERS_SLUG', $this->id ); + } + + // Override any passed args. + $args = array( + 'slug' => BP_MEMBERS_SLUG, + 'root_slug' => isset( $bp->pages->members->slug ) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, + 'has_directory' => true, + 'directory_title' => _x( 'Members', 'component directory title', 'buddypress' ), + 'search_string' => __( 'Search Members...', 'buddypress' ), + 'global_tables' => array( + 'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity', + 'table_name_signups' => $wpdb->base_prefix . 'signups', // signups is a global WordPress table + ) + ); + + parent::setup_globals( $args ); + + /** Logged in user *************************************************** + */ + + // The core userdata of the user who is currently logged in. + $bp->loggedin_user->userdata = bp_core_get_core_userdata( bp_loggedin_user_id() ); + + // Fetch the full name for the logged in user. + $bp->loggedin_user->fullname = isset( $bp->loggedin_user->userdata->display_name ) ? $bp->loggedin_user->userdata->display_name : ''; + + // 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://example.com/members/andy. + $bp->loggedin_user->domain = bp_core_get_user_domain( bp_loggedin_user_id() ); + + /** Displayed user *************************************************** + */ + + // The core userdata of the user who is currently being displayed. + $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); + + // Fetch the full name displayed user. + $bp->displayed_user->fullname = isset( $bp->displayed_user->userdata->display_name ) ? $bp->displayed_user->userdata->display_name : ''; + + // The domain for the user currently being displayed. + $bp->displayed_user->domain = bp_core_get_user_domain( bp_displayed_user_id() ); + + /** Signup *********************************************************** + */ + + $bp->signup = new stdClass; + + /** Profiles Fallback ************************************************ + */ + + if ( ! bp_is_active( 'xprofile' ) ) { + $bp->profile = new stdClass; + $bp->profile->slug = 'profile'; + $bp->profile->id = 'profile'; + } + } + + /** + * Set up canonical stack for this component. + * + * @since 2.1.0 + */ + public function setup_canonical_stack() { + $bp = buddypress(); + + /** Default Profile Component **************************************** + */ + + if ( defined( 'BP_DEFAULT_COMPONENT' ) && BP_DEFAULT_COMPONENT ) { + $bp->default_component = BP_DEFAULT_COMPONENT; + } else { + if ( bp_is_active( 'activity' ) && isset( $bp->pages->activity ) ) { + $bp->default_component = bp_get_activity_slug(); + } else { + $bp->default_component = ( 'xprofile' === $bp->profile->id ) ? 'profile' : $bp->profile->id; + } + } + + /** Canonical Component Stack **************************************** + */ + + if ( bp_displayed_user_id() ) { + $bp->canonical_stack['base_url'] = bp_displayed_user_domain(); + + if ( bp_current_component() ) { + $bp->canonical_stack['component'] = bp_current_component(); + } + + if ( bp_current_action() ) { + $bp->canonical_stack['action'] = bp_current_action(); + } + + if ( !empty( $bp->action_variables ) ) { + $bp->canonical_stack['action_variables'] = bp_action_variables(); + } + + // Looking at the single member root/home, so assume the default. + if ( ! bp_current_component() ) { + $bp->current_component = $bp->default_component; + + // The canonical URL will not contain the default component. + } elseif ( bp_is_current_component( $bp->default_component ) && ! bp_current_action() ) { + unset( $bp->canonical_stack['component'] ); + } + + // If we're on a spammer's profile page, only users with the 'bp_moderate' cap + // can view subpages on the spammer's profile. + // + // users without the cap trying to access a spammer's subnav page will get + // redirected to the root of the spammer's profile page. this occurs by + // by removing the component in the canonical stack. + if ( bp_is_user_spammer( bp_displayed_user_id() ) && ! bp_current_user_can( 'bp_moderate' ) ) { + unset( $bp->canonical_stack['component'] ); + } + } + } + + /** + * Set up fall-back component navigation if XProfile is inactive. + * + * @since 1.5.0 + * + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Bail if XProfile component is active. + if ( bp_is_active( 'xprofile' ) ) { + return; + } + + // Don't set up navigation if there's no member. + if ( ! is_user_logged_in() && ! bp_is_user() ) { + return; + } + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $slug = bp_get_profile_slug(); + $profile_link = trailingslashit( $user_domain . $slug ); + + // Setup the main navigation. + $main_nav = array( + 'name' => _x( 'Profile', 'Member profile main navigation', 'buddypress' ), + 'slug' => $slug, + 'position' => 20, + 'screen_function' => 'bp_members_screen_display_profile', + 'default_subnav_slug' => 'public', + 'item_css_id' => buddypress()->profile->id + ); + + // Setup the subnav items for the member profile. + $sub_nav[] = array( + 'name' => _x( 'View', 'Member profile view', 'buddypress' ), + 'slug' => 'public', + 'parent_url' => $profile_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_members_screen_display_profile', + 'position' => 10 + ); + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the title for pages and <title>. + */ + public function setup_title() { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = __( 'You', 'buddypress' ); + } elseif ( bp_is_user() ) { + $bp->bp_options_title = bp_get_displayed_user_fullname(); + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->bp_options_title ) + ) ); + } + + parent::setup_title(); + } + + /** + * Setup cache groups. + * + * @since 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/classes/class-bp-members-list-table.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-list-table.php new file mode 100644 index 0000000000000000000000000000000000000000..0ea6286d7402368886d1f59f5e2ddb871b15d7a9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-list-table.php @@ -0,0 +1,408 @@ +<?php +/** + * BuddyPress Members List Table class. + * + * @package BuddyPress + * @subpackage MembersAdminClasses + * @since 2.3.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * List table class for signups admin page. + * + * @since 2.0.0 + */ +class BP_Members_List_Table extends WP_Users_List_Table { + + /** + * Signup counts. + * + * @since 2.0.0 + * + * @var int + */ + public $signup_counts = 0; + + /** + * Constructor. + * + * @since 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', + 'screen' => get_current_screen()->id, + ) ); + } + + /** + * 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 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, + ) ); + } + + /** + * Display the users screen views + * + * @since 2.5.0 + * + * @global string $role The name of role the users screens is filtered by + */ + public function views() { + global $role; + + // Used to reset the role + $reset_role = $role; + + // Temporarly set the role to registered + $role = 'registered'; + + // Used to reset the screen id once views are displayed + $reset_screen_id = $this->screen->id; + + // Temporarly set the screen id to the users one + $this->screen->id = 'users'; + + // Use the parent function so that other plugins can safely add views + parent::views(); + + // Reset the role + $role = $reset_role; + + // Reset the screen id + $this->screen->id = $reset_screen_id; + } + + /** + * 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 2.0.0 + * + * @param array $which Current table nav item. + */ + public function extra_tablenav( $which ) { + return; + } + + /** + * Specific signups columns. + * + * @since 2.0.0 + * + * @return array + */ + public function get_columns() { + + /** + * Filters the single site Members signup columns. + * + * @since 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 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 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 2.0.0 + */ + public function get_sortable_columns() { + return array( + 'username' => 'login', + 'email' => 'email', + 'registered' => 'signup_id', + ); + } + + /** + * Display signups rows. + * + * @since 2.0.0 + */ + public function display_rows() { + $style = ''; + foreach ( $this->items as $userid => $signup_object ) { + + // Avoid a notice error appearing since 4.3.0. + if ( isset( $signup_object->id ) ) { + $signup_object->ID = $signup_object->id; + } + + $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; + echo "\n\t" . $this->single_row( $signup_object, $style ); + } + } + + /** + * Display a signup row. + * + * @since 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 void + */ + 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 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 2.0.0 + * + * @param object|null $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 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 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 2.0.0 + * + * @param object|null $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 2.0.0 + * + * @param object|null $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 2.0.0 + * + * @param object|null $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 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 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 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 ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-ms-list-table.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-ms-list-table.php new file mode 100644 index 0000000000000000000000000000000000000000..6ecd98cb64b651004cd171d0f78ba524dddd4234 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-ms-list-table.php @@ -0,0 +1,410 @@ +<?php +/** + * BuddyPress Members List Table for Multisite. + * + * @package BuddyPress + * @subpackage MembersAdminClasses + * @since 2.3.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * List table class for signups network admin page. + * + * @since 2.0.0 + */ +class BP_Members_MS_List_Table extends WP_MS_Users_List_Table { + + /** + * Signup counts. + * + * @since 2.0.0 + * + * @var int + */ + public $signup_counts = 0; + + /** + * Constructor. + * + * @since 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', + 'screen' => get_current_screen()->id, + ) ); + } + + /** + * 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 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, + ) ); + } + + /** + * Display the users screen views + * + * @since 2.5.0 + * + * @global string $role The name of role the users screens is filtered by + */ + public function views() { + global $role; + + // Used to reset the role + $reset_role = $role; + + // Temporarly set the role to registered + $role = 'registered'; + + // Used to reset the screen id once views are displayed + $reset_screen_id = $this->screen->id; + + // Temporarly set the screen id to the users one + $this->screen->id = 'users-network'; + + // Use the parent function so that other plugins can safely add views + parent::views(); + + // Reset the role + $role = $reset_role; + + // Reset the screen id + $this->screen->id = $reset_screen_id; + } + + /** + * Specific signups columns. + * + * @since 2.0.0 + * + * @return array + */ + public function get_columns() { + + /** + * Filters the multisite Members signup columns. + * + * @since 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 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 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 2.0.0 + */ + public function get_sortable_columns() { + return array( + 'username' => 'login', + 'email' => 'email', + 'registered' => 'signup_id', + ); + } + + /** + * Display signups rows. + * + * @since 2.0.0 + */ + public function display_rows() { + $style = ''; + foreach ( $this->items as $userid => $signup_object ) { + + // Avoid a notice error appearing since 4.3.0. + if ( isset( $signup_object->id ) ) { + $signup_object->ID = $signup_object->id; + } + + $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"'; + echo "\n\t" . $this->single_row( $signup_object, $style ); + } + } + + /** + * Display a signup row. + * + * @since 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>'; + } + + /** + * Prevents regular users row actions to be output. + * + * @since 2.4.0 + * + * @param object|null $signup_object Signup being acted upon. + * @param string $column_name Current column name. + * @param string $primary Primary column name. + * @return string + */ + protected function handle_row_actions( $signup_object = null, $column_name = '', $primary = '' ) { + return ''; + } + + /** + * Markup for the checkbox used to select items for bulk actions. + * + * @since 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 2.0.0 + * + * @param object|null $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', + ), + network_admin_url( 'users.php' ) + ); + + // Activate link. + $activate_link = add_query_arg( + array( + 'page' => 'bp-signups', + 'signup_id' => $signup_object->id, + 'action' => 'activate', + ), + network_admin_url( 'users.php' ) + ); + + // Delete link. + $delete_link = add_query_arg( + array( + 'page' => 'bp-signups', + 'signup_id' => $signup_object->id, + 'action' => 'delete', + ), + network_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 2.0.0 + * + * @param object|null $signup_object The signup data object. + */ + public function column_name( $signup_object = null ) { + echo esc_html( $signup_object->user_name ); + } + + /** + * Display user email. + * + * @since 2.0.0 + * + * @param object|null $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 2.0.0 + * + * @param object|null $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 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 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 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 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 ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-theme-compat.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..e9a6c4a6889cf1fa32dbf50de768ea1d54bcc85e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-theme-compat.php @@ -0,0 +1,215 @@ +<?php +/** + * BuddyPress Member Theme Compat. + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main theme compat class for BuddyPress Members. + * + * This class sets up the necessary theme compatibility actions to safely output + * member template parts to the_title and the_content areas of a theme. + * + * @since 1.7.0 + */ +class BP_Members_Theme_Compat { + + /** + * Set up the members component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_members' ) ); + } + + /** + * Are we looking at something that needs members theme compatibility? + * + * @since 1.7.0 + */ + 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() ) { + 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 1.5.0 + */ + do_action( 'bp_members_screen_index' ); + + add_filter( 'bp_get_buddypress_template', array( $this, 'directory_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // 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() ) { + return; + } + + /** + * Fires if looking at Members user page when needing theme compat. + * + * @since 1.5.0 + */ + do_action( 'bp_members_screen_display_profile' ); + + add_filter( 'bp_get_buddypress_template', array( $this, 'single_template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); + + } + } + + /** Directory *************************************************************/ + + /** + * Add template hierarchy to theme compat for the members directory page. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 1.8.0 + * + * @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() ) { + + // Set up the template hierarchy. + $new_templates = array(); + if ( '' !== bp_get_current_member_type() ) { + $new_templates[] = 'members/index-directory-type-' . sanitize_file_name( bp_get_current_member_type() ) . '.php'; + } + $new_templates[] = 'members/index-directory.php'; + + /** + * Filters the template hierarchy for theme compat and members directory page. + * + * @since 1.8.0 + * + * @param array $value Array of template paths to add to hierarchy. + */ + $new_templates = apply_filters( 'bp_template_hierarchy_members_directory', $new_templates ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with directory data. + * + * @since 1.7.0 + */ + public function directory_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => bp_get_directory_title( 'members' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members index template part. + * + * @since 1.7.0 + */ + public function directory_content() { + return bp_buffer_template_part( 'members/index', null, false ); + } + + /** Single ****************************************************************/ + + /** + * Add custom template hierarchy to theme compat for member pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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 some variables we're going to reference in our custom templates. + $user_nicename = buddypress()->displayed_user->userdata->user_nicename; + + /** + * Filters the template hierarchy for theme compat and member pages. + * + * @since 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', + 'members/single/index-action-' . sanitize_file_name( bp_current_action() ) . '.php', + 'members/single/index-component-' . sanitize_file_name( bp_current_component() ) . '.php', + 'members/single/index.php' + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with the displayed user's data. + * + * @since 1.7.0 + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => bp_get_displayed_user_fullname(), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members' single home template part. + * + * @since 1.7.0 + */ + public function single_dummy_content() { + return bp_buffer_template_part( 'members/single/home', null, false ); + } +} diff --git a/wp-content/plugins/buddypress/bp-members/classes/class-bp-registration-theme-compat.php b/wp-content/plugins/buddypress/bp-members/classes/class-bp-registration-theme-compat.php new file mode 100644 index 0000000000000000000000000000000000000000..6a942a58b1df088455e10172515ffeabbbbcfad9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-registration-theme-compat.php @@ -0,0 +1,140 @@ +<?php +/** + * BuddyPress Member Screens. + * + * Handlers for member screens that aren't handled elsewhere. + * + * @package BuddyPress + * @subpackage MembersScreens + * @since 1.7.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main theme compat class for BuddyPress Registration. + * + * 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 1.7.0 + */ +class BP_Registration_Theme_Compat { + + /** + * Setup the groups component theme compatibility. + * + * @since 1.7.0 + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_registration' ) ); + } + + /** + * Are we looking at either the registration or activation pages? + * + * @since 1.7.0 + */ + public function is_registration() { + + // Bail if not looking at the registration or activation page. + if ( ! bp_is_register_page() && ! bp_is_activation_page() ) { + return; + } + + // Not a directory. + bp_update_is_directory( false, 'register' ); + + // Setup actions. + add_filter( 'bp_get_buddypress_template', array( $this, 'template_hierarchy' ) ); + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) ); + } + + /** Template ***********************************************************/ + + /** + * Add template hierarchy to theme compat for registration/activation pages. + * + * This is to mirror how WordPress has + * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}. + * + * @since 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() ); + + /** + * 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 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" + ) ); + + // Merge new templates with existing stack + // @see bp_get_theme_compat_templates(). + $templates = array_merge( (array) $new_templates, $templates ); + + return $templates; + } + + /** + * Update the global $post with dummy data. + * + * @since 1.7.0 + */ + public function dummy_post() { + // Registration page. + if ( bp_is_register_page() ) { + $title = __( 'Create an Account', 'buddypress' ); + + if ( 'completed-confirmation' == bp_get_current_signup_step() ) { + $title = __( 'Check Your Email To Activate Your Account!', 'buddypress' ); + } + + // Activation page. + } else { + $title = __( 'Activate Your Account', 'buddypress' ); + + if ( bp_account_was_activated() ) { + $title = __( 'Account Activated', 'buddypress' ); + } + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'page', + 'post_status' => 'publish', + 'is_page' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with either the register or activate templates. + * + * @since 1.7.0 + */ + public function dummy_content() { + if ( bp_is_register_page() ) { + return bp_buffer_template_part( 'members/register', null, false ); + } else { + return bp_buffer_template_part( 'members/activate', null, false ); + } + } +} 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 index 9af77c8990cac1c2c2d7ac1c48baa5ab01b2a5c6..936b72cf346a55e73f1368fb0558eb3c84117ae1 100644 --- a/wp-content/plugins/buddypress/bp-members/classes/class-bp-signup.php +++ b/wp-content/plugins/buddypress/bp-members/classes/class-bp-signup.php @@ -1,12 +1,14 @@ <?php - /** * Signups Management class. * * @package BuddyPress * @subpackage coreClasses - * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + */ + +/** + * Class used to handle Signups. */ class BP_Signup { @@ -72,7 +74,7 @@ class BP_Signup { /** * Class constructor. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param integer $signup_id The ID for the signup being queried. */ @@ -86,7 +88,7 @@ class BP_Signup { /** * Populate the instantiated class with data based on the signup_id provided. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ public function populate() { global $wpdb; @@ -108,10 +110,9 @@ class BP_Signup { /** * Fetch signups based on parameters. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -149,18 +150,18 @@ class BP_Signup { if ( empty( $r['include'] ) ) { - // Search terms + // 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 + // Activation key. if ( ! empty( $r['activation_key'] ) ) { $sql['where'][] = $wpdb->prepare( "activation_key = %s", $r['activation_key'] ); } - // User login + // User login. if ( ! empty( $r['user_login'] ) ) { $sql['where'][] = $wpdb->prepare( "user_login = %s", $r['user_login'] ); } @@ -173,13 +174,13 @@ class BP_Signup { $sql['in'] = "AND signup_id IN ({$in})"; } - // Implode WHERE clauses + // Implode WHERE clauses. $sql['where'] = 'WHERE ' . implode( ' AND ', $sql['where'] ); /** * Filters the Signups paged query. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value SQL statement. * @param array $sql Array of SQL statement parts. @@ -193,7 +194,7 @@ class BP_Signup { } // Used to calculate a diff between now & last - // time an activation link has been resent + // time an activation link has been resent. $now = current_time( 'timestamp', true ); foreach ( (array) $paged_signups as $key => $signup ) { @@ -207,7 +208,7 @@ class BP_Signup { $signup->user_name = wp_unslash( $signup->meta['field_1'] ); } - // Sent date defaults to date of registration + // Sent date defaults to date of registration. if ( ! empty( $signup->meta['sent_date'] ) ) { $signup->date_sent = $signup->meta['sent_date']; } else { @@ -218,8 +219,8 @@ class BP_Signup { $diff = $now - $sent_at; /** - * add a boolean in case the last time an activation link - * has been sent happened less than a day ago + * 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; @@ -240,7 +241,7 @@ class BP_Signup { /** * Filters the Signups count query. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value SQL statement. * @param array $sql Array of SQL statement parts. @@ -255,10 +256,9 @@ class BP_Signup { /** * Add a signup. * - * @since BuddyPress (2.0.0) - * - * @param array $args + * @since 2.0.0 * + * @param array $args Array of arguments for signup addition. * @return int|bool ID of newly created signup on success, false on * failure. */ @@ -296,7 +296,7 @@ class BP_Signup { /** * Filters the result of a signup addition. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int|bool $retval Newly added user ID on success, false on failure. */ @@ -313,13 +313,12 @@ class BP_Signup { * mirror signups there by creating "phantom" users, mimicking WP's * default behavior. * - * @since BuddyPress (2.0.0) + * @since 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() ) { @@ -337,7 +336,7 @@ class BP_Signup { } // Update the user status to '2', ie "not activated" - // (0 = active, 1 = spam, 2 = not active) + // (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 @@ -346,7 +345,7 @@ class BP_Signup { delete_user_option( $user_id, 'capabilities' ); delete_user_option( $user_id, 'user_level' ); - // Set any profile data + // Set any profile data. if ( bp_is_active( 'xprofile' ) ) { if ( ! empty( $usermeta['profile_field_ids'] ) ) { $profile_field_ids = explode( ',', $usermeta['profile_field_ids'] ); @@ -359,7 +358,7 @@ class BP_Signup { $current_field = $usermeta["field_{$field_id}"]; xprofile_set_field_data( $field_id, $user_id, $current_field ); - // Save the visibility level + // 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 ); } @@ -369,7 +368,7 @@ class BP_Signup { /** * Filters the user ID for the backcompat functionality. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $user_id User ID being registered. */ @@ -379,10 +378,9 @@ class BP_Signup { /** * Check a user status (from wp_users) on a non-multisite config. * - * @since BuddyPress (2.0.0) + * @since 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 ) { @@ -397,7 +395,7 @@ class BP_Signup { /** * Filters the user status of a provided user ID. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $value User status of the provided user ID. */ @@ -407,10 +405,9 @@ class BP_Signup { /** * Activate a signup. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $key Activation key. - * * @return bool True on success, false on failure. */ public static function validate( $key = '' ) { @@ -421,7 +418,7 @@ class BP_Signup { } $activated = $wpdb->update( - // Signups table + // Signups table. buddypress()->members->table_name_signups, array( 'active' => 1, @@ -430,12 +427,12 @@ class BP_Signup { array( 'activation_key' => $key, ), - // Data sanitization format + // Data sanitization format. array( '%d', '%s', ), - // WHERE sanitization format + // WHERE sanitization format. array( '%s', ) @@ -444,7 +441,7 @@ class BP_Signup { /** * Filters the status of the activated user. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param bool $activated Whether or not the activation was successful. */ @@ -454,7 +451,7 @@ class BP_Signup { /** * How many inactive signups do we have? * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return int The number of signups. */ @@ -467,7 +464,7 @@ class BP_Signup { /** * Filters the total inactive signups. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $count_signups How many total signups there are. */ @@ -480,11 +477,10 @@ class BP_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 + * @since 2.0.0 * - * @return int The signup id + * @param array $args Array of arguments for the signup update. + * @return int The signup id. */ public static function update( $args = array() ) { global $wpdb; @@ -502,21 +498,21 @@ class BP_Signup { } $wpdb->update( - // Signups table + // Signups table. buddypress()->members->table_name_signups, - // Data to update + // Data to update. array( 'meta' => serialize( $r['meta'] ), ), - // WHERE + // WHERE. array( 'signup_id' => $r['signup_id'], ), - // Data sanitization format + // Data sanitization format. array( '%s', ), - // WHERE sanitization format + // WHERE sanitization format. array( '%d', ) @@ -525,7 +521,7 @@ class BP_Signup { /** * Filters the signup ID which received a meta update. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $value The signup ID. */ @@ -535,10 +531,9 @@ class BP_Signup { /** * Resend an activation email. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Single ID or list of IDs to resend. - * * @return array */ public static function resend( $signup_ids = array() ) { @@ -559,7 +554,7 @@ class BP_Signup { /** * Fires before activation emails are resent. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of IDs to resend activation emails to. */ @@ -571,31 +566,31 @@ class BP_Signup { $meta['sent_date'] = current_time( 'mysql', true ); $meta['count_sent'] = $signup->count_sent + 1; - // Send activation email + // 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 + // 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 + // 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 + // Repair signups table. self::validate( $signup->activation_key ); continue; - // Send the validation email + // Send the validation email. } else { - bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key ); + bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key, $signup->user_login ); } } - // Update metas + // Update metas. $result['resent'][] = self::update( array( 'signup_id' => $signup->signup_id, 'meta' => $meta, @@ -605,7 +600,7 @@ class BP_Signup { /** * Fires after activation emails are resent. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of IDs to resend activation emails to. * @param array $result Updated metadata related to activation emails. @@ -615,7 +610,7 @@ class BP_Signup { /** * Filters the result of the metadata for signup activation email resends. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $result Updated metadata related to activation emails. */ @@ -625,10 +620,9 @@ class BP_Signup { /** * Activate a pending account. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Single ID or list of IDs to activate. - * * @return array */ public static function activate( $signup_ids = array() ) { @@ -649,7 +643,7 @@ class BP_Signup { /** * Fires before activation of user accounts. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of IDs to activate. */ @@ -669,13 +663,13 @@ class BP_Signup { if ( empty( $user_id ) ) { - // Status is not 2, so user's account has been activated + // 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 + // Repair signups table. self::validate( $signup->activation_key ); - // we have a user id, account is not active, let's delete it + // 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() ); } @@ -688,7 +682,7 @@ class BP_Signup { /** * Fires after activation of user accounts. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of IDs activated activate. * @param array $result Array of data for activated accounts. @@ -698,7 +692,7 @@ class BP_Signup { /** * Filters the result of the metadata after user activation. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $result Updated metadata related to user activation. */ @@ -708,10 +702,9 @@ class BP_Signup { /** * Delete a pending account. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Single ID or list of IDs to delete. - * * @return array */ public static function delete( $signup_ids = array() ) { @@ -734,7 +727,7 @@ class BP_Signup { /** * Fires before deletion of pending accounts. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of pending IDs to delete. */ @@ -743,17 +736,17 @@ class BP_Signup { foreach ( $signups as $signup ) { $user_id = username_exists( $signup->user_login ); - if ( ! empty( $user_id ) && $signup->activation_key == wp_hash( $user_id ) ) { + if ( ! empty( $user_id ) && $signup->activation_key === bp_get_user_meta( $user_id, 'activation_key', true ) ) { if ( 2 != self::check_user_status( $user_id ) ) { - // Status is not 2, so user's account has been activated + // 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 + // Repair signups table. self::validate( $signup->activation_key ); - // we have a user id, account is not active, let's delete it + // We have a user id, account is not active, let's delete it. } else { bp_core_delete_account( $user_id ); } @@ -761,11 +754,11 @@ class BP_Signup { if ( empty( $result['errors'][ $signup->signup_id ] ) ) { $wpdb->delete( - // Signups table + // Signups table. buddypress()->members->table_name_signups, - // Where + // Where. array( 'signup_id' => $signup->signup_id, ), - // WHERE sanitization format + // WHERE sanitization format. array( '%d', ) ); @@ -776,7 +769,7 @@ class BP_Signup { /** * Fires after deletion of pending accounts. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $signup_ids Array of pending IDs to delete. * @param array $result Array of data for deleted accounts. @@ -786,7 +779,7 @@ class BP_Signup { /** * Filters the result of the metadata for deleted pending accounts. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $result Updated metadata related to deleted pending accounts. */ 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 e471f82ce9a995cf6b5c7e7c46c466a05beeed4d..cb642540e6430f857de9e2861571928ac1761f94 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Messages Actions. * @@ -9,32 +8,227 @@ * * @package BuddyPress * @subpackage MessagesActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +/** + * Handle creating of private messages or sitewide notices + * + * @since 2.4.0 This function was split from messages_screen_compose(). See #6505. + * + * @return boolean + */ +function bp_messages_action_create_message() { + + // Bail if not posting to the compose message screen. + if ( ! bp_is_post_request() || ! bp_is_messages_component() || ! bp_is_current_action( 'compose' ) ) { + return false; + } + + // Check the nonce. + check_admin_referer( 'messages_send_message' ); + + // Define local variables. + $redirect_to = ''; + $feedback = ''; + $success = false; + + // Missing subject or content. + if ( empty( $_POST['subject'] ) || empty( $_POST['content'] ) ) { + $success = false; + + if ( empty( $_POST['subject'] ) ) { + $feedback = __( 'Your message was not sent. Please enter a subject line.', 'buddypress' ); + } else { + $feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' ); + } + + // Subject and content present. + } else { + + // Setup the link to the logged-in user's messages. + $member_messages = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ); + + // Site-wide notice. + if ( isset( $_POST['send-notice'] ) ) { + + // Attempt to save the notice and redirect to notices. + if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) { + $success = true; + $feedback = __( 'Notice successfully created.', 'buddypress' ); + $redirect_to = trailingslashit( $member_messages . 'notices' ); + + // Notice could not be sent. + } else { + $success = false; + $feedback = __( 'Notice was not created. Please try again.', 'buddypress' ); + } + + // Private conversation. + } else { + + // Filter recipients into the format we need - array( 'username/userid', 'username/userid' ). + $autocomplete_recipients = (array) explode( ',', $_POST['send-to-input'] ); + $typed_recipients = (array) explode( ' ', $_POST['send_to_usernames'] ); + $recipients = array_merge( $autocomplete_recipients, $typed_recipients ); + + /** + * Filters the array of recipients to receive the composed message. + * + * @since 1.2.10 + * + * @param array $recipients Array of recipients to receive message. + */ + $recipients = apply_filters( 'bp_messages_recipients', $recipients ); + + // Attempt to send the message. + $send = messages_new_message( array( + 'recipients' => $recipients, + 'subject' => $_POST['subject'], + 'content' => $_POST['content'], + 'error_type' => 'wp_error' + ) ); + + // Send the message and redirect to it. + if ( true === is_int( $send ) ) { + $success = true; + $feedback = __( 'Message successfully sent.', 'buddypress' ); + $view = trailingslashit( $member_messages . 'view' ); + $redirect_to = trailingslashit( $view . $send ); + + // Message could not be sent. + } else { + $success = false; + $feedback = $send->get_error_message(); + } + } + } + + // Feedback. + if ( ! empty( $feedback ) ) { + + // Determine message type. + $type = ( true === $success ) + ? 'success' + : 'error'; + + // Add feedback message. + bp_core_add_message( $feedback, $type ); + } + + // Maybe redirect. + if ( ! empty( $redirect_to ) ) { + bp_core_redirect( $redirect_to ); + } +} +add_action( 'bp_actions', 'bp_messages_action_create_message' ); + +/** + * Handle editing of sitewide notices. + * + * @since 2.4.0 This function was split from messages_screen_notices(). See #6505. + * + * @global int $notice_id + * + * @return boolean + */ +function bp_messages_action_edit_notice() { + global $notice_id; + + // Bail if not viewing a single notice URL. + if ( ! bp_is_messages_component() || ! bp_is_current_action( 'notices' ) || ! bp_action_variable( 1 ) ) { + return false; + } + + // Get action variables. + $action = bp_action_variable( 0 ); // deactivate|activate|delete. + $notice_id = bp_action_variable( 1 ); // 1|2|3|etc... + + // Bail if notice ID is not numeric. + if ( ! is_numeric( $notice_id ) ) { + return; + } + + // Define local variables. + $redirect_to = ''; + $feedback = ''; + $success = false; + + // Get the notice from database. + $notice = new BP_Messages_Notice( $notice_id ); + + // Take action. + switch ( $action ) { + + // Deactivate. + case 'deactivate' : + $success = $notice->deactivate(); + $feedback = true === $success + ? __( 'Notice deactivated successfully.', 'buddypress' ) + : __( 'There was a problem deactivating that notice.', 'buddypress' ); + break; + + // Activate. + case 'activate' : + $success = $notice->activate(); + $feedback = true === $success + ? __( 'Notice activated successfully.', 'buddypress' ) + : __( 'There was a problem activating that notice.', 'buddypress' ); + break; + + // Delete. + case 'delete' : + $success = $notice->delete(); + $feedback = true === $success + ? __( 'Notice deleted successfully.', 'buddypress' ) + : __( 'There was a problem deleting that notice.', 'buddypress' ); + break; + } + + // Feedback. + if ( ! empty( $feedback ) ) { + + // Determine message type. + $type = ( true === $success ) + ? 'success' + : 'error'; + + // Add feedback message. + bp_core_add_message( $feedback, $type ); + } + + // Redirect. + $member_notices = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ); + $redirect_to = trailingslashit( $member_notices . 'notices' ); + + bp_core_redirect( $redirect_to ); +} +add_action( 'bp_actions', 'bp_messages_action_edit_notice' ); + /** * Process a request to view a single message thread. */ function messages_action_conversation() { - // Bail if not viewing a single conversation + // Bail if not viewing a single conversation. if ( ! bp_is_messages_component() || ! bp_is_current_action( 'view' ) ) { return false; } - // Get the thread ID from the action variable + // Get the thread ID from the action variable. $thread_id = (int) bp_action_variable( 0 ); if ( ! messages_is_valid_thread( $thread_id ) || ( ! messages_check_thread_access( $thread_id ) && ! bp_current_user_can( 'bp_moderate' ) ) ) { bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) ); } - // Check if a new reply has been submitted + // Check if a new reply has been submitted. if ( isset( $_POST['send'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'messages_send_message', 'send_message_nonce' ); $new_reply = messages_new_message( array( @@ -43,7 +237,7 @@ function messages_action_conversation() { 'content' => $_POST['content'] ) ); - // Send the reply + // Send the reply. if ( ! empty( $new_reply ) ) { bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) ); } else { @@ -53,13 +247,13 @@ function messages_action_conversation() { bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' ); } - // Mark message read + // 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) + * @since 1.7.0 */ do_action( 'messages_action_conversation' ); } @@ -85,7 +279,7 @@ function messages_action_delete_message() { return false; } - // Delete message + // Delete message. if ( !messages_delete_thread( $thread_id ) ) { bp_core_add_message( __('There was an error deleting that message.', 'buddypress'), 'error' ); } else { @@ -99,7 +293,7 @@ add_action( 'bp_actions', 'messages_action_delete_message' ); /** * Handle marking a single message thread as read. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return bool|null Returns false on failure. Otherwise redirects back to the * message box URL. @@ -140,7 +334,7 @@ add_action( 'bp_actions', 'bp_messages_action_mark_read' ); /** * Handle marking a single message thread as unread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return bool|null Returns false on failure. Otherwise redirects back to the * message box URL. @@ -181,7 +375,7 @@ 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) + * @since 2.2.0 * * @return bool Returns false on failure. Otherwise redirects back to the * message box URL. 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 53ea6cd3941cfe47096c87f6c421fb302f66fa75..434c3a8f5d18a113a93b52500895b701322a9c5b 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Messages Caching. * @@ -7,9 +6,11 @@ * actions throughout BuddyPress. * * @package BuddyPress + * @subpackage MessagesCache + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -19,7 +20,7 @@ defined( 'ABSPATH' ) || exit; * $message_ids and adds it to WP cache. This improves efficiency when using * message meta within a loop context. * - * @since BuddyPress (2.2.0) + * @since 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. @@ -35,12 +36,12 @@ function bp_messages_update_meta_cache( $message_ids = false ) { ) ); } -// List actions to clear super cached pages on, if super cache is installed +// List actions to clear super cached pages on, if super cache is installed. add_action( 'messages_delete_thread', 'bp_core_clear_cache' ); add_action( 'messages_send_notice', 'bp_core_clear_cache' ); add_action( 'messages_message_sent', 'bp_core_clear_cache' ); -// Don't cache message inbox/sentbox/compose as it's too problematic +// Don't cache message inbox/sentbox/compose as it's too problematic. add_action( 'messages_screen_compose', 'bp_core_clear_cache' ); add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' ); add_action( 'messages_screen_inbox', 'bp_core_clear_cache' ); @@ -48,20 +49,20 @@ add_action( 'messages_screen_inbox', 'bp_core_clear_cache' ); /** * Clear message cache after a message is saved. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_Messages_Message $message + * @param BP_Messages_Message $message Message being saved. */ function bp_messages_clear_cache_on_message_save( BP_Messages_Message $message ) { - // Delete thread cache + // Delete thread cache. wp_cache_delete( $message->thread_id, 'bp_messages_threads' ); - // Delete unread count for each recipient + // 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 + // Delete thread recipient cache. wp_cache_delete( 'thread_recipients_' . $message->thread_id, 'bp_messages' ); } add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_save' ); @@ -69,19 +70,19 @@ add_action( 'messages_message_after_save', 'bp_messages_clear_cache_on_message_s /** * Clear message cache after a message thread is deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int|array $thread_ids If single thread, the thread ID. * Otherwise, an array of thread IDs. */ function bp_messages_clear_cache_on_message_delete( $thread_ids ) { - // Delete thread and thread recipient cache + // 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 + // Delete unread count for logged-in user. wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' ); } add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete' ); @@ -91,9 +92,9 @@ add_action( 'messages_delete_thread', 'bp_messages_clear_cache_on_message_delete * * Currently, invalidates active notice cache. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_Messages_Notice $notice + * @param BP_Messages_Notice $notice Notice that was saved. */ 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 e9c9b383584074f0f9945c2f97649b8a0e55e183..ef1a00425d0f216ee4dacc2f971c81b2936f246b 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Messages Classes + * BuddyPress Messages Classes. * * @package BuddyPress * @subpackage MessagesClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; require dirname( __FILE__ ) . '/classes/class-bp-messages-thread.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 a696034cd2e77e7adfa7acfc91c7fff459a87f8b..f061916ccdb49b85304ca5a06cb7736c5f19c013 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php @@ -1,13 +1,13 @@ <?php - /** - * BuddyPress Messages CSS and JS + * BuddyPress Messages CSS and JS. * * @package BuddyPress * @subpackage MessagesScripts + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -19,10 +19,13 @@ function messages_add_autocomplete_js() { if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); - wp_enqueue_script( 'bp-jquery-autocomplete' ); - wp_enqueue_script( 'bp-jquery-autocomplete-fb' ); - wp_enqueue_script( 'bp-jquery-bgiframe' ); - wp_enqueue_script( 'bp-jquery-dimensions' ); + $min = bp_core_get_minified_asset_suffix(); + $url = buddypress()->plugin_url . 'bp-messages/js/'; + + wp_enqueue_script( 'bp-jquery-autocomplete', "{$url}autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-autocomplete-fb', "{$url}autocomplete/jquery.autocompletefb{$min}.js", array( 'jquery' ), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-bgiframe', "{$url}autocomplete/jquery.bgiframe{$min}.js", array( 'jquery' ), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-dimensions', "{$url}autocomplete/jquery.dimensions{$min}.js", array( 'jquery' ), bp_get_version() ); } } add_action( 'bp_enqueue_scripts', 'messages_add_autocomplete_js' ); @@ -34,7 +37,16 @@ add_action( 'bp_enqueue_scripts', 'messages_add_autocomplete_js' ); */ function messages_add_autocomplete_css() { if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { - wp_enqueue_style( 'bp-messages-autocomplete' ); + $min = bp_core_get_minified_asset_suffix(); + $url = buddypress()->plugin_url . 'bp-messages/css/'; + + wp_enqueue_style( 'bp-messages-autocomplete', "{$url}autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version() ); + + wp_style_add_data( 'bp-messages-autocomplete', 'rtl', true ); + if ( $min ) { + wp_style_add_data( 'bp-messages-autocomplete', 'suffix', $min ); + } + wp_print_styles(); } } 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 c8cb48f5e835d7071637c3844daa73368c8583eb..b2edbbdf54079b875eb255ccb8645ba0352231f6 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Messages Filters. * @@ -7,9 +6,10 @@ * * @package BuddyPress * @subpackage MessagesFilters + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; add_filter( 'bp_get_message_notice_subject', 'wp_filter_kses', 1 ); @@ -33,6 +33,13 @@ add_filter( 'messages_message_subject_before_save', 'force_balance_tags' ); add_filter( 'messages_notice_message_before_save', 'force_balance_tags' ); add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' ); +if ( function_exists( 'wp_encode_emoji' ) ) { + add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' ); + add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' ); + add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' ); + add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' ); +} + add_filter( 'bp_get_message_notice_subject', 'wptexturize' ); add_filter( 'bp_get_message_notice_text', 'wptexturize' ); add_filter( 'bp_get_message_thread_subject', 'wptexturize' ); @@ -70,15 +77,16 @@ add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' ); /** * Enforce limitations on viewing private message contents * - * @since BuddyPress (2.3.2) + * @since 2.3.2 * * @see bp_has_message_threads() for description of parameters * * @param array|string $args See {@link bp_has_message_threads()}. + * @return array */ function bp_messages_enforce_current_user( $args = array() ) { - // Non-community moderators can only ever see their own messages + // 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'] ) { @@ -86,7 +94,7 @@ function bp_messages_enforce_current_user( $args = array() ) { } } - // Return possibly modified $args array + // Return possibly modified $args array. return $args; } add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_enforce_current_user', 5 ); 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 f7dc3cb1612a114dd348b9f6bd84e26c3d39a51f..900fcaa5d9cfceb55b63ab084bbb1ce5b3d5b186 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Messages Functions. * @@ -10,14 +9,17 @@ * * @package BuddyPress * @subpackage MessagesFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Create a new message. * + * @since 2.4.0 Added 'error_type' as an additional $args parameter. + * * @param array|string $args { * Array of arguments. * @type int $sender_id Optional. ID of the user who is sending the @@ -32,27 +34,42 @@ defined( 'ABSPATH' ) || exit; * 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 string $error_type Optional. Error type. Either 'bool' or 'wp_error'. Default: 'bool'. * } * @return int|bool ID of the message thread on success, false on failure. */ function messages_new_message( $args = '' ) { - // Parse the default arguments + // Parse the default arguments. $r = bp_parse_args( $args, array( 'sender_id' => bp_loggedin_user_id(), - 'thread_id' => false, // false for a new message, thread id for a reply to a thread. + 'thread_id' => false, // False for a new message, thread id for a reply to a thread. 'recipients' => array(), // Can be an array of usernames, user_ids or mixed. 'subject' => false, 'content' => false, - 'date_sent' => bp_core_current_time() + 'date_sent' => bp_core_current_time(), + 'error_type' => 'bool' ), 'messages_new_message' ); - // Bail if no sender or no content + // Bail if no sender or no content. if ( empty( $r['sender_id'] ) || empty( $r['content'] ) ) { - return false; + if ( 'wp_error' === $r['error_type'] ) { + if ( empty( $r['sender_id'] ) ) { + $error_code = 'messages_empty_sender'; + $feedback = __( 'Your message was not sent. Please use a valid sender.', 'buddypress' ); + } else { + $error_code = 'messages_empty_content'; + $feedback = __( 'Your message was not sent. Please enter some content.', 'buddypress' ); + } + + return new WP_Error( $error_code, $feedback ); + + } else { + return false; + } } - // Create a new message object + // Create a new message object. $message = new BP_Messages_Message; $message->thread_id = $r['thread_id']; $message->sender_id = $r['sender_id']; @@ -73,7 +90,7 @@ function messages_new_message( $args = '' ) { unset( $message->recipients[ $r['sender_id'] ] ); } - // Set a default reply subject if none was sent + // Set a default reply subject if none was sent. if ( empty( $message->subject ) ) { $message->subject = sprintf( __( 'Re: %s', 'buddypress' ), $thread->messages[0]->subject ); } @@ -81,47 +98,51 @@ function messages_new_message( $args = '' ) { // ...otherwise use the recipients passed } else { - // Bail if no recipients + // Bail if no recipients. if ( empty( $r['recipients'] ) ) { - return false; + if ( 'wp_error' === $r['error_type'] ) { + return new WP_Error( 'message_empty_recipients', __( 'Message could not be sent. Please enter a recipient.', 'buddypress' ) ); + } else { + return false; + } } - // Set a default subject if none exists + // Set a default subject if none exists. if ( empty( $message->subject ) ) { $message->subject = __( 'No Subject', 'buddypress' ); } - // Setup the recipients array + // Setup the recipients array. $recipient_ids = array(); - // Invalid recipients are added to an array, for future enhancements + // Invalid recipients are added to an array, for future enhancements. $invalid_recipients = array(); - // Loop the recipients and convert all usernames to user_ids where needed + // Loop the recipients and convert all usernames to user_ids where needed. foreach( (array) $r['recipients'] as $recipient ) { - // Trim spaces and skip if empty + // Trim spaces and skip if empty. $recipient = trim( $recipient ); if ( empty( $recipient ) ) { continue; } // Check user_login / nicename columns first - // @see http://buddypress.trac.wordpress.org/ticket/5151 + // @see http://buddypress.trac.wordpress.org/ticket/5151. if ( bp_is_username_compatibility_mode() ) { $recipient_id = bp_core_get_userid( urldecode( $recipient ) ); } else { $recipient_id = bp_core_get_userid_from_nicename( $recipient ); } - // Check against user ID column if no match and if passed recipient is numeric + // Check against user ID column if no match and if passed recipient is numeric. if ( empty( $recipient_id ) && is_numeric( $recipient ) ) { if ( bp_core_get_core_userdata( (int) $recipient ) ) { $recipient_id = (int) $recipient; } } - // Decide which group to add this recipient to + // Decide which group to add this recipient to. if ( empty( $recipient_id ) ) { $invalid_recipients[] = $recipient; } else { @@ -136,34 +157,47 @@ function messages_new_message( $args = '' ) { unset( $recipient_ids[ $self_send ] ); } - // Remove duplicates & bail if no recipients + // Remove duplicates & bail if no recipients. $recipient_ids = array_unique( $recipient_ids ); if ( empty( $recipient_ids ) ) { - return false; + if ( 'wp_error' === $r['error_type'] ) { + return new WP_Error( 'message_invalid_recipients', __( 'Message could not be sent because you have entered an invalid username. Please try again.', 'buddypress' ) ); + } else { + return false; + } } - // Format this to match existing recipients + // Format this to match existing recipients. foreach( (array) $recipient_ids as $i => $recipient_id ) { $message->recipients[$i] = new stdClass; $message->recipients[$i]->user_id = $recipient_id; } } - // Bail if message failed to send - if ( ! $message->send() ) { + // Bail if message failed to send. + $send = $message->send(); + if ( false === is_int( $send ) ) { + if ( 'wp_error' === $r['error_type'] ) { + if ( is_wp_error( $send ) ) { + return $send; + } else { + return new WP_Error( 'message_generic_error', __( 'Message was not sent. Please try again.', 'buddypress' ) ); + } + } + return false; } /** * Fires after a message has been successfully sent. * - * @since BuddyPress (1.1.0) + * @since 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 + // Return the thread ID. return $message->thread_id; } @@ -172,7 +206,6 @@ 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 ) { @@ -186,12 +219,12 @@ function messages_send_notice( $subject, $message ) { $notice->message = $message; $notice->date_sent = bp_core_current_time(); $notice->is_active = 1; - $notice->save(); // send it. + $notice->save(); // Send it. /** * Fires after a notice has been successfully sent. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $subject Subject of the notice. * @param string $message Content of the notice. @@ -205,8 +238,7 @@ function messages_send_notice( $subject, $message ) { /** * Delete message thread(s). * - * @param int|array Thread ID or array of thread IDs. - * + * @param int|array $thread_ids Thread ID or array of thread IDs. * @return bool True on success, false on failure. */ function messages_delete_thread( $thread_ids ) { @@ -214,7 +246,7 @@ function messages_delete_thread( $thread_ids ) { /** * Fires before specified thread IDs have been deleted. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int|array Thread ID or array of thread IDs that were deleted. */ @@ -235,7 +267,7 @@ function messages_delete_thread( $thread_ids ) { /** * Fires after specified thread IDs have been deleted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int|array Thread ID or array of thread IDs that were deleted. */ @@ -259,7 +291,6 @@ function messages_delete_thread( $thread_ids ) { * * @param int $thread_id ID of the thread. * @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 ) { @@ -324,7 +355,6 @@ 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. - * * @return int */ function messages_get_unread_count( $user_id = 0 ) { @@ -340,7 +370,6 @@ function messages_get_unread_count( $user_id = 0 ) { * * @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. */ @@ -352,7 +381,6 @@ 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 ) { @@ -363,7 +391,6 @@ 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 ) { @@ -373,7 +400,7 @@ function messages_is_valid_thread( $thread_id ) { /** * Get the thread ID from a message ID. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $message_id ID of the message. * @return int The ID of the thread if found, otherwise 0. @@ -393,7 +420,7 @@ function messages_get_message_thread_id( $message_id = 0 ) { * * If $meta_key is false, this will delete all meta for the message ID. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see delete_metadata() for full documentation excluding $meta_type variable. * @@ -401,23 +428,22 @@ function messages_get_message_thread_id( $message_id = 0 ) { * @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 + // 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 + // With no meta_key, ignore $delete_all. $delete_all = false; } else { $keys = array( $meta_key ); } - // no keys, so stop now! + // No keys, so stop now! if ( empty( $keys ) ) { return false; } @@ -436,14 +462,13 @@ function bp_messages_delete_meta( $message_id, $meta_key = false, $meta_value = /** * Get a piece of message metadata. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -457,7 +482,7 @@ function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) { /** * Update a piece of message metadata. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see update_metadata() for full documentation excluding $meta_type variable. * @@ -465,8 +490,7 @@ function bp_messages_get_meta( $message_id, $meta_key = '', $single = true ) { * @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. - * + * the specified value. Otherwise, update all entries. * @return mixed */ function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_value = '' ) { @@ -480,7 +504,7 @@ function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_val /** * Add a piece of message metadata. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @see add_metadata() for full documentation excluding $meta_type variable. * @@ -488,8 +512,8 @@ function bp_messages_update_meta( $message_id, $meta_key, $meta_value, $prev_val * @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, + * 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 */ 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 d8ba3abe7dbcd09d39c3704ab4cd8ee0b98c6904..f107d848a886b3ffee661098495620719303a399 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php @@ -1,346 +1,18 @@ <?php - /** - * BuddyPress Messages Loader + * BuddyPress Messages Loader. * * A private messages component, for users to send messages to each other. * * @package BuddyPress * @subpackage MessagesLoader + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/** - * Implementation of BP_Component for the Messages component. - * - * @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.0) - * @var bool - */ - public $autocomplete_all; - - /** - * Start the messages component creation process. - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'messages', - __( 'Private Messages', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 50, - 'features' => array( 'star' ) - ) - ); - } - - /** - * Include files. - * - * @since BuddyPress (1.5.0) - * - * @param array $includes See {BP_Component::includes()} for details. - */ - public function includes( $includes = array() ) { - - // Files to include - $includes = array( - 'cssjs', - 'cache', - 'actions', - 'screens', - 'classes', - 'filters', - 'template', - 'functions', - 'notifications', - 'widgets', - ); - - // Conditional includes - if ( bp_is_active( $this->id, 'star' ) ) { - $includes[] = 'star'; - } - - parent::includes( $includes ); - } - - /** - * Set up globals for the Messages component. - * - * The BP_MESSAGES_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - * - * @param array $args Not used. - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - // Define a slug, if necessary - 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_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. - 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, - '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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Only grab count if we're on a user page and current user has access - if ( bp_is_user() && bp_user_has_access() ) { - $count = bp_get_total_unread_messages_count(); - $class = ( 0 === $count ) ? 'no-count' : 'count'; - $nav_name = sprintf( __( 'Messages <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ); - } else { - $nav_name = __( 'Messages', 'buddypress' ); - } - - // Add 'Messages' to the main navigation - $main_nav = array( - 'name' => $nav_name, - 'slug' => $this->slug, - 'position' => 50, - 'show_for_displayed_user' => false, - 'screen_function' => 'messages_screen_inbox', - 'default_subnav_slug' => 'inbox', - 'item_css_id' => $this->id - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - // Link to user messages - $messages_link = trailingslashit( $user_domain . $this->slug ); - - // Add the subnav items to the profile - $sub_nav[] = array( - 'name' => __( 'Inbox', 'buddypress' ), - 'slug' => 'inbox', - 'parent_url' => $messages_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'messages_screen_inbox', - 'position' => 10, - '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', - 'parent_url' => $messages_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'messages_screen_sentbox', - 'position' => 20, - 'user_has_access' => bp_core_can_edit_settings() - ); - - $sub_nav[] = array( - 'name' => __( 'Compose', 'buddypress' ), - 'slug' => 'compose', - 'parent_url' => $messages_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'messages_screen_compose', - 'position' => 30, - 'user_has_access' => bp_core_can_edit_settings() - ); - - if ( bp_current_user_can( 'bp_moderate' ) ) { - $sub_nav[] = array( - 'name' => __( 'Notices', 'buddypress' ), - 'slug' => 'notices', - 'parent_url' => $messages_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'messages_screen_notices', - 'position' => 90, - 'user_has_access' => bp_current_user_can( 'bp_moderate' ) - ); - } - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the Toolbar. - * - * @param array $wp_admin_nav See {BP_Component::setup_admin_bar()} - * for details. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - $bp = buddypress(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $user_domain = bp_loggedin_user_domain(); - $messages_link = trailingslashit( $user_domain . $this->slug ); - - // Unread message count - $count = messages_get_unread_count(); - if ( !empty( $count ) ) { - $title = sprintf( __( 'Messages <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) ); - $inbox = sprintf( __( 'Inbox <span class="count">%s</span>', 'buddypress' ), number_format_i18n( $count ) ); - } else { - $title = __( 'Messages', 'buddypress' ); - $inbox = __( 'Inbox', 'buddypress' ); - } - - // Add main Messages menu - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => $title, - 'href' => trailingslashit( $messages_link ) - ); - - // Inbox - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-inbox', - 'title' => $inbox, - '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, - 'id' => 'my-account-' . $this->id . '-sentbox', - 'title' => __( 'Sent', 'buddypress' ), - 'href' => trailingslashit( $messages_link . 'sentbox' ) - ); - - // Compose Message - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-compose', - 'title' => __( 'Compose', 'buddypress' ), - 'href' => trailingslashit( $messages_link . 'compose' ) - ); - - // Site Wide Notices - if ( bp_current_user_can( 'bp_moderate' ) ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-notices', - 'title' => __( 'All Member Notices', 'buddypress' ), - 'href' => trailingslashit( $messages_link . 'notices' ) - ); - } - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title>. - */ - public function setup_title() { - $bp = buddypress(); - - if ( bp_is_messages_component() ) { - if ( bp_is_my_profile() ) { - $bp->bp_options_title = __( 'My Messages', 'buddypress' ); - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-messages-component.php'; /** * Bootstrap the Messages component. 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 6cb091d2ec66d4fcb9c1d080c073f41b608110b9..d49594cde91fca73397a4e7ccc5eeee99638d0f9 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php @@ -1,13 +1,13 @@ <?php - /** - * BuddyPress Messages Notifications + * BuddyPress Messages Notifications. * * @package BuddyPress * @subpackage MessagesNotifications + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Email *********************************************************************/ @@ -15,7 +15,7 @@ defined( 'ABSPATH' ) || exit; /** * Email message recipients to alert them of a new unread private message. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array|BP_Messages_Message $raw_args { * Array of arguments. Also accepts a BP_Messages_Message object. @@ -26,123 +26,62 @@ defined( 'ABSPATH' ) || exit; * } */ function messages_notification_new_message( $raw_args = array() ) { - - // Cast possible $message object as an array if ( is_object( $raw_args ) ) { $args = (array) $raw_args; } else { $args = $raw_args; } - // These should be extracted below + // These should be extracted below. $recipients = array(); $email_subject = $email_content = ''; $sender_id = 0; - // Barf + // Barf. extract( $args ); - // Get the sender display name - $sender_name = bp_core_get_user_displayname( $sender_id ); - - // Bail if no recipients - if ( ! empty( $recipients ) ) { - - foreach ( $recipients as $recipient ) { - - if ( $sender_id == $recipient->user_id || 'no' == bp_get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) ) { - continue; - } - - // User data and links - $ud = get_userdata( $recipient->user_id ); - - // Bail if user cannot be found - if ( empty( $ud ) ) { - continue; - } - - $message_link = bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() .'/'; - $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; - $settings_link = bp_core_get_user_domain( $recipient->user_id ) . $settings_slug . '/notifications/'; - - // Sender info - $sender_name = stripslashes( $sender_name ); - $subject = stripslashes( wp_filter_kses( $subject ) ); - $content = stripslashes( wp_filter_kses( $message ) ); - - // Set up and send the message - $email_to = $ud->user_email; - $email_subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New message from %s', 'buddypress' ), $sender_name ) ) ); - - $email_content = sprintf( __( -'%1$s sent you a new message: - -Subject: %2$s - -"%3$s" - -To view and read your messages please log in and visit: %4$s - ---------------------- -', 'buddypress' ), $sender_name, $subject, $content, $message_link ); - - // Only show the disable notifications line if the settings component is enabled - if ( bp_is_active( 'settings' ) ) { - $email_content .= sprintf( __( 'To disable these notifications, please log in and go to: %s', 'buddypress' ), $settings_link ); - } - - /** - * 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 ); + if ( empty( $recipients ) ) { + return; + } - /** - * 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 ); + $sender_name = bp_core_get_user_displayname( $sender_id ); - /** - * 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 ); + // Send an email to each recipient. + foreach ( $recipients as $recipient ) { + if ( $sender_id == $recipient->user_id || 'no' == bp_get_user_meta( $recipient->user_id, 'notification_messages_new_message', true ) ) { + continue; + } - wp_mail( $email_to, $email_subject, $email_content ); + // User data and links. + $ud = get_userdata( $recipient->user_id ); + if ( empty( $ud ) ) { + continue; } + + $args = array( + 'tokens' => array( + 'usermessage' => wp_strip_all_tags( stripslashes( $message ) ), + 'message.url' => esc_url( bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() . '/view/' . $thread_id . '/' ), + 'sender.name' => $sender_name, + 'usersubject' => sanitize_text_field( stripslashes( $subject ) ), + ), + ); + bp_send_email( 'messages-unread', $ud, $args ); } /** * Fires after the sending of a new message email notification. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 + * @deprecated 2.5.0 Use the filters in BP_Email. + * $email_subject and $email_content arguments unset and deprecated. * * @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. + * @param string $email_subject Deprecated in 2.5; now an empty string. + * @param string $email_content Deprecated in 2.5; now an empty string. + * @param array $args Array of originally provided arguments. */ - do_action( 'bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args ); + do_action( 'bp_messages_sent_notification_email', $recipients, '', '', $args ); } add_action( 'messages_message_sent', 'messages_notification_new_message', 10 ); @@ -151,7 +90,7 @@ add_action( 'messages_message_sent', 'messages_notification_new_message', 10 ); /** * Format notifications for the Messages component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $action The kind of notification being rendered. * @param int $item_id The primary item id. @@ -160,7 +99,6 @@ add_action( 'messages_message_sent', 'messages_notification_new_message', 10 ); * 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' ) { @@ -176,7 +114,7 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $ } else { $amount = 'single'; - // get message thread ID + // Get message thread ID. $message = new BP_Messages_Message( $item_id ); $thread_id = $message->thread_id; $link = ( ! empty( $thread_id ) ) @@ -223,7 +161,7 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $ /** * Fires right before returning the formatted message notifications. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $action The type of message notification. * @param int $item_id The primary item ID. @@ -238,7 +176,7 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $ /** * Send notifications to message recipients. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param BP_Messages_Message $message Message object. */ @@ -262,13 +200,13 @@ add_action( 'messages_message_sent', 'bp_messages_message_sent_add_notification' /** * Mark new message notification when member reads a message thread directly. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_messages_screen_conversation_mark_notifications() { if ( bp_is_active( 'notifications' ) ) { global $thread_template; - // get unread PM notifications for the user + // Get unread PM notifications for the user. $new_pm_notifications = BP_Notifications_Notification::get( array( 'user_id' => bp_loggedin_user_id(), 'component_name' => buddypress()->messages->id, @@ -277,15 +215,15 @@ function bp_messages_screen_conversation_mark_notifications() { ) ); $unread_message_ids = wp_list_pluck( $new_pm_notifications, 'item_id' ); - // no unread PMs, so stop! + // No unread PMs, so stop! if ( empty( $unread_message_ids ) ) { return; } - // get the unread message ids for this thread only + // Get the unread message ids for this thread only. $message_ids = array_intersect( $unread_message_ids, wp_list_pluck( $thread_template->thread->messages, 'id' ) ); - // mark each notification for each PM message as read + // Mark each notification for each PM message as read. foreach ( $message_ids as $message_id ) { bp_notifications_mark_notifications_by_item_id( bp_loggedin_user_id(), (int) $message_id, buddypress()->messages->id, 'new_message' ); } @@ -296,7 +234,7 @@ add_action( 'thread_loop_start', 'bp_messages_screen_conversation_mark_notificat /** * When a message is deleted, delete corresponding notifications. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $thread_id ID of the thread. * @param array $message_ids IDs of the messages. 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 1fa275d85dd9fec694a5785a4a52cf7be9e451be..2be493733d63f9db92a473ff4d471702209ff8b6 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Messages Screens. * @@ -9,15 +8,19 @@ * * @package BuddyPress * @subpackage MessagesScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Load the Messages > Inbox screen. + * + * @since 1.0.0 */ function messages_screen_inbox() { + if ( bp_action_variables() ) { bp_do_404(); return; @@ -26,14 +29,14 @@ function messages_screen_inbox() { /** * Fires right before the loading of the Messages inbox screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'messages_screen_inbox' ); /** * Filters the template to load for the Messages inbox screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the messages template to load. */ @@ -42,8 +45,11 @@ function messages_screen_inbox() { /** * Load the Messages > Sent screen. + * + * @since 1.0.0 */ function messages_screen_sentbox() { + if ( bp_action_variables() ) { bp_do_404(); return; @@ -52,14 +58,14 @@ function messages_screen_sentbox() { /** * Fires right before the loading of the Messages sentbox screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'messages_screen_sentbox' ); /** * Filters the template to load for the Messages sentbox screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the messages template to load. */ @@ -68,6 +74,8 @@ function messages_screen_sentbox() { /** * Load the Messages > Compose screen. + * + * @since 1.0.0 */ function messages_screen_compose() { @@ -79,66 +87,17 @@ function messages_screen_compose() { // Remove any saved message data from a previous session. messages_remove_callback_values(); - // Check if the message form has been submitted - if ( isset( $_POST['send'] ) ) { - - // Check the nonce - check_admin_referer( 'messages_send_message' ); - - // 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' ); - } else { - // If this is a notice, send it - if ( isset( $_POST['send-notice'] ) ) { - if ( messages_send_notice( $_POST['subject'], $_POST['content'] ) ) { - 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' ); - } - } 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, - 'subject' => $_POST['subject'], - 'content' => $_POST['content'] - ) ); - - // Send the message - if ( ! empty( $thread_id ) ) { - 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' ); - } - } - } - } - /** * Fires right before the loading of the Messages compose screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'messages_screen_compose' ); /** * Filters the template to load for the Messages compose screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the messages template to load. */ @@ -148,38 +107,44 @@ function messages_screen_compose() { /** * Load an individual conversation screen. * + * @since 1.0.0 + * * @return bool|null False on failure. */ function messages_screen_conversation() { - // Bail if not viewing a single message - if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) ) { + // Bail if not viewing a single message. + if ( ! bp_is_messages_component() || ! bp_is_current_action( 'view' ) ) { return false; } $thread_id = (int) bp_action_variable( 0 ); - if ( empty( $thread_id ) || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !bp_current_user_can( 'bp_moderate' ) ) ) { + if ( empty( $thread_id ) || ! messages_is_valid_thread( $thread_id ) || ( ! messages_check_thread_access( $thread_id ) && ! bp_current_user_can( 'bp_moderate' ) ) ) { bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) ); } - // Load up BuddyPress one time + // Load up BuddyPress one time. $bp = buddypress(); - // 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() ); + // Decrease the unread count in the nav before it's rendered. + $count = bp_get_total_unread_messages_count(); + $class = ( 0 === $count ) ? 'no-count' : 'count'; + $nav_name = sprintf( __( 'Messages <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ); + + $bp->bp_nav[ $bp->messages->slug ]['name'] = $nav_name; /** * Fires right before the loading of the Messages view screen template file. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'messages_screen_conversation' ); /** * Filters the template to load for the Messages view screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the messages template to load. */ @@ -190,41 +155,11 @@ add_action( 'bp_screens', 'messages_screen_conversation' ); /** * Load the Messages > Notices screen. * + * @since 1.0.0 + * * @return false|null False on failure. */ function messages_screen_notices() { - global $notice_id; - - if ( !bp_current_user_can( 'bp_moderate' ) ) { - return false; - } - - $notice_id = (int)bp_action_variable( 1 ); - - if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) { - $notice = new BP_Messages_Notice( $notice_id ); - - if ( bp_is_action_variable( 'deactivate', 0 ) ) { - if ( !$notice->deactivate() ) { - bp_core_add_message( __('There was a problem deactivating that notice.', 'buddypress'), 'error' ); - } else { - bp_core_add_message( __('Notice deactivated.', 'buddypress') ); - } - } 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') ); - } - } elseif ( bp_is_action_variable( 'delete' ) ) { - if ( !$notice->delete() ) { - bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' ); - } else { - bp_core_add_message( __('Notice deleted.', 'buddypress') ); - } - } - bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' ) ); - } if ( bp_action_variables() ) { bp_do_404(); @@ -234,14 +169,14 @@ function messages_screen_notices() { /** * Fires right before the loading of the Messages notices screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'messages_screen_notices' ); /** * Filters the template to load for the Messages notices screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the messages template to load. */ @@ -250,8 +185,11 @@ function messages_screen_notices() { /** * Render the markup for the Messages section of Settings > Notifications. + * + * @since 1.0.0 */ function messages_screen_notification_settings() { + if ( bp_action_variables() ) { bp_do_404(); return; @@ -275,8 +213,8 @@ function messages_screen_notification_settings() { <tr id="messages-notification-settings-new-message"> <td></td> <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php checked( $new_messages, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php checked( $new_messages, 'no', true ) ?>/></td> + <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" id="notification-messages-new-messages-yes" value="yes" <?php checked( $new_messages, 'yes', true ) ?>/><label for="notification-messages-new-messages-yes" class="bp-screen-reader-text"><?php _e( 'Yes, send email', 'buddypress' ); ?></label></td> + <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" id="notification-messages-new-messages-no" value="no" <?php checked( $new_messages, 'no', true ) ?>/><label for="notification-messages-new-messages-no" class="bp-screen-reader-text"><?php _e( 'No, do not send email', 'buddypress' ); ?></label></td> </tr> <?php @@ -284,7 +222,7 @@ function messages_screen_notification_settings() { /** * Fires inside the closing </tbody> tag for messages screen notification settings. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'messages_screen_notification_settings' ); ?> </tbody> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php index 84f2ce52295ff385b30bdcdcc196de125854ceda..2b4e667a34bb835795e082d4b4e4c296759c3f84 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-star.php @@ -2,15 +2,20 @@ /** * Functions related to starring private messages. * - * @since BuddyPress (2.3.0) + * @package BuddyPress + * @subpackage MessagesStar + * @since 2.3.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** UTILITY **************************************************************/ /** * Return the starred messages slug. Defaults to 'starred'. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @return string */ @@ -18,7 +23,7 @@ function bp_get_messages_starred_slug() { /** * Filters the starred message slug. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param string */ @@ -28,10 +33,10 @@ function bp_get_messages_starred_slug() { /** * Function to determine if a message ID is starred. * - * @since BuddyPress (2.3.0) + * @since 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 + * @param int $user_id The user ID. * @return bool */ function bp_messages_is_message_starred( $mid = 0, $user_id = 0 ) { @@ -55,7 +60,7 @@ function bp_messages_is_message_starred( $mid = 0, $user_id = 0 ) { /** * Output the link or raw URL for starring or unstarring a message. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $args See bp_get_the_message_star_action_link() for full documentation. */ @@ -65,7 +70,7 @@ function bp_the_message_star_action_link( $args = array() ) { /** * Return the link or raw URL for starring or unstarring a message. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $args { * Array of arguments. @@ -89,7 +94,7 @@ function bp_the_message_star_action_link( $args = array() ) { */ function bp_get_the_message_star_action_link( $args = array() ) { - // Default user ID + // Default user ID. $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id(); @@ -107,47 +112,47 @@ function bp_the_message_star_action_link( $args = array() ) { 'title_star_thread' => __( 'Star the first message in this thread', 'buddypress' ), ), 'messages_star_action_link' ); - // Check user ID and determine base user URL + // Check user ID and determine base user URL. switch ( $r['user_id'] ) { - // Current user + // Current user. case bp_loggedin_user_id() : $user_domain = bp_loggedin_user_domain(); break; - // Displayed user + // Displayed user. case bp_displayed_user_id() : $user_domain = bp_displayed_user_domain(); break; - // Empty or other + // Empty or other. default : $user_domain = bp_core_get_user_domain( $r['user_id'] ); break; } - // Bail if no user domain was calculated + // Bail if no user domain was calculated. if ( empty( $user_domain ) ) { return ''; } - // Define local variables + // Define local variables. $retval = $bulk_attr = ''; - // thread ID + // Thread ID. if ( (int) $r['thread_id'] > 0 ) { - // see if we're in the loop + // See if we're in the loop. if ( bp_get_message_thread_id() == $r['thread_id'] ) { - // grab all message ids + // 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 + // Make sure order is ASC. + // Order is DESC when used in the thread loop by default. $mids = array_reverse( $mids ); - // pull up the thread + // Pull up the thread. } else { $thread = new BP_Messages_Thread( $r['thread_id'] ); $mids = wp_list_pluck( $thread->messages, 'id' ); @@ -157,7 +162,7 @@ function bp_the_message_star_action_link( $args = array() ) { $message_id = 0; foreach ( $mids as $mid ) { - // try to find the first msg that is starred in a thread + // 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; @@ -165,14 +170,14 @@ function bp_the_message_star_action_link( $args = array() ) { } } - // no star, so default to first message in thread + // No star, so default to first message in thread. if ( empty( $message_id ) ) { $message_id = $mids[0]; } $message_id = (int) $message_id; - // nonce + // Nonce. $nonce = wp_create_nonce( "bp-messages-star-{$message_id}" ); if ( true === $is_starred ) { @@ -186,7 +191,7 @@ function bp_the_message_star_action_link( $args = array() ) { $title = $r["title_{$action}_thread"]; - // message ID + // Message ID. } else { $message_id = (int) $r['message_id']; $is_starred = bp_messages_is_message_starred( $message_id ); @@ -206,7 +211,7 @@ function bp_the_message_star_action_link( $args = array() ) { /** * Filters the star action URL for starring / unstarring a message. * - * @since BuddyPress (2.3.0) + * @since 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(). @@ -219,7 +224,7 @@ function bp_the_message_star_action_link( $args = array() ) { /** * Filters the star action link, including markup. * - * @since BuddyPress (2.3.0) + * @since 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(). @@ -230,7 +235,7 @@ function bp_the_message_star_action_link( $args = array() ) { /** * Save or delete star message meta according to a message's star status. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $args { * Array of arguments. @@ -253,7 +258,7 @@ function bp_messages_star_set_action( $args = array() ) { 'bulk' => false ) ); - // Set thread ID + // Set thread ID. if ( ! empty( $r['thread_id'] ) ) { $thread_id = (int) $r['thread_id']; } else { @@ -263,14 +268,14 @@ function bp_messages_star_set_action( $args = array() ) { return false; } - // Check if user has access to thread + // 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 + // Star. if ( 'star' == $r['action'] ) { if ( true === $is_starred ) { return true; @@ -278,9 +283,9 @@ function bp_messages_star_set_action( $args = array() ) { bp_messages_add_meta( $r['message_id'], 'starred_by_user', $r['user_id'] ); return true; } - // unstar + // Unstar. } else { - // unstar one message + // Unstar one message. if ( false === $r['bulk'] ) { if ( false === $is_starred ) { return true; @@ -289,7 +294,7 @@ function bp_messages_star_set_action( $args = array() ) { return true; } - // unstar all messages in a thread + // Unstar all messages in a thread. } else { $thread = new BP_Messages_Thread( $thread_id ); $mids = wp_list_pluck( $thread->messages, 'id' ); @@ -310,7 +315,7 @@ function bp_messages_star_set_action( $args = array() ) { /** * Screen handler to display a user's "Starred" private messages page. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_messages_star_screen() { add_action( 'bp_template_content', 'bp_messages_star_content' ); @@ -318,7 +323,7 @@ function bp_messages_star_screen() { /** * Fires right before the loading of the "Starred" messages box. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ do_action( 'bp_messages_screen_star' ); @@ -328,26 +333,26 @@ function bp_messages_star_screen() { /** * Screen content callback to display a user's "Starred" messages page. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_messages_star_content() { - // add our message thread filter + // 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 + // Load the message loop template part. bp_get_template_part( 'members/single/messages/messages-loop' ); - // remove our filter + // 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) + * @since 2.3.0 * * @param array $r Current message thread arguments. - * @return array + * @return array $r Array of starred message threads. */ function bp_messages_filter_starred_message_threads( $r = array() ) { $r['box'] = 'starred'; @@ -364,7 +369,7 @@ function bp_messages_filter_starred_message_threads( $r = array() ) { /** * Action handler to set a message's star status for those not using JS. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_messages_star_action_handler() { if ( ! bp_is_user_messages() ) { @@ -379,19 +384,19 @@ function bp_messages_star_action_handler() { wp_die( "Oops! That's a no-no!" ); } - // Check capability + // Check capability. if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) { return; } - // mark the star + // 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 back to previous screen. $redirect = wp_get_referer() ? wp_get_referer() : bp_loggedin_user_domain() . bp_get_messages_slug(); bp_core_redirect( $redirect ); die(); @@ -401,7 +406,7 @@ 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) + * @since 2.3.0 */ function bp_messages_star_bulk_manage_handler() { if ( empty( $_POST['messages_bulk_nonce' ] ) ) { @@ -413,7 +418,7 @@ function bp_messages_star_bulk_manage_handler() { return; } - // Check capability + // Check capability. if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) { return; } @@ -432,7 +437,7 @@ function bp_messages_star_bulk_manage_handler() { case 'star' : $count = count( $threads ); - // if we're starring a thread, we only star the first message in the thread + // 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' ); @@ -474,7 +479,7 @@ add_action( 'bp_actions', 'bp_messages_star_bulk_manage_handler', 5 ); * * The dashicons font is used for the star / unstar icon. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ function bp_messages_star_enqueue_scripts() { if ( ! bp_is_user_messages() ) { @@ -488,7 +493,7 @@ 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) + * @since 2.3.0 */ function bp_messages_star_bulk_management_dropdown() { ?> @@ -503,9 +508,9 @@ add_action( 'bp_messages_bulk_management_dropdown', 'bp_messages_star_bulk_manag /** * Add CSS class for the current message depending on starred status. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param array $retval Current CSS classes + * @param array $retval Current CSS classes. * @return array */ function bp_messages_star_message_css_class( $retval = array() ) { @@ -515,7 +520,7 @@ function bp_messages_star_message_css_class( $retval = array() ) { $status = 'not-starred'; } - // add css class based on star status for the current message + // Add css class based on star status for the current message. $retval[] = "message-{$status}"; return $retval; 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 bf71fcef714194a7040af96d2efaf61155b9086f..b5b7f8eaaa0ca176e21489288e0327d23568e55a 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php @@ -1,362 +1,17 @@ <?php - /** * BuddyPress Messages Template Tags. * * @package BuddyPress * @subpackage MessagesTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -/** - * Message Box Template Class - */ -class BP_Messages_Box_Template { - - /** - * The loop iterator. - * - * @access public - * @var int - */ - public $current_thread = -1; - - /** - * The number of threads returned by the paged query. - * - * @access public - * @var int - */ - public $current_thread_count = 0; - - /** - * Total number of threads matching the query params. - * - * @access public - * @var int - */ - public $total_thread_count = 0; - - /** - * Array of threads located by the query. - * - * @access public - * @var array - */ - public $threads = array(); - - /** - * The thread object currently being iterated on. - * - * @access public - * @var object - */ - public $thread = false; - - /** - * A flag for whether the loop is currently being iterated. - * - * @access public - * @var bool - */ - public $in_the_loop = false; - - /** - * User ID of the current inbox. - * - * @access public - * @var int - */ - public $user_id = 0; - - /** - * The current "box" view ('notices', 'sentbox', 'inbox'). - * - * @access public - * @var string - */ - public $box = 'inbox'; - - /** - * The page number being requested. - * - * @access public - * @var int - */ - public $pag_page = 1; - - /** - * The number of items being requested per page. - * - * @access public - * @var int - */ - public $pag_num = 10; - - /** - * An HTML string containing pagination links. - * - * @access public - * @var string - */ - public $pag_links = ''; - - /** - * Search terms for limiting the thread query. - * - * @access public - * @var string - */ - public $search_terms = ''; - - /** - * Constructor method. - * - * @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( 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']; - } - - if ( !$this->threads ) { - $this->thread_count = 0; - $this->total_thread_count = 0; - } else { - $total_notice_count = BP_Messages_Notice::get_total_notice_count(); - - 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) $r['max']; - } - - if ( ! empty( $r['max'] ) ) { - if ( (int) $r['max'] >= count( $this->threads ) ) { - $this->thread_count = count( $this->threads ); - } else { - $this->thread_count = (int) $r['max']; - } - } else { - $this->thread_count = count( $this->threads ); - } - } - - if ( (int) $this->total_thread_count && (int) $this->pag_num ) { - $pag_args = array( - $r['page_arg'] => '%#%', - ); - - if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { - $base = remove_query_arg( 's', wp_get_referer() ); - } else { - $base = ''; - } - - $add_args = array(); - - if ( ! empty( $this->search_terms ) ) { - $add_args['s'] = $this->search_terms; - } - - $this->pag_links = paginate_links( array( - 'base' => add_query_arg( $pag_args, $base ), - 'format' => '', - 'total' => ceil( (int) $this->total_thread_count / (int) $this->pag_num ), - 'current' => $this->pag_page, - 'prev_text' => _x( '←', 'Message pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Message pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => $add_args, - ) ); - } - } - - /** - * Whether there are threads available in the loop. - * - * @see bp_has_message_threads() - * - * @return bool True if there are items in the loop, otherwise false. - */ - public function has_threads() { - if ( $this->thread_count ) { - return true; - } - - return false; - } - - /** - * Set up the next member and iterate index. - * - * @return object The next member to iterate over. - */ - public function next_thread() { - $this->current_thread++; - $this->thread = $this->threads[$this->current_thread]; - - return $this->thread; - } - - /** - * Rewind the threads and reset thread index. - */ - public function rewind_threads() { - $this->current_thread = -1; - if ( $this->thread_count > 0 ) { - $this->thread = $this->threads[0]; - } - } - - /** - * Whether there are threads left in the loop to iterate over. - * - * This method is used by {@link bp_message_threads()} as part of the - * while loop that controls iteration inside the threads loop, eg: - * while ( bp_message_threads() ) { ... - * - * @see bp_message_threads() - * - * @return bool True if there are more threads to show, otherwise false. - */ - function message_threads() { - if ( $this->current_thread + 1 < $this->thread_count ) { - return true; - } elseif ( $this->current_thread + 1 == $this->thread_count ) { - - /** - * 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current thread inside the loop. - * - * Used by {@link bp_message_thread()} to set up the current thread data - * while looping, so that template tags used during that iteration make - * reference to the current thread. - * - * @see bp_message_thread() - */ - public function the_message_thread() { - - $this->in_the_loop = true; - $this->thread = $this->next_thread(); - - if ( ! bp_is_current_action( 'notices' ) ) { - $last_message_index = count( $this->thread->messages ) - 1; - $this->thread->messages = array_reverse( (array) $this->thread->messages ); - - // Set up the last message data - if ( count($this->thread->messages) > 1 ) { - if ( 'inbox' == $this->box ) { - foreach ( (array) $this->thread->messages as $key => $message ) { - if ( bp_loggedin_user_id() != $message->sender_id ) { - $last_message_index = $key; - break; - } - } - - } elseif ( 'sentbox' == $this->box ) { - foreach ( (array) $this->thread->messages as $key => $message ) { - if ( bp_loggedin_user_id() == $message->sender_id ) { - $last_message_index = $key; - break; - } - } - } - } - - $this->thread->last_message_id = $this->thread->messages[ $last_message_index ]->id; - $this->thread->last_message_date = $this->thread->messages[ $last_message_index ]->date_sent; - $this->thread->last_sender_id = $this->thread->messages[ $last_message_index ]->sender_id; - $this->thread->last_message_subject = $this->thread->messages[ $last_message_index ]->subject; - $this->thread->last_message_content = $this->thread->messages[ $last_message_index ]->message; - } - - // 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' ); - } - } -} +require dirname( __FILE__ ) . '/classes/class-bp-messages-box-template.php'; +require dirname( __FILE__ ) . '/classes/class-bp-messages-thread-template.php'; /** * Retrieve private message threads for display in inbox/sentbox/notices. @@ -365,7 +20,7 @@ class BP_Messages_Box_Template { * for querying the database and retrieving private messages for display inside * the theme via individual template parts for a member's inbox/sentbox/notices. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global BP_Messages_Box_Template $messages_template * @@ -377,6 +32,8 @@ class BP_Messages_Box_Template { * 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 $type Type of messages to return. Values: 'all', 'read', 'unread' + * Default: 'all' * @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. @@ -386,42 +43,48 @@ class BP_Messages_Box_Template { * } * @return bool True if there are threads to display, otherwise false. */ -function bp_has_message_threads( $args = '' ) { +function bp_has_message_threads( $args = array() ) { global $messages_template; - // The default box the user is looking at - if ( bp_is_current_action( 'sentbox' ) ) { - $default_box = 'sentbox'; - } elseif ( bp_is_current_action( 'notices' ) ) { - $default_box = 'notices'; - } else { - $default_box = 'inbox'; + // The default box the user is looking at. + $current_action = bp_current_action(); + switch ( $current_action ) { + case 'sentbox' : + case 'notices' : + case 'inbox' : + $default_box = $current_action; + break; + default : + $default_box = 'inbox'; + break; } - // Parse the arguments + // User ID + // @todo displayed user for moderators that get this far? + $user_id = bp_loggedin_user_id(); + + // Search Terms. + $search_terms = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : ''; + + // Parse the arguments. $r = bp_parse_args( $args, array( - 'user_id' => bp_loggedin_user_id(), + 'user_id' => $user_id, 'box' => $default_box, 'per_page' => 10, 'max' => false, 'type' => 'all', - 'search_terms' => isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '', - 'page_arg' => 'mpage', // See https://buddypress.trac.wordpress.org/ticket/3679 + 'search_terms' => $search_terms, + '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 - if ( bp_is_current_action( 'notices' ) && !bp_current_user_can( 'bp_moderate' ) ) { - bp_core_redirect( bp_displayed_user_domain() ); - } - - // Load the messages loop global up with messages + // Load the messages loop global up with messages. $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) + * @since 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. @@ -467,7 +130,7 @@ function bp_message_thread_id() { /** * Filters the ID of the current thread in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $thread_id ID of the current thread in the loop. */ @@ -491,7 +154,7 @@ function bp_message_thread_subject() { /** * Filters the subject of the current thread in the loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Subject of the current thread in the loop. */ @@ -515,7 +178,7 @@ function bp_message_thread_excerpt() { /** * Filters the excerpt of the current thread in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Excerpt of the current thread in the loop. */ @@ -531,7 +194,7 @@ function bp_message_thread_excerpt() { * When viewing your Sentbox, last message is the most recent message in * the thread of which you *are* the member. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_message_thread_content() { echo bp_get_message_thread_content(); @@ -545,7 +208,8 @@ function bp_message_thread_content() { * When viewing your Sentbox, last message is the most recent message in * the thread of which you *are* the member. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * * @return string The raw content of the last message in the thread. */ function bp_get_message_thread_content() { @@ -554,7 +218,7 @@ function bp_message_thread_content() { /** * Filters the content of the last message in the thread. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $last_message_content Content of the last message in the thread. */ @@ -578,7 +242,7 @@ function bp_message_thread_from() { /** * Filters the link to the page of the current thread's last author. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Link to the page of the current thread's last author. */ @@ -602,7 +266,7 @@ function bp_message_thread_to() { /** * Filters the HTML links to the pages of the current thread's recipients. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value HTML links to the pages of the current thread's recipients. */ @@ -637,7 +301,7 @@ function bp_message_thread_view_link( $thread_id = 0 ) { /** * Filters the permalink of a particular thread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value permalink of a particular thread. */ @@ -661,7 +325,7 @@ function bp_message_thread_delete_link() { /** * Filters the URL for deleting the current thread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL for deleting the current thread. * @param string $value Text indicating action being executed. @@ -674,7 +338,7 @@ function bp_message_thread_delete_link() { * * Since this function directly outputs a URL, it is escaped. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_the_message_thread_mark_unread_url() { echo esc_url( bp_get_the_message_thread_mark_unread_url() ); @@ -682,7 +346,7 @@ function bp_the_message_thread_mark_unread_url() { /** * Return the URL used for marking a single message thread as unread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return string */ @@ -709,7 +373,7 @@ function bp_the_message_thread_mark_unread_url() { /** * Filters the URL used for marking a single message thread as unread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $url URL used for marking a single message thread as unread. */ @@ -721,7 +385,7 @@ function bp_the_message_thread_mark_unread_url() { * * Since this function directly outputs a URL, it is escaped. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_the_message_thread_mark_read_url() { echo esc_url( bp_get_the_message_thread_mark_read_url() ); @@ -729,7 +393,7 @@ function bp_the_message_thread_mark_read_url() { /** * Return the URL used for marking a single message thread as read. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return string */ @@ -756,7 +420,7 @@ function bp_the_message_thread_mark_read_url() { /** * Filters the URL used for marking a single message thread as read. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $url URL used for marking a single message thread as read. */ @@ -786,7 +450,7 @@ function bp_message_css_class() { /** * Filters the CSS class for the current thread. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param string $class Class string to be added to the list of classes. */ @@ -808,7 +472,7 @@ function bp_message_thread_has_unread() { /** * Filters whether or not a message thread has unread items. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not a message thread has unread items. */ @@ -836,7 +500,7 @@ function bp_message_thread_unread_count() { /** * Filters the current thread's unread count. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $count Current thread unread count. */ @@ -846,7 +510,7 @@ function bp_message_thread_unread_count() { /** * Output a thread's total message count. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int|bool $thread_id Optional. ID of the thread. Defaults to current thread ID. */ @@ -856,11 +520,10 @@ function bp_message_thread_total_count( $thread_id = false ) { /** * Get the current thread's total message count. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -880,7 +543,7 @@ function bp_message_thread_total_count( $thread_id = false ) { /** * Filters the current thread's total message count. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $count Current thread total message count. */ @@ -890,7 +553,7 @@ function bp_message_thread_total_count( $thread_id = false ) { /** * Output markup for the current thread's total and unread count. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int|bool $thread_id Optional. ID of the thread. Default: current thread ID. */ @@ -901,7 +564,6 @@ function bp_message_thread_total_and_unread_count( $thread_id = false ) { * 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 ) { @@ -936,7 +598,7 @@ function bp_message_thread_last_post_date_raw() { /** * Filters the unformatted date of the last post in the current thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $last_message_date Unformatted date of the last post in the current thread. */ @@ -959,7 +621,7 @@ function bp_message_thread_last_post_date() { /** * Filters the nicely formatted date of the last post in the current thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $value Formatted date of the last post in the current thread. */ @@ -1013,7 +675,7 @@ function bp_message_thread_avatar( $args = '' ) { /** * Filters the avatar for the last sender in the current message thread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value User avatar string. */ @@ -1044,7 +706,7 @@ function bp_total_unread_messages_count() { /** * Filters the unread messages count for the current inbox. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $value Unread messages count for the current inbox. */ @@ -1068,7 +730,7 @@ function bp_messages_pagination() { /** * Filters the pagination HTML for the current thread loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $pag_links Pagination HTML for the current thread loop. */ @@ -1077,8 +739,6 @@ function bp_messages_pagination() { /** * Generate the "Viewing message x to y (of z messages)" string for a loop. - * - * @return string */ function bp_messages_pagination_count() { global $messages_template; @@ -1101,19 +761,19 @@ function bp_messages_pagination_count() { * Output the Private Message search form. * * @todo Move markup to template part in: /members/single/messages/search.php - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_message_search_form() { - // Get the default search text + // Get the default search text. $default_search_value = bp_get_search_default_text( 'messages' ); - // Setup a few values based on what's being searched for + // 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 + // Start the output buffer, so form can be filtered. ob_start(); ?> <form action="" method="get" id="search-message-form"> @@ -1124,13 +784,13 @@ function bp_message_search_form() { <?php - // Get the search form from the above output buffer + // 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) + * @since 2.2.0 * * @param string $search_form_html HTML markup for the message search form. */ @@ -1153,7 +813,7 @@ function bp_messages_form_action() { /** * Filters the form action for Messages HTML forms. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value The form action. */ @@ -1180,7 +840,7 @@ function bp_messages_username_value() { * 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) + * @since 1.0.0 * * @param string $value Default user name. */ @@ -1207,7 +867,7 @@ function bp_messages_subject_value() { */ function bp_get_messages_subject_value() { - // Sanitized in bp-messages-filters.php + // Sanitized in bp-messages-filters.php. $subject = ! empty( $_POST['subject'] ) ? $_POST['subject'] : ''; @@ -1215,7 +875,7 @@ function bp_messages_subject_value() { /** * Filters the default value for the subject field. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $subject The default value for the subject field. */ @@ -1238,7 +898,7 @@ function bp_messages_content_value() { */ function bp_get_messages_content_value() { - // Sanitized in bp-messages-filters.php + // Sanitized in bp-messages-filters.php. $content = ! empty( $_POST['content'] ) ? $_POST['content'] : ''; @@ -1246,7 +906,7 @@ function bp_messages_content_value() { /** * Filters the default value for the content field. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $content The default value for the content field. */ @@ -1285,7 +945,7 @@ function bp_messages_options() { /** * Output the dropdown for bulk management of messages. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_messages_bulk_management_dropdown() { ?> @@ -1299,7 +959,7 @@ function bp_messages_bulk_management_dropdown() { /** * Action to add additional options to the messages bulk management dropdown. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ do_action( 'bp_messages_bulk_management_dropdown' ); ?> @@ -1311,7 +971,9 @@ function bp_messages_bulk_management_dropdown() { /** * Return whether or not the notice is currently active. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 + * + * @return bool */ function bp_messages_is_active_notice() { global $messages_template; @@ -1323,7 +985,7 @@ function bp_messages_is_active_notice() { /** * Filters whether or not the notice is currently active. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $retval Whether or not the notice is currently active. */ @@ -1335,9 +997,10 @@ function bp_messages_is_active_notice() { * * Since 1.6 this function has been deprecated in favor of text in the theme. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.6.0) + * @since 1.0.0 + * @deprecated 1.6.0 * @uses bp_get_message_is_active_notice() + * @return bool */ function bp_message_is_active_notice() { echo bp_get_message_is_active_notice(); @@ -1348,8 +1011,8 @@ function bp_message_is_active_notice() { * Since 1.6 this function has been deprecated in favor of text in the * theme. * - * @since BuddyPress (1.0.0) - * @deprecated BuddyPress (1.6.0) + * @since 1.0.0 + * @deprecated 1.6.0 * @uses bp_messages_is_active_notice() */ function bp_get_message_is_active_notice() { @@ -1378,7 +1041,7 @@ function bp_message_notice_id() { /** * Filters the ID of the current notice in the loop. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $id ID of the current notice in the loop. */ @@ -1402,7 +1065,7 @@ function bp_message_notice_post_date() { /** * Filters the post date of the current notice in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Formatted post date of the current notice in the loop. */ @@ -1426,7 +1089,7 @@ function bp_message_notice_subject() { /** * Filters the subject of the current notice in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $subject Subject of the current notice in the loop. */ @@ -1450,7 +1113,7 @@ function bp_message_notice_text() { /** * Filters the text of the current notice in the loop. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $message Text for the current notice in the loop. */ @@ -1474,7 +1137,7 @@ function bp_message_notice_delete_link() { /** * Filters the URL for deleting the current notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL for deleting the current notice. * @param string $value Text indicating action being executed. @@ -1505,7 +1168,7 @@ function bp_message_activate_deactivate_link() { /** * Filters the URL for deactivating the current notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $link URL for deactivating the current notice. */ @@ -1535,7 +1198,7 @@ function bp_message_activate_deactivate_text() { /** * Filters the "Deactivate" or "Activate" text for notice action links. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $text Text used for notice action links. */ @@ -1545,7 +1208,7 @@ function bp_message_activate_deactivate_text() { /** * Output the messages component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_messages_slug() */ @@ -1555,7 +1218,7 @@ function bp_messages_slug() { /** * Return the messages component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @return string */ @@ -1564,7 +1227,7 @@ function bp_messages_slug() { /** * Filters the messages component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Messages component slug. */ @@ -1622,7 +1285,7 @@ function bp_send_private_message_link() { /** * Filters the URL for the Private Message link in member profile headers. * - * @since BuddyPress (1.2.10) + * @since 1.2.10 * * @param string $value URL for the Private Message link in member profile headers. */ @@ -1634,7 +1297,7 @@ function bp_send_private_message_link() { * * Explicitly named function to avoid confusion with public messages. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 * * @uses bp_get_send_message_button() */ @@ -1655,13 +1318,13 @@ function bp_send_message_button() { */ function bp_get_send_message_button() { // Note: 'bp_get_send_message_button' is a legacy filter. Use - // 'bp_get_send_message_button_args' instead. See #4536 + // '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) + * @since 1.8.0 * * @param array $value See {@link BP_Button}. */ @@ -1695,7 +1358,7 @@ function bp_message_loading_image_src() { /** * Filters the URL of the Messages AJAX loader gif. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL of the Messages AJAX loader gif. */ @@ -1740,7 +1403,7 @@ function bp_message_get_recipient_usernames() { */ function bp_get_message_get_recipient_usernames() { - // Sanitized in bp-messages-filters.php + // Sanitized in bp-messages-filters.php. $recipients = isset( $_GET['r'] ) ? $_GET['r'] : ''; @@ -1748,205 +1411,13 @@ function bp_message_get_recipient_usernames() { /** * Filters the recipients usernames for prefilling the 'To' field on the Compose screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $recipients Recipients usernames for 'To' field prefilling. */ return apply_filters( 'bp_get_message_get_recipient_usernames', $recipients ); } - -/** - * Message Thread Template Class - */ -class BP_Messages_Thread_Template { - - /** - * The loop iterator. - * - * @access public - * @var int - */ - public $current_message = -1; - - /** - * Number of messages returned by the paged query. - * - * @access public - * @var int - */ - public $message_count = 0; - - /** - * The message object currently being iterated on. - * - * @access public - * @var object - */ - public $message; - - /** - * Thread that the current messages belong to. - * - * @access public - * @var BP_Messages_Thread - */ - public $thread; - - /** - * A flag for whether the loop is currently being iterated. - * - * @access public - * @var bool - */ - public $in_the_loop = false; - - /** - * The page number being requested. - * - * @access public - * @var int - */ - public $pag_page = 1; - - /** - * The number of items being requested per page. - * - * @access public - * @var int - */ - public $pag_num = 10; - - /** - * An HTML string containing pagination links. - * - * @access public - * @var string - */ - public $pag_links = ''; - - /** - * The total number of messages matching the query. - * - * @access public - * @var int - */ - public $total_message_count = 0; - - /** - * Constructor method. - * - * @see BP_Messages_Thread::populate() for full parameter info. - * - * @param int $thread_id - * @param string $order - * @param array $args - */ - 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; - $this->thread->last_message_id = $this->thread->messages[ $last_message_index ]->id; - $this->thread->last_message_date = $this->thread->messages[ $last_message_index ]->date_sent; - $this->thread->last_sender_id = $this->thread->messages[ $last_message_index ]->sender_id; - $this->thread->last_message_subject = $this->thread->messages[ $last_message_index ]->subject; - $this->thread->last_message_content = $this->thread->messages[ $last_message_index ]->message; - } - - /** - * Whether there are messages available in the loop. - * - * @see bp_thread_has_messages() - * - * @return bool True if there are items in the loop, otherwise false. - */ - public function has_messages() { - if ( ! empty( $this->message_count ) ) { - return true; - } - - return false; - } - - /** - * Set up the next member and iterate index. - * - * @return object The next member to iterate over. - */ - public function next_message() { - $this->current_message++; - $this->message = $this->thread->messages[ $this->current_message ]; - - return $this->message; - } - - /** - * Rewind the messages and reset message index. - */ - public function rewind_messages() { - $this->current_message = -1; - if ( $this->message_count > 0 ) { - $this->message = $this->thread->messages[0]; - } - } - - /** - * Whether there are messages left in the loop to iterate over. - * - * This method is used by {@link bp_thread_messages()} as part of the - * while loop that controls iteration inside the messages loop, eg: - * while ( bp_thread_messages() ) { ... - * - * @see bp_thread_messages() - * - * @return bool True if there are more messages to show, otherwise false. - */ - public function messages() { - 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current message inside the loop. - * - * Used by {@link bp_thread_the_message()} to set up the current - * message data while looping, so that template tags used during - * that iteration make reference to the current message. - * - * @see bp_thread_the_message() - */ - public function the_message() { - $this->in_the_loop = true; - $this->message = $this->next_message(); - - // 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' ); - } - } -} - /** * Initialize the messages template loop for a specific thread. * @@ -1974,7 +1445,7 @@ function bp_thread_has_messages( $args = '' ) { $r['thread_id'] = (int) bp_action_variable( 0 ); } - // Set up extra args + // Set up extra args. $extra_args = $r; unset( $extra_args['thread_id'], $extra_args['order'] ); @@ -2038,7 +1509,7 @@ function bp_the_thread_id() { /** * Filters the ID of the thread that the current loop belongs to. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $thread_id ID of the thread. */ @@ -2062,7 +1533,7 @@ function bp_the_thread_subject() { /** * Filters the subject of the thread currently being iterated over. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @return string $last_message_subject Subject of the thread currently being iterated over. */ @@ -2091,7 +1562,7 @@ function bp_get_the_thread_recipients() { /** * Get the number of recipients in the current thread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return int */ @@ -2103,7 +1574,7 @@ function bp_get_thread_recipients_count() { /** * Get the max number of recipients to list in the 'Conversation between...' gloss. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @return int */ @@ -2111,7 +1582,7 @@ 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) + * @since 2.3.0 * * @param int $count Recipient count. Default: 5. */ @@ -2121,7 +1592,7 @@ function bp_get_max_thread_recipients_to_list() { /** * Output HTML links to recipients in the current thread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_the_thread_recipients_list() { echo bp_get_thread_recipients_list(); @@ -2129,7 +1600,7 @@ function bp_the_thread_recipients_list() { /** * Generate HTML links to the profiles of recipients in the current thread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return string */ @@ -2153,7 +1624,7 @@ function bp_the_thread_recipients_list() { /** * Filters the HTML links to the profiles of recipients in the current thread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param string $value Comma-separated list of recipient HTML links for current thread. */ @@ -2163,7 +1634,7 @@ function bp_the_thread_recipients_list() { /** * Echo the ID of the current message in the thread. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_thread_message_id() { echo (int) bp_get_the_thread_message_id(); @@ -2171,7 +1642,7 @@ function bp_the_thread_message_id() { /** * Get the ID of the current message in the thread. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int */ @@ -2185,7 +1656,7 @@ function bp_the_thread_message_id() { /** * Filters the ID of the current message in the thread. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $thread_message_id ID of the current message in the thread. */ @@ -2195,7 +1666,7 @@ function bp_the_thread_message_id() { /** * Output the CSS classes for messages within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_the_thread_message_css_class() { echo esc_attr( bp_get_the_thread_message_css_class() ); @@ -2203,7 +1674,7 @@ function bp_the_thread_message_css_class() { /** * Generate the CSS classes for messages within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string */ @@ -2212,13 +1683,13 @@ function bp_the_thread_message_css_class() { $classes = array(); - // Zebra-striping + // Zebra-striping. $classes[] = bp_get_the_thread_message_alt_class(); - // ID of the sender + // ID of the sender. $classes[] = 'sent-by-' . intval( $thread_template->message->sender_id ); - // Whether the sender is the same as the logged-in user + // Whether the sender is the same as the logged-in user. if ( bp_loggedin_user_id() == $thread_template->message->sender_id ) { $classes[] = 'sent-by-me'; } @@ -2226,7 +1697,7 @@ function bp_the_thread_message_css_class() { /** * Filters the CSS classes for messages within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $classes Array of classes to add to the HTML class attribute. */ @@ -2258,7 +1729,7 @@ function bp_the_thread_message_alt_class() { /** * Filters the CSS class used for message zebra striping. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $class Class determined to be next for zebra striping effect. */ @@ -2268,7 +1739,7 @@ function bp_the_thread_message_alt_class() { /** * Output the ID for message sender within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_the_thread_message_sender_id() { echo (int) bp_get_the_thread_message_sender_id(); @@ -2276,7 +1747,7 @@ function bp_the_thread_message_sender_id() { /** * Return the ID for message sender within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string */ @@ -2290,7 +1761,7 @@ function bp_the_thread_message_sender_id() { /** * Filters the ID for message sender within a single thread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param int $user_id ID of the message sender. */ @@ -2330,7 +1801,7 @@ function bp_the_thread_message_sender_avatar( $args = '' ) { /** * Filters the avatar for the current message sender. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value <img> tag containing the avatar value. */ @@ -2345,6 +1816,8 @@ function bp_the_thread_message_sender_avatar( $args = '' ) { /** * Output a link to the sender of the current message. + * + * @since 1.1.0 */ function bp_the_thread_message_sender_link() { echo esc_url( bp_get_the_thread_message_sender_link() ); @@ -2352,6 +1825,8 @@ function bp_the_thread_message_sender_link() { /** * Get a link to the sender of the current message. * + * @since 1.1.0 + * * @return string */ function bp_get_the_thread_message_sender_link() { @@ -2360,7 +1835,7 @@ function bp_the_thread_message_sender_link() { /** * Filters the link to the sender of the current message. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Link to the sender of the current message. */ @@ -2369,6 +1844,8 @@ function bp_the_thread_message_sender_link() { /** * Output the display name of the sender of the current message. + * + * @since 1.1.0 */ function bp_the_thread_message_sender_name() { echo esc_html( bp_get_the_thread_message_sender_name() ); @@ -2376,6 +1853,8 @@ function bp_the_thread_message_sender_name() { /** * Get the display name of the sender of the current message. * + * @since 1.1.0 + * * @return string */ function bp_get_the_thread_message_sender_name() { @@ -2390,7 +1869,7 @@ function bp_the_thread_message_sender_name() { /** * Filters the display name of the sender of the current message. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $display_name Display name of the sender of the current message. */ @@ -2399,6 +1878,8 @@ function bp_the_thread_message_sender_name() { /** * Output the URL for deleting the current thread. + * + * @since 1.5.0 */ function bp_the_thread_delete_link() { echo esc_url( bp_get_the_thread_delete_link() ); @@ -2406,6 +1887,8 @@ function bp_the_thread_delete_link() { /** * Get the URL for deleting the current thread. * + * @since 1.5.0 + * * @return string URL */ function bp_get_the_thread_delete_link() { @@ -2413,7 +1896,7 @@ function bp_the_thread_delete_link() { /** * Filters the URL for deleting the current thread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value URL for deleting the current thread. * @param string $value Text indicating action being executed. @@ -2423,6 +1906,8 @@ function bp_the_thread_delete_link() { /** * Output the 'Sent x hours ago' string for the current message. + * + * @since 1.1.0 */ function bp_the_thread_message_time_since() { echo bp_get_the_thread_message_time_since(); @@ -2430,6 +1915,8 @@ function bp_the_thread_message_time_since() { /** * Generate the 'Sent x hours ago' string for the current message. * + * @since 1.1.0 + * * @return string */ function bp_get_the_thread_message_time_since() { @@ -2437,7 +1924,7 @@ function bp_the_thread_message_time_since() { /** * Filters the 'Sent x hours ago' string for the current message. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Default text of 'Sent x hours ago'. */ @@ -2447,7 +1934,7 @@ function bp_the_thread_message_time_since() { /** * Output the timestamp for the current message. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_the_thread_message_date_sent() { echo bp_get_the_thread_message_date_sent(); @@ -2455,7 +1942,7 @@ function bp_the_thread_message_date_sent() { /** * Generate the 'Sent x hours ago' string for the current message. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses strtotime() To convert the message string into a usable timestamp. * @@ -2467,7 +1954,7 @@ function bp_the_thread_message_date_sent() { /** * Filters the date sent value for the current message as a timestamp. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $value Timestamp of the date sent value for the current message. */ @@ -2476,6 +1963,8 @@ function bp_the_thread_message_date_sent() { /** * Output the content of the current message in the loop. + * + * @since 1.1.0 */ function bp_the_thread_message_content() { echo bp_get_the_thread_message_content(); @@ -2483,6 +1972,8 @@ function bp_the_thread_message_content() { /** * Get the content of the current message in the loop. * + * @since 1.1.0 + * * @return string */ function bp_get_the_thread_message_content() { @@ -2491,7 +1982,7 @@ function bp_the_thread_message_content() { /** * Filters the content of the current message in the loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $message The content of the current message in the loop. */ @@ -2503,7 +1994,7 @@ function bp_the_thread_message_content() { /** * Enable oEmbed support for Messages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @see BP_Embed */ @@ -2519,13 +2010,12 @@ add_action( 'thread_loop_start', 'bp_messages_embed' ); * * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}. * - * @since BuddyPress (2.2.0) + * @since 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 ) { @@ -2537,14 +2027,12 @@ function bp_embed_message_cache( $cache, $id, $cachekey ) { * * Used during {@link BP_Embed::parse_oembed()} via {@link bp_messages_embed()}. * - * @since BuddyPress (2.2.0) + * @since 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 ); 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 bee180b92e31b965618825e6ebff8b83e100fa7f..1b577624813d1666824f8ff2e00d88668d0fa90e 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-widgets.php @@ -4,127 +4,20 @@ * * @package BuddyPress * @subpackage Messages + * @since 1.9.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +require dirname( __FILE__ ) . '/classes/class-bp-messages-sitewide-notices-widget.php'; + /** * Register widgets for the Messages component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_messages_register_widgets() { add_action( 'widgets_init', create_function('', 'return register_widget( "BP_Messages_Sitewide_Notices_Widget" );') ); } add_action( 'bp_register_widgets', 'bp_messages_register_widgets' ); - -/** Sitewide Notices widget ***************************************************/ - -/** - * A widget that displays sitewide notices. - * - * @since BuddyPress (1.9.0) - */ -class BP_Messages_Sitewide_Notices_Widget extends WP_Widget { - - /** - * Constructor method - */ - function __construct() { - parent::__construct( - 'bp_messages_sitewide_notices_widget', - __( '(BuddyPress) Sitewide Notices', 'buddypress' ), - array( - 'classname' => 'widget_bp_core_sitewide_messages buddypress widget', - 'description' => __( 'Display Sitewide Notices posted by the site administrator', 'buddypress' ), - ) - ); - } - - /** - * Render the widget. - * - * @see WP_Widget::widget() for a description of parameters. - * - * @param array $args See {@WP_Widget::widget()}. - * @param array $instance See {@WP_Widget::widget()}. - */ - public function widget( $args, $instance ) { - - if ( ! is_user_logged_in() ) { - return; - } - - // Don't display the widget if there are no Notices to show - $notices = BP_Messages_Notice::get_active(); - if ( empty( $notices ) ) { - return; - } - - extract( $args ); - - $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; - - /** - * 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; ?> - - <div class="bp-site-wide-message"> - <?php bp_message_get_notices(); ?> - </div> - - <?php - - echo $after_widget; - } - - /** - * Process the saved settings for the widget. - * - * @see WP_Widget::update() for a description of parameters and - * return values. - * - * @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 ) { - $instance = $old_instance; - $instance['title'] = strip_tags( $new_instance['title'] ); - return $instance; - } - - /** - * Render the settings form for Appearance > Widgets. - * - * @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( - 'title' => '', - ) ); - - $title = strip_tags( $instance['title'] ); ?> - - <p> - <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'buddypress' ); ?></label> - <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 ); ?>" /> - </p> - - <?php - } -} diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-box-template.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-box-template.php new file mode 100644 index 0000000000000000000000000000000000000000..1487ff7977de5afd98f3e50e9128fb41b1cd9f9a --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-box-template.php @@ -0,0 +1,347 @@ +<?php +/** + * BuddyPress Messages Box Template Class. + * + * @package BuddyPress + * @subpackage MessagesTemplate + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Message Box Template Class + */ +class BP_Messages_Box_Template { + + /** + * The loop iterator. + * + * @var int + */ + public $current_thread = -1; + + /** + * The number of threads returned by the paged query. + * + * @var int + */ + public $current_thread_count = 0; + + /** + * Total number of threads matching the query params. + * + * @var int + */ + public $total_thread_count = 0; + + /** + * Array of threads located by the query. + * + * @var array + */ + public $threads = array(); + + /** + * The thread object currently being iterated on. + * + * @var object + */ + public $thread = false; + + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop = false; + + /** + * User ID of the current inbox. + * + * @var int + */ + public $user_id = 0; + + /** + * The current "box" view ('notices', 'sentbox', 'inbox'). + * + * @var string + */ + public $box = 'inbox'; + + /** + * The page number being requested. + * + * @var int + */ + public $pag_page = 1; + + /** + * The number of items being requested per page. + * + * @var int + */ + public $pag_num = 10; + + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links = ''; + + /** + * Search terms for limiting the thread query. + * + * @var string + */ + public $search_terms = ''; + + /** + * Constructor method. + * + * @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( 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']; + } + + if ( !$this->threads ) { + $this->thread_count = 0; + $this->total_thread_count = 0; + } else { + $total_notice_count = BP_Messages_Notice::get_total_notice_count(); + + 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) $r['max']; + } + + if ( ! empty( $r['max'] ) ) { + if ( (int) $r['max'] >= count( $this->threads ) ) { + $this->thread_count = count( $this->threads ); + } else { + $this->thread_count = (int) $r['max']; + } + } else { + $this->thread_count = count( $this->threads ); + } + } + + if ( (int) $this->total_thread_count && (int) $this->pag_num ) { + $pag_args = array( + $r['page_arg'] => '%#%', + ); + + if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) { + $base = remove_query_arg( 's', wp_get_referer() ); + } else { + $base = ''; + } + + $add_args = array(); + + if ( ! empty( $this->search_terms ) ) { + $add_args['s'] = $this->search_terms; + } + + $this->pag_links = paginate_links( array( + 'base' => add_query_arg( $pag_args, $base ), + 'format' => '', + 'total' => ceil( (int) $this->total_thread_count / (int) $this->pag_num ), + 'current' => $this->pag_page, + 'prev_text' => _x( '←', 'Message pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Message pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => $add_args, + ) ); + } + } + + /** + * Whether there are threads available in the loop. + * + * @see bp_has_message_threads() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_threads() { + if ( $this->thread_count ) { + return true; + } + + return false; + } + + /** + * Set up the next member and iterate index. + * + * @return object The next member to iterate over. + */ + public function next_thread() { + $this->current_thread++; + $this->thread = $this->threads[$this->current_thread]; + + return $this->thread; + } + + /** + * Rewind the threads and reset thread index. + */ + public function rewind_threads() { + $this->current_thread = -1; + if ( $this->thread_count > 0 ) { + $this->thread = $this->threads[0]; + } + } + + /** + * Whether there are threads left in the loop to iterate over. + * + * This method is used by {@link bp_message_threads()} as part of the + * while loop that controls iteration inside the threads loop, eg: + * while ( bp_message_threads() ) { ... + * + * @see bp_message_threads() + * + * @return bool True if there are more threads to show, otherwise false. + */ + function message_threads() { + if ( $this->current_thread + 1 < $this->thread_count ) { + return true; + } elseif ( $this->current_thread + 1 == $this->thread_count ) { + + /** + * Fires when at the end of threads to iterate over. + * + * @since 1.5.0 + */ + do_action( 'messages_box_loop_end' ); + // Do some cleaning up after the loop. + $this->rewind_threads(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current thread inside the loop. + * + * Used by {@link bp_message_thread()} to set up the current thread data + * while looping, so that template tags used during that iteration make + * reference to the current thread. + * + * @see bp_message_thread() + */ + public function the_message_thread() { + + $this->in_the_loop = true; + $this->thread = $this->next_thread(); + + if ( ! bp_is_current_action( 'notices' ) ) { + $last_message_index = count( $this->thread->messages ) - 1; + $this->thread->messages = array_reverse( (array) $this->thread->messages ); + + // Set up the last message data. + if ( count($this->thread->messages) > 1 ) { + if ( 'inbox' == $this->box ) { + foreach ( (array) $this->thread->messages as $key => $message ) { + if ( bp_loggedin_user_id() != $message->sender_id ) { + $last_message_index = $key; + break; + } + } + + } elseif ( 'sentbox' == $this->box ) { + foreach ( (array) $this->thread->messages as $key => $message ) { + if ( bp_loggedin_user_id() == $message->sender_id ) { + $last_message_index = $key; + break; + } + } + } + } + + $this->thread->last_message_id = $this->thread->messages[ $last_message_index ]->id; + $this->thread->last_message_date = $this->thread->messages[ $last_message_index ]->date_sent; + $this->thread->last_sender_id = $this->thread->messages[ $last_message_index ]->sender_id; + $this->thread->last_message_subject = $this->thread->messages[ $last_message_index ]->subject; + $this->thread->last_message_content = $this->thread->messages[ $last_message_index ]->message; + } + + // Loop has just started. + if ( 0 == $this->current_thread ) { + + /** + * Fires if at the start of the message thread loop. + * + * @since 1.5.0 + */ + do_action( 'messages_box_loop_start' ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-component.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-component.php new file mode 100644 index 0000000000000000000000000000000000000000..403c1de6162917bea8e1d059f6c83189de3a1bcd --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-component.php @@ -0,0 +1,347 @@ +<?php +/** + * BuddyPress Messages Loader. + * + * A private messages component, for users to send messages to each other. + * + * @package BuddyPress + * @subpackage MessagesLoader + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Implementation of BP_Component for the Messages component. + * + * @since 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 1.5.0 + * @var bool + */ + public $autocomplete_all; + + /** + * Start the messages component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'messages', + __( 'Private Messages', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 50, + 'features' => array( 'star' ) + ) + ); + } + + /** + * Include files. + * + * @since 1.5.0 + * + * @param array $includes See {BP_Component::includes()} for details. + */ + public function includes( $includes = array() ) { + + // Files to include. + $includes = array( + 'cssjs', + 'cache', + 'actions', + 'screens', + 'classes', + 'filters', + 'template', + 'functions', + 'notifications', + 'widgets', + ); + + // Conditional includes. + if ( bp_is_active( $this->id, 'star' ) ) { + $includes[] = 'star'; + } + + parent::includes( $includes ); + } + + /** + * Set up globals for the Messages component. + * + * The BP_MESSAGES_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @param array $args Not used. + */ + public function setup_globals( $args = array() ) { + $bp = buddypress(); + + // Define a slug, if necessary. + 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_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. + 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, + '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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $access = bp_core_can_edit_settings(); + $slug = bp_get_messages_slug(); + $messages_link = trailingslashit( $user_domain . $slug ); + + // Only grab count if we're on a user page and current user has access. + if ( bp_is_user() && bp_user_has_access() ) { + $count = bp_get_total_unread_messages_count(); + $class = ( 0 === $count ) ? 'no-count' : 'count'; + $nav_name = sprintf( __( 'Messages <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ); + } else { + $nav_name = __( 'Messages', 'buddypress' ); + } + + // Add 'Messages' to the main navigation. + $main_nav = array( + 'name' => $nav_name, + 'slug' => $slug, + 'position' => 50, + 'show_for_displayed_user' => $access, + 'screen_function' => 'messages_screen_inbox', + 'default_subnav_slug' => 'inbox', + 'item_css_id' => $this->id + ); + + // Add the subnav items to the profile. + $sub_nav[] = array( + 'name' => __( 'Inbox', 'buddypress' ), + 'slug' => 'inbox', + 'parent_url' => $messages_link, + 'parent_slug' => $slug, + 'screen_function' => 'messages_screen_inbox', + 'position' => 10, + 'user_has_access' => $access + ); + + 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' => $slug, + 'screen_function' => 'bp_messages_star_screen', + 'position' => 11, + 'user_has_access' => $access + ); + } + + $sub_nav[] = array( + 'name' => __( 'Sent', 'buddypress' ), + 'slug' => 'sentbox', + 'parent_url' => $messages_link, + 'parent_slug' => $slug, + 'screen_function' => 'messages_screen_sentbox', + 'position' => 20, + 'user_has_access' => $access + ); + + $sub_nav[] = array( + 'name' => __( 'Compose', 'buddypress' ), + 'slug' => 'compose', + 'parent_url' => $messages_link, + 'parent_slug' => $slug, + 'screen_function' => 'messages_screen_compose', + 'position' => 30, + 'user_has_access' => $access + ); + + if ( bp_current_user_can( 'bp_moderate' ) ) { + $sub_nav[] = array( + 'name' => __( 'Notices', 'buddypress' ), + 'slug' => 'notices', + 'parent_url' => $messages_link, + 'parent_slug' => $slug, + 'screen_function' => 'messages_screen_notices', + 'position' => 90, + 'user_has_access' => true + ); + } + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the Toolbar. + * + * @param array $wp_admin_nav See {BP_Component::setup_admin_bar()} for details. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $messages_link = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ); + + // Unread message count. + $count = messages_get_unread_count(); + if ( !empty( $count ) ) { + $title = sprintf( __( 'Messages <span class="count">%s</span>', 'buddypress' ), bp_core_number_format( $count ) ); + $inbox = sprintf( __( 'Inbox <span class="count">%s</span>', 'buddypress' ), bp_core_number_format( $count ) ); + } else { + $title = __( 'Messages', 'buddypress' ); + $inbox = __( 'Inbox', 'buddypress' ); + } + + // Add main Messages menu. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => $title, + 'href' => $messages_link + ); + + // Inbox. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-inbox', + 'title' => $inbox, + 'href' => $messages_link, + 'position' => 10 + ); + + // 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() ), + 'position' => 11 + ); + } + + // Sent Messages. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-sentbox', + 'title' => __( 'Sent', 'buddypress' ), + 'href' => trailingslashit( $messages_link . 'sentbox' ), + 'position' => 20 + ); + + // Compose Message. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-compose', + 'title' => __( 'Compose', 'buddypress' ), + 'href' => trailingslashit( $messages_link . 'compose' ), + 'position' => 30 + ); + + // Site Wide Notices. + if ( bp_current_user_can( 'bp_moderate' ) ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-notices', + 'title' => __( 'All Member Notices', 'buddypress' ), + 'href' => trailingslashit( $messages_link . 'notices' ), + 'position' => 90 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + */ + public function setup_title() { + + if ( bp_is_messages_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = __( 'My Messages', 'buddypress' ); + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups + * + * @since 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/classes/class-bp-messages-message.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-message.php index 4617f8af91fac9db944459b0d37e8209a1d74444..1f0ebdb3391651ddf9a5a83cac45ab60a77379bc 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Messages Classes + * BuddyPress Messages Classes. * * @package BuddyPress * @subpackage MessagesClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -65,7 +66,7 @@ class BP_Messages_Message { /** * Constructor. * - * @param int $id Optional. ID of the message. + * @param int|null $id Optional. ID of the message. */ public function __construct( $id = null ) { $this->date_sent = bp_core_current_time(); @@ -99,8 +100,7 @@ class BP_Messages_Message { /** * Send a message. * - * @return int|bool ID of the newly created message on success, false - * on failure. + * @return int|bool ID of the newly created message on success, false on failure. */ public function send() { global $wpdb; @@ -118,7 +118,7 @@ class BP_Messages_Message { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Messages_Message $this Current instance of the message item being saved. Passed by reference. */ @@ -136,7 +136,7 @@ class BP_Messages_Message { $new_thread = true; } - // First insert the message into the messages table + // 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; @@ -145,17 +145,17 @@ class BP_Messages_Message { $recipient_ids = array(); if ( $new_thread ) { - // Add an recipient entry for all recipients + // 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 + // 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 + // 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 ) ); } @@ -164,7 +164,7 @@ class BP_Messages_Message { /** * Fires after the current message item has been saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Messages_Message $this Current instance of the message item being saved. Passed by reference. */ @@ -176,7 +176,7 @@ class BP_Messages_Message { /** * Get a list of recipients for a message. * - * @return array + * @return object $value List of recipients for a message. */ public function get_recipients() { global $wpdb; @@ -192,8 +192,7 @@ class BP_Messages_Message { * Get list of recipient IDs from their usernames. * * @param array $recipient_usernames Usernames of recipients. - * - * @return array + * @return array $recipient_ids Array of Recepient IDs. */ public static function get_recipient_ids( $recipient_usernames ) { if ( !$recipient_usernames ) @@ -214,7 +213,6 @@ class BP_Messages_Message { * 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 ) { @@ -230,7 +228,6 @@ class BP_Messages_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. */ @@ -246,7 +243,6 @@ class BP_Messages_Message { * 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 ) { 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 index eb2e504f1304786e7639cf2fb3bf0fcb81c83653..36aa932445cdc6b08041b546a38b5092d575b1e6 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress Messages Classes + * BuddyPress Messages Classes. * * @package BuddyPress * @subpackage MessagesClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -14,7 +15,7 @@ defined( 'ABSPATH' ) || exit; * * Use this class to create, activate, deactivate or delete notices. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ class BP_Messages_Notice { /** @@ -55,8 +56,9 @@ class BP_Messages_Notice { /** * Constructor. * - * @since BuddyPress (1.0.0) - * @param int $id Optional. The ID of the current notice. + * @since 1.0.0 + * + * @param int|null $id Optional. The ID of the current notice. */ public function __construct( $id = null ) { if ( $id ) { @@ -70,7 +72,7 @@ class BP_Messages_Notice { * * Runs during constructor. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ public function populate() { global $wpdb; @@ -90,7 +92,7 @@ class BP_Messages_Notice { /** * Saves a notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return bool */ @@ -107,7 +109,7 @@ class BP_Messages_Notice { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Messages_Notice $this Current instance of the message notice item being saved. Passed by reference. */ @@ -135,7 +137,7 @@ class BP_Messages_Notice { /** * Fires after the current message notice item has been saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Messages_Notice $this Current instance of the message item being saved. Passed by reference. */ @@ -147,7 +149,7 @@ class BP_Messages_Notice { /** * Activates a notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return bool */ @@ -159,7 +161,7 @@ class BP_Messages_Notice { /** * Deactivates a notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return bool */ @@ -171,7 +173,7 @@ class BP_Messages_Notice { /** * Deletes a notice. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return bool */ @@ -181,7 +183,7 @@ class BP_Messages_Notice { /** * Fires before the current message item has been deleted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_Messages_Notice $this Current instance of the message notice item being deleted. */ @@ -204,21 +206,21 @@ class BP_Messages_Notice { * * To get all notices, pass a value of -1 to pag_num. * - * @since BuddyPress (1.0.0) + * @since 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 + * @return object List of notices to display. */ 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 + 'pag_num' => 20, // Number of notices per page. + 'pag_page' => 1 // Page number. ) ); $limit_sql = ''; @@ -236,7 +238,7 @@ class BP_Messages_Notice { /** * Returns the total number of recorded notices. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return int */ @@ -253,7 +255,7 @@ class BP_Messages_Notice { /** * Returns the active notice that should be displayed on the frontend. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @return object The BP_Messages_Notice object. */ diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-sitewide-notices-widget.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-sitewide-notices-widget.php new file mode 100644 index 0000000000000000000000000000000000000000..74284c6d12bb53ad4904af1a2d7da7bb60902be9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-sitewide-notices-widget.php @@ -0,0 +1,121 @@ +<?php +/** + * BuddyPress Messages Sitewide Notices Widget. + * + * @package BuddyPress + * @subpackage Messages + * @since 1.9.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * A widget that displays sitewide notices. + * + * @since 1.9.0 + */ +class BP_Messages_Sitewide_Notices_Widget extends WP_Widget { + + /** + * Constructor method. + */ + function __construct() { + parent::__construct( + 'bp_messages_sitewide_notices_widget', + __( '(BuddyPress) Sitewide Notices', 'buddypress' ), + array( + 'classname' => 'widget_bp_core_sitewide_messages buddypress widget', + 'description' => __( 'Display Sitewide Notices posted by the site administrator', 'buddypress' ), + ) + ); + } + + /** + * Render the widget. + * + * @see WP_Widget::widget() for a description of parameters. + * + * @param array $args See {@WP_Widget::widget()}. + * @param array $instance See {@WP_Widget::widget()}. + */ + public function widget( $args, $instance ) { + + if ( ! is_user_logged_in() ) { + return; + } + + // Don't display the widget if there are no Notices to show. + $notices = BP_Messages_Notice::get_active(); + if ( empty( $notices ) ) { + return; + } + + extract( $args ); + + $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; + + /** + * Filters the title of the Messages widget. + * + * @since 1.9.0 + * @since 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; ?> + + <div class="bp-site-wide-message"> + <?php bp_message_get_notices(); ?> + </div> + + <?php + + echo $after_widget; + } + + /** + * Process the saved settings for the widget. + * + * @see WP_Widget::update() for a description of parameters and + * return values. + * + * @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 ) { + $instance = $old_instance; + $instance['title'] = strip_tags( $new_instance['title'] ); + return $instance; + } + + /** + * Render the settings form for Appearance > Widgets. + * + * @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( + 'title' => '', + ) ); + + $title = strip_tags( $instance['title'] ); ?> + + <p> + <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'buddypress' ); ?></label> + <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 ); ?>" /> + </p> + + <?php + } +} diff --git a/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread-template.php b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread-template.php new file mode 100644 index 0000000000000000000000000000000000000000..e78e5664b21a973c5717abb8ed1d6414f09f8cc1 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/classes/class-bp-messages-thread-template.php @@ -0,0 +1,186 @@ +<?php +/** + * BuddyPress Messages Thread Template Class. + * + * @package BuddyPress + * @subpackage MessagesTemplate + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Message Thread Template Class + */ +class BP_Messages_Thread_Template { + + /** + * The loop iterator. + * + * @var int + */ + public $current_message = -1; + + /** + * Number of messages returned by the paged query. + * + * @var int + */ + public $message_count = 0; + + /** + * The message object currently being iterated on. + * + * @var object + */ + public $message; + + /** + * Thread that the current messages belong to. + * + * @var BP_Messages_Thread + */ + public $thread; + + /** + * A flag for whether the loop is currently being iterated. + * + * @var bool + */ + public $in_the_loop = false; + + /** + * The page number being requested. + * + * @var int + */ + public $pag_page = 1; + + /** + * The number of items being requested per page. + * + * @var int + */ + public $pag_num = 10; + + /** + * An HTML string containing pagination links. + * + * @var string + */ + public $pag_links = ''; + + /** + * The total number of messages matching the query. + * + * @var int + */ + public $total_message_count = 0; + + /** + * Constructor method. + * + * @see BP_Messages_Thread::populate() for full parameter info. + * + * @param int $thread_id ID of the message thread to display. + * @param string $order Order to show the thread's messages in. + * @param array $args Array of arguments for the query. + */ + 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 ); + } + + /** + * Whether there are messages available in the loop. + * + * @see bp_thread_has_messages() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_messages() { + if ( ! empty( $this->message_count ) ) { + return true; + } + + return false; + } + + /** + * Set up the next member and iterate index. + * + * @return object The next member to iterate over. + */ + public function next_message() { + $this->current_message++; + $this->message = $this->thread->messages[ $this->current_message ]; + + return $this->message; + } + + /** + * Rewind the messages and reset message index. + */ + public function rewind_messages() { + $this->current_message = -1; + if ( $this->message_count > 0 ) { + $this->message = $this->thread->messages[0]; + } + } + + /** + * Whether there are messages left in the loop to iterate over. + * + * This method is used by {@link bp_thread_messages()} as part of the + * while loop that controls iteration inside the messages loop, eg: + * while ( bp_thread_messages() ) { ... + * + * @see bp_thread_messages() + * + * @return bool True if there are more messages to show, otherwise false. + */ + public function messages() { + 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 1.1.0 + */ + do_action( 'thread_loop_end' ); + // Do some cleaning up after the loop. + $this->rewind_messages(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current message inside the loop. + * + * Used by {@link bp_thread_the_message()} to set up the current + * message data while looping, so that template tags used during + * that iteration make reference to the current message. + * + * @see bp_thread_the_message() + */ + public function the_message() { + $this->in_the_loop = true; + $this->message = $this->next_message(); + + // Loop has just started. + if ( 0 === $this->current_message ) { + + /** + * Fires if at the start of the message loop. + * + * @since 1.1.0 + */ + do_action( 'thread_loop_start' ); + } + } +} 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 index 117bdfa765bc854c877b76815cd0476a648db620..113ee20762e7744ea79812cd6b5d132ab6f535c2 100644 --- 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 @@ -1,24 +1,26 @@ <?php /** - * BuddyPress Messages Classes + * BuddyPress Messages Classes. * * @package BuddyPress * @subpackage MessagesClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * BuddyPress Message Thread class. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ class BP_Messages_Thread { + /** * The message thread ID. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * @var int */ public $thread_id; @@ -26,23 +28,23 @@ class BP_Messages_Thread { /** * The current messages. * - * @since BuddyPress (1.0.0) - * @var object + * @since 1.0.0 + * @var array */ public $messages; /** * The current recipients in the message thread. * - * @since BuddyPress (1.0.0) - * @var object + * @since 1.0.0 + * @var array */ public $recipients; /** * The user IDs of all messages in the message thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var array */ public $sender_ids; @@ -50,7 +52,7 @@ class BP_Messages_Thread { /** * The unread count for the logged-in user. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var int */ public $unread_count; @@ -58,7 +60,7 @@ class BP_Messages_Thread { /** * The content of the last message in this thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var string */ public $last_message_content; @@ -66,7 +68,7 @@ class BP_Messages_Thread { /** * The date of the last message in this thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var string */ public $last_message_date; @@ -74,7 +76,7 @@ class BP_Messages_Thread { /** * The ID of the last message in this thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var int */ public $last_message_id; @@ -82,7 +84,7 @@ class BP_Messages_Thread { /** * The subject of the last message in this thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var string */ public $last_message_subject; @@ -90,7 +92,7 @@ class BP_Messages_Thread { /** * The user ID of the author of the last message in this thread. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * @var int */ public $last_sender_id; @@ -98,7 +100,7 @@ class BP_Messages_Thread { /** * Sort order of the messages in this thread (ASC or DESC). * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * @var string */ public $messages_order; @@ -106,13 +108,13 @@ class BP_Messages_Thread { /** * Constructor. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see BP_Messages_Thread::populate() for full description of parameters. * - * @param bool $thread_id - * @param string $order - * @param array $args + * @param bool $thread_id ID for the message thread. + * @param string $order Order to display the messages in. + * @param array $args Array of arguments for thread querying. */ public function __construct( $thread_id = false, $order = 'ASC', $args = array() ) { if ( $thread_id ) { @@ -125,11 +127,11 @@ class BP_Messages_Thread { * * Used in constructor. * - * @since BuddyPress (1.0.0) + * @since 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 { + * @param array $args { * Array of arguments. * @type bool $update_meta_cache Whether to pre-fetch metadata for * queried message items. Default: true. @@ -137,45 +139,52 @@ class BP_Messages_Thread { * @return bool False on failure. */ public function populate( $thread_id = 0, $order = 'ASC', $args = array() ) { - global $wpdb; - if( 'ASC' != $order && 'DESC' != $order ) { + if ( 'ASC' !== $order && 'DESC' !== $order ) { $order = 'ASC'; } - // merge $args with our defaults + // Merge $args with our defaults. $r = wp_parse_args( $args, array( + 'user_id' => bp_loggedin_user_id(), 'update_meta_cache' => true ) ); $this->messages_order = $order; - $this->thread_id = $thread_id; + $this->thread_id = (int) $thread_id; - // get messages for thread - $this->messages = self::get_messages( $thread_id ); + // Get messages for thread. + $this->messages = self::get_messages( $this->thread_id ); if ( empty( $this->messages ) || is_wp_error( $this->messages ) ) { return false; } - // flip if order is DESC + // Flip if order is DESC. if ( 'DESC' === $order ) { $this->messages = array_reverse( $this->messages ); } + $last_message_index = count( $this->messages ) - 1; + $this->last_message_id = $this->messages[ $last_message_index ]->id; + $this->last_message_date = $this->messages[ $last_message_index ]->date_sent; + $this->last_sender_id = $this->messages[ $last_message_index ]->sender_id; + $this->last_message_subject = $this->messages[ $last_message_index ]->subject; + $this->last_message_content = $this->messages[ $last_message_index ]->message; + foreach ( (array) $this->messages as $key => $message ) { - $this->sender_ids[$message->sender_id] = $message->sender_id; + $this->sender_ids[ $message->sender_id ] = $message->sender_id; } - // Fetch the recipients + // 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; + // Get the unread count for the logged in user. + if ( isset( $this->recipients[ $r['user_id'] ] ) ) { + $this->unread_count = $this->recipients[ $r['user_id'] ]->unread_count; } - // Grab all message meta + // Grab all message meta. if ( true === (bool) $r['update_meta_cache'] ) { bp_messages_update_meta_cache( wp_list_pluck( $this->messages, 'id' ) ); } @@ -183,7 +192,7 @@ class BP_Messages_Thread { /** * Fires after a BP_Messages_Thread object has been populated. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_Messages_Thread $this Message thread object. */ @@ -193,7 +202,7 @@ class BP_Messages_Thread { /** * Mark a thread initialized in this class as read. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see BP_Messages_Thread::mark_as_read() */ @@ -204,7 +213,7 @@ class BP_Messages_Thread { /** * Mark a thread initialized in this class as unread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @see BP_Messages_Thread::mark_as_unread() */ @@ -215,11 +224,10 @@ class BP_Messages_Thread { /** * Returns recipients for a message thread. * - * @since BuddyPress (1.0.0) - * @since BuddyPress (2.3.0) Added $thread_id as a parameter. + * @since 1.0.0 + * @since 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 ) { @@ -229,12 +237,15 @@ class BP_Messages_Thread { $thread_id = $this->thread_id; } + $thread_id = (int) $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 ) ); + $sql = $wpdb->prepare( "SELECT * FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d", $thread_id ); + $results = $wpdb->get_results( $sql ); foreach ( (array) $results as $recipient ) { $recipients[ $recipient->user_id ] = $recipient; @@ -246,7 +257,7 @@ class BP_Messages_Thread { /** * Filters the recipients of a message thread. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param array $recipients Array of recipient objects. * @param int $thread_id ID of the current thread. @@ -259,21 +270,22 @@ class BP_Messages_Thread { /** * Get all messages associated with a thread. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $thread_id The message thread ID. * - * @return array + * @return object List of messages associated with a thread. */ public static function get_messages( $thread_id = 0 ) { - $messages = wp_cache_get( $thread_id, 'bp_messages_threads' ); + $thread_id = (int) $thread_id; + $messages = wp_cache_get( $thread_id, 'bp_messages_threads' ); if ( false === $messages ) { global $wpdb; $bp = buddypress(); - // always sort by ASC by default + // 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' ); @@ -285,10 +297,9 @@ class BP_Messages_Thread { /** * Static method to get message recipients by thread ID. * - * @since BuddyPress (2.3.0) - * - * @param int $thread_id The thread ID. + * @since 2.3.0 * + * @param int $thread_id The thread ID. * @return array */ public static function get_recipients_for_thread( $thread_id = 0 ) { @@ -302,19 +313,20 @@ class BP_Messages_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) + * @since 1.0.0 * * @param int $thread_id The message thread ID. - * * @return bool */ - public static function delete( $thread_id ) { + public static function delete( $thread_id = 0 ) { global $wpdb; + $thread_id = (int) $thread_id; + /** * Fires before a message thread is marked as deleted. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $thread_id ID of the thread being deleted. */ @@ -325,54 +337,55 @@ class BP_Messages_Thread { // Mark messages as deleted // // @todo the reliance on bp_loggedin_user_id() sucks for plugins - // refactor this method to accept a $user_id parameter + // 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 + // 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 + // 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 + // 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) + * @since 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 + // 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 + // Do something for each message ID. foreach ( $message_ids as $message_id ) { - // Delete message meta + + // 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) + * @since 1.0.0 * * @param int $message_id ID of the message. */ do_action( 'messages_thread_deleted_thread', $message_id ); } - // Delete all the recipients + // 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) + * @since 2.2.0 * * @param int $thread_id ID of the thread being deleted. * @param array $message_ids IDs of messages being deleted. @@ -385,7 +398,7 @@ class BP_Messages_Thread { /** * Get current message threads for a user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $args { * Array of arguments. @@ -404,7 +417,7 @@ class BP_Messages_Thread { public static function get_current_threads_for_user( $args = array() ) { global $wpdb; - // Backward compatibility with old method of passing arguments + // Backward compatibility with old method of passing arguments. if ( ! is_array( $args ) || func_num_args() > 1 ) { _deprecated_argument( __METHOD__, '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__ ) ); @@ -421,7 +434,7 @@ class BP_Messages_Thread { $args = bp_core_parse_args_array( $old_args_keys, $func_args ); } - $defaults = array( + $r = bp_parse_args( $args, array( 'user_id' => false, 'box' => 'inbox', 'type' => 'all', @@ -429,8 +442,7 @@ class BP_Messages_Thread { '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( @@ -455,7 +467,7 @@ class BP_Messages_Thread { $r['user_id'] = (int) $r['user_id']; - // Default deleted SQL + // Default deleted SQL. $deleted_sql = 'r.is_deleted = 0'; switch ( $r['box'] ) { @@ -469,13 +481,13 @@ class BP_Messages_Thread { $sender_sql = 'AND r.sender_only = 0'; break; - // Omit user-deleted threads from all other custom message boxes default : + // Omit user-deleted threads from all other custom message boxes. $deleted_sql = $wpdb->prepare( '( r.user_id = %d AND r.is_deleted = 0 )', $r['user_id'] ); break; } - // Process meta query into SQL + // 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']; @@ -486,32 +498,32 @@ class BP_Messages_Thread { $bp = buddypress(); - // set up SQL array + // 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 + // Get thread IDs. $thread_ids = $wpdb->get_results( implode( ' ', $sql ) ); if ( empty( $thread_ids ) ) { return false; } - // adjust $sql to work for thread total + // 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 + // Sort threads by date_sent. foreach( (array) $thread_ids as $thread ) { - $sorted_threads[$thread->thread_id] = strtotime( $thread->date_sent ); + $sorted_threads[ $thread->thread_id ] = strtotime( $thread->date_sent ); } arsort( $sorted_threads ); - $threads = false; + $threads = array(); foreach ( (array) $sorted_threads as $thread_id => $date_sent ) { $threads[] = new BP_Messages_Thread( $thread_id, 'ASC', array( 'update_meta_cache' => false @@ -521,14 +533,17 @@ class BP_Messages_Thread { /** * Filters the results of the query for a user's message threads. * - * @since BuddyPress (2.2.0) + * @since 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 ) ); + return apply_filters( 'bp_messages_thread_current_threads', array( + 'threads' => &$threads, + 'total' => (int) $total_threads + ) ); } /** @@ -537,11 +552,10 @@ class BP_Messages_Thread { * 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) + * @since 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() ) { @@ -556,7 +570,7 @@ class BP_Messages_Thread { $meta_query = new WP_Meta_Query( $meta_query ); // WP_Meta_Query expects the table name at - // $wpdb->messagemeta + // $wpdb->messagemeta. $wpdb->messagemeta = buddypress()->messages->table_name_meta; return $meta_query->get_sql( 'message', 'm', 'id' ); @@ -568,16 +582,16 @@ class BP_Messages_Thread { /** * Mark a thread as read. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $thread_id The message thread ID. */ - public static function mark_as_read( $thread_id ) { + public static function mark_as_read( $thread_id = 0 ) { 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); + $wpdb->query( $sql ); wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' ); @@ -586,16 +600,16 @@ class BP_Messages_Thread { /** * Mark a thread as unread. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $thread_id The message thread ID. */ - public static function mark_as_unread( $thread_id ) { + public static function mark_as_unread( $thread_id = 0 ) { 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); + $wpdb->query( $sql ); wp_cache_delete( 'thread_recipients_' . $thread_id, 'bp_messages' ); wp_cache_delete( bp_loggedin_user_id(), 'bp_messages_unread_count' ); @@ -604,39 +618,40 @@ class BP_Messages_Thread { /** * Returns the total number of message threads for a user. * - * @since BuddyPress (1.0.0) + * @since 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 + * @return int $value Total thread count for the provided user. */ 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'; + $exclude_sender = $type_sql = ''; + 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 "; + 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 ) ); + 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) + * @since 1.0.0 * * @param int $thread_id The message thread ID. - * * @return bool */ public static function user_is_sender( $thread_id ) { @@ -646,7 +661,7 @@ class BP_Messages_Thread { $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 ) { + if ( empty( $sender_ids ) ) { return false; } @@ -656,10 +671,9 @@ class BP_Messages_Thread { /** * Returns the userlink of the last sender in a message thread. * - * @since BuddyPress (1.0.0) + * @since 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 ) { @@ -677,11 +691,10 @@ class BP_Messages_Thread { /** * Gets the unread message count for a user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $user_id The user ID. - * - * @return int + * @return int $unread_count Total inbox unread count for user. */ public static function get_inbox_count( $user_id = 0 ) { global $wpdb; @@ -703,7 +716,7 @@ class BP_Messages_Thread { /** * Filters a user's unread message count. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param int $unread_count Unread message count. * @param int $user_id ID of the user. @@ -714,22 +727,22 @@ class BP_Messages_Thread { /** * Checks whether a user is a part of a message thread discussion. * - * @since BuddyPress (1.0.0) + * @since 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; + if ( isset( $recipients[ $user_id ] ) && 0 == $recipients[ $user_id ]->is_deleted ) { + return $recipients[ $user_id ]->id; } else { return null; } @@ -738,14 +751,14 @@ class BP_Messages_Thread { /** * Checks whether a message thread exists. * - * @since BuddyPress (1.0.0) + * @since 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 + + // Bail if no thread ID is passed. if ( empty( $thread_id ) ) { return false; } @@ -767,15 +780,16 @@ class BP_Messages_Thread { * 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) + * @since 1.0.0 * * @param array $recipients Array containing the message recipients (array of objects). - * - * @return string + * @return string $value String of message recipent userlinks. */ public static function get_recipient_links( $recipients ) { - if ( count( $recipients ) >= 5 ) + + if ( count( $recipients ) >= 5 ) { return sprintf( __( '%s Recipients', 'buddypress' ), number_format_i18n( count( $recipients ) ) ); + } $recipient_links = array(); @@ -795,7 +809,7 @@ class BP_Messages_Thread { /** * Upgrade method for the older BP message thread DB table. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @todo We should remove this. No one is going to upgrade from v1.1, right? * @return bool @@ -807,7 +821,7 @@ class BP_Messages_Thread { $errors = false; $threads = $wpdb->get_results( "SELECT * FROM {$bp_prefix}bp_messages_threads" ); - // Nothing to update, just return true to remove the table + // Nothing to update, just return true to remove the table. if ( empty( $threads ) ) { return true; } @@ -817,19 +831,16 @@ class BP_Messages_Thread { foreach( (array) $threads as $thread ) { $message_ids = maybe_unserialize( $thread->message_ids ); - if ( !empty( $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 ) ) ) + // 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; + return (bool) ! $errors; } } diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..88659df3d14f01f2909027324e55670005499c9e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.css @@ -0,0 +1,80 @@ +.ac_results { + padding: 0px; + 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-position: outside; + list-style: none; + padding: 0; + margin: 0; + } + + .ac_results li { + margin: 0px; + 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 2px; + 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: 0.8em; + cursor: pointer; + } + +input#send-to-input { width: 275px; } diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..dfc07fad0ca575eb9153c2610e7c007e86d90df0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb-rtl.min.css @@ -0,0 +1 @@ +.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-messages/css/autocomplete/jquery.autocompletefb.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css index 8006cc12c0dfc96363f0bb049bf7ab9c53520e04..688195f92692bbf80a05cdb44461967e185415eb 100644 --- a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css @@ -34,10 +34,6 @@ margin-right: 5px; } -.ac_loading { - background : url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat; -} - .ac_odd { background-color: #f0f0f0; } @@ -82,4 +78,3 @@ ul.acfb-holder { } input#send-to-input { width: 275px; } - diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css index 5c4f759d0e201c530109765202a3421ead7fdcec..7f552188b11647123542b6be1d10b0c44838ce6e 100644 --- a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css @@ -1 +1 @@ -.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-position:outside;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_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat}.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 2px;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 +.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-messages/js/autocomplete/jquery.autocomplete.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js index b3116293773e1e0a970c57eeca41fb8b3b6b659c..aabee6aa008c8e99ec5f5f539baff8a19ca71182 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js +++ b/wp-content/plugins/buddypress/bp-messages/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-messages/js/autocomplete/jquery.autocomplete.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js index 811fd97ee5b3aa42308c9e6b2a191be0370e55b3..7841e418b91de3537d880a2fc573d5df9d6d3628 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js @@ -1,13 +1,2 @@ -/*! - * Autocomplete - jQuery plugin 1.0 Beta - * - * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer - * - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * Revision: $Id: jquery.autocomplete.js 4485 2008-01-20 13:52:47Z joern.zaefferer $ - * - */ -;(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";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(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){if(!g.multiple){b.blur()}x.preventDefault();b.focus()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(){}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A<B.length;A++){if(B[A].result.toLowerCase()==C.toLowerCase()){z=B[A];break}}}if(typeof x=="function"){x(z)}else{b.trigger("result",z&&[z.data,z.value])}}a.each(h(b.val()),function(z,A){f(A,y,y)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind()});function d(){var y=r.selected();if(!y){return false}var x=y.result;p=x;if(g.multiple){var z=h(b.val());if(z.length>1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);jQuery("#send-to-input").addClass("loading");if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(a.trim(g.multipleSeparator));var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);var x=y[0].value.split(";");y.value=x[0];q(z,y.value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(y),limit:g.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y<z.length;y++){var B=a.trim(z[y]);if(B){B=B.split("|");x[x.length]={data:B,value:B[0],result:g.formatResult&&g.formatResult(B,B[0])||B[0]}}}return x}function n(){b.removeClass(g.loadingClass);jQuery("#send-to-input").removeClass("loading")}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:250,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatItem(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("<ul>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li>").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery); \ No newline at end of file +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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-messages/js/autocomplete/jquery.autocompletefb.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js index 5e637a5abb507ed5ed86b2b428b086ec126d584b..24d3c6272f87d3c0d2d73c482ad208d2d1510612 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js @@ -13,7 +13,6 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ - jQuery.fn.autoCompletefb = function(options) { var tmp = this; @@ -52,21 +51,21 @@ jQuery.fn.autoCompletefb = function(options) var f = settings.foundClass.replace(/\./,''); var d = String(d).split(' ('); var un = d[1].substr(0, d[1].length-1); - + /* Don't add the same user multiple times */ - if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) { + if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) { var ln = '#link-' + un; var l = jQuery(ln).attr('href'); var v = '<li class="'+f+'" id="un-'+un+'"><span><a href="'+l+'">'+d[0]+'</a></span> <span class="p">X</span></li>'; - + var x = jQuery(settings.inputClass,tmp).before(v); jQuery('#send-to-usernames').addClass(un); - + jQuery('.p',x[0].previousSibling).click(function(){ acfb.removeFind(this); }); - } - + } + jQuery(settings.inputClass,tmp).val(''); }); diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js index 539ff4afd567c8ea756b10ab0b9941fee534b6db..fa87e0b88156e056a08a7bd4815ecd6d69e96ce0 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js @@ -1,16 +1,2 @@ -/*! - * jQuery plugin: autoCompletefb(AutoComplete Facebook) - * @requires jQuery v1.2.2 or later - * using plugin:jquery.autocomplete.js - * - * Credits: - * - Idea: Facebook - * - Guillermo Rauch: Original MooTools script - * - InteRiders <http://interiders.com/> - * - * Copyright (c) 2008 Widi Harsojo <wharsojo@gmail.com>, http://wharsojo.wordpress.com/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;jQuery.fn.autoCompletefb=function(b){var c=this;var d={ul:c,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};if(b){jQuery.extend(d,b)}var a={params:d,removeFind:function(e){a.removeUsername(e);jQuery(e).unbind("click").parent().remove();jQuery(d.inputClass,c).focus();return c.acfb},removeUsername:function(f){var e=f.parentNode.id.substr(f.parentNode.id.indexOf("-")+1);jQuery("#send-to-usernames").removeClass(e)}};jQuery(d.foundClass+" img.p").click(function(){a.removeFind(this)});jQuery(d.inputClass,c).autocomplete(d.urlLookup,d.acOptions);jQuery(d.inputClass,c).result(function(n,o,m){var m=d.foundClass.replace(/\./,"");var o=String(o).split(" (");var j=o[1].substr(0,o[1].length-1);if(0===jQuery(d.inputClass).siblings("#un-"+j).length){var k="#link-"+j;var h=jQuery(k).attr("href");var i='<li class="'+m+'" id="un-'+j+'"><span><a href="'+h+'">'+o[0]+'</a></span> <span class="p">X</span></li>';var g=jQuery(d.inputClass,c).before(i);jQuery("#send-to-usernames").addClass(j);jQuery(".p",g[0].previousSibling).click(function(){a.removeFind(this)})}jQuery(d.inputClass,c).val("")});jQuery(d.inputClass,c).focus();return a}; \ No newline at end of file +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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-messages/js/autocomplete/jquery.bgiframe.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js index 690f3e1ad8d34c509aa0203ee4ea740e0b7e5c6f..f0330bd5ed0db440b008692a54516f6bdea6f908 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js @@ -1,6 +1,2 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (license.bgiframe.txt). - * - * Version 2.1.2 - */ -(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery); \ No newline at end of file +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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-messages/js/autocomplete/jquery.dimensions.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js index 20c46bc948d9f57afefb3385caf93c857128fd36..c8161823a94cc9d232d9674c5d9ebe7bdf95c7ba 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js @@ -1,13 +1,2 @@ -/*! - * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - * $LastChangedDate: 2007-09-11 05:38:31 +0300 (Вт, 11 сен 2007) $ - * $Rev: 3238 $ - * - * Version: @VERSION - * - * Requires: jQuery 1.2+ - */ -(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this[c.toLowerCase()]()+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var g=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});return this[c.toLowerCase()]()+a(this,"border"+g+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+g)+a(this,"padding"+e)+(f.margin?(a(this,"margin"+g)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});var a=function(c,d){return parseInt(b.css(c.jquery?c[0]:c,d))||0}})(jQuery); \ No newline at end of file +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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-notifications/bp-notifications-actions.php b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php index a1009675c9719300f61e5da6d9e3dad835327cd3..5d3c71cc6e2338290fb154b64409d09584699691 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-actions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress Notifications Actions + * BuddyPress Notifications 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 user @@ -9,43 +8,44 @@ * * @package BuddyPress * @subpackage NotificationsActions + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Handle marking single notifications as read. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool */ function bp_notifications_action_mark_read() { - // Bail if not the unread screen + // Bail if not the unread screen. if ( ! bp_is_notifications_component() || ! bp_is_current_action( 'unread' ) ) { return false; } - // Get the action + // Get the action. $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; $nonce = !empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; $id = !empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : ''; - // Bail if no action or no ID + // Bail if no action or no ID. if ( ( 'read' !== $action ) || empty( $id ) || empty( $nonce ) ) { return false; } - // Check the nonce and mark the notification + // Check the nonce and mark the notification. if ( bp_verify_nonce_request( 'bp_notification_mark_read_' . $id ) && bp_notifications_mark_notification( $id, false ) ) { bp_core_add_message( __( 'Notification successfully marked read.', 'buddypress' ) ); } else { bp_core_add_message( __( 'There was a problem marking that notification.', 'buddypress' ), 'error' ); } - // Redirect + // Redirect. bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/unread/' ); } add_action( 'bp_actions', 'bp_notifications_action_mark_read' ); @@ -53,35 +53,35 @@ add_action( 'bp_actions', 'bp_notifications_action_mark_read' ); /** * Handle marking single notifications as unread. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool */ function bp_notifications_action_mark_unread() { - // Bail if not the read screen + // Bail if not the read screen. if ( ! bp_is_notifications_component() || ! bp_is_current_action( 'read' ) ) { return false; } - // Get the action + // Get the action. $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; $nonce = !empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; $id = !empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : ''; - // Bail if no action or no ID + // Bail if no action or no ID. if ( ( 'unread' !== $action ) || empty( $id ) || empty( $nonce ) ) { return false; } - // Check the nonce and mark the notification + // Check the nonce and mark the notification. if ( bp_verify_nonce_request( 'bp_notification_mark_unread_' . $id ) && bp_notifications_mark_notification( $id, true ) ) { bp_core_add_message( __( 'Notification successfully marked unread.', 'buddypress' ) ); } else { bp_core_add_message( __( 'There was a problem marking that notification.', 'buddypress' ), 'error' ); } - // Redirect + // Redirect. bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/read/' ); } add_action( 'bp_actions', 'bp_notifications_action_mark_unread' ); @@ -89,35 +89,35 @@ add_action( 'bp_actions', 'bp_notifications_action_mark_unread' ); /** * Handle deleting single notifications. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return bool */ function bp_notifications_action_delete() { - // Bail if not the read or unread screen + // 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 + // Get the action. $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; $nonce = !empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; $id = !empty( $_GET['notification_id'] ) ? $_GET['notification_id'] : ''; - // Bail if no action or no ID + // Bail if no action or no ID. if ( ( 'delete' !== $action ) || empty( $id ) || empty( $nonce ) ) { return false; } - // Check the nonce and delete the notification + // Check the nonce and delete the notification. if ( bp_verify_nonce_request( 'bp_notification_delete_' . $id ) && bp_notifications_delete_notification( $id ) ) { bp_core_add_message( __( 'Notification successfully deleted.', 'buddypress' ) ); } else { bp_core_add_message( __( 'There was a problem deleting that notification.', 'buddypress' ), 'error' ); } - // Redirect + // Redirect. bp_core_redirect( bp_displayed_user_domain() . bp_get_notifications_slug() . '/' . bp_current_action() . '/' ); } add_action( 'bp_actions', 'bp_notifications_action_delete' ); @@ -125,7 +125,7 @@ add_action( 'bp_actions', 'bp_notifications_action_delete' ); /** * Handles bulk management (mark as read/unread, delete) of notifications. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @return bool */ @@ -136,7 +136,7 @@ function bp_notifications_action_bulk_manage() { return false; } - // Get the action + // 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'] : ''; @@ -178,7 +178,7 @@ function bp_notifications_action_bulk_manage() { break; } - // Redirect + // 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 bd2f8785470db80b0496cc24a94e0cc72ff1ab54..5d213c629253890dc80455d22833c94b6d5d8f99 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-adminbar.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Notifications Admin Bar functions. * @@ -7,15 +6,18 @@ * * @package BuddyPress * @subpackage NotificationsToolbar + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Build the "Notifications" dropdown. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @return bool */ function bp_notifications_toolbar_menu() { global $wp_admin_bar; @@ -30,7 +32,7 @@ function bp_notifications_toolbar_menu() { $menu_title = '<span id="ab-pending-notifications" class="' . $alert_class . '">' . number_format_i18n( $count ) . '</span>'; $menu_link = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() ); - // Add the top-level Notifications button + // Add the top-level Notifications button. $wp_admin_bar->add_menu( array( 'parent' => 'top-secondary', 'id' => 'bp-notifications', 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 d4b0c639d20ffb7b627791a4500d64957db774a1..3d59e770fdc8301bcbc40722068a0dafe1c31d40 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-cache.php @@ -1,11 +1,15 @@ <?php - /** * Functions related to notifications caching. * - * @since BuddyPress (2.0.0) + * @package BuddyPress + * @subpackage NotificationsCache + * @since 2.0.0 */ +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + /** * Slurp up metadata for a set of notifications. * @@ -13,29 +17,29 @@ * 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) + * @since 2.3.0 * - * @param int|str|array $notification_ids Accepts a single notification_id, or a - * comma-separated list or array of - * notification ids. + * @param int|string|array|bool $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, + 'object_ids' => $notification_ids, + 'object_type' => buddypress()->notifications->id, 'cache_group' => 'notification_meta', 'object_column' => 'notification_id', - 'meta_table' => buddypress()->notifications->table_name_meta, + 'meta_table' => buddypress()->notifications->table_name_meta, 'cache_key_prefix' => 'bp_notifications_meta' ) ); } /** - * Clear all notifications cache for a given user ID + * Clear all notifications cache for a given user ID. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param int $user_id The user ID's cache to clear + * @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' ); @@ -44,7 +48,7 @@ function bp_notifications_clear_all_for_user_cache( $user_id = 0 ) { /** * Invalidate 'all_for_user_' cache when saving. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_Notifications_Notification $n Notification object. */ @@ -56,13 +60,13 @@ add_action( 'bp_notification_after_save', 'bp_notifications_clear_all_for_user_c /** * Invalidate the 'all_for_user_' cache when deleting. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @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) + // Pull up a list of items matching the args (those about te be deleted). $ns = BP_Notifications_Notification::get( $args ); $user_ids = array(); @@ -80,18 +84,18 @@ add_action( 'bp_notification_before_delete', 'bp_notifications_clear_all_for_use /** * Invalidates 'all_for_user_' cache when updating. * - * @since BuddyPress (2.3.0) + * @since 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 + // 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 + // 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 ); 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 b96a6cc8f45cc87e3494acbbb24b0109e043e938..c6ed68e7a5c1f90953d721b3b4f2173ffce89c51 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-classes.php @@ -1,16 +1,15 @@ <?php /** - * BuddyPress Notifications Classes + * BuddyPress Notifications Classes. * * Classes used for the Notifications component. * * @package BuddyPress * @subpackage NotificationsClasses - * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; 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 75228d79d1e2d5173806d128dc557083341f6a4b..4e4610c74f33f458394acd512768807e4ed5e930 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-functions.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Notifications Functions. * @@ -7,34 +6,35 @@ * * @package BuddyPress * @subpackage NotificationsFunctions + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Add a notification for a specific user, from a specific component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param array $args { * Array of arguments describing the notification. All are optional. - * @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. - * @type string $component_name Name of the component to associate the - * notification with. - * @type string $component_action Name of the action to associate the - * notification with. - * @type string $date_notified Timestamp for the notification. + * @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. + * @type string $component_name Name of the component to associate the + * notification with. + * @type string $component_action Name of the action to associate the + * notification with. + * @type string $date_notified Timestamp for the notification. * } * @return int|bool ID of the newly created notification on success, false - * on failure. + * on failure. */ function bp_notifications_add_notification( $args = array() ) { - $r = wp_parse_args( $args, array( + $r = bp_parse_args( $args, array( 'user_id' => 0, 'item_id' => 0, 'secondary_item_id' => 0, @@ -43,12 +43,12 @@ function bp_notifications_add_notification( $args = array() ) { 'date_notified' => bp_core_current_time(), 'is_new' => 1, 'allow_duplicate' => false, - ) ); + ), 'notifications_add_notification' );; - // Check for existing duplicate notifications + // Check for existing duplicate notifications. if ( ! $r['allow_duplicate'] ) { - // date_notified, allow_duplicate don't count toward - // duplicate status + // Date_notified, allow_duplicate don't count toward + // duplicate status. $existing = BP_Notifications_Notification::get( array( 'user_id' => $r['user_id'], 'item_id' => $r['item_id'], @@ -63,7 +63,7 @@ function bp_notifications_add_notification( $args = array() ) { } } - // Setup the new notification + // Setup the new notification. $notification = new BP_Notifications_Notification; $notification->user_id = $r['user_id']; $notification->item_id = $r['item_id']; @@ -73,17 +73,17 @@ function bp_notifications_add_notification( $args = array() ) { $notification->date_notified = $r['date_notified']; $notification->is_new = $r['is_new']; - // Save the new notification + // Save the new notification. return $notification->save(); } /** * Get a specific notification by its ID. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $id ID of the notification. - * @return BP_Notifications_Notification + * @return BP_Notifications_Notification Notification object for ID specified. */ function bp_notifications_get_notification( $id ) { return new BP_Notifications_Notification( $id ); @@ -92,7 +92,7 @@ function bp_notifications_get_notification( $id ) { /** * Delete a specific notification by its ID. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $id ID of the notification to delete. * @return bool True on success, false on failure. @@ -110,10 +110,10 @@ function bp_notifications_delete_notification( $id ) { * * Used when clearing out notifications for a specific notification item. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $id ID of the user whose notifications are being deleted. - * @param int $is_new 0 for read, 1 for unread. + * @param int $id ID of the notification. + * @param int|bool $is_new 0 for read, 1 for unread. * @return bool True on success, false on failure. */ function bp_notifications_mark_notification( $id, $is_new = false ) { @@ -130,19 +130,19 @@ function bp_notifications_mark_notification( $id, $is_new = false ) { /** * Get all notifications for a user and cache them. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param int $user_id ID of the user whose notifications are being fetched. - * @return array + * @return array $notifications Array of notifications for user. */ function bp_notifications_get_all_notifications_for_user( $user_id = 0 ) { - // Default to displayed user if no ID is passed + // Default to displayed user if no ID is passed. if ( empty( $user_id ) ) { $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); } - // Get notifications out of the cache, or query if necessary + // Get notifications out of the cache, or query if necessary. $notifications = wp_cache_get( 'all_for_user_' . $user_id, 'bp_notifications' ); if ( false === $notifications ) { $notifications = BP_Notifications_Notification::get( array( @@ -154,7 +154,7 @@ function bp_notifications_get_all_notifications_for_user( $user_id = 0 ) { /** * Filters all notifications for a user. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $notifications Array of notifications for user. * @param int $user_id ID of the user being fetched. @@ -165,60 +165,68 @@ function bp_notifications_get_all_notifications_for_user( $user_id = 0 ) { /** * Get notifications for a specific user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications are being fetched. - * @param string $format Format of the returned values. 'string' returns HTML, - * while 'object' returns a structured object for parsing. + * @param int $user_id ID of the user whose notifications are being fetched. + * @param string $format Format of the returned values. 'string' returns HTML, + * while 'object' returns a structured object for parsing. * @return mixed Object or array on success, false on failure. */ function bp_notifications_get_notifications_for_user( $user_id, $format = 'string' ) { - // Setup local variables + // Setup local variables. $bp = buddypress(); - // Get notifications (out of the cache, or query if necessary) + // Get notifications (out of the cache, or query if necessary). $notifications = bp_notifications_get_all_notifications_for_user( $user_id ); - $grouped_notifications = array(); // Notification groups - $renderable = array(); // Renderable notifications + $grouped_notifications = array(); // Notification groups. + $renderable = array(); // Renderable notifications. - // Group notifications by component and component_action and provide totals + // Group notifications by component and component_action and provide totals. for ( $i = 0, $count = count( $notifications ); $i < $count; ++$i ) { $notification = $notifications[$i]; $grouped_notifications[$notification->component_name][$notification->component_action][] = $notification; } - // Bail if no notification groups + // Bail if no notification groups. if ( empty( $grouped_notifications ) ) { return false; } - // Calculate a renderable output for each notification type + // Calculate a renderable output for each notification type. foreach ( $grouped_notifications as $component_name => $action_arrays ) { - // Skip if group is empty + // We prefer that extended profile component-related notifications use + // the component_name of 'xprofile'. However, the extended profile child + // object in the $bp object is keyed as 'profile', which is where we need + // to look for the registered notification callback. + if ( 'xprofile' == $component_name ) { + $component_name = 'profile'; + } + + // Skip if group is empty. if ( empty( $action_arrays ) ) { continue; } - // Loop through each actionable item and try to map it to a component + // Loop through each actionable item and try to map it to a component. foreach ( (array) $action_arrays as $component_action_name => $component_action_items ) { - // Get the number of actionable items + // Get the number of actionable items. $action_item_count = count( $component_action_items ); - // Skip if the count is less than 1 + // Skip if the count is less than 1. if ( $action_item_count < 1 ) { continue; } - // Callback function exists + // Callback function exists. if ( isset( $bp->{$component_name}->notification_callback ) && is_callable( $bp->{$component_name}->notification_callback ) ) { - // Function should return an object + // Function should return an object. if ( 'object' === $format ) { - // Retrieve the content of the notification using the callback + // Retrieve the content of the notification using the callback. $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, @@ -228,11 +236,11 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin 'array' ); - // Create the object to be returned + // Create the object to be returned. $notification_object = $component_action_items[0]; // Minimal backpat with non-compatible notification - // callback functions + // callback functions. if ( is_string( $content ) ) { $notification_object->content = $content; $notification_object->href = bp_loggedin_user_domain(); @@ -243,7 +251,7 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin $renderable[] = $notification_object; - // Return an array of content strings + // Return an array of content strings. } else { $content = call_user_func( $bp->{$component_name}->notification_callback, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); $renderable[] = $content; @@ -253,10 +261,10 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin } elseif ( isset( $bp->{$component_name}->format_notification_function ) && function_exists( $bp->{$component_name}->format_notification_function ) ) { $renderable[] = call_user_func( $bp->{$component_name}->format_notification_function, $component_action_name, $component_action_items[0]->item_id, $component_action_items[0]->secondary_item_id, $action_item_count ); - // Allow non BuddyPress components to hook in + // Allow non BuddyPress components to hook in. } else { - // The array to reference with apply_filters_ref_array() + // The array to reference with apply_filters_ref_array(). $ref_array = array( $component_action_name, $component_action_items[0]->item_id, @@ -265,23 +273,23 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin $format ); - // Function should return an object + // Function should return an object. if ( 'object' === $format ) { /** * Filters the notifications for a user. * - * @since BuddyPress (1.9.0) + * @since 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 + // Create the object to be returned. $notification_object = $component_action_items[0]; // Minimal backpat with non-compatible notification - // callback functions + // callback functions. if ( is_string( $content ) ) { $notification_object->content = $content; $notification_object->href = bp_loggedin_user_domain(); @@ -292,7 +300,7 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin $renderable[] = $notification_object; - // Return an array of content strings + // Return an array of content strings. } else { /** This filters is documented in bp-notifications/bp-notifications-functions.php */ @@ -302,7 +310,7 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin } } - // If renderable is empty array, set to false + // If renderable is empty array, set to false. if ( empty( $renderable ) ) { $renderable = false; } @@ -310,9 +318,9 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin /** * Filters the final array of notifications to be displayed for a user. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param Array|Bool $renderable Array of notifications to render or false if no notifications. + * @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. */ @@ -327,10 +335,10 @@ function bp_notifications_get_notifications_for_user( $user_id, $format = 'strin * Used when clearing out notifications for a specific component when the user * has visited that component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications are being deleted. - * @param string $component_name Name of the associated component. + * @param int $user_id ID of the user whose notifications 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. */ @@ -348,13 +356,13 @@ function bp_notifications_delete_notifications_by_type( $user_id, $component_nam * Used when clearing out notifications for a specific component when the user * has visited that component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications are being deleted. - * @param int $item_id ID of the associated item. - * @param string $component_name Name of the associated component. - * @param string $component_action Name of the associated action. - * @param int $secondary_item_id ID of the secondary associated item. + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int $item_id ID of the associated item. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $secondary_item_id ID of the secondary associated item. * @return bool True on success, false on failure. */ function bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) { @@ -372,12 +380,12 @@ function bp_notifications_delete_notifications_by_item_id( $user_id, $item_id, $ * * Used when clearing out notifications for an entire component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $item_id ID of the user whose notifications are being deleted. - * @param string $component_name Name of the associated component. - * @param string $component_action Optional. Name of the associated action. - * @param int $secondary_item_id Optional. ID of the secondary associated item. + * @param int $item_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string|bool $component_action Optional. Name of the associated action. + * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. * @return bool True on success, false on failure. */ function bp_notifications_delete_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false ) { @@ -398,10 +406,10 @@ function bp_notifications_delete_all_notifications_by_type( $item_id, $component * are associated with that user. However, this will only be true with * certain components (such as Friends). Use with caution! * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose associated items are being deleted. - * @param string $component_name Name of the associated component. + * @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. */ @@ -413,6 +421,26 @@ function bp_notifications_delete_notifications_from_user( $user_id, $component_n ) ); } +/** + * Delete a user's notifications when the user is deleted. + * + * @since 2.5.0 + * + * @param int $user_id ID of the user who is about to be deleted. + * @return int|bool The number of rows deleted, or false on error. + */ +function bp_notifications_delete_notifications_on_user_delete( $user_id ) { + return BP_Notifications_Notification::delete( array( + 'user_id' => $user_id, + 'item_id' => false, + 'secondary_item_id' => false, + 'component_action' => false, + 'component_name' => false, + ) ); +} +add_action( 'wpmu_delete_user', 'bp_notifications_delete_notifications_on_user_delete' ); +add_action( 'delete_user', 'bp_notifications_delete_notifications_on_user_delete' ); + /** Mark **********************************************************************/ /** @@ -421,12 +449,12 @@ function bp_notifications_delete_notifications_from_user( $user_id, $component_n * Used when clearing out notifications for a specific component when the user * has visited that component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications are being deleted. - * @param string $component_name Name of the associated component. - * @param string $component_action Name of the associated action. - * @param int $is_new 0 for read, 1 for unread. + * @param int $user_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $is_new 0 for read, 1 for unread. * @return bool True on success, false on failure. */ function bp_notifications_mark_notifications_by_type( $user_id, $component_name, $component_action, $is_new = false ) { @@ -448,14 +476,14 @@ function bp_notifications_mark_notifications_by_type( $user_id, $component_name, * Used when clearing out notifications for a specific component when the user * has visited that component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications are being deleted. - * @param int $item_id ID of the associated item. - * @param string $component_name Name of the associated component. - * @param string $component_action Name of the associated action. - * @param int $secondary_item_id ID of the secondary associated item. - * @param int $is_new 0 for read, 1 for unread. + * @param int $user_id ID of the user whose notifications are being deleted. + * @param int $item_id ID of the associated item. + * @param string $component_name Name of the associated component. + * @param string $component_action Name of the associated action. + * @param int|bool $secondary_item_id ID of the secondary associated item. + * @param int|bool $is_new 0 for read, 1 for unread. * @return bool True on success, false on failure. */ function bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false, $is_new = false ) { @@ -478,14 +506,13 @@ function bp_notifications_mark_notifications_by_item_id( $user_id, $item_id, $co * * Used when clearing out notifications for an entire component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user whose notifications 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 Optional. Name of the associated action. - * @param int $secondary_item_id Optional. ID of the secondary associated item. - * @param int $is_new 0 for read, 1 for unread. + * @param int $item_id ID of the user whose notifications are being deleted. + * @param string $component_name Name of the associated component. + * @param string|bool $component_action Optional. Name of the associated action. + * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. + * @param int|bool $is_new 0 for read, 1 for unread. * @return bool True on success, false on failure. */ function bp_notifications_mark_all_notifications_by_type( $item_id, $component_name, $component_action = false, $secondary_item_id = false, $is_new = false ) { @@ -511,13 +538,12 @@ function bp_notifications_mark_all_notifications_by_type( $item_id, $component_n * are associated with that user. However, this will only be true with * certain components (such as Friends). Use with caution! * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @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. - * @param int $is_new 0 for read, 1 for unread. + * @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. + * @param int|bool $is_new 0 for read, 1 for unread. * @return bool True on success, false on failure. */ function bp_notifications_mark_notifications_from_user( $user_id, $component_name, $component_action, $is_new = false ) { @@ -540,9 +566,9 @@ function bp_notifications_mark_notifications_from_user( $user_id, $component_nam * * Used before deleting a notification for a user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user being checked. + * @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. */ @@ -553,10 +579,10 @@ function bp_notifications_check_notification_access( $user_id, $notification_id /** * Get a count of unread notification items for a user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user whose unread notifications are being - * counted. + * counted. * @return int Unread notification count. */ function bp_notifications_get_unread_notification_count( $user_id = 0 ) { @@ -566,7 +592,7 @@ function bp_notifications_get_unread_notification_count( $user_id = 0 ) { /** * Filters the count of unread notification items for a user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $count Count of unread notification items for a user. */ @@ -577,34 +603,39 @@ function bp_notifications_get_unread_notification_count( $user_id = 0 ) { * Return an array of component names that are currently active and have * registered Notifications callbacks. * - * @since BuddyPress (1.9.1) + * @since 1.9.1 * * @see http://buddypress.trac.wordpress.org/ticket/5300 * - * @return array + * @return array $component_names Array of registered components. */ function bp_notifications_get_registered_components() { - // Load BuddyPress + // Load BuddyPress. $bp = buddypress(); - // Setup return value + // Setup return value. $component_names = array(); - // Get the active components + // Get the active components. $active_components = array_keys( $bp->active_components ); - // Loop through components, look for callbacks, add to return value + // Loop through components, look for callbacks, add to return value. foreach ( $active_components as $component ) { if ( !empty( $bp->$component->notification_callback ) ) { $component_names[] = $component; } + // The extended profile component is identified in the active_components array as 'xprofile'. + // However, the extended profile child object has the key 'profile' in the $bp object. + if ( 'xprofile' == $component && ! empty( $bp->profile->notification_callback ) ) { + $component_names[] = $component; + } } /** * Filters active components with registered notifications callbacks. * - * @since BuddyPress (1.9.1) + * @since 1.9.1 * * @param array $component_names Array of registered component names. * @param array $active_components Array of active components. @@ -617,7 +648,7 @@ function bp_notifications_get_registered_components() { /** * Delete a meta entry from the DB for a notification item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @global object $wpdb WordPress database access object. * @@ -628,22 +659,21 @@ function bp_notifications_get_registered_components() { * @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. - * + * 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 + // 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 + // With no meta_key, ignore $delete_all. $delete_all = false; } else { $keys = array( $meta_key ); @@ -663,7 +693,7 @@ function bp_notifications_delete_meta( $notification_id, $meta_key = '', $meta_v /** * Get metadata for a given notification item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @uses apply_filters() To call the 'bp_notifications_get_meta' hook. * @@ -672,9 +702,8 @@ function bp_notifications_delete_meta( $notification_id, $meta_key = '', $meta_v * 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. - * + * 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 ) { @@ -685,7 +714,7 @@ function bp_notifications_get_meta( $notification_id = 0, $meta_key = '', $singl /** * Filters the metadata for a specified notification item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param mixed $retval The meta values for the notification item. * @param int $notification_id ID of the notification item. @@ -698,7 +727,7 @@ function bp_notifications_get_meta( $notification_id = 0, $meta_key = '', $singl /** * Update a piece of notification meta. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param int $notification_id ID of the notification item whose metadata is being * updated. @@ -707,7 +736,6 @@ function bp_notifications_get_meta( $notification_id = 0, $meta_key = '', $singl * @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 @@ -724,7 +752,7 @@ function bp_notifications_update_meta( $notification_id, $meta_key, $meta_value, /** * Add a piece of notification metadata. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param int $notification_id ID of the notification item. * @param string $meta_key Metadata key. @@ -732,7 +760,6 @@ function bp_notifications_update_meta( $notification_id, $meta_key, $meta_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 ) { 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 8c52a6880235d4507bb3d3cc835315796cb542cb..c48060da610dd2dd38039c1ed11fdc539141357f 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-loader.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Member Notifications Loader. * @@ -7,261 +6,18 @@ * * @package BuddyPress * @subpackage NotificationsLoader - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Notifications_Component extends BP_Component { - - /** - * Start the notifications component creation process. - * - * @since BuddyPress (1.9.0) - */ - public function __construct() { - parent::start( - 'notifications', - _x( 'Notifications', 'Page <title>', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 30 - ) - ); - } - - /** - * Include notifications component files. - * - * @since BuddyPress (1.9.0) - * - * @see BP_Component::includes() for a description of arguments. - * - * @param array $includes See BP_Component::includes() for a description. - */ - public function includes( $includes = array() ) { - $includes = array( - 'actions', - 'classes', - 'screens', - 'adminbar', - 'template', - 'functions', - 'cache', - ); - - parent::includes( $includes ); - } - - /** - * Set up component global data. - * - * @since BuddyPress (1.9.0) - * - * @see BP_Component::setup_globals() for a description of arguments. - * - * @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 ); - } - - // Global tables for the notifications component - $global_tables = array( - 'table_name' => $bp->table_prefix . 'bp_notifications', - 'table_name_meta' => $bp->table_prefix . 'bp_notifications_meta', - ); - - // All globals for the notifications component. - // Note that global_tables is included in this array. - $args = array( - 'slug' => BP_NOTIFICATIONS_SLUG, - 'has_directory' => false, - 'search_string' => __( 'Search Notifications...', 'buddypress' ), - 'global_tables' => $global_tables, - ); - - parent::setup_globals( $args ); - } - - /** - * Set up component navigation. - * - * @since BuddyPress (1.9.0) - * - * @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. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Only grab count if we're on a user page and current user has access - if ( bp_is_user() && bp_user_has_access() ) { - $count = bp_notifications_get_unread_notification_count( bp_displayed_user_id() ); - $class = ( 0 === $count ) ? 'no-count' : 'count'; - $nav_name = sprintf( _x( 'Notifications <span class="%s">%s</span>', 'Profile screen nav', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) ); - } else { - $nav_name = _x( 'Notifications', 'Profile screen nav', 'buddypress' ); - } - - // Add 'Notifications' to the main navigation - $main_nav = array( - 'name' => $nav_name, - 'slug' => $this->slug, - 'position' => 30, - 'show_for_displayed_user' => bp_core_can_edit_settings(), - 'screen_function' => 'bp_notifications_screen_unread', - 'default_subnav_slug' => 'unread', - 'item_css_id' => $this->id, - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - $notifications_link = trailingslashit( $user_domain . bp_get_notifications_slug() ); - - // Add the subnav items to the notifications nav item - $sub_nav[] = array( - 'name' => _x( 'Unread', 'Notification screen nav', 'buddypress' ), - 'slug' => 'unread', - 'parent_url' => $notifications_link, - 'parent_slug' => bp_get_notifications_slug(), - 'screen_function' => 'bp_notifications_screen_unread', - 'position' => 10, - 'item_css_id' => 'notifications-my-notifications', - 'user_has_access' => bp_core_can_edit_settings(), - ); - - $sub_nav[] = array( - 'name' => _x( 'Read', 'Notification screen nav', 'buddypress' ), - 'slug' => 'read', - 'parent_url' => $notifications_link, - 'parent_slug' => bp_get_notifications_slug(), - 'screen_function' => 'bp_notifications_screen_read', - 'position' => 20, - 'user_has_access' => bp_core_can_edit_settings(), - ); - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the component entries in the WordPress Admin Bar. - * - * @since BuddyPress (1.9.0) - * - * @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. - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $notifications_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); - - // Pending notification requests - $count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ); - if ( ! empty( $count ) ) { - $title = sprintf( _x( 'Notifications <span class="count">%s</span>', 'My Account Notification pending', 'buddypress' ), number_format_i18n( $count ) ); - $unread = sprintf( _x( 'Unread <span class="count">%s</span>', 'My Account Notification pending', 'buddypress' ), number_format_i18n( $count ) ); - } else { - $title = _x( 'Notifications', 'My Account Notification', 'buddypress' ); - $unread = _x( 'Unread', 'My Account Notification sub nav', 'buddypress' ); - } - - // Add the "My Account" sub menus - $wp_admin_nav[] = array( - 'parent' => buddypress()->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => $title, - 'href' => trailingslashit( $notifications_link ), - ); - - // Unread - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-unread', - 'title' => $unread, - 'href' => trailingslashit( $notifications_link ), - ); - - // Read - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-read', - 'title' => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ), - 'href' => trailingslashit( $notifications_link . 'read' ), - ); - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Set up the title for pages and <title>. - * - * @since BuddyPress (1.9.0) - */ - public function setup_title() { - $bp = buddypress(); - - // Adjust title - if ( bp_is_notifications_component() ) { - if ( bp_is_my_profile() ) { - $bp->bp_options_title = __( 'Notifications', 'buddypress' ); - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - 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(); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-notifications-component.php'; /** * Bootstrap the Notifications component. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_setup_notifications() { buddypress()->notifications = new BP_Notifications_Component(); 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 1971ed7b72e0e14026accd220a3200e868348392..af33f49598ea4f879f0d2afce3f9c238d7bae9da 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-screens.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress Notifications Screen Functions. * @@ -9,29 +8,30 @@ * * @package BuddyPress * @subpackage NotificationsScreens + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Catch and route the 'unread' notifications screen. * - * @since BuddyPress (1.9.0) + * @since 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) + * @since 1.9.0 */ do_action( 'bp_notifications_screen_unread' ); /** * Filters the template to load for the notifications unread screen. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $template Path to the notifications unread template to load. */ @@ -41,21 +41,21 @@ function bp_notifications_screen_unread() { /** * Catch and route the 'read' notifications screen. * - * @since BuddyPress (1.9.0) + * @since 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) + * @since 1.9.0 */ do_action( 'bp_notifications_screen_read' ); /** * Filters the template to load for the notifications read screen. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $template Path to the notifications read template to load. */ @@ -65,7 +65,7 @@ function bp_notifications_screen_read() { /** * Catch and route the 'settings' notifications screen. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_screen_settings() { 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 027250a56236164fa2f0fc2c6131304c9ac82497..053c6442057f2ce91b6d9e57047aa055f1c04d89 100644 --- a/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php +++ b/wp-content/plugins/buddypress/bp-notifications/bp-notifications-template.php @@ -1,19 +1,21 @@ <?php - /** - * BuddyPress Notifications Template Functions + * BuddyPress Notifications Template Functions. * * @package BuddyPress * @subpackage TonificationsTemplate + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-notifications-template.php'; + /** * Output the notifications component slug. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_slug() { echo bp_get_notifications_slug(); @@ -21,7 +23,7 @@ function bp_notifications_slug() { /** * Return the notifications component slug. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Slug of the Notifications component. */ @@ -30,7 +32,7 @@ function bp_notifications_slug() { /** * Filters the notifications component slug. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $slug Notifications component slug. */ @@ -40,7 +42,7 @@ function bp_notifications_slug() { /** * Output the notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_permalink() { echo bp_get_notifications_permalink(); @@ -48,7 +50,7 @@ function bp_notifications_permalink() { /** * Return the notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Notifications permalink. */ @@ -58,7 +60,7 @@ function bp_notifications_permalink() { /** * Filters the notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval Permalink for the notifications. */ @@ -68,7 +70,7 @@ function bp_notifications_permalink() { /** * Output the unread notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_unread_permalink() { echo bp_get_notifications_unread_permalink(); @@ -76,7 +78,7 @@ function bp_notifications_unread_permalink() { /** * Return the unread notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Unread notifications permalink. */ @@ -86,7 +88,7 @@ function bp_notifications_unread_permalink() { /** * Filters the unread notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval Permalink for the unread notifications. */ @@ -96,7 +98,7 @@ function bp_notifications_unread_permalink() { /** * Output the read notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_read_permalink() { echo bp_get_notifications_read_permalink(); @@ -104,7 +106,7 @@ function bp_notifications_read_permalink() { /** * Return the read notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Read notifications permalink. */ @@ -114,376 +116,13 @@ function bp_notifications_read_permalink() { /** * Filters the read notifications permalink. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval Permalink for the read notifications. */ return apply_filters( 'bp_get_notifications_unread_permalink', $retval ); } -/** Main Loop *****************************************************************/ - -/** - * The main notifications template loop class. - * - * Responsible for loading a group of notifications into a loop for display. - * - * @since BuddyPress (1.9.0) - */ -class BP_Notifications_Template { - - /** - * The loop iterator. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - public $current_notification = -1; - - /** - * The number of notifications returned by the paged query. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - public $current_notification_count; - - /** - * Total number of notifications matching the query. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - public $total_notification_count; - - /** - * Array of notifications located by the query. - * - * @since BuddyPress (1.9.0) - * @access public - * @var array - */ - public $notifications; - - /** - * The notification object currently being iterated on. - * - * @since BuddyPress (1.9.0) - * @access public - * @var object - */ - public $notification; - - /** - * A flag for whether the loop is currently being iterated. - * - * @since BuddyPress (1.9.0) - * @access public - * @var bool - */ - public $in_the_loop; - - /** - * The ID of the user to whom the displayed notifications belong. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - public $user_id; - - /** - * The page number being requested. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - 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. - * - * @since BuddyPress (1.9.0) - * @access public - * @var int - */ - public $pag_num; - - /** - * An HTML string containing pagination links. - * - * @since BuddyPress (1.9.0) - * @access public - * @var string - */ - public $pag_links; - - /** - * A string to match against. - * - * @since BuddyPress (1.9.0) - * @access public - * @var string - */ - public $search_terms; - - /** - * A database column to order the results by. - * - * @since BuddyPress (1.9.0) - * @access public - * @var string - */ - public $order_by; - - /** - * The direction to sort the results (ASC or DESC) - * - * @since BuddyPress (1.9.0) - * @access public - * @var string - */ - public $sort_order; - - /** - * Array of variables used in this notification query - * - * @since BuddyPress (2.2.2) - * @var array - */ - public $query_vars; - - /** - * Constructor method. - * - * @see bp_has_notifications() For information on the array format. - * - * @since BuddyPress (1.9.0) - * - * @param array $args { - * An array of arguments. See {@link bp_has_notifications()} - * for more details. - * } - */ - public function __construct( $args = array() ) { - - // Parse arguments - $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, - 'is_new' => true, - 'search_terms' => '', - 'order_by' => 'date_notified', - 'sort_order' => 'DESC', - 'page_arg' => 'npage', - 'page' => 1, - 'per_page' => 25, - 'max' => null, - 'meta_query' => false, - 'date_query' => false - ) ); - - // Overrides - - // Sort order direction - $orders = array( 'ASC', 'DESC' ); - if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders ) ) { - $r['sort_order'] = $_GET['sort_order']; - } else { - $r['sort_order'] = in_array( $r['sort_order'], $orders ) ? $r['sort_order'] : 'DESC'; - } - - // Setup variables - $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->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( $this->query_vars ); - $this->total_notification_count = BP_Notifications_Notification::get_total_count( $this->query_vars ); - - if ( empty( $this->notifications ) ) { - $this->notification_count = 0; - $this->total_notification_count = 0; - - } else { - if ( ! empty( $r['max'] ) ) { - if ( $r['max'] >= count( $this->notifications ) ) { - $this->notification_count = count( $this->notifications ); - } else { - $this->notification_count = (int) $r['max']; - } - } else { - $this->notification_count = count( $this->notifications ); - } - } - - 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->pag_arg, '%#%' ), - 'format' => '', - 'total' => ceil( (int) $this->total_notification_count / (int) $this->pag_num ), - 'current' => $this->pag_page, - 'prev_text' => _x( '←', 'Notifications pagination previous text', 'buddypress' ), - 'next_text' => _x( '→', 'Notifications pagination next text', 'buddypress' ), - 'mid_size' => 1, - 'add_args' => $add_args, - ) ); - } - } - - /** - * Whether there are notifications available in the loop. - * - * @since BuddyPress (1.9.0) - * - * @see bp_has_notifications() - * - * @return bool True if there are items in the loop, otherwise false. - */ - public function has_notifications() { - if ( $this->notification_count ) { - return true; - } - - return false; - } - - /** - * Set up the next notification and iterate index. - * - * @since BuddyPress (1.9.0) - * - * @return object The next notification to iterate over. - */ - public function next_notification() { - - $this->current_notification++; - - $this->notification = $this->notifications[ $this->current_notification ]; - - return $this->notification; - } - - /** - * Rewind the blogs and reset blog index. - * - * @since BuddyPress (1.9.0) - */ - public function rewind_notifications() { - - $this->current_notification = -1; - - if ( $this->notification_count > 0 ) { - $this->notification = $this->notifications[0]; - } - } - - /** - * Whether there are notifications left in the loop to iterate over. - * - * This method is used by {@link bp_notifications()} as part of the - * while loop that controls iteration inside the notifications loop, eg: - * while ( bp_notifications() ) { ... - * - * @since BuddyPress (1.9.0) - * - * @see bp_notifications() - * - * @return bool True if there are more notifications to show, - * otherwise false. - */ - public function notifications() { - - if ( $this->current_notification + 1 < $this->notification_count ) { - 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(); - } - - $this->in_the_loop = false; - return false; - } - - /** - * Set up the current notification inside the loop. - * - * Used by {@link bp_the_notification()} to set up the current - * notification data while looping, so that template tags used during - * that iteration make reference to the current notification. - * - * @since BuddyPress (1.9.0) - * - * @see bp_the_notification() - */ - public function the_notification() { - $this->in_the_loop = true; - $this->notification = $this->next_notification(); - - // 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' ); - } - } -} - /** The Loop ******************************************************************/ /** @@ -493,41 +132,42 @@ class BP_Notifications_Template { * buddypress()->notifications->query_loop global, enabling the use of BP * templates and template functions to display a list of notifications. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param array $args { + * @param array|string $args { * Arguments for limiting the contents of the notifications loop. Can be * passed as an associative array, or as a URL query string. * * See {@link BP_Notifications_Notification::get()} for detailed * information on the arguments. In addition, also supports: * - * @type int $max Optional. Max items to display. Default: false. + * @type int $max Optional. Max items to display. Default: false. * @type string $page_arg URL argument to use for pagination. - * Default: 'npage'. + * Default: 'npage'. * } + * @return bool */ function bp_has_notifications( $args = '' ) { - // Get the default is_new argument + // Get the default is_new argument. if ( bp_is_current_action( 'unread' ) ) { $is_new = 1; } elseif ( bp_is_current_action( 'read' ) ) { $is_new = 0; - // not on a notifications page? default to fetch new notifications + // Not on a notifications page? default to fetch new notifications. } else { $is_new = 1; } - // Get the user ID + // Get the user ID. if ( bp_displayed_user_id() ) { $user_id = bp_displayed_user_id(); } else { $user_id = bp_loggedin_user_id(); } - // Parse the args + // Parse the args. $r = bp_parse_args( $args, array( 'id' => false, 'user_id' => $user_id, @@ -543,22 +183,22 @@ function bp_has_notifications( $args = '' ) { 'page' => 1, 'per_page' => 25, - // these are additional arguments that are not available in - // BP_Notifications_Notification::get() + // These are additional arguments that are not available in + // BP_Notifications_Notification::get(). 'max' => false, 'page_arg' => 'npage', ), 'has_notifications' ); - // Get the notifications + // Get the notifications. $query_loop = new BP_Notifications_Template( $r ); - // Setup the global query loop + // 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) + * @since 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. @@ -569,7 +209,7 @@ function bp_has_notifications( $args = '' ) { /** * Get the notifications returned by the template loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return array List of notifications. */ @@ -580,7 +220,7 @@ function bp_the_notifications() { /** * Get the current notification object in the loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return object The current notification within the loop. */ @@ -593,7 +233,7 @@ function bp_the_notification() { /** * Output the ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_id() { echo bp_get_the_notification_id(); @@ -601,7 +241,7 @@ function bp_the_notification_id() { /** * Return the ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int ID of the current notification. */ @@ -610,7 +250,7 @@ function bp_the_notification_id() { /** * Filters the ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $id ID of the notification being iterated on. */ @@ -620,7 +260,7 @@ function bp_the_notification_id() { /** * Output the associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_item_id() { echo bp_get_the_notification_item_id(); @@ -628,7 +268,7 @@ function bp_the_notification_item_id() { /** * Return the associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int ID of the item associated with the current notification. */ @@ -637,7 +277,7 @@ function bp_the_notification_item_id() { /** * Filters the associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $item_id ID of the associated item. */ @@ -647,7 +287,7 @@ function bp_the_notification_item_id() { /** * Output the secondary associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_secondary_item_id() { echo bp_get_the_notification_secondary_item_id(); @@ -655,7 +295,7 @@ function bp_the_notification_secondary_item_id() { /** * Return the secondary associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int ID of the secondary item associated with the current notification. */ @@ -664,7 +304,7 @@ function bp_the_notification_secondary_item_id() { /** * Filters the secondary associated item ID of the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $secondary_item_id ID of the secondary associated item. */ @@ -674,7 +314,7 @@ function bp_the_notification_secondary_item_id() { /** * Output the name of the component associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_component_name() { echo bp_get_the_notification_component_name(); @@ -682,7 +322,7 @@ function bp_the_notification_component_name() { /** * Return the name of the component associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int Name of the component associated with the current notification. */ @@ -691,7 +331,7 @@ function bp_the_notification_component_name() { /** * Filters the name of the component associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $component_name Name of the component associated with the current notification. */ @@ -701,7 +341,7 @@ function bp_the_notification_component_name() { /** * Output the name of the action associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_component_action() { echo bp_get_the_notification_component_action(); @@ -709,7 +349,7 @@ function bp_the_notification_component_action() { /** * Return the name of the action associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return int Name of the action associated with the current notification. */ @@ -718,7 +358,7 @@ function bp_the_notification_component_action() { /** * Filters the name of the action associated with the notification currently being iterated on. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $component_action Name of the action associated with the current notification. */ @@ -728,7 +368,7 @@ function bp_the_notification_component_action() { /** * Output the timestamp of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_date_notified() { echo bp_get_the_notification_date_notified(); @@ -736,7 +376,7 @@ function bp_the_notification_date_notified() { /** * Return the timestamp of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Timestamp of the current notification. */ @@ -745,7 +385,7 @@ function bp_the_notification_date_notified() { /** * Filters the timestamp of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $date_notified Timestamp of the current notification. */ @@ -755,7 +395,7 @@ function bp_the_notification_date_notified() { /** * Output the timestamp of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_time_since() { echo bp_get_the_notification_time_since(); @@ -763,20 +403,20 @@ function bp_the_notification_time_since() { /** * Return the timestamp of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string Timestamp of the current notification. */ function bp_get_the_notification_time_since() { - // Get the notified date + // Get the notified date. $date_notified = bp_get_the_notification_date_notified(); - // Notified date has legitimate data + // Notified date has legitimate data. if ( '0000-00-00 00:00:00' !== $date_notified ) { $retval = bp_core_time_since( $date_notified ); - // Notified date is empty, so return a fun string + // Notified date is empty, so return a fun string. } else { $retval = __( 'Date not found', 'buddypress' ); } @@ -784,7 +424,7 @@ function bp_the_notification_time_since() { /** * Filters the time since value of the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval Time since value for current notification. */ @@ -794,7 +434,7 @@ function bp_the_notification_time_since() { /** * Output full-text description for a specific notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_the_notification_description() { echo bp_get_the_notification_description(); @@ -803,7 +443,7 @@ function bp_the_notification_description() { /** * Get full-text description for a specific notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string */ @@ -811,7 +451,7 @@ function bp_the_notification_description() { $bp = buddypress(); $notification = $bp->notifications->query_loop->notification; - // Callback function exists + // Callback function exists. if ( isset( $bp->{ $notification->component_name }->notification_callback ) && is_callable( $bp->{ $notification->component_name }->notification_callback ) ) { $description = call_user_func( $bp->{ $notification->component_name }->notification_callback, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 ); @@ -819,7 +459,7 @@ function bp_the_notification_description() { } elseif ( isset( $bp->{ $notification->component_name }->format_notification_function ) && function_exists( $bp->{ $notification->component_name }->format_notification_function ) ) { $description = call_user_func( $bp->{ $notification->component_name }->format_notification_function, $notification->component_action, $notification->item_id, $notification->secondary_item_id, 1 ); - // Allow non BuddyPress components to hook in + // Allow non BuddyPress components to hook in. } else { /** This filter is documented in bp-notifications/bp-notifications-functions.php */ @@ -829,8 +469,8 @@ function bp_the_notification_description() { /** * Filters the full-text description for a specific notification. * - * @since BuddyPress (1.9.0) - * @since BuddyPress (2.3.0) Added the `$notification` parameter. + * @since 1.9.0 + * @since 2.3.0 Added the `$notification` parameter. * * @param string $description Full-text description for a specific notification. * @param object $notification Notification object. @@ -841,7 +481,7 @@ function bp_the_notification_description() { /** * Output the mark read link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses bp_get_the_notification_mark_read_link() */ @@ -851,11 +491,13 @@ function bp_the_notification_mark_read_link() { /** * Return the mark read link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @return string */ function bp_get_the_notification_mark_read_link() { - // Start the output buffer + // Start the output buffer. ob_start(); ?> <a href="<?php bp_the_notification_mark_read_url(); ?>" class="mark-read primary"><?php _e( 'Read', 'buddypress' ); ?></a> @@ -865,7 +507,7 @@ function bp_the_notification_mark_read_link() { /** * Filters the mark read link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval HTML for the mark read link for the current notification. */ @@ -873,11 +515,11 @@ function bp_the_notification_mark_read_link() { } /** - * Output the URL used for marking a single notification as read + * Output the URL used for marking a single notification as read. * * Since this function directly outputs a URL, it is escaped. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses bp_get_the_notification_mark_read_url() */ @@ -885,31 +527,33 @@ function bp_the_notification_mark_read_url() { echo esc_url( bp_get_the_notification_mark_read_url() ); } /** - * Return the URL used for marking a single notification as read - * - * @since BuddyPress (2.1.0) + * Return the URL used for marking a single notification as read. + * + * @since 2.1.0 + * + * @return string */ function bp_get_the_notification_mark_read_url() { - // Get the notification ID + // Get the notification ID. $id = bp_get_the_notification_id(); - // Get the args to add to the URL + // Get the args to add to the URL. $args = array( 'action' => 'read', 'notification_id' => $id ); - // Add the args to the URL + // Add the args to the URL. $url = add_query_arg( $args, bp_get_notifications_unread_permalink() ); - // Add the nonce + // Add the nonce. $url = wp_nonce_url( $url, 'bp_notification_mark_read_' . $id ); /** * Filters the URL used for marking a single notification as read. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $url URL to use for marking the single notification as read. */ @@ -919,7 +563,7 @@ function bp_the_notification_mark_read_url() { /** * Output the mark unread link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses bp_get_the_notification_mark_unread_link() */ @@ -929,11 +573,13 @@ function bp_the_notification_mark_unread_link() { /** * Return the mark unread link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @return string */ function bp_get_the_notification_mark_unread_link() { - // Start the output buffer + // Start the output buffer. ob_start(); ?> <a href="<?php bp_the_notification_mark_unread_url(); ?>" class="mark-unread primary"><?php _ex( 'Unread', 'Notification screen action', 'buddypress' ); ?></a> @@ -943,7 +589,7 @@ function bp_the_notification_mark_unread_link() { /** * Filters the link used for marking a single notification as unread. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval HTML for the mark unread link for the current notification. */ @@ -951,11 +597,11 @@ function bp_the_notification_mark_unread_link() { } /** - * Output the URL used for marking a single notification as unread + * Output the URL used for marking a single notification as unread. * * Since this function directly outputs a URL, it is escaped. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses bp_get_the_notification_mark_unread_url() */ @@ -963,31 +609,33 @@ function bp_the_notification_mark_unread_url() { echo esc_url( bp_get_the_notification_mark_unread_url() ); } /** - * Return the URL used for marking a single notification as unread - * - * @since BuddyPress (2.1.0) + * Return the URL used for marking a single notification as unread. + * + * @since 2.1.0 + * + * @return string */ function bp_get_the_notification_mark_unread_url() { - // Get the notification ID + // Get the notification ID. $id = bp_get_the_notification_id(); - // Get the args to add to the URL + // Get the args to add to the URL. $args = array( 'action' => 'unread', 'notification_id' => $id ); - // Add the args to the URL + // Add the args to the URL. $url = add_query_arg( $args, bp_get_notifications_read_permalink() ); - // Add the nonce + // Add the nonce. $url = wp_nonce_url( $url, 'bp_notification_mark_unread_' . $id ); /** * Filters the URL used for marking a single notification as unread. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $url URL to use for marking the single notification as unread. */ @@ -997,7 +645,7 @@ function bp_the_notification_mark_unread_url() { /** * Output the mark link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses bp_get_the_notification_mark_unread_link() */ @@ -1007,7 +655,9 @@ function bp_the_notification_mark_link() { /** * Return the mark link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @return string */ function bp_get_the_notification_mark_link() { @@ -1020,7 +670,7 @@ function bp_the_notification_mark_link() { /** * Filters the mark link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval The mark link for the current notification. */ @@ -1030,7 +680,7 @@ function bp_the_notification_mark_link() { /** * Output the delete link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @uses bp_get_the_notification_delete_link() */ @@ -1040,11 +690,13 @@ function bp_the_notification_delete_link() { /** * Return the delete link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @return string */ function bp_get_the_notification_delete_link() { - // Start the output buffer + // Start the output buffer. ob_start(); ?> <a href="<?php bp_the_notification_delete_url(); ?>" class="delete secondary confirm"><?php _e( 'Delete', 'buddypress' ); ?></a> @@ -1054,7 +706,7 @@ function bp_the_notification_delete_link() { /** * Filters the delete link for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $retval HTML for the delete link for the current notification. */ @@ -1062,11 +714,11 @@ function bp_the_notification_delete_link() { } /** - * Output the URL used for deleting a single notification + * Output the URL used for deleting a single notification. * * Since this function directly outputs a URL, it is escaped. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @uses esc_url() * @uses bp_get_the_notification_delete_url() @@ -1075,40 +727,40 @@ function bp_the_notification_delete_url() { echo esc_url( bp_get_the_notification_delete_url() ); } /** - * Return the URL used for deleting a single notification + * Return the URL used for deleting a single notification. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string */ function bp_get_the_notification_delete_url() { - // URL to add nonce to + // URL to add nonce to. if ( bp_is_current_action( 'unread' ) ) { $link = bp_get_notifications_unread_permalink(); } elseif ( bp_is_current_action( 'read' ) ) { $link = bp_get_notifications_read_permalink(); } - // Get the ID + // Get the ID. $id = bp_get_the_notification_id(); - // Get the args to add to the URL + // Get the args to add to the URL. $args = array( 'action' => 'delete', 'notification_id' => $id ); - // Add the args + // Add the args. $url = add_query_arg( $args, $link ); - // Add the nonce + // Add the nonce. $url = wp_nonce_url( $url, 'bp_notification_delete_' . $id ); /** * Filters the URL used for deleting a single notification. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $url URL used for deleting a single notification. */ @@ -1118,7 +770,9 @@ function bp_the_notification_delete_url() { /** * Output the action links for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 + * + * @param array|string $args Array of arguments. */ function bp_the_notification_action_links( $args = '' ) { echo bp_get_the_notification_action_links( $args ); @@ -1126,20 +780,19 @@ function bp_the_notification_action_links( $args = '' ) { /** * Return the action links for the current notification. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param array $args { + * @param array|string $args { * @type string $before HTML before the links. - * @type string $after HTML after the links. - * @type string $sep HTML between the links. - * @type array $links Array of links to implode by 'sep'. + * @type string $after HTML after the links. + * @type string $sep HTML between the links. + * @type array $links Array of links to implode by 'sep'. * } - * * @return string HTML links for actions to take on single notifications. */ function bp_get_the_notification_action_links( $args = '' ) { - // Parse + // Parse. $r = wp_parse_args( $args, array( 'before' => '', 'after' => '', @@ -1150,13 +803,13 @@ function bp_the_notification_action_links( $args = '' ) { ) ) ); - // Build the links + // 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) + * @since 1.9.0 * * @param string $retval HTML links for actions to take on single notifications. */ @@ -1166,7 +819,7 @@ function bp_the_notification_action_links( $args = '' ) { /** * Output the pagination count for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_pagination_count() { echo bp_get_notifications_pagination_count(); @@ -1174,7 +827,7 @@ function bp_notifications_pagination_count() { /** * Return the pagination count for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string HTML for the pagination count. */ @@ -1194,7 +847,7 @@ function bp_notifications_pagination_count() { /** * Filters the pagination count for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $pag HTML for the pagination count. */ @@ -1204,7 +857,7 @@ function bp_notifications_pagination_count() { /** * Output the pagination links for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_pagination_links() { echo bp_get_notifications_pagination_links(); @@ -1212,7 +865,7 @@ function bp_notifications_pagination_links() { /** * Return the pagination links for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @return string HTML for the pagination links. */ @@ -1221,7 +874,7 @@ function bp_notifications_pagination_links() { /** * Filters the pagination links for the current notification loop. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param string $pag_links HTML for the pagination links. */ @@ -1231,17 +884,17 @@ function bp_notifications_pagination_links() { /** Form Helpers **************************************************************/ /** - * Output the form for changing the sort order of notifications + * Output the form for changing the sort order of notifications. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_notifications_sort_order_form() { - // Setup local variables + // Setup local variables. $orders = array( 'DESC', 'ASC' ); $selected = 'DESC'; - // Check for a custom sort_order + // Check for a custom sort_order. if ( !empty( $_REQUEST['sort_order'] ) ) { if ( in_array( $_REQUEST['sort_order'], $orders ) ) { $selected = $_REQUEST['sort_order']; @@ -1249,7 +902,7 @@ function bp_notifications_sort_order_form() { } ?> <form action="" method="get" id="notifications-sort-order"> - <label for="notifications-friends"><?php esc_html_e( 'Order By:', 'buddypress' ); ?></label> + <label for="notifications-sort-order-list"><?php esc_html_e( 'Order By:', 'buddypress' ); ?></label> <select id="notifications-sort-order-list" name="sort_order" onchange="this.form.submit();"> <option value="DESC" <?php selected( $selected, 'DESC' ); ?>><?php _e( 'Newest First', 'buddypress' ); ?></option> @@ -1267,7 +920,7 @@ function bp_notifications_sort_order_form() { /** * Output the dropdown for bulk management of notifications. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 */ function bp_notifications_bulk_management_dropdown() { ?> diff --git a/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-component.php b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-component.php new file mode 100644 index 0000000000000000000000000000000000000000..67a6db5ec7a11bb764920b0b244d03e079be73d3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-component.php @@ -0,0 +1,266 @@ +<?php +/** + * BuddyPress Member Notifications Loader. + * + * Initializes the Notifications component. + * + * @package BuddyPress + * @subpackage NotificationsLoader + * @since 1.9.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Extends the component class to set up the Notifications component. + */ +class BP_Notifications_Component extends BP_Component { + + /** + * Start the notifications component creation process. + * + * @since 1.9.0 + */ + public function __construct() { + parent::start( + 'notifications', + _x( 'Notifications', 'Page <title>', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 30 + ) + ); + } + + /** + * Include notifications component files. + * + * @since 1.9.0 + * + * @see BP_Component::includes() for a description of arguments. + * + * @param array $includes See BP_Component::includes() for a description. + */ + public function includes( $includes = array() ) { + $includes = array( + 'actions', + 'classes', + 'screens', + 'adminbar', + 'template', + 'functions', + 'cache', + ); + + parent::includes( $includes ); + } + + /** + * Set up component global data. + * + * @since 1.9.0 + * + * @see BP_Component::setup_globals() for a description of arguments. + * + * @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 ); + } + + // Global tables for the notifications component. + $global_tables = array( + 'table_name' => $bp->table_prefix . 'bp_notifications', + 'table_name_meta' => $bp->table_prefix . 'bp_notifications_meta', + ); + + // All globals for the notifications component. + // Note that global_tables is included in this array. + $args = array( + 'slug' => BP_NOTIFICATIONS_SLUG, + 'has_directory' => false, + 'search_string' => __( 'Search Notifications...', 'buddypress' ), + 'global_tables' => $global_tables, + ); + + parent::setup_globals( $args ); + } + + /** + * Set up component navigation. + * + * @since 1.9.0 + * + * @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. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $access = bp_core_can_edit_settings(); + $slug = bp_get_notifications_slug(); + $notifications_link = trailingslashit( $user_domain . $slug ); + + // Only grab count if we're on a user page and current user has access. + if ( bp_is_user() && bp_user_has_access() ) { + $count = bp_notifications_get_unread_notification_count( bp_displayed_user_id() ); + $class = ( 0 === $count ) ? 'no-count' : 'count'; + $nav_name = sprintf( _x( 'Notifications <span class="%s">%s</span>', 'Profile screen nav', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ); + } else { + $nav_name = _x( 'Notifications', 'Profile screen nav', 'buddypress' ); + } + + // Add 'Notifications' to the main navigation. + $main_nav = array( + 'name' => $nav_name, + 'slug' => $slug, + 'position' => 30, + 'show_for_displayed_user' => $access, + 'screen_function' => 'bp_notifications_screen_unread', + 'default_subnav_slug' => 'unread', + 'item_css_id' => $this->id, + ); + + // Add the subnav items to the notifications nav item. + $sub_nav[] = array( + 'name' => _x( 'Unread', 'Notification screen nav', 'buddypress' ), + 'slug' => 'unread', + 'parent_url' => $notifications_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_notifications_screen_unread', + 'position' => 10, + 'item_css_id' => 'notifications-my-notifications', + 'user_has_access' => $access, + ); + + $sub_nav[] = array( + 'name' => _x( 'Read', 'Notification screen nav', 'buddypress' ), + 'slug' => 'read', + 'parent_url' => $notifications_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_notifications_screen_read', + 'position' => 20, + 'user_has_access' => $access, + ); + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the component entries in the WordPress Admin Bar. + * + * @since 1.9.0 + * + * @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. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $notifications_link = trailingslashit( bp_loggedin_user_domain() . bp_get_notifications_slug() ); + + // Pending notification requests. + $count = bp_notifications_get_unread_notification_count( bp_loggedin_user_id() ); + if ( ! empty( $count ) ) { + $title = sprintf( _x( 'Notifications <span class="count">%s</span>', 'My Account Notification pending', 'buddypress' ), bp_core_number_format( $count ) ); + $unread = sprintf( _x( 'Unread <span class="count">%s</span>', 'My Account Notification pending', 'buddypress' ), bp_core_number_format( $count ) ); + } else { + $title = _x( 'Notifications', 'My Account Notification', 'buddypress' ); + $unread = _x( 'Unread', 'My Account Notification sub nav', 'buddypress' ); + } + + // Add the "My Account" sub menus. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => $title, + 'href' => $notifications_link + ); + + // Unread. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-unread', + 'title' => $unread, + 'href' => $notifications_link, + 'position' => 10 + ); + + // Read. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-read', + 'title' => _x( 'Read', 'My Account Notification sub nav', 'buddypress' ), + 'href' => trailingslashit( $notifications_link . 'read' ), + 'position' => 20 + ); + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Set up the title for pages and <title>. + * + * @since 1.9.0 + */ + public function setup_title() { + + // Adjust title. + if ( bp_is_notifications_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = __( 'Notifications', 'buddypress' ); + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups. + * + * @since 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/classes/class-bp-notifications-notification.php b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-notification.php index 9b43bd859fca01ee2256e855b57742a4016b6b4a..c417b890e636eab817ca1197b2c7b71c190e4c0b 100644 --- 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 @@ -1,16 +1,15 @@ <?php /** - * BuddyPress Notifications Classes + * BuddyPress Notifications Classes. * * Classes used for the Notifications component. * * @package BuddyPress * @subpackage NotificationsClasses - * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -18,15 +17,14 @@ defined( 'ABSPATH' ) || exit; * * Use this class to create, access, edit, or delete BuddyPress Notifications. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ class BP_Notifications_Notification { /** * The notification ID. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var int */ public $id; @@ -34,8 +32,7 @@ class BP_Notifications_Notification { /** * The ID of the item associated with the notification. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var int */ public $item_id; @@ -43,8 +40,7 @@ class BP_Notifications_Notification { /** * The ID of the secondary item associated with the notification. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var int */ public $secondary_item_id = null; @@ -52,8 +48,7 @@ class BP_Notifications_Notification { /** * The ID of the user the notification is associated with. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var int */ public $user_id; @@ -61,8 +56,7 @@ class BP_Notifications_Notification { /** * The name of the component that the notification is for. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var string */ public $component_name; @@ -70,8 +64,7 @@ class BP_Notifications_Notification { /** * The component action which the notification is related to. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var string */ public $component_action; @@ -79,8 +72,7 @@ class BP_Notifications_Notification { /** * The date the notification was created. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var string */ public $date_notified; @@ -88,8 +80,7 @@ class BP_Notifications_Notification { /** * Is the notification new, or has it already been read. * - * @since BuddyPress (1.9.0) - * @access public + * @since 1.9.0 * @var bool */ public $is_new; @@ -99,10 +90,10 @@ class BP_Notifications_Notification { /** * Constructor method. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $id Optional. Provide an ID to access an existing - * notification item. + * notification item. */ public function __construct( $id = 0 ) { if ( ! empty( $id ) ) { @@ -114,7 +105,7 @@ class BP_Notifications_Notification { /** * Update or insert notification details into the database. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @global wpdb $wpdb WordPress database object. * @@ -122,10 +113,10 @@ class BP_Notifications_Notification { */ public function save() { - // Return value + // Return value. $retval = false; - // Default data and format + // Default data and format. $data = array( 'user_id' => $this->user_id, 'item_id' => $this->item_id, @@ -142,22 +133,22 @@ class BP_Notifications_Notification { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference. + * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference. */ do_action_ref_array( 'bp_notification_before_save', array( &$this ) ); - // Update + // Update. if ( ! empty( $this->id ) ) { $result = self::_update( $data, array( 'ID' => $this->id ), $data_format, array( '%d' ) ); - // Insert + // Insert. } else { $result = self::_insert( $data, $data_format ); } - // Set the notification ID if successful + // Set the notification ID if successful. if ( ! empty( $result ) && ! is_wp_error( $result ) ) { global $wpdb; @@ -168,20 +159,21 @@ class BP_Notifications_Notification { /** * Fires after the current notification item gets saved. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference. + * @param BP_Notifications_Notification $value 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 the result. return $retval; } /** * Fetch data for an existing notification from the database. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @global BuddyPress $bp The one true BuddyPress instance. * @global wpdb $wpdb WordPress database object. @@ -191,10 +183,10 @@ class BP_Notifications_Notification { $bp = buddypress(); - // Look for a notification + // 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 + // 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; @@ -211,19 +203,18 @@ class BP_Notifications_Notification { /** * Create a notification entry. * - * @since BuddyPress (1.9.0) + * @since 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. + * @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. @@ -236,17 +227,17 @@ class BP_Notifications_Notification { /** * Update notifications. * - * @since BuddyPress (1.9.0) + * @since 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 $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. */ @@ -258,13 +249,13 @@ class BP_Notifications_Notification { /** * Delete notifications. * - * @since BuddyPress (1.9.0) + * @since 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 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. */ @@ -279,10 +270,14 @@ class BP_Notifications_Notification { * Used by BP_Notifications_Notification::get() to create its WHERE * clause. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param array $args See {@link BP_Notifications_Notification::get()} - * for more details. + * @param array $args See {@link BP_Notifications_Notification::get()} + * for more details. + * @param string $select_sql SQL SELECT fragment. + * @param string $from_sql SQL FROM fragment. + * @param string $join_sql SQL JOIN fragment. + * @param string $meta_query_sql SQL meta query fragment. * @return string WHERE clause. */ protected static function get_where_sql( $args = array(), $select_sql = '', $from_sql = '', $join_sql = '', $meta_query_sql = '' ) { @@ -291,31 +286,31 @@ class BP_Notifications_Notification { $where_conditions = array(); $where = ''; - // id + // The id. if ( ! empty( $args['id'] ) ) { $id_in = implode( ',', wp_parse_id_list( $args['id'] ) ); $where_conditions['id'] = "id IN ({$id_in})"; } - // user_id + // The 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 + // The 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 + // The 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 + // The component_name. if ( ! empty( $args['component_name'] ) ) { if ( ! is_array( $args['component_name'] ) ) { $component_names = explode( ',', $args['component_name'] ); @@ -332,7 +327,7 @@ class BP_Notifications_Notification { $where_conditions['component_name'] = "component_name IN ({$cn_in})"; } - // component_action + // The component_action. if ( ! empty( $args['component_action'] ) ) { if ( ! is_array( $args['component_action'] ) ) { $component_actions = explode( ',', $args['component_action'] ); @@ -349,25 +344,25 @@ class BP_Notifications_Notification { $where_conditions['component_action'] = "component_action IN ({$ca_in})"; } - // is_new + // If 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 + // The 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 + // The date query. if ( ! empty( $args['date_query'] ) ) { $where_conditions['date_query'] = self::get_date_query_sql( $args['date_query'] ); } - // meta query + // The meta query. if ( ! empty( $meta_query_sql['where'] ) ) { $where_conditions['meta_query'] = $meta_query_sql['where']; } @@ -375,7 +370,7 @@ class BP_Notifications_Notification { /** * Filters the MySQL WHERE conditions for the Notifications items get method. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $where_conditions Current conditions for MySQL WHERE statement. * @param array $args Parsed arguments passed into method. @@ -386,7 +381,7 @@ class BP_Notifications_Notification { */ $where_conditions = apply_filters( 'bp_notifications_get_where_conditions', $where_conditions, $args, $select_sql, $from_sql, $join_sql, $meta_query_sql ); - // Custom WHERE + // Custom WHERE. if ( ! empty( $where_conditions ) ) { $where = 'WHERE ' . implode( ' AND ', $where_conditions ); } @@ -400,31 +395,31 @@ class BP_Notifications_Notification { * Used by BP_Notifications_Notification::get() to create its ORDER BY * clause. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param array $args See {@link BP_Notifications_Notification::get()} - * for more details. + * for more details. * @return string ORDER BY clause. */ protected static function get_order_by_sql( $args = array() ) { - // Setup local variable + // Setup local variable. $conditions = array(); $retval = ''; - // Order by + // Order by. if ( ! empty( $args['order_by'] ) ) { $order_by = implode( ', ', (array) $args['order_by'] ); $conditions['order_by'] = "{$order_by}"; } - // Sort order direction + // 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 + // Custom ORDER BY. if ( ! empty( $conditions ) ) { $retval = 'ORDER BY ' . implode( ' ', $conditions ); } @@ -437,19 +432,19 @@ class BP_Notifications_Notification { * * Used by BP_Notifications_Notification::get() to create its LIMIT clause. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param array $args See {@link BP_Notifications_Notification::get()} - * for more details. - * @return string LIMIT clause. + * for more details. + * @return string $retval LIMIT clause. */ protected static function get_paged_sql( $args = array() ) { global $wpdb; - // Setup local variable + // Setup local variable. $retval = ''; - // Custom LIMIT + // Custom LIMIT. if ( ! empty( $args['page'] ) && ! empty( $args['per_page'] ) ) { $page = absint( $args['page'] ); $per_page = absint( $args['per_page'] ); @@ -467,7 +462,7 @@ class BP_Notifications_Notification { * arguments of the following forms: * * - associative arrays whose key/value pairs are column => value, to - * be used in WHERE, SET, or VALUES clauses + * 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' )) * @@ -494,10 +489,11 @@ class BP_Notifications_Notification { * * which can easily be passed as arguments to the $wpdb methods. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param $args Associative array of filter arguments. - * See {@BP_Notifications_Notification::get()} for a breakdown. + * @param array $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() ) { @@ -506,43 +502,43 @@ class BP_Notifications_Notification { 'format' => array(), ); - // id + // The id. if ( ! empty( $args['id'] ) ) { $where_clauses['data']['id'] = absint( $args['id'] ); $where_clauses['format'][] = '%d'; } - // user_id + // The user_id. if ( ! empty( $args['user_id'] ) ) { $where_clauses['data']['user_id'] = absint( $args['user_id'] ); $where_clauses['format'][] = '%d'; } - // item_id + // The item_id. if ( ! empty( $args['item_id'] ) ) { $where_clauses['data']['item_id'] = absint( $args['item_id'] ); $where_clauses['format'][] = '%d'; } - // secondary_item_id + // The 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 + // The component_name. if ( ! empty( $args['component_name'] ) ) { $where_clauses['data']['component_name'] = $args['component_name']; $where_clauses['format'][] = '%s'; } - // component_action + // The component_action. if ( ! empty( $args['component_action'] ) ) { $where_clauses['data']['component_action'] = $args['component_action']; $where_clauses['format'][] = '%s'; } - // is_new + // If is_new. if ( isset( $args['is_new'] ) ) { $where_clauses['data']['is_new'] = ! empty( $args['is_new'] ) ? 1 : 0; $where_clauses['format'][] = '%d'; @@ -556,12 +552,12 @@ class BP_Notifications_Notification { /** * Check that a specific notification is for a specific user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param int $user_id ID of the user being checked. + * @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. + * false. */ public static function check_access( $user_id, $notification_id ) { global $wpdb; @@ -572,11 +568,11 @@ class BP_Notifications_Notification { } /** - * Parse notifications query arguments + * Parse notifications query arguments. * - * @since BuddyPress 2.3.0 + * @since 2.3.0 * - * @param mixed $args + * @param mixed $args Args to parse. * @return array */ public static function parse_args( $args = '' ) { @@ -602,62 +598,62 @@ class BP_Notifications_Notification { /** * Get notifications, based on provided filter parameters. * - * @since BuddyPress (1.9.0) + * @since 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). + * @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 + // Parse the arguments. $r = self::parse_args( $args ); - // Get BuddyPress + // Get BuddyPress. $bp = buddypress(); - // METADATA + // METADATA. $meta_query_sql = self::get_meta_query_sql( $r['meta_query'] ); - // SELECT + // SELECT. $select_sql = "SELECT *"; - // FROM + // FROM. $from_sql = "FROM {$bp->notifications->table_name} n "; - // JOIN + // JOIN. $join_sql = $meta_query_sql['join']; - // WHERE + // WHERE. $where_sql = self::get_where_sql( array( 'id' => $r['id'], 'user_id' => $r['user_id'], @@ -670,19 +666,19 @@ class BP_Notifications_Notification { 'date_query' => $r['date_query'] ), $select_sql, $from_sql, $join_sql, $meta_query_sql ); - // ORDER BY + // ORDER BY. $order_sql = self::get_order_by_sql( array( 'order_by' => $r['order_by'], 'sort_order' => $r['sort_order'] ) ); - // LIMIT %d, %d + // LIMIT %d, %d. $pag_sql = self::get_paged_sql( array( 'page' => $r['page'], 'per_page' => $r['per_page'] ) ); - // Concatenate query parts + // Concatenate query parts. $sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql} {$order_sql} {$pag_sql}"; return $wpdb->get_results( $sql ); @@ -691,10 +687,9 @@ class BP_Notifications_Notification { /** * Get a count of total notifications matching a set of arguments. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @see BP_Notifications_Notification::get() for a description of - * arguments. + * @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. @@ -702,25 +697,25 @@ class BP_Notifications_Notification { public static function get_total_count( $args ) { global $wpdb; - // Parse the arguments + // Parse the arguments. $r = self::parse_args( $args ); - // Load BuddyPress + // Load BuddyPress. $bp = buddypress(); - // METADATA + // METADATA. $meta_query_sql = self::get_meta_query_sql( $r['meta_query'] ); - // SELECT + // SELECT. $select_sql = "SELECT COUNT(*)"; - // FROM + // FROM. $from_sql = "FROM {$bp->notifications->table_name} n "; - // JOIN + // JOIN. $join_sql = $meta_query_sql['join']; - // WHERE + // WHERE. $where_sql = self::get_where_sql( array( 'id' => $r['id'], 'user_id' => $r['user_id'], @@ -733,10 +728,10 @@ class BP_Notifications_Notification { 'date_query' => $r['date_query'] ), $select_sql, $from_sql, $join_sql, $meta_query_sql ); - // Concatenate query parts + // Concatenate query parts. $sql = "{$select_sql} {$from_sql} {$join_sql} {$where_sql}"; - // Return the queried results + // Return the queried results. return $wpdb->get_var( $sql ); } @@ -749,7 +744,7 @@ class BP_Notifications_Notification { * WP_Query, we have to alter the return value (stripping the leading * AND keyword from the 'where' clause). * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $meta_query An array of meta_query filters. See the * documentation for WP_Meta_Query for details. @@ -757,24 +752,24 @@ class BP_Notifications_Notification { */ public static function get_meta_query_sql( $meta_query = array() ) { - // Default array keys & empty values + // Default array keys & empty values. $sql_array = array( 'join' => '', 'where' => '', ); - // Bail if no meta query + // Bail if no meta query. if ( empty( $meta_query ) ) { return $sql_array; } - // WP_Meta_Query expects the table name at $wpdb->notificationmeta + // 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() + // Strip the leading AND - it's handled in get(). $sql_array['where'] = preg_replace( '/^\sAND/', '', $meta_sql['where'] ); $sql_array['join'] = $meta_sql['join']; @@ -790,7 +785,7 @@ class BP_Notifications_Notification { * differently than WP_Query, we have to alter the return value (stripping * the leading AND keyword from the query). * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $date_query An array of date_query parameters. See the * documentation for the first parameter of WP_Date_Query. @@ -798,32 +793,32 @@ class BP_Notifications_Notification { */ 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' ) ) { + // Bail if not a proper date query format. + if ( empty( $date_query ) || ! is_array( $date_query ) ) { return ''; } - // Date query + // Date query. $date_query = new BP_Date_Query( $date_query, 'date_recorded' ); - // Strip the leading AND - it's handled in get() + // Strip the leading AND - it's handled in get(). return preg_replace( '/^\sAND/', '', $date_query->get_sql() ); } /** * Update notifications. * - * @since BuddyPress (1.9.0) + * @since 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', ) + * 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() ) { @@ -833,7 +828,7 @@ class BP_Notifications_Notification { /** * Fires before the update of a notification item. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $update_args See BP_Notifications_Notification::update(). * @param array $where_args See BP_Notifications_Notification::update(). @@ -851,14 +846,14 @@ class BP_Notifications_Notification { /** * Delete notifications. * - * @since BuddyPress (1.9.0) + * @since 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', ) + * 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() ) { @@ -867,7 +862,7 @@ class BP_Notifications_Notification { /** * Fires before the deletion of a notification item. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $args Associative array of columns/values, to determine * which rows should be deleted. Of the format @@ -883,7 +878,7 @@ class BP_Notifications_Notification { /** * Delete a single notification by ID. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @see BP_Notifications_Notification::delete() for explanation of * return value. @@ -900,12 +895,12 @@ class BP_Notifications_Notification { /** * Fetch all the notifications in the database for a specific user. * - * @since BuddyPress (1.9.0) + * @since 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. + * @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' ) { @@ -918,10 +913,10 @@ class BP_Notifications_Notification { /** * Fetch all the unread notifications in the database for a specific user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user whose notifications are being - * fetched. + * fetched. * @return array Associative array of unread notification items. */ public static function get_unread_for_user( $user_id = 0 ) { @@ -934,10 +929,10 @@ class BP_Notifications_Notification { /** * Fetch all the read notifications in the database for a specific user. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param int $user_id ID of the user whose notifications are being - * fetched. + * fetched. * @return array Associative array of unread notification items. */ public static function get_read_for_user( $user_id = 0 ) { @@ -950,24 +945,24 @@ class BP_Notifications_Notification { /** * Get unread notifications for a user, in a pagination-friendly format. * - * @since BuddyPress (1.9.0) + * @since 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 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. + * 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. + * @type int $total Count of all located notifications matching + * the query params. * } */ public static function get_current_notifications_for_user( $args = array() ) { @@ -981,7 +976,7 @@ class BP_Notifications_Notification { $notifications = self::get( $r ); - // Bail if no notifications + // Bail if no notifications. if ( empty( $notifications ) ) { return false; } @@ -996,20 +991,24 @@ class BP_Notifications_Notification { /** * Mark all user notifications as read. * - * @since BuddyPress (1.9.0) + * @since 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). + * @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). + * @param int $item_id Item ID being acted on. + * @param string $component_name Name of component the notifications are for. + * @param string $component_action Name of the component action. + * @param int $secondary_item_id The ID of the secondary item. + * @return bool|int False on failure to update. ID on success. */ 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 + // Values to be updated. $update_args = array( 'is_new' => $is_new, ); - // WHERE clauses + // WHERE clauses. $where_args = array( 'user_id' => $user_id, ); @@ -1036,19 +1035,23 @@ class BP_Notifications_Notification { /** * Mark all notifications from a user as read. * - * @since BuddyPress (1.9.0) + * @since 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). + * @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). + * @param string $component_name Name of component the notifications are for. + * @param string $component_action Name of the component action. + * @param int $secondary_item_id The ID of the secondary item. + * @return bool|int */ public static function mark_all_from_user( $user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) { - // Values to be updated + // Values to be updated. $update_args = array( 'is_new' => $is_new, ); - // WHERE clauses + // WHERE clauses. $where_args = array( 'item_id' => $user_id, ); @@ -1072,25 +1075,27 @@ class BP_Notifications_Notification { * 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. + * @since 1.9.0 + * + * @param int $item_id The ID of the item associated with the + * notifications. + * @param int $is_new Mark as read (1) or unread (0). + * @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 int $secondary_item_id Optional. ID of the secondary + * associated item. + * @return bool|int */ public static function mark_all_by_type( $item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) { - // Values to be updated + // Values to be updated. $update_args = array( 'is_new' => $is_new, ); - // WHERE clauses + // WHERE clauses. $where_args = array( 'item_id' => $item_id, ); diff --git a/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-template.php b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-template.php new file mode 100644 index 0000000000000000000000000000000000000000..567b3d172f6d03b53ffc977620713afe8875cc51 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-notifications/classes/class-bp-notifications-template.php @@ -0,0 +1,356 @@ +<?php +/** + * BuddyPress Notifications Template Loop Class. + * + * @package BuddyPress + * @subpackage TonificationsTemplate + * @since 1.9.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main notifications template loop class. + * + * Responsible for loading a group of notifications into a loop for display. + * + * @since 1.9.0 + */ +class BP_Notifications_Template { + + /** + * The loop iterator. + * + * @since 1.9.0 + * @var int + */ + public $current_notification = -1; + + /** + * The number of notifications returned by the paged query. + * + * @since 1.9.0 + * @var int + */ + public $current_notification_count; + + /** + * Total number of notifications matching the query. + * + * @since 1.9.0 + * @var int + */ + public $total_notification_count; + + /** + * Array of notifications located by the query. + * + * @since 1.9.0 + * @var array + */ + public $notifications; + + /** + * The notification object currently being iterated on. + * + * @since 1.9.0 + * @var object + */ + public $notification; + + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.9.0 + * @var bool + */ + public $in_the_loop; + + /** + * The ID of the user to whom the displayed notifications belong. + * + * @since 1.9.0 + * @var int + */ + public $user_id; + + /** + * The page number being requested. + * + * @since 1.9.0 + * @var int + */ + public $pag_page; + + /** + * The $_GET argument used in URLs for determining pagination. + * + * @since 1.9.0 + * @var int + */ + public $pag_arg; + + /** + * The number of items to display per page of results. + * + * @since 1.9.0 + * @var int + */ + public $pag_num; + + /** + * An HTML string containing pagination links. + * + * @since 1.9.0 + * @var string + */ + public $pag_links; + + /** + * A string to match against. + * + * @since 1.9.0 + * @var string + */ + public $search_terms; + + /** + * A database column to order the results by. + * + * @since 1.9.0 + * @var string + */ + public $order_by; + + /** + * The direction to sort the results (ASC or DESC). + * + * @since 1.9.0 + * @var string + */ + public $sort_order; + + /** + * Array of variables used in this notification query. + * + * @since 2.2.2 + * @var array + */ + public $query_vars; + + /** + * Constructor method. + * + * @see bp_has_notifications() For information on the array format. + * + * @since 1.9.0 + * + * @param array $args { + * An array of arguments. See {@link bp_has_notifications()} + * for more details. + * } + */ + public function __construct( $args = array() ) { + + // Parse arguments. + $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, + 'is_new' => true, + 'search_terms' => '', + 'order_by' => 'date_notified', + 'sort_order' => 'DESC', + 'page_arg' => 'npage', + 'page' => 1, + 'per_page' => 25, + 'max' => null, + 'meta_query' => false, + 'date_query' => false + ) ); + + // Sort order direction. + $orders = array( 'ASC', 'DESC' ); + if ( ! empty( $_GET['sort_order'] ) && in_array( $_GET['sort_order'], $orders ) ) { + $r['sort_order'] = $_GET['sort_order']; + } else { + $r['sort_order'] = in_array( $r['sort_order'], $orders ) ? $r['sort_order'] : 'DESC'; + } + + // Setup variables. + $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->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( $this->query_vars ); + $this->total_notification_count = BP_Notifications_Notification::get_total_count( $this->query_vars ); + + if ( empty( $this->notifications ) ) { + $this->notification_count = 0; + $this->total_notification_count = 0; + + } else { + if ( ! empty( $r['max'] ) ) { + if ( $r['max'] >= count( $this->notifications ) ) { + $this->notification_count = count( $this->notifications ); + } else { + $this->notification_count = (int) $r['max']; + } + } else { + $this->notification_count = count( $this->notifications ); + } + } + + 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->pag_arg, '%#%' ), + 'format' => '', + 'total' => ceil( (int) $this->total_notification_count / (int) $this->pag_num ), + 'current' => $this->pag_page, + 'prev_text' => _x( '←', 'Notifications pagination previous text', 'buddypress' ), + 'next_text' => _x( '→', 'Notifications pagination next text', 'buddypress' ), + 'mid_size' => 1, + 'add_args' => $add_args, + ) ); + } + } + + /** + * Whether there are notifications available in the loop. + * + * @since 1.9.0 + * + * @see bp_has_notifications() + * + * @return bool True if there are items in the loop, otherwise false. + */ + public function has_notifications() { + if ( $this->notification_count ) { + return true; + } + + return false; + } + + /** + * Set up the next notification and iterate index. + * + * @since 1.9.0 + * + * @return object The next notification to iterate over. + */ + public function next_notification() { + + $this->current_notification++; + + $this->notification = $this->notifications[ $this->current_notification ]; + + return $this->notification; + } + + /** + * Rewind the blogs and reset blog index. + * + * @since 1.9.0 + */ + public function rewind_notifications() { + + $this->current_notification = -1; + + if ( $this->notification_count > 0 ) { + $this->notification = $this->notifications[0]; + } + } + + /** + * Whether there are notifications left in the loop to iterate over. + * + * This method is used by {@link bp_notifications()} as part of the + * while loop that controls iteration inside the notifications loop, eg: + * while ( bp_notifications() ) { ... + * + * @since 1.9.0 + * + * @see bp_notifications() + * + * @return bool True if there are more notifications to show, + * otherwise false. + */ + public function notifications() { + + if ( $this->current_notification + 1 < $this->notification_count ) { + return true; + + } elseif ( $this->current_notification + 1 == $this->notification_count ) { + + /** + * Fires right before the rewinding of notification posts. + * + * @since 1.9.0 + */ + do_action( 'notifications_loop_end'); + + $this->rewind_notifications(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Set up the current notification inside the loop. + * + * Used by {@link bp_the_notification()} to set up the current + * notification data while looping, so that template tags used during + * that iteration make reference to the current notification. + * + * @since 1.9.0 + * + * @see bp_the_notification() + */ + public function the_notification() { + $this->in_the_loop = true; + $this->notification = $this->next_notification(); + + // Loop has just started. + if ( 0 === $this->current_notification ) { + + /** + * Fires if the current notification item is the first in the notification loop. + * + * @since 1.9.0 + */ + do_action( 'notifications_loop_start' ); + } + } +} 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 4b94e16a3960b0ef01caeb35638e19fe9e4a040e..3904dbfaefad46ca735bb7ec4c64a5988df2b8e9 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php @@ -1,18 +1,18 @@ <?php - /** * BuddyPress Settings Actions * * @todo split actions into separate screen functions * @package BuddyPress * @subpackage SettingsActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Handles the changing and saving of user email addresses 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 @@ -22,19 +22,21 @@ defined( 'ABSPATH' ) || exit; * Special considerations are made for super admins that are able to edit any * users accounts already, without knowing their existing password. * + * @since 1.6.0 + * * @global BuddyPress $bp */ function bp_settings_action_general() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Bail if no submit action + // Bail if no submit action. if ( ! isset( $_POST['submit'] ) ) return; - // Bail if not in settings + // Bail if not in settings. if ( ! bp_is_settings_component() || ! bp_is_current_action( 'general' ) ) return; @@ -51,29 +53,29 @@ function bp_settings_action_general() { $pass_changed = false; // true if the user changes their password $email_changed = false; // true if the user changes their email $feedback_type = 'error'; // success|error - $feedback = array(); // array of strings for feedback + $feedback = array(); // array of strings for feedback. - // Nonce check + // Nonce check. check_admin_referer('bp_settings_general'); - // Validate the user again for the current password when making a big change + // Validate the user again for the current password when making a big change. if ( ( is_super_admin() ) || ( !empty( $_POST['pwd'] ) && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) { $update_user = get_userdata( bp_displayed_user_id() ); - /** Email Change Attempt ******************************************/ + /* Email Change Attempt ******************************************/ if ( !empty( $_POST['email'] ) ) { // What is missing from the profile page vs signup - - // let's double check the goodies + // let's double check the goodies. $user_email = sanitize_email( esc_html( trim( $_POST['email'] ) ) ); $old_user_email = $bp->displayed_user->userdata->user_email; - // User is changing email address + // User is changing email address. if ( $old_user_email != $user_email ) { - // Run some tests on the email address + // Run some tests on the email address. $email_checks = bp_core_validate_email_address( $user_email ); if ( true !== $email_checks ) { @@ -90,9 +92,9 @@ function bp_settings_action_general() { } } - // Store a hash to enable email validation + // Store a hash to enable email validation. if ( false === $email_error ) { - $hash = wp_hash( $_POST['email'] ); + $hash = wp_generate_password( 32, false ); $pending_email = array( 'hash' => $hash, @@ -100,119 +102,92 @@ function bp_settings_action_general() { ); bp_update_user_meta( bp_displayed_user_id(), 'pending_email_change', $pending_email ); - - $email_text = sprintf( - __( 'Dear %1$s, - -You recently changed the email address associated with your account on %2$s. -If this is correct, please click on the following link to complete the change: -%3$s - -You can safely ignore and delete this email if you do not want to take this action or if you have received this email in error. - -This email has been sent to %4$s. - -Regards, -%5$s -%6$s', 'buddypress' ), - bp_core_get_user_displayname( bp_displayed_user_id() ), - bp_get_site_name(), - esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/?verify_email_change=' . $hash ), - $user_email, - bp_get_site_name(), - bp_get_root_domain() + $verify_link = bp_displayed_user_domain() . bp_get_settings_slug() . '/?verify_email_change=' . $hash; + + // Send the verification email. + $args = array( + 'tokens' => array( + 'displayname' => bp_core_get_user_displayname( bp_displayed_user_id() ), + 'old-user.email' => $old_user_email, + 'user.email' => $user_email, + 'verify.url' => esc_url( $verify_link ), + ), ); - - /** - * Filter the email text sent when a user changes emails. - * - * @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 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 ); - - // Send the verification email - wp_mail( $user_email, sprintf( __( '[%s] Verify your new email address', 'buddypress' ), wp_specialchars_decode( bp_get_site_name() ) ), $content ); + bp_send_email( 'settings-verify-email-change', bp_displayed_user_id(), $args ); // We mark that the change has taken place so as to ensure a - // success message, even though verification is still required + // success message, even though verification is still required. $_POST['email'] = $update_user->user_email; $email_changed = true; } - // No change + // No change. } else { $email_error = false; } - // Email address cannot be empty + // Email address cannot be empty. } else { $email_error = 'empty'; } - /** Password Change Attempt ***************************************/ + /* Password Change Attempt ***************************************/ if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) { if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) { - // Password change attempt is successful + // 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 + // The new password is the same as the current password. } else { $pass_error = 'same'; } - // Password change attempt was unsuccessful + // Password change attempt was unsuccessful. } else { $pass_error = 'mismatch'; } - // Both password fields were empty + // Both password fields were empty. } elseif ( empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) { $pass_error = false; - // One of the password boxes was left empty + // One of the password boxes was left empty. } elseif ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) { $pass_error = 'empty'; } // The structure of the $update_user object changed in WP 3.3, but - // wp_update_user() still expects the old format + // wp_update_user() still expects the old format. if ( isset( $update_user->data ) && is_object( $update_user->data ) ) { $update_user = $update_user->data; $update_user = get_object_vars( $update_user ); // Unset the password field to prevent it from emptying out the // user's user_pass field in the database. - // @see wp_update_user() + // @see wp_update_user(). if ( false === $pass_changed ) { unset( $update_user['user_pass'] ); } } // Clear cached data, so that the changed settings take effect - // on the current page load + // on the current page load. if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) { wp_cache_delete( 'bp_core_userdata_' . bp_displayed_user_id(), 'bp' ); $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); } - // Password Error + // Password Error. } else { $pass_error = 'invalid'; } - // Email feedback + // Email feedback. switch ( $email_error ) { case 'invalid' : $feedback['email_invalid'] = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' ); @@ -227,11 +202,11 @@ Regards, $feedback['email_empty'] = __( 'Email address cannot be empty.', 'buddypress' ); break; case false : - // No change + // No change. break; } - // Password feedback + // Password feedback. switch ( $pass_error ) { case 'invalid' : $feedback['pass_error'] = __( 'Your current password is invalid.', 'buddypress' ); @@ -246,16 +221,16 @@ Regards, $feedback['pass_same'] = __( 'The new password must be different from the current password.', 'buddypress' ); break; case false : - // No change + // No change. break; } - // No errors so show a simple success message + // No errors so show a simple success message. if ( ( ( false === $email_error ) || ( false == $pass_error ) ) && ( ( true === $pass_changed ) || ( true === $email_changed ) ) ) { $feedback[] = __( 'Your settings have been saved.', 'buddypress' ); $feedback_type = 'success'; - // Some kind of errors occurred + // Some kind of errors occurred. } elseif ( ( ( false === $email_error ) || ( false === $pass_error ) ) && ( ( false === $pass_changed ) || ( false === $email_changed ) ) ) { if ( bp_is_my_profile() ) { $feedback['nochange'] = __( 'No changes were made to your account.', 'buddypress' ); @@ -264,35 +239,37 @@ Regards, } } - // Set the feedback + // Set the feedback. bp_core_add_message( implode( "\n", $feedback ), $feedback_type ); /** * Fires after the general settings have been saved, and before redirect. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_core_general_settings_after_save' ); - // Redirect to prevent issues with browser back button + // Redirect to prevent issues with browser back button. bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ) ); } add_action( 'bp_actions', 'bp_settings_action_general' ); /** - * Handles the changing and saving of user notification settings + * Handles the changing and saving of user notification settings. + * + * @since 1.6.0 */ function bp_settings_action_notifications() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Bail if no submit action + // Bail if no submit action. if ( ! isset( $_POST['submit'] ) ) return; - // Bail if not in settings + // Bail if not in settings. if ( ! bp_is_settings_component() || ! bp_is_current_action( 'notifications' ) ) return false; @@ -306,7 +283,7 @@ function bp_settings_action_notifications() { bp_settings_update_notification_settings( bp_displayed_user_id(), (array) $_POST['notifications'] ); - // Switch feedback for super admins + // Switch feedback for super admins. if ( bp_is_my_profile() ) { bp_core_add_message( __( 'Your notification settings have been saved.', 'buddypress' ), 'success' ); } else { @@ -316,7 +293,7 @@ function bp_settings_action_notifications() { /** * Fires after the notification settings have been saved, and before redirect. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_core_notification_settings_after_save' ); @@ -326,18 +303,20 @@ add_action( 'bp_actions', 'bp_settings_action_notifications' ); /** * Handles the setting of user capabilities, spamming, hamming, role, etc... + * + * @since 1.6.0 */ function bp_settings_action_capabilities() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Bail if no submit action + // Bail if no submit action. if ( ! isset( $_POST['capabilities-submit'] ) ) return; - // Bail if not in settings + // Bail if not in settings. if ( ! bp_is_settings_component() || ! bp_is_current_action( 'capabilities' ) ) return false; @@ -348,22 +327,22 @@ function bp_settings_action_capabilities() { } // Only super admins can currently spam users (but they can't spam - // themselves) + // themselves). if ( ! is_super_admin() || bp_is_my_profile() ) { return; } - // Nonce check + // Nonce check. check_admin_referer( 'capabilities' ); /** * Fires before the capabilities settings have been saved. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_settings_capabilities_before_save' ); - /** Spam **************************************************************/ + /* Spam **************************************************************/ $is_spammer = !empty( $_POST['user-spammer'] ) ? true : false; @@ -374,7 +353,7 @@ function bp_settings_action_capabilities() { /** * Fires after processing a user as a spammer. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -382,34 +361,36 @@ function bp_settings_action_capabilities() { do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $status ); } - /** Other *************************************************************/ + /* Other *************************************************************/ /** * Fires after the capabilities settings have been saved and before redirect. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_settings_capabilities_after_save' ); - // Redirect to the root domain + // Redirect to the root domain. bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/' ); } add_action( 'bp_actions', 'bp_settings_action_capabilities' ); /** - * Handles the deleting of a user + * Handles the deleting of a user. + * + * @since 1.6.0 */ function bp_settings_action_delete_account() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Bail if no submit action + // Bail if no submit action. if ( ! isset( $_POST['delete-account-understand'] ) ) return; - // Bail if not in settings + // Bail if not in settings. if ( ! bp_is_settings_component() || ! bp_is_current_action( 'delete-account' ) ) return false; @@ -419,24 +400,24 @@ function bp_settings_action_delete_account() { return; } - // Bail if account deletion is disabled + // Bail if account deletion is disabled. if ( bp_disable_account_deletion() && ! bp_current_user_can( 'delete_users' ) ) { return false; } - // Nonce check + // Nonce check. check_admin_referer( 'delete-account' ); // Get username now because it might be gone soon! $username = bp_get_displayed_user_fullname(); - // delete the users account + // Delete the users account. if ( bp_core_delete_account( bp_displayed_user_id() ) ) { - // Add feedback after 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 + // Redirect to the root domain. bp_core_redirect( bp_get_root_domain() ); } } @@ -445,7 +426,7 @@ add_action( 'bp_actions', 'bp_settings_action_delete_account' ); /** * Process email change verification or cancel requests. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_settings_verify_email_change(){ if ( ! bp_is_settings_component() ) { @@ -458,11 +439,11 @@ function bp_settings_verify_email_change(){ $redirect_to = trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() ); - // Email change is being verified + // Email change is being verified. if ( isset( $_GET['verify_email_change'] ) ) { $pending_email = bp_get_user_meta( bp_displayed_user_id(), 'pending_email_change', true ); - // Bail if the hash provided doesn't match the one saved in the database + // Bail if the hash provided doesn't match the one saved in the database. if ( urldecode( $_GET['verify_email_change'] ) !== $pending_email['hash'] ) { return; } @@ -473,23 +454,23 @@ function bp_settings_verify_email_change(){ ) ); if ( $email_changed ) { - // Delete object cache for displayed user + // Delete object cache for displayed user. wp_cache_delete( 'bp_core_userdata_' . bp_displayed_user_id(), 'bp' ); - // Delete the pending email change key + // Delete the pending email change key. bp_delete_user_meta( bp_displayed_user_id(), 'pending_email_change' ); - // Post a success message and redirect + // Post a success message and redirect. bp_core_add_message( __( 'You have successfully verified your new email address.', 'buddypress' ) ); } else { - // Unknown error + // Unknown error. bp_core_add_message( __( 'There was a problem verifying your new email address. Please try again.', 'buddypress' ), 'error' ); } bp_core_redirect( $redirect_to ); die(); - // Email change is being dismissed + // Email change is being dismissed. } elseif ( ! empty( $_GET['dismiss_email_change'] ) ) { bp_delete_user_meta( bp_displayed_user_id(), 'pending_email_change' ); bp_core_add_message( __( 'You have successfully dismissed your pending email change.', 'buddypress' ) ); @@ -503,7 +484,7 @@ 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) + * @since 2.2.0 */ function bp_settings_remove_email_subnav() { if ( ! has_action( 'bp_notification_settings' ) ) { 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 9081bccadb05b079e021658696b2c635125bc322..aa7f776d81727e009af7bf19c40644917e3e2751 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php @@ -1,13 +1,13 @@ <?php - /** * BuddyPress Settings Functions * * @package BuddyPress * @subpackage SettingsFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. 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 c310125e284e0d7fe98c668695309efdfe9ca7ce..b417d8e78ae0b5f1b91403d56d031abd3c05bbfd 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php @@ -1,202 +1,22 @@ <?php - /** - * BuddyPress Settings Loader + * BuddyPress Settings Loader. * * @package BuddyPress * @subpackage SettingsLoader + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_Settings_Component extends BP_Component { - - /** - * Start the settings component creation process - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'settings', - __( 'Settings', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 100 - ) - ); - } - - /** - * Include files - * - * @global BuddyPress $bp The one true BuddyPress instance - */ - public function includes( $includes = array() ) { - parent::includes( array( - 'actions', - 'screens', - 'template', - 'functions', - ) ); - } - - /** - * Setup globals - * - * The BP_SETTINGS_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - */ - public function setup_globals( $args = array() ) { - - // Define a slug, if necessary - if ( !defined( 'BP_SETTINGS_SLUG' ) ) - define( 'BP_SETTINGS_SLUG', $this->id ); - - // All globals for settings component. - parent::setup_globals( array( - 'slug' => BP_SETTINGS_SLUG, - 'has_directory' => false, - ) ); - } - - /** - * Set up navigation. - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - // Add the settings navigation item - $main_nav = array( - 'name' => __( 'Settings', 'buddypress' ), - 'slug' => $this->slug, - 'position' => 100, - 'show_for_displayed_user' => bp_core_can_edit_settings(), - 'screen_function' => 'bp_settings_screen_general', - 'default_subnav_slug' => 'general' - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - $settings_link = trailingslashit( $user_domain . $this->slug ); - - // Add General Settings nav item - $sub_nav[] = array( - 'name' => __( 'General', 'buddypress' ), - 'slug' => 'general', - 'parent_url' => $settings_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_settings_screen_general', - 'position' => 10, - 'user_has_access' => bp_core_can_edit_settings() - ); - - // Add Email nav item. Formerly called 'Notifications', we - // retain the old slug and function names for backward compat - $sub_nav[] = array( - 'name' => __( 'Email', 'buddypress' ), - 'slug' => 'notifications', - 'parent_url' => $settings_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_settings_screen_notification', - 'position' => 20, - 'user_has_access' => bp_core_can_edit_settings() - ); - - // Add Spam Account nav item - if ( bp_current_user_can( 'bp_moderate' ) ) { - $sub_nav[] = array( - 'name' => __( 'Capabilities', 'buddypress' ), - 'slug' => 'capabilities', - 'parent_url' => $settings_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_settings_screen_capabilities', - 'position' => 80, - 'user_has_access' => ! bp_is_my_profile() - ); - } - - // Add Delete Account nav item - if ( ( ! bp_disable_account_deletion() && bp_is_my_profile() ) || bp_current_user_can( 'delete_users' ) ) { - $sub_nav[] = array( - 'name' => __( 'Delete Account', 'buddypress' ), - 'slug' => 'delete-account', - 'parent_url' => $settings_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_settings_screen_delete_account', - 'position' => 90, - 'user_has_access' => ! is_super_admin( bp_displayed_user_id() ) - ); - } - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the Toolbar - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - - // The instance - $bp = buddypress(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Setup the logged in user variables - $user_domain = bp_loggedin_user_domain(); - $settings_link = trailingslashit( $user_domain . $this->slug ); - - // Add main Settings menu - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => __( 'Settings', 'buddypress' ), - 'href' => trailingslashit( $settings_link ) - ); - - // General Account - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-general', - 'title' => __( 'General', 'buddypress' ), - 'href' => trailingslashit( $settings_link . 'general' ) - ); - - // 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' ) && ! 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', - 'title' => __( 'Delete Account', 'buddypress' ), - 'href' => trailingslashit( $settings_link . 'delete-account' ) - ); - } - } - - parent::setup_admin_bar( $wp_admin_nav ); - } -} +require dirname( __FILE__ ) . '/classes/class-bp-settings-component.php'; +/** + * Instantiates the settings component. + * + * @since 1.6.0 + */ function bp_setup_settings() { buddypress()->settings = new BP_Settings_Component(); } 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 8ecc3b40a7e1b00f7c7dc9353ec2f08f281ed3bb..7fd7685b3d2b824d15e8da72cc14b41346069961 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php @@ -1,19 +1,19 @@ <?php - /** - * BuddyPress Settings Screens + * BuddyPress Settings Screens. * * @package BuddyPress * @subpackage SettingsScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Show the general settings template + * Show the general settings template. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_settings_screen_general() { @@ -25,7 +25,7 @@ function bp_settings_screen_general() { /** * Filters the template file path to use for the general settings screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Directory path to look in for the template file. */ @@ -33,9 +33,9 @@ function bp_settings_screen_general() { } /** - * Show the notifications settings template + * Show the notifications settings template. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_settings_screen_notification() { @@ -47,7 +47,7 @@ function bp_settings_screen_notification() { /** * Filters the template file path to use for the notification settings screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Directory path to look in for the template file. */ @@ -55,9 +55,9 @@ function bp_settings_screen_notification() { } /** - * Show the delete-account settings template + * Show the delete-account settings template. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function bp_settings_screen_delete_account() { @@ -69,7 +69,7 @@ function bp_settings_screen_delete_account() { /** * Filters the template file path to use for the delete-account settings screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Directory path to look in for the template file. */ @@ -77,9 +77,9 @@ function bp_settings_screen_delete_account() { } /** - * Show the capabilities settings template + * Show the capabilities settings template. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ function bp_settings_screen_capabilities() { @@ -91,7 +91,7 @@ function bp_settings_screen_capabilities() { /** * Filters the template file path to use for the capabilities settings screen. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $value Directory path to look in for the template file. */ 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 093a75b06d122eabeab67dc2e61059e958526440..01f3b64c78aafc5bb6ea6ede3e4dbef589ced3d8 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php @@ -1,21 +1,19 @@ <?php - /** - * BuddyPress Settings Template Functions + * BuddyPress Settings Template Functions. * * @package BuddyPress * @subpackage SettingsTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Output the settings component slug + * Output the settings component slug. * - * @package BuddyPress - * @subpackage SettingsTemplate - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_settings_slug() */ @@ -23,18 +21,18 @@ function bp_settings_slug() { echo bp_get_settings_slug(); } /** - * Return the settings component slug + * Return the settings component slug. + * + * @since 1.5.0 * - * @package BuddyPress - * @subpackage SettingsTemplate - * @since BuddyPress (1.5.0) + * @return string */ function bp_get_settings_slug() { /** * Filters the Settings component slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $slug Settings component slug. */ @@ -42,11 +40,9 @@ function bp_settings_slug() { } /** - * Output the settings component root slug + * Output the settings component root slug. * - * @package BuddyPress - * @subpackage SettingsTemplate - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @uses bp_get_settings_root_slug() */ @@ -54,18 +50,18 @@ function bp_settings_root_slug() { echo bp_get_settings_root_slug(); } /** - * Return the settings component root slug + * Return the settings component root slug. + * + * @since 1.5.0 * - * @package BuddyPress - * @subpackage SettingsTemplate - * @since BuddyPress (1.5.0) + * @return string */ function bp_get_settings_root_slug() { /** * Filters the Settings component root slug. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $root_slug Settings component root slug. */ @@ -75,7 +71,7 @@ function bp_settings_root_slug() { /** * Add the 'pending email change' message to the settings page. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_settings_pending_email_notice() { $pending_email = bp_get_user_meta( bp_displayed_user_id(), 'pending_email_change', true ); @@ -91,7 +87,13 @@ function bp_settings_pending_email_notice() { ?> <div id="message" class="bp-template-notice error"> - <p><?php printf( __( '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>', 'buddypress' ), $pending_email['newemail'], bp_get_displayed_user_email(), esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1' ) ) ?></p> + <p><?php printf( + __( 'There is a pending change of your email address to %1$s.<br />Check your email (%2$s) for the verification link. <a href="%3$s">Cancel</a>', 'buddypress' ), + '<code>' . $pending_email['newemail'] . '</code>', + '<code>' . $pending_email['newemail'] . '</code>', + esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/?dismiss_email_change=1' ) + ); + ?></p> </div> <?php diff --git a/wp-content/plugins/buddypress/bp-settings/classes/class-bp-settings-component.php b/wp-content/plugins/buddypress/bp-settings/classes/class-bp-settings-component.php new file mode 100644 index 0000000000000000000000000000000000000000..7d5bb110fe3b62beb7456cede098fb9e57908f55 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-settings/classes/class-bp-settings-component.php @@ -0,0 +1,218 @@ +<?php +/** + * BuddyPress Settings Loader. + * + * @package BuddyPress + * @subpackage SettingsLoader + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Creates our Settings component. + * + * @since 1.5.0 + */ +class BP_Settings_Component extends BP_Component { + + /** + * Start the settings component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'settings', + __( 'Settings', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 100 + ) + ); + } + + /** + * Include files. + * + * @since 1.5.0 + * + * @param array $includes Array of values to include. Not used. + */ + public function includes( $includes = array() ) { + parent::includes( array( + 'actions', + 'screens', + 'template', + 'functions', + ) ); + } + + /** + * Setup globals. + * + * The BP_SETTINGS_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @param array $args Array of arguments. + */ + public function setup_globals( $args = array() ) { + + // Define a slug, if necessary. + if ( ! defined( 'BP_SETTINGS_SLUG' ) ) { + define( 'BP_SETTINGS_SLUG', $this->id ); + } + + // All globals for settings component. + parent::setup_globals( array( + 'slug' => BP_SETTINGS_SLUG, + 'has_directory' => false, + ) ); + } + + /** + * Set up navigation. + * + * @since 1.5.0 + * + * @param array $main_nav Array of main nav items. + * @param array $sub_nav Array of sub nav items. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $access = bp_core_can_edit_settings(); + $slug = bp_get_settings_slug(); + $settings_link = trailingslashit( $user_domain . $slug ); + + // Add the settings navigation item. + $main_nav = array( + 'name' => __( 'Settings', 'buddypress' ), + 'slug' => $slug, + 'position' => 100, + 'show_for_displayed_user' => $access, + 'screen_function' => 'bp_settings_screen_general', + 'default_subnav_slug' => 'general' + ); + + // Add General Settings nav item. + $sub_nav[] = array( + 'name' => __( 'General', 'buddypress' ), + 'slug' => 'general', + 'parent_url' => $settings_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_settings_screen_general', + 'position' => 10, + 'user_has_access' => $access + ); + + // Add Email nav item. Formerly called 'Notifications', we + // retain the old slug and function names for backward compat. + $sub_nav[] = array( + 'name' => __( 'Email', 'buddypress' ), + 'slug' => 'notifications', + 'parent_url' => $settings_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_settings_screen_notification', + 'position' => 20, + 'user_has_access' => $access + ); + + // Add Spam Account nav item. + if ( bp_current_user_can( 'bp_moderate' ) ) { + $sub_nav[] = array( + 'name' => __( 'Capabilities', 'buddypress' ), + 'slug' => 'capabilities', + 'parent_url' => $settings_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_settings_screen_capabilities', + 'position' => 80, + 'user_has_access' => ! bp_is_my_profile() + ); + } + + // Add Delete Account nav item. + if ( ( ! bp_disable_account_deletion() && bp_is_my_profile() ) || bp_current_user_can( 'delete_users' ) ) { + $sub_nav[] = array( + 'name' => __( 'Delete Account', 'buddypress' ), + 'slug' => 'delete-account', + 'parent_url' => $settings_link, + 'parent_slug' => $slug, + 'screen_function' => 'bp_settings_screen_delete_account', + 'position' => 90, + 'user_has_access' => ! is_super_admin( bp_displayed_user_id() ) + ); + } + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the Toolbar. + * + * @since 1.5.0 + * + * @param array $wp_admin_nav Array of Admin Bar items. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Setup the logged in user variables. + $settings_link = trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() ); + + // Add main Settings menu. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => __( 'Settings', 'buddypress' ), + 'href' => $settings_link + ); + + // General Account. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-general', + 'title' => __( 'General', 'buddypress' ), + 'href' => $settings_link, + 'position' => 10 + ); + + // 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' ), + 'position' => 20 + ); + } + + // Delete Account + 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', + 'title' => __( 'Delete Account', 'buddypress' ), + 'href' => trailingslashit( $settings_link . 'delete-account' ), + 'position' => 90 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } +} 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 457e20ddaa921d901a65bafcc6486baddb7ad559..e7209222e9fc2b5fa82c94991e112e968dfe8fe1 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 @@ -1,14 +1,14 @@ <?php - /** - * Functions of BuddyPress's Legacy theme + * Functions of BuddyPress's Legacy theme. + * + * @since 1.7.0 * * @package BuddyPress * @subpackage BP_Theme_Compat - * @since BuddyPress (1.7) */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** Theme Setup ***************************************************************/ @@ -16,7 +16,7 @@ defined( 'ABSPATH' ) || exit; if ( !class_exists( 'BP_Legacy' ) ) : /** - * Loads BuddyPress Legacy Theme functionality + * Loads BuddyPress Legacy Theme functionality. * * This is not a real theme by WordPress standards, and is instead used as the * fallback for any WordPress theme that does not have BuddyPress templates in it. @@ -27,7 +27,7 @@ if ( !class_exists( 'BP_Legacy' ) ) : * * See @link BP_Theme_Compat() for more. * - * @since BuddyPress (1.7) + * @since 1.7.0 * * @package BuddyPress * @subpackage BP_Theme_Compat @@ -37,9 +37,9 @@ class BP_Legacy extends BP_Theme_Compat { /** Functions *************************************************************/ /** - * The main BuddyPress (Legacy) Loader + * The main BuddyPress (Legacy) Loader. * - * @since BuddyPress (1.7) + * @since 1.7.0 * * @uses BP_Legacy::setup_globals() * @uses BP_Legacy::setup_actions() @@ -49,13 +49,12 @@ class BP_Legacy extends BP_Theme_Compat { } /** - * Component global variables + * Component global variables. * * You'll want to customize the values in here, so they match whatever your * needs are. * - * @since BuddyPress (1.7) - * @access private + * @since 1.7.0 */ protected function setup_globals() { $bp = buddypress(); @@ -67,20 +66,19 @@ class BP_Legacy extends BP_Theme_Compat { } /** - * Setup the theme hooks + * Setup the theme hooks. * - * @since BuddyPress (1.7) - * @access private + * @since 1.7.0 * * @uses add_filter() To add various filters * @uses add_action() To add various actions */ protected function setup_actions() { - // Template Output + // 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 + // Filter BuddyPress template hierarchy and look for page templates. add_filter( 'bp_get_buddypress_template', array( $this, 'theme_compat_page_templates' ), 10, 1 ); /** Scripts ***********************************************************/ @@ -88,7 +86,7 @@ class BP_Legacy extends BP_Theme_Compat { add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS 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> + add_action( 'bp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head>. /** Body no-js Class **************************************************/ @@ -98,19 +96,19 @@ class BP_Legacy extends BP_Theme_Compat { if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Register buttons for the relevant component templates - // Friends button + // Friends button. if ( bp_is_active( 'friends' ) ) add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); - // Activity button + // Activity button. if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 ); - // Messages button + // Messages button. if ( bp_is_active( 'messages' ) ) add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 ); - // Group buttons + // 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 ); @@ -118,7 +116,7 @@ class BP_Legacy extends BP_Theme_Compat { add_action( 'bp_groups_directory_group_filter', 'bp_legacy_theme_group_create_nav', 999 ); } - // Blog button + // 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 ); @@ -137,7 +135,7 @@ class BP_Legacy extends BP_Theme_Compat { $actions = array( - // Directory filters + // Directory filters. 'blogs_filter' => 'bp_legacy_theme_object_template_loader', 'forums_filter' => 'bp_legacy_theme_object_template_loader', 'groups_filter' => 'bp_legacy_theme_object_template_loader', @@ -146,12 +144,12 @@ class BP_Legacy extends BP_Theme_Compat { 'invite_filter' => 'bp_legacy_theme_invite_template_loader', 'requests_filter' => 'bp_legacy_theme_requests_template_loader', - // Friends + // Friends. 'accept_friendship' => 'bp_legacy_theme_ajax_accept_friendship', 'addremove_friend' => 'bp_legacy_theme_ajax_addremove_friend', 'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship', - // Activity + // Activity. 'activity_get_older_updates' => 'bp_legacy_theme_activity_template_loader', 'activity_mark_fav' => 'bp_legacy_theme_mark_activity_favorite', 'activity_mark_unfav' => 'bp_legacy_theme_unmark_activity_favorite', @@ -164,11 +162,11 @@ class BP_Legacy extends BP_Theme_Compat { 'bp_spam_activity' => 'bp_legacy_theme_spam_activity', 'bp_spam_activity_comment' => 'bp_legacy_theme_spam_activity', - // Groups + // Groups. 'groups_invite_user' => 'bp_legacy_theme_ajax_invite_user', 'joinleave_group' => 'bp_legacy_theme_ajax_joinleave_group', - // Messages + // Messages. 'messages_autocomplete_results' => 'bp_legacy_theme_ajax_messages_autocomplete_results', 'messages_close_notice' => 'bp_legacy_theme_ajax_close_notice', 'messages_delete' => 'bp_legacy_theme_ajax_messages_delete', @@ -177,13 +175,13 @@ class BP_Legacy extends BP_Theme_Compat { 'messages_send_reply' => 'bp_legacy_theme_ajax_messages_send_reply', ); - // Conditional actions + // Conditional actions. if ( bp_is_active( 'messages', 'star' ) ) { $actions['messages_star'] = 'bp_legacy_theme_ajax_messages_star_handler'; } /** - * Register all of these AJAX handlers + * Register all of these AJAX handlers. * * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" * executes for users that aren't logged in. This is for backpat with BP <1.6. @@ -200,7 +198,7 @@ class BP_Legacy extends BP_Theme_Compat { /** * Fires after all of the BuddyPress theme compat actions have been added. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param BP_Legacy $this Current BP_Legacy instance. */ @@ -210,18 +208,18 @@ 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. + * @since 1.7.0 + * @since 2.3.0 Support custom CSS file named after the current theme or parent theme. * * @uses wp_enqueue_style() To enqueue the styles */ public function enqueue_styles() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); - // Locate the BP stylesheet + // Locate the BP stylesheet. $ltr = $this->locate_asset_in_stack( "buddypress{$min}.css", 'css' ); - // LTR + // LTR. if ( ! is_rtl() && isset( $ltr['location'], $ltr['handle'] ) ) { wp_enqueue_style( $ltr['handle'], $ltr['location'], array(), $this->version, 'screen' ); @@ -230,12 +228,12 @@ class BP_Legacy extends BP_Theme_Compat { } } - // RTL + // 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 + $rtl['handle'] = str_replace( '-css', '-css-rtl', $rtl['handle'] ); // Backwards compatibility. wp_enqueue_style( $rtl['handle'], $rtl['location'], array(), $this->version, 'screen' ); if ( $min ) { @@ -247,7 +245,7 @@ class BP_Legacy extends BP_Theme_Compat { // 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 + // Use a unique handle. $theme['handle'] = 'bp-' . get_template(); wp_enqueue_style( $theme['handle'], $theme['location'], array(), $this->version, 'screen' ); @@ -256,7 +254,7 @@ class BP_Legacy extends BP_Theme_Compat { } } - // Compatibility stylesheet for specific themes, RTL-version + // Compatibility stylesheet for specific themes, RTL-version. if ( is_rtl() ) { $theme_rtl = $this->locate_asset_in_stack( get_template() . "-rtl{$min}.css", 'css' ); @@ -274,16 +272,16 @@ class BP_Legacy extends BP_Theme_Compat { /** * Enqueue the required JavaScript files * - * @since BuddyPress (1.7) + * @since 1.7.0 */ public function enqueue_scripts() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); - // Locate the BP JS file + // Locate the BP JS file. $asset = $this->locate_asset_in_stack( "buddypress{$min}.js", 'js' ); // Enqueue the global JS, if found - AJAX will not work - // without it + // without it. if ( isset( $asset['location'], $asset['handle'] ) ) { wp_enqueue_script( $asset['handle'], $asset['location'], bp_core_get_js_dependencies(), $this->version ); } @@ -291,7 +289,7 @@ class BP_Legacy extends BP_Theme_Compat { /** * Filters core JavaScript strings for internationalization before AJAX usage. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $value Array of key/value pairs for AJAX usage. */ @@ -312,26 +310,26 @@ class BP_Legacy extends BP_Theme_Compat { ) ); wp_localize_script( $asset['handle'], 'BP_DTheme', $params ); - // Maybe enqueue comment reply JS + // Maybe enqueue comment reply JS. if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } - // Maybe enqueue password verify JS (register page or user settings page) + // Maybe enqueue password verify JS (register page or user settings page). if ( bp_is_register_page() || ( function_exists( 'bp_is_user_settings_general' ) && bp_is_user_settings_general() ) ) { - // Locate the Register Page JS file + // Locate the Register Page JS file. $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', ) ); - // Enqueue script + // Enqueue script. wp_enqueue_script( $asset['handle'] . '-password-verify', $asset['location'], $dependencies, $this->version); } - // Star private messages + // Star private messages. if ( bp_is_active( 'messages', 'star' ) && bp_is_user_messages() ) { wp_localize_script( $asset['handle'], 'BP_PM_Star', array( 'strings' => array( @@ -371,9 +369,8 @@ class BP_Legacy extends BP_Theme_Compat { * release, in favor of a unified _template_stack() system. Plugin * and theme authors should not attempt to use what follows. * - * @since BuddyPress (1.8) - * @access private - * @param string $file A filename like buddypress.css + * @since 1.8.0 + * @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: @@ -388,7 +385,7 @@ class BP_Legacy extends BP_Theme_Compat { $file = str_replace( '.min', '', $file ); } - // No need to check child if template == stylesheet + // No need to check child if template == stylesheet. if ( is_child_theme() ) { $locations['bp-child'] = array( 'dir' => get_stylesheet_directory(), @@ -409,7 +406,7 @@ class BP_Legacy extends BP_Theme_Compat { 'file' => $file, ); - // Subdirectories within the top-level $locations directories + // Subdirectories within the top-level $locations directories. $subdirs = array( 'buddypress/' . $type, 'community/' . $type, @@ -433,9 +430,9 @@ class BP_Legacy extends BP_Theme_Compat { } /** - * Put some scripts in the header, like AJAX url for wp-lists + * Put some scripts in the header, like AJAX url for wp-lists. * - * @since BuddyPress (1.7) + * @since 1.7.0 */ public function head_scripts() { ?> @@ -458,7 +455,10 @@ class BP_Legacy extends BP_Theme_Compat { * * The no-js class is removed by the JavaScript created in buddypress.js. * - * @since BuddyPress (1.7) + * @since 1.7.0 + * + * @param array $classes Array of classes to append to body tag. + * @return array $classes */ public function add_nojs_body_class( $classes ) { if ( ! in_array( 'no-js', $classes ) ) @@ -468,11 +468,11 @@ class BP_Legacy extends BP_Theme_Compat { } /** - * Load localizations for topic script + * Load localizations for topic script. * * These localizations require information that may not be loaded even by init. * - * @since BuddyPress (1.7) + * @since 1.7.0 */ public function localize_scripts() { } @@ -480,16 +480,16 @@ class BP_Legacy extends BP_Theme_Compat { /** * Outputs sitewide notices markup in the footer. * - * @since BuddyPress (1.7) + * @since 1.7.0 * * @see https://buddypress.trac.wordpress.org/ticket/4802 */ public function sitewide_notices() { - // Do not show notices if user is not logged in + // Do not show notices if user is not logged in. if ( ! is_user_logged_in() ) return; - // add a class to determine if the admin bar is on or not + // Add a class to determine if the admin bar is on or not. $class = did_action( 'admin_bar_menu' ) ? 'admin-bar-on' : 'admin-bar-off'; echo '<div id="sitewide-notice" class="' . $class . '">'; @@ -500,18 +500,17 @@ class BP_Legacy extends BP_Theme_Compat { /** * Add secondary avatar image to this activity stream's record, if supported. * - * @since BuddyPress (1.7) + * @since 1.7.0 * - * @param string $action The text of this activity - * @param BP_Activity_Activity $activity Activity object - * @package BuddyPress Theme + * @param string $action The text of this activity. + * @param BP_Activity_Activity $activity Activity object. * @return string */ function secondary_avatars( $action, $activity ) { switch ( $activity->component ) { case 'groups' : case 'friends' : - // Only insert avatar if one exists + // Only insert avatar if one exists. if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) { $reverse_content = strrev( $action ); $position = strpos( $reverse_content, 'a<' ); @@ -529,9 +528,9 @@ class BP_Legacy extends BP_Theme_Compat { * * @see https://buddypress.trac.wordpress.org/ticket/6065 * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param array $templates + * @param array $templates Array of 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 @@ -541,7 +540,7 @@ class BP_Legacy extends BP_Theme_Compat { /** * Filters whether or not we are looking at a directory to determine if to return early. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param bool $value Whether or not we are viewing a directory. */ @@ -549,7 +548,7 @@ class BP_Legacy extends BP_Theme_Compat { return $templates; } - // No page ID yet + // No page ID yet. $page_id = 0; // Get the WordPress Page ID for the current view. @@ -572,12 +571,12 @@ class BP_Legacy extends BP_Theme_Compat { } } - // Bail if no directory page set + // Bail if no directory page set. if ( 0 === $page_id ) { return $templates; } - // Check for page template + // 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 @@ -604,10 +603,10 @@ endif; /** * Add the Create a Group button to the Groups directory title. * - * bp-legacy puts the Create a Group button into the page title, to mimic + * The bp-legacy puts the Create a Group button into the page title, to mimic * the behavior of bp-default. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * @todo Deprecate * * @param string $title Groups directory title. @@ -620,13 +619,12 @@ function bp_legacy_theme_group_create_button( $title ) { /** * 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 bp-legacy puts the Create a Group nav at the last position of * the Groups directory navigation. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @uses bp_group_create_nav_item() to output the create a Group nav item - * @return string + * @uses bp_group_create_nav_item() to output the create a Group nav item. */ function bp_legacy_theme_group_create_nav() { bp_group_create_nav_item(); @@ -635,10 +633,10 @@ function bp_legacy_theme_group_create_nav() { /** * Add the Create a Site button to the Sites directory title. * - * bp-legacy puts the Create a Site button into the page title, to mimic + * The bp-legacy puts the Create a Site button into the page title, to mimic * the behavior of bp-default. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * @todo Deprecate * * @param string $title Sites directory title. @@ -651,13 +649,12 @@ function bp_legacy_theme_blog_create_button( $title ) { /** * 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 bp-legacy puts the Create a Site nav at the last position of * the Sites directory navigation. * - * @since BuddyPress (2.2.0) + * @since 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(); @@ -676,14 +673,16 @@ function bp_legacy_theme_blog_create_nav() { * By using cookies we can also make sure that user settings are retained * across page loads. * + * @param string $query_string Query string for the current request. + * @param string $object Object for cookie. * @return string Query string for the component loops - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_legacy_theme_ajax_querystring( $query_string, $object ) { if ( empty( $object ) ) return ''; - // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts + // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts. if ( ! empty( $_POST['cookie'] ) ) { $_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) ); } else { @@ -697,7 +696,7 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) { * default params passed to the template loop. */ - // Activity stream filtering on action + // Activity stream filtering on action. if ( ! empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) { $qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter']; $qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; @@ -718,19 +717,19 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) { if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] ) $qs[] = 'page=' . absint( $_POST['page'] ); - // excludes 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 ); } - // to get newest activities + // To get newest activities. if ( ! empty( $_POST['offset'] ) ) { $qs[] = 'offset=' . intval( $_POST['offset'] ); } $object_search_text = bp_get_search_default_text( $object ); - if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) + if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) $qs[] = 'search_terms=' . urlencode( $_POST['search_terms'] ); // Now pass the querystring to override default values. @@ -759,7 +758,7 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) { /** * Filters the AJAX query string for the component loops. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $query_string The query string we are working with. * @param string $object The type of page we are on. @@ -776,25 +775,25 @@ function bp_legacy_theme_ajax_querystring( $query_string, $object ) { * Load the template loop for the current object. * * @return string Prints template loop for the specified object - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_legacy_theme_object_template_loader() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Bail if no object passed + // Bail if no object passed. if ( empty( $_POST['object'] ) ) return; - // Sanitize the object + // Sanitize the object. $object = sanitize_title( $_POST['object'] ); - // Bail if object is not an active component to prevent arbitrary file inclusion + // Bail if object is not an active component to prevent arbitrary file inclusion. if ( ! bp_is_active( $object ) ) return; - /** + /** * AJAX requests happen too early to be seen by bp_update_is_directory() * so we do it manually here to ensure templates load with the correct * context. Without this check, templates will load the 'single' version @@ -805,12 +804,12 @@ function bp_legacy_theme_object_template_loader() { $template_part = $object . '/' . $object . '-loop'; - // The template part can be overridden by the calling JS function + // The template part can be overridden by the calling JS function. if ( ! empty( $_POST['template'] ) ) { $template_part = sanitize_option( 'upload_path', $_POST['template'] ); } - // Locate the object template + // Locate the object template. bp_get_template_part( $template_part ); exit(); } @@ -818,8 +817,9 @@ function bp_legacy_theme_object_template_loader() { /** * Load messages template loop when searched on the private message page * - * @return string Prints template loop for the Messages component - * @since BuddyPress (1.6) + * @since 1.6.0 + * + * @return string Prints template loop for the Messages component. */ function bp_legacy_theme_messages_template_loader() { bp_get_template_part( 'members/single/messages/messages-loop' ); @@ -829,7 +829,7 @@ function bp_legacy_theme_messages_template_loader() { /** * Load group invitations loop to handle pagination requests sent via AJAX. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_legacy_theme_invite_template_loader() { bp_get_template_part( 'groups/single/invites-loop' ); @@ -839,7 +839,7 @@ function bp_legacy_theme_invite_template_loader() { /** * Load group membership requests loop to handle pagination requests sent via AJAX. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_legacy_theme_requests_template_loader() { bp_get_template_part( 'groups/single/requests-loop' ); @@ -847,15 +847,15 @@ function bp_legacy_theme_requests_template_loader() { } /** - * Load the activity loop template when activity is requested via AJAX, + * Load the activity loop template when activity is requested via AJAX. * * @return string JSON object containing 'contents' (output of the template loop * for the Activity component) and 'feed_url' (URL to the relevant RSS feed). * - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_legacy_theme_activity_template_loader() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -863,7 +863,7 @@ function bp_legacy_theme_activity_template_loader() { if ( ! empty( $_POST['scope'] ) ) $scope = $_POST['scope']; - // We need to calculate and return the feed URL for each scope + // We need to calculate and return the feed URL for each scope. switch ( $scope ) { case 'friends': $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/'; @@ -891,7 +891,7 @@ function bp_legacy_theme_activity_template_loader() { /** * Filters the feed URL for when activity is requested via AJAX. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * * @param string $feed_url URL for the feed to be used. * @param string $scope Scope for the activity request. @@ -906,16 +906,16 @@ function bp_legacy_theme_activity_template_loader() { * Processes Activity updates received via a POST request. * * @return string HTML - * @since BuddyPress (1.2) + * @since 1.2.0 */ function bp_legacy_theme_post_update() { $bp = buddypress(); - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Check the nonce + // Check the nonce. check_admin_referer( 'post_update', '_wpnonce_post_update' ); if ( ! is_user_logged_in() ) @@ -925,17 +925,36 @@ function bp_legacy_theme_post_update() { 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' ) ) { + $item_id = 0; + $object = ''; + + + // Try to get the item id from posted variables. + if ( ! empty( $_POST['item_id'] ) ) { + $item_id = (int) $_POST['item_id']; + } + + // Try to get the object from posted variables. + if ( ! empty( $_POST['object'] ) ) { + $object = sanitize_key( $_POST['object'] ); + + // If the object is not set and we're in a group, set the item id and the object + } elseif ( bp_is_group() ) { + $item_id = bp_get_current_group_id(); + $object = 'groups'; + } + + if ( ! $object && bp_is_active( 'activity' ) ) { $activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) ); - } elseif ( $_POST['object'] == 'groups' ) { - if ( ! empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) ) - $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) ); + } elseif ( 'groups' === $object ) { + if ( $item_id && bp_is_active( 'groups' ) ) + $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $item_id ) ); } else { /** 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'] ); + $activity_id = apply_filters( 'bp_activity_custom_update', false, $object, $item_id, $_POST['content'] ); } if ( empty( $activity_id ) ) @@ -967,21 +986,23 @@ function bp_legacy_theme_post_update() { /** * Posts new Activity comments received via a POST request. * + * @since 1.2.0 + * * @global BP_Activity_Template $activities_template + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_new_activity_comment() { global $activities_template; $bp = buddypress(); - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { return; } - // Check the nonce + // Check the nonce. check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' ); if ( ! is_user_logged_in() ) { @@ -1013,17 +1034,17 @@ function bp_legacy_theme_new_activity_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 + // 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 ); - // Swap the current comment with the activity item we just loaded + // Swap the current comment with the activity item we just loaded. if ( isset( $activities_template->activities[0] ) ) { $activities_template->activity = new stdClass(); $activities_template->activity->id = $activities_template->activities[0]->item_id; $activities_template->activity->current_comment = $activities_template->activities[0]; // Because the whole tree has not been loaded, we manually - // determine depth + // determine depth. $depth = 1; $parent_id = (int) $activities_template->activities[0]->secondary_item_id; while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) { @@ -1034,7 +1055,7 @@ function bp_legacy_theme_new_activity_comment() { $activities_template->activity->current_comment->depth = $depth; } - // get activity comment template part + // Get activity comment template part. bp_get_template_part( 'activity/comment' ); unset( $activities_template ); @@ -1044,15 +1065,16 @@ function bp_legacy_theme_new_activity_comment() { /** * Deletes an Activity item received via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_delete_activity() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_activity_delete_link' ); if ( ! is_user_logged_in() ) @@ -1063,7 +1085,7 @@ function bp_legacy_theme_delete_activity() { $activity = new BP_Activity_Activity( (int) $_POST['id'] ); - // Check access + // Check access. if ( ! bp_activity_user_can_delete( $activity ) ) exit( '-1' ); @@ -1079,17 +1101,18 @@ function bp_legacy_theme_delete_activity() { } /** - * Deletes an Activity comment received via a POST request + * Deletes an Activity comment received via a POST request. + * + * @since 1.2.0 * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @return mixed String on error, void on success. */ function bp_legacy_theme_delete_activity_comment() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_activity_delete_link' ); if ( ! is_user_logged_in() ) @@ -1097,7 +1120,7 @@ function bp_legacy_theme_delete_activity_comment() { $comment = new BP_Activity_Activity( $_POST['id'] ); - // Check access + // Check access. if ( ! bp_current_user_can( 'bp_moderate' ) && $comment->user_id != bp_loggedin_user_id() ) exit( '-1' ); @@ -1116,15 +1139,16 @@ function bp_legacy_theme_delete_activity_comment() { } /** - * AJAX spam an activity item or comment + * AJAX spam an activity item or comment. * - * @return mixed String on error, void on success - * @since BuddyPress (1.6) + * @since 1.6.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_spam_activity() { $bp = buddypress(); - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1132,7 +1156,7 @@ function bp_legacy_theme_spam_activity() { if ( ! is_user_logged_in() || ! bp_is_active( 'activity' ) || empty( $bp->activity->akismet ) ) exit( '-1' ); - // Check an item ID was passed + // Check an item ID was passed. if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) exit( '-1' ); @@ -1140,18 +1164,18 @@ function bp_legacy_theme_spam_activity() { if ( ! bp_activity_user_can_mark_spam() ) exit( '-1' ); - // Load up the activity item + // Load up the activity item. $activity = new BP_Activity_Activity( (int) $_POST['id'] ); if ( empty( $activity->component ) ) exit( '-1' ); - // Check nonce + // Check nonce. check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); /** 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 + // Mark as spam. bp_activity_mark_as_spam( $activity ); $activity->save(); @@ -1163,11 +1187,12 @@ function bp_legacy_theme_spam_activity() { /** * Mark an activity as a favourite via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_mark_activity_favorite() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1182,11 +1207,12 @@ function bp_legacy_theme_mark_activity_favorite() { /** * Un-favourite an activity via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_unmark_activity_favorite() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1202,11 +1228,12 @@ function bp_legacy_theme_unmark_activity_favorite() { * Fetches an activity's full, non-excerpted content via a POST request. * Used for the 'Read More' link on long activity items. * + * @since 1.5.0 + * * @return string HTML - * @since BuddyPress (1.5) */ function bp_legacy_theme_get_single_activity_content() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1223,13 +1250,13 @@ function bp_legacy_theme_get_single_activity_content() { /** * Fires before the return of an activity's full, non-excerpted content via a POST request. * - * @since BuddyPress (1.7.0) + * @since 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 + // 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 */ @@ -1241,11 +1268,12 @@ function bp_legacy_theme_get_single_activity_content() { /** * Invites a friend to join a group via a POST request. * - * @since BuddyPress (1.2) + * @since 1.2.0 + * * @todo Audit return types */ function bp_legacy_theme_ajax_invite_user() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1267,15 +1295,15 @@ function bp_legacy_theme_ajax_invite_user() { $group = groups_get_group( $group_id ); // Users who have previously requested membership do not need - // another invitation created for them + // another invitation created for them. if ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) { $user_status = 'is_pending'; - // Create the user invitation + // Create the user invitation. } elseif ( groups_invite_user( array( 'user_id' => $friend_id, 'group_id' => $group_id ) ) ) { $user_status = 'is_invited'; - // Miscellaneous failure + // Miscellaneous failure. } else { return; } @@ -1303,12 +1331,12 @@ function bp_legacy_theme_ajax_invite_user() { } elseif ( 'uninvite' == $_POST['friend_action'] ) { // Users who have previously requested membership should not - // have their requests deleted on the "uninvite" action + // have their requests deleted on the "uninvite" action. if ( BP_Groups_Member::check_for_membership_request( $friend_id, $group_id ) ) { return; } - // Remove the unsent invitation + // Remove the unsent invitation. if ( ! groups_uninvite_user( $friend_id, $group_id ) ) { return; } @@ -1323,19 +1351,20 @@ function bp_legacy_theme_ajax_invite_user() { /** * Friend/un-friend a user via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_ajax_addremove_friend() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Cast fid as an integer + // Cast fid as an integer. $friend_id = (int) $_POST['fid']; - // Trying to cancel friendship + // Trying to cancel friendship. if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_remove_friend' ); @@ -1345,7 +1374,7 @@ function bp_legacy_theme_ajax_addremove_friend() { echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; } - // Trying to request friendship + // Trying to request friendship. } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_add_friend' ); @@ -1355,7 +1384,7 @@ function bp_legacy_theme_ajax_addremove_friend() { echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; } - // Trying to cancel pending request + // Trying to cancel pending request. } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_withdraw_friendship' ); @@ -1365,7 +1394,7 @@ function bp_legacy_theme_ajax_addremove_friend() { echo __("Friendship request could not be cancelled.", 'buddypress'); } - // Request already pending + // Request already pending. } else { echo __( 'Request Pending', 'buddypress' ); } @@ -1376,11 +1405,12 @@ function bp_legacy_theme_ajax_addremove_friend() { /** * Accept a user friendship request via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_ajax_accept_friendship() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1395,11 +1425,12 @@ function bp_legacy_theme_ajax_accept_friendship() { /** * Reject a user friendship request via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_ajax_reject_friendship() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1414,15 +1445,16 @@ function bp_legacy_theme_ajax_reject_friendship() { /** * Join or leave a group when clicking the "join/leave" button via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_ajax_joinleave_group() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - // Cast gid as integer + // Cast gid as integer. $group_id = (int) $_POST['gid']; if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) @@ -1444,7 +1476,7 @@ function bp_legacy_theme_ajax_joinleave_group() { } elseif ( 'private' == $group->status ) { // If the user has already been invited, then this is - // an Accept Invitation button + // an Accept Invitation button. if ( groups_check_user_has_invite( bp_loggedin_user_id(), $group->id ) ) { check_ajax_referer( 'groups_accept_invite' ); @@ -1454,14 +1486,14 @@ function bp_legacy_theme_ajax_joinleave_group() { echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; } - // Otherwise, it's a Request Membership button + // Otherwise, it's a Request Membership button. } else { check_ajax_referer( 'groups_request_membership' ); if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) { _e( 'Error requesting membership', 'buddypress' ); } else { - echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>'; + echo '<a id="group-' . esc_attr( $group->id ) . '" class="group-button disabled pending membership-requested" rel="membership-requested" title="' . __( 'Request Sent', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Request Sent', 'buddypress' ) . '</a>'; } } } @@ -1474,7 +1506,7 @@ function bp_legacy_theme_ajax_joinleave_group() { } elseif ( 'public' == $group->status ) { echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; } elseif ( 'private' == $group->status ) { - echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; + echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; } } @@ -1484,11 +1516,12 @@ function bp_legacy_theme_ajax_joinleave_group() { /** * Close and keep closed site wide notices from an admin in the sidebar, via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_ajax_close_notice() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1509,11 +1542,12 @@ function bp_legacy_theme_ajax_close_notice() { /** * Send a private message reply to a thread via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_ajax_messages_send_reply() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1523,76 +1557,35 @@ function bp_legacy_theme_ajax_messages_send_reply() { if ( !empty( $result ) ) { - // pretend we're in the message loop + // Pretend we're in the message loop. global $thread_template; bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) ); - // set the current message to the 2nd last + // 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 + // 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 + // Now manually iterate message like we're in the loop. bp_thread_the_message(); - // 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 - - /** - * 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 - - /** - * Fires after the single message header is displayed. - * - * @since BuddyPress (1.1.0) - */ - do_action( 'bp_after_message_meta' ); ?> - </div> + // Manually call oEmbed + // this is needed because we're not at the beginning of the loop. + bp_messages_embed(); - <?php + // Add new-message css class. + add_filter( 'bp_get_the_thread_message_css_class', create_function( '$retval', ' + $retval[] = "new-message"; + return $retval; + ' ) ); - /** - * 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 bp_the_thread_message_content(); ?> - </div> - - <?php - - /** - * Fires after the message content for a private message. - * - * @since BuddyPress (1.1.0) - */ - do_action( 'bp_after_message_content' ); ?> + // Output single message template part. + bp_get_template_part( 'members/single/messages/message' ); - <div class="clear"></div> - </div> - <?php - // clean up the loop + // Clean up the loop. bp_thread_messages(); } else { @@ -1605,11 +1598,12 @@ function bp_legacy_theme_ajax_messages_send_reply() { /** * Mark a private message as unread in your inbox via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_ajax_message_markunread() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1630,11 +1624,12 @@ function bp_legacy_theme_ajax_message_markunread() { /** * Mark a private message as read in your inbox via a POST request. * - * @return mixed String on error, void on success - * @since BuddyPress (1.2) + * @since 1.2.0 + * + * @return mixed String on error, void on success. */ function bp_legacy_theme_ajax_message_markread() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1655,11 +1650,12 @@ function bp_legacy_theme_ajax_message_markread() { /** * Delete a private message(s) in your inbox via a POST request. * + * @since 1.2.0 + * * @return string HTML - * @since BuddyPress (1.2) */ function bp_legacy_theme_ajax_messages_delete() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; @@ -1681,16 +1677,14 @@ function bp_legacy_theme_ajax_messages_delete() { * * Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined. * - * @since BuddyPress (1.2.0) - * - * @return string HTML. + * @since 1.2.0 */ function bp_legacy_theme_ajax_messages_autocomplete_results() { /** * Filters the max results default value for ajax messages autocomplete results. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param int $value Max results for autocomplete. Default 10. */ @@ -1715,7 +1709,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"> %s (%s)' . "\n", esc_attr( 'link-' . $user->ID ), esc_url( $user->image ), @@ -1731,17 +1725,17 @@ function bp_legacy_theme_ajax_messages_autocomplete_results() { /** * AJAX callback to set a message's star status. * - * @since BuddyPress (2.3.0) + * @since 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 nonce. check_ajax_referer( 'bp-messages-star-' . (int) $_POST['message_id'], 'nonce' ); - // Check capability + // Check capability. if ( ! is_user_logged_in() || ! bp_core_can_edit_settings() ) { return; } @@ -1758,3 +1752,177 @@ function bp_legacy_theme_ajax_messages_star_handler() { echo '-1'; die(); } + +/** + * BP Legacy's callback for the cover image feature. + * + * @since 2.4.0 + * + * @param array $params the current component's feature parameters. + * @return array an array to inform about the css handle to attach the css rules to + */ +function bp_legacy_theme_cover_image( $params = array() ) { + if ( empty( $params ) ) { + return; + } + + // Avatar height - padding - 1/2 avatar height. + $avatar_offset = $params['height'] - 5 - round( (int) bp_core_avatar_full_height() / 2 ); + + // Header content offset + spacing. + $top_offset = bp_core_avatar_full_height() - 10; + $left_offset = bp_core_avatar_full_width() + 20; + + $cover_image = isset( $params['cover_image'] ) ? 'background-image: url(' . $params['cover_image'] . ');' : ''; + + $hide_avatar_style = ''; + + // Adjust the cover image header, in case avatars are completely disabled. + if ( ! buddypress()->avatar->show_avatars ) { + $hide_avatar_style = ' + #buddypress #item-header-cover-image #item-header-avatar { + display: none; + } + '; + + if ( bp_is_user() ) { + $hide_avatar_style = ' + #buddypress #item-header-cover-image #item-header-avatar a { + display: block; + height: ' . $top_offset . 'px; + margin: 0 15px 19px 0; + } + + #buddypress div#item-header #item-header-cover-image #item-header-content { + margin-left:auto; + } + '; + } + } + + return ' + /* Cover image */ + #buddypress #header-cover-image { + height: ' . $params["height"] . 'px; + ' . $cover_image . ' + } + + #buddypress #create-group-form #header-cover-image { + position: relative; + margin: 1em 0; + } + + .bp-user #buddypress #item-header { + padding-top: 0; + } + + #buddypress #item-header-cover-image #item-header-avatar { + margin-top: '. $avatar_offset .'px; + float: left; + overflow: visible; + width:auto; + } + + #buddypress div#item-header #item-header-cover-image #item-header-content { + clear: both; + float: left; + margin-left: ' . $left_offset . 'px; + margin-top: -' . $top_offset . 'px; + width:auto; + } + + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + margin-top: ' . $params["height"] . 'px; + margin-left: 0; + clear: none; + max-width: 50%; + } + + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + padding-top: 20px; + max-width: 20%; + } + + ' . $hide_avatar_style . ' + + #buddypress div#item-header-cover-image h2 a, + #buddypress div#item-header-cover-image h2 { + color: #FFF; + text-rendering: optimizelegibility; + text-shadow: 0px 0px 3px rgba( 0, 0, 0, 0.8 ); + margin: 0 0 .6em; + font-size:200%; + } + + #buddypress #item-header-cover-image #item-header-avatar img.avatar { + border: solid 2px #FFF; + background: rgba( 255, 255, 255, 0.8 ); + } + + #buddypress #item-header-cover-image #item-header-avatar a { + border: none; + text-decoration: none; + } + + #buddypress #item-header-cover-image #item-buttons { + margin: 0 0 10px; + padding: 0 0 5px; + } + + #buddypress #item-header-cover-image #item-buttons:after { + clear: both; + content: ""; + display: table; + } + + @media screen and (max-width: 782px) { + #buddypress #item-header-cover-image #item-header-avatar, + .bp-user #buddypress #item-header #item-header-cover-image #item-header-avatar, + #buddypress div#item-header #item-header-cover-image #item-header-content { + width:100%; + text-align:center; + } + + #buddypress #item-header-cover-image #item-header-avatar a { + display:inline-block; + } + + #buddypress #item-header-cover-image #item-header-avatar img { + margin:0; + } + + #buddypress div#item-header #item-header-cover-image #item-header-content, + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + margin:0; + } + + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content, + body.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + max-width: 100%; + } + + #buddypress div#item-header-cover-image h2 a, + #buddypress div#item-header-cover-image h2 { + color: inherit; + text-shadow: none; + margin:25px 0 0; + font-size:200%; + } + + #buddypress #item-header-cover-image #item-buttons div { + float:none; + display:inline-block; + } + + #buddypress #item-header-cover-image #item-buttons:before { + content:""; + } + + #buddypress #item-header-cover-image #item-buttons { + margin: 5px 0; + } + } + '; +} 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 6a184cf3ba9abd2e61c8cebee51852cbb5761d3a..c30d1c697d8f8d136602dfe9a094d4344f899b7b 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,9 +1,15 @@ <?php +/** + * BuddyPress - Activity Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the start of the activity loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_loop' ); ?> @@ -48,7 +54,7 @@ do_action( 'bp_before_activity_loop' ); ?> /** * Fires after the finish of the activity loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_activity_loop' ); ?> 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 4bc1eaf59b512b8949b5edc3c1587475c0b2f18c..9b3089cd3fd4c719e0a58573b36a5056ac137c14 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Activity Stream Comment * @@ -10,14 +9,10 @@ * @subpackage bp-legacy */ -?> - -<?php - /** * Fires before the display of an activity comment. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_activity_comment' ); ?> @@ -56,7 +51,7 @@ do_action( 'bp_before_activity_comment' ); ?> /** * Fires after the defualt comment action options display. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_activity_comment_options' ); ?> @@ -70,6 +65,6 @@ do_action( 'bp_before_activity_comment' ); ?> /** * Fires after the display of an activity comment. * - * @since BuddyPress (1.5.0) + * @since 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 d9f01a4ef0dcb2227b57b3ffa3b4374f5e30d83f..12497e3a273686167c310f51945adf35823abece 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Activity Stream (Single Item) * @@ -10,14 +9,10 @@ * @subpackage bp-legacy */ -?> - -<?php - /** * Fires before the display of an activity entry. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_entry' ); ?> @@ -53,7 +48,7 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires after the display of an activity entry content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_entry_content' ); ?> @@ -69,7 +64,7 @@ do_action( 'bp_before_activity_entry' ); ?> <?php if ( bp_activity_can_comment() ) : ?> - <a href="<?php bp_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a> + <a href="<?php bp_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment %s', 'buddypress' ), '<span>' . bp_activity_get_comment_count() . '</span>' ); ?></a> <?php endif; ?> @@ -94,7 +89,7 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires at the end of the activity entry meta data area. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_entry_meta' ); ?> @@ -109,7 +104,7 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires before the display of the activity entry comments. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_entry_comments' ); ?> @@ -125,6 +120,7 @@ do_action( 'bp_before_activity_entry' ); ?> <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> <div class="ac-reply-content"> <div class="ac-textarea"> + <label for="ac-input-<?php bp_activity_id(); ?>" class="bp-screen-reader-text"><?php _e( 'Comment', 'buddypress' ); ?></label> <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input bp-suggestions" name="ac_input_<?php bp_activity_id(); ?>"></textarea> </div> <input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" /> <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a> @@ -136,7 +132,7 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires after the activity entry comment form. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_activity_entry_comments' ); ?> @@ -155,7 +151,7 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires after the display of the activity entry comments. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_activity_entry_comments' ); ?> @@ -166,6 +162,6 @@ do_action( 'bp_before_activity_entry' ); ?> /** * Fires after the display of an activity entry. * - * @since BuddyPress (1.2.0) + * @since 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 acce864a56da52fbf31099af7c2f700f656660b1..8dcdf737df3b35b728e8b08067a047be972ae41f 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,9 +1,17 @@ <?php +/** + * BuddyPress Activity templates + * + * @since 2.3.0 + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the activity directory listing. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_activity' ); ?> @@ -14,7 +22,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the activity directory display content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_directory_activity_content' ); ?> @@ -29,7 +37,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires towards the top of template pages for notice display. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'template_notices' ); ?> @@ -40,11 +48,11 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the listing of activity type tabs. * - * @since BuddyPress (1.2.0) + * @since 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> + <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 %s', 'buddypress' ), '<span>' . bp_get_total_member_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() ) : ?> @@ -53,7 +61,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the listing of friends activity type tab. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_type_tab_friends' ); ?> @@ -61,7 +69,7 @@ do_action( 'bp_before_directory_activity' ); ?> <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> - <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of my friends only.', 'buddypress' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li> + <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of my friends only.', 'buddypress' ); ?>"><?php printf( __( 'My Friends %s', 'buddypress' ), '<span>' . bp_get_total_friend_count( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> @@ -72,7 +80,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the listing of groups activity type tab. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_type_tab_groups' ); ?> @@ -80,7 +88,7 @@ do_action( 'bp_before_directory_activity' ); ?> <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> - <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of groups I am a member of.', 'buddypress' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php esc_attr_e( 'The activity of groups I am a member of.', 'buddypress' ); ?>"><?php printf( __( 'My Groups %s', 'buddypress' ), '<span>' . bp_get_total_group_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> @@ -91,13 +99,13 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the listing of favorites activity type tab. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_type_tab_favorites' ); ?> <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?> - <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php esc_attr_e( "The activity I've marked as a favorite.", 'buddypress' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php esc_attr_e( "The activity I've marked as a favorite.", 'buddypress' ); ?>"><?php printf( __( 'My Favorites %s', 'buddypress' ), '<span>' . bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> @@ -108,7 +116,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the listing of mentions activity type tab. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_type_tab_mentions' ); ?> @@ -123,7 +131,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires after the listing of activity type tabs. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_type_tabs' ); ?> </ul> @@ -138,7 +146,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the display of the activity syndication options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_syndication_options' ); ?> @@ -154,7 +162,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires inside the select input for activity filter by options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_filter_options' ); ?> @@ -168,7 +176,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires before the display of the activity list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_activity_list' ); ?> @@ -183,7 +191,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires after the display of the activity list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_directory_activity_list' ); ?> @@ -199,7 +207,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires after the activity directory display content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_directory_activity_content' ); ?> @@ -208,7 +216,7 @@ do_action( 'bp_before_directory_activity' ); ?> /** * Fires after the activity directory listing. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_directory_activity' ); ?> 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 12023a8da17c2a51ab42c3959a132e1139cfd5d1..563297390b6ae74950af6c8e7ab3294af6efa239 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Activity Post Form * @@ -16,7 +15,7 @@ /** * Fires before the activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_activity_post_form' ); ?> @@ -34,6 +33,7 @@ <div id="whats-new-content"> <div id="whats-new-textarea"> + <label for="whats-new" class="bp-screen-reader-text"><?php _e( 'Post what\'s new', 'buddypress' ); ?></label> <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> @@ -50,6 +50,7 @@ <?php _e( 'Post in', 'buddypress' ); ?>: + <label for="whats-new-post-in" class="bp-screen-reader-text"><?php _e( 'Post in', 'buddypress' ); ?></label> <select id="whats-new-post-in" name="whats-new-post-in"> <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option> @@ -65,7 +66,7 @@ </div> <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> - <?php elseif ( bp_is_group_home() ) : ?> + <?php elseif ( bp_is_group_activity() ) : ?> <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" /> @@ -77,7 +78,7 @@ /** * Fires at the end of the activity post form markup. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_activity_post_form_options' ); ?> @@ -90,7 +91,7 @@ /** * Fires after the activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_activity_post_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 2ba08a48580b0249ecb6819fcc698939fa6fa02e..54cff31d6e1de85262fb34e0f7e6dda7323737f8 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,3 +1,12 @@ +<?php +/** + * BuddyPress - Home + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div id="buddypress"> <?php 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 index 18f8145c43269bd387565c1dca4c4aba543f6393..a9fb56db6730b352bce245b3c32b9d77550e524b 100644 --- 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 @@ -1,14 +1,15 @@ <?php /** - * BuddyPress Avatars camera template + * BuddyPress Avatars camera template. * - * This template is used to create the camera Backbone views + * This template is used to create the camera Backbone views. * - * @since 2.3 + * @since 2.3.0 * * @package BuddyPress * @subpackage bp-attachments */ + ?> <script id="tmpl-bp-avatar-webcam" type="text/html"> <# if ( ! data.user_media ) { #> 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 index 274e97ea7fe5c161ac3b3fd88f7036270fa28b9d..b1b3775c280388841f58e58acc55259bee27b64e 100644 --- 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 @@ -1,14 +1,15 @@ <?php /** - * BuddyPress Avatars crop template + * BuddyPress Avatars crop template. * - * This template is used to create the crop Backbone views + * This template is used to create the crop Backbone views. * - * @since 2.3 + * @since 2.3.0 * * @package BuddyPress * @subpackage bp-attachments */ + ?> <script id="tmpl-bp-avatar-item" type="text/html"> <div id="avatar-to-crop"> 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 index 82c401f831cc1b30ee2dc1d1403e84e1e356ada3..e7ba87910d34d4e115fd08210c814282c88103e3 100644 --- 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 @@ -1,18 +1,18 @@ <?php /** - * BuddyPress Avatars main template + * 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 + * It's also used to create the common Backbone views. + * + * @since 2.3.0 * * @package BuddyPress * @subpackage bp-attachments */ - /** * This action is for internal use, please do not use it */ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php new file mode 100644 index 0000000000000000000000000000000000000000..ae8294b0d8b64d0b53ac77a0a493393036e54939 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php @@ -0,0 +1,36 @@ +<?php +/** + * BuddyPress Cover Images main template. + * + * This template is used to inject the BuddyPress Backbone views + * dealing with cover images. + * + * It's also used to create the common Backbone views. + * + * @since 2.4.0 + * + * @package BuddyPress + * @subpackage bp-attachments + */ + +?> + +<div class="bp-cover-image"></div> +<div class="bp-cover-image-status"></div> +<div class="bp-cover-image-manage"></div> + +<?php bp_attachments_get_template_part( 'uploader' ); ?> + +<script id="tmpl-bp-cover-image-delete" type="text/html"> + <# if ( 'user' === data.object ) { #> + <p><?php _e( "If you'd like to delete your current cover image but not upload a new one, please use the delete Cover Image button.", 'buddypress' ); ?></p> + <p><a class="button edit" id="bp-delete-cover-image" href="#" title="<?php esc_attr_e( 'Delete Cover Image', 'buddypress' ); ?>"><?php esc_html_e( 'Delete My Cover Image', 'buddypress' ); ?></a></p> + <# } else if ( 'group' === data.object ) { #> + <p><?php _e( "If you'd like to remove the existing group cover image but not upload a new one, please use the delete group cover image button.", 'buddypress' ); ?></p> + <p><a class="button edit" id="bp-delete-cover-image" href="#" title="<?php esc_attr_e( 'Delete Cover Image', 'buddypress' ); ?>"><?php esc_html_e( 'Delete Group Cover Image', 'buddypress' ); ?></a></p> + <# } else { #> + <?php do_action( 'bp_attachments_cover_image_delete_template' ); ?> + <# } #> +</script> + +<?php do_action( 'bp_attachments_cover_image_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 index 79a1efee2dee095a5d56f4fd6442039a12f1773e..5525881408b12fa8620d08bf58ebaee242b0976b 100644 --- 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 @@ -1,14 +1,15 @@ <?php /** - * BuddyPress Uploader templates + * BuddyPress Uploader templates. * - * This template is used to create the BuddyPress Uploader Backbone views + * This template is used to create the BuddyPress Uploader Backbone views. * - * @since 2.3 + * @since 2.3.0 * * @package BuddyPress * @subpackage bp-attachments */ + ?> <script type="text/html" id="tmpl-upload-window"> <?php if ( ! _device_can_upload() ) : ?> @@ -21,7 +22,7 @@ <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> + <p class="drag-drop-buttons"><label for="{{data.browse_button}}" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php esc_html_e( 'Select your File', 'buddypress' ); ?></label><input id="{{data.browse_button}}" type="button" value="<?php esc_attr_e( 'Select your File', 'buddypress' ); ?>" class="button" /></p> </div> </div> </div> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php new file mode 100644 index 0000000000000000000000000000000000000000..265fe08bdde825aabcef041022c614ce3eaa4dc7 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php @@ -0,0 +1,227 @@ +<?php +/** + * BuddyPress email template. + * + * Magic numbers: + * 1.618 = golden mean. + * 1.35 = default body_text_size multipler. Gives default heading of 20px. + * + * @since 2.5.0 + * + * @package BuddyPress + * @subpackage Core + */ + +/* +Based on the Cerberus "Fluid" template by Ted Goas (http://tedgoas.github.io/Cerberus/). +License for the original template: + + +The MIT License (MIT) + +Copyright (c) 2013 Ted Goas + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +$settings = bp_email_get_appearance_settings(); + +?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <meta charset="<?php echo esc_attr( get_bloginfo( 'charset' ) ); ?>"> + <meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary --> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine --> + + <!-- CSS Reset --> + <style type="text/css"> + /* What it does: Remove spaces around the email design added by some email clients. */ + /* Beware: It can remove the padding / margin and add a background color to the compose a reply window. */ + html, + body { + Margin: 0 !important; + padding: 0 !important; + height: 100% !important; + width: 100% !important; + } + + /* What it does: Stops email clients resizing small text. */ + * { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + } + + /* What it does: Forces Outlook.com to display emails full width. */ + .ExternalClass { + width: 100%; + } + + /* What is does: Centers email on Android 4.4 */ + div[style*="margin: 16px 0"] { + margin: 0 !important; + } + + /* What it does: Stops Outlook from adding extra spacing to tables. */ + table, + td { + mso-table-lspace: 0pt !important; + mso-table-rspace: 0pt !important; + } + + /* What it does: Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */ + table { + border-spacing: 0 !important; + border-collapse: collapse !important; + table-layout: fixed !important; + Margin: 0 auto !important; + } + table table table { + table-layout: auto; + } + + /* What it does: Uses a better rendering method when resizing images in IE. */ + /* & manages img max widths to ensure content body images don't exceed template width. */ + img { + -ms-interpolation-mode:bicubic; + height: auto; + max-width: 100%; + } + + /* What it does: Overrides styles added when Yahoo's auto-senses a link. */ + .yshortcuts a { + border-bottom: none !important; + } + + /* What it does: A work-around for iOS meddling in triggered links. */ + a[x-apple-data-detectors] { + color: inherit !important; + text-decoration: underline !important; + } + </style> + +</head> +<body class="email_bg" width="100%" height="100%" bgcolor="<?php echo esc_attr( $settings['email_bg'] ); ?>" style="Margin: 0;"> +<table cellpadding="0" cellspacing="0" border="0" height="100%" width="100%" bgcolor="<?php echo esc_attr( $settings['email_bg'] ); ?>" style="border-collapse:collapse;" class="email_bg"><tr><td valign="top"> + <center style="width: 100%;"> + + <!-- Visually Hidden Preheader Text : BEGIN --> + <div style="display: none; font-size: 1px; line-height: 1px; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all; font-family: sans-serif;"> + {{email.preheader}} + </div> + <!-- Visually Hidden Preheader Text : END --> + + <div style="max-width: 600px;"> + <!--[if (gte mso 9)|(IE)]> + <table cellspacing="0" cellpadding="0" border="0" width="600" align="center"> + <tr> + <td> + <![endif]--> + + <!-- Email Header : BEGIN --> + <table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="max-width: 600px; border-top: 7px solid <?php echo esc_attr( $settings['highlight_color'] ); ?>" bgcolor="<?php echo esc_attr( $settings['header_bg'] ); ?>" class="header_bg"> + <tr> + <td style="text-align: center; padding: 15px 0; font-family: sans-serif; mso-height-rule: exactly; font-weight: bold; color: <?php echo esc_attr( $settings['header_text_color'] ); ?>; font-size: <?php echo esc_attr( $settings['header_text_size'] . 'px' ); ?>" class="header_text_color header_text_size"> + <?php + /** + * Fires before the display of the email template header. + * + * @since 2.5.0 + */ + do_action( 'bp_before_email_header' ); + + echo bp_get_option( 'blogname' ); + + /** + * Fires after the display of the email template header. + * + * @since 2.5.0 + */ + do_action( 'bp_after_email_header' ); + ?> + </td> + </tr> + </table> + <!-- Email Header : END --> + + <!-- Email Body : BEGIN --> + <table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="<?php echo esc_attr( $settings['body_bg'] ); ?>" width="100%" style="max-width: 600px; border-radius: 5px;" class="body_bg"> + + <!-- 1 Column Text : BEGIN --> + <tr> + <td> + <table cellspacing="0" cellpadding="0" border="0" width="100%"> + <tr> + <td style="padding: 20px; font-family: sans-serif; mso-height-rule: exactly; line-height: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.618 ) . 'px' ) ?>; color: <?php echo esc_attr( $settings['body_text_color'] ); ?>; font-size: <?php echo esc_attr( $settings['body_text_size'] . 'px' ); ?>" class="body_text_color body_text_size"> + <span style="font-weight: bold; font-size: <?php echo esc_attr( floor( $settings['body_text_size'] * 1.35 ) . 'px' ); ?>" class="welcome"><?php bp_email_the_salutation( $settings ); ?></span> + <hr color="<?php echo esc_attr( $settings['email_bg'] ); ?>"><br> + {{{content}}} + </td> + </tr> + </table> + </td> + </tr> + <!-- 1 Column Text : BEGIN --> + + </table> + <!-- Email Body : END --> + + <!-- Email Footer : BEGIN --> + <br> + <table cellspacing="0" cellpadding="0" border="0" align="left" width="100%" style="max-width: 600px; border-radius: 5px;" bgcolor="<?php echo esc_attr( $settings['footer_bg'] ); ?>" class="footer_bg"> + <tr> + <td style="padding: 20px; width: 100%; font-size: <?php echo esc_attr( $settings['footer_text_size'] . 'px' ); ?>; font-family: sans-serif; mso-height-rule: exactly; line-height: <?php echo esc_attr( floor( $settings['footer_text_size'] * 1.618 ) . 'px' ) ?>; text-align: left; color: <?php echo esc_attr( $settings['footer_text_color'] ); ?>;" class="footer_text_color footer_text_size"> + <?php + /** + * Fires before the display of the email template footer. + * + * @since 2.5.0 + */ + do_action( 'bp_before_email_footer' ); + ?> + + <span class="footer_text"><?php echo nl2br( stripslashes( $settings['footer_text'] ) ); ?></span> + <br><br> + <a href="{{{unsubscribe}}}" style="text-decoration: underline;"><?php _ex( 'unsubscribe', 'email', 'buddypress' ); ?></a> + + <?php + /** + * Fires after the display of the email template footer. + * + * @since 2.5.0 + */ + do_action( 'bp_after_email_footer' ); + ?> + </td> + </tr> + </table> + <!-- Email Footer : END --> + + <!--[if (gte mso 9)|(IE)]> + </td> + </tr> + </table> + <![endif]--> + </div> + </center> +</td></tr></table> +<?php if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) wp_footer(); ?> +</body> +</html> 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 ae8318382b65a7fa8abda57f1442d8fd395afdb3..b1ff3793dce357ee3d60f33e25245251765d3cf0 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 @@ -1,22 +1,17 @@ <?php - /** * BuddyPress - Blogs Loop * - * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter(). * * @package BuddyPress * @subpackage bp-legacy */ -?> - -<?php - /** * Fires before the start of the blogs loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_blogs_loop' ); ?> @@ -39,7 +34,7 @@ do_action( 'bp_before_blogs_loop' ); ?> /** * Fires before the blogs directory list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_blogs_list' ); ?> @@ -61,7 +56,7 @@ do_action( 'bp_before_blogs_loop' ); ?> /** * Fires after the listing of a blog item in the blogs loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_directory_blogs_item' ); ?> </div> @@ -73,7 +68,7 @@ do_action( 'bp_before_blogs_loop' ); ?> /** * Fires inside the blogs action listing area. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_blogs_actions' ); ?> @@ -97,7 +92,7 @@ do_action( 'bp_before_blogs_loop' ); ?> /** * Fires after the blogs directory list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_blogs_list' ); ?> @@ -132,6 +127,6 @@ do_action( 'bp_before_blogs_loop' ); ?> /** * Fires after the display of the blogs loop. * - * @since BuddyPress (1.2.0) + * @since 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 c46632c68db87139a87b2a0ca1c991521bd7e671..7b563718da9cd39e70feb5de23e034883c42b3e8 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,9 +1,15 @@ <?php +/** + * BuddyPress - Blogs Create + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the blog creation template file. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_before_create_blog_content_template' ); ?> @@ -17,7 +23,7 @@ do_action( 'template_notices' ); ?> /** * Fires before the display of the blog creation form. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_create_blog_content' ); ?> @@ -38,7 +44,7 @@ do_action( 'bp_before_create_blog_content' ); ?> /** * Fires after the display of the blog creation form. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_create_blog_content' ); ?> @@ -47,6 +53,6 @@ do_action( 'bp_after_create_blog_content' ); ?> /** * Fires at the bottom of the blog creation template file. * - * @since BuddyPress (1.6.0) + * @since 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 0c4a15c07ff0ccdb04561398ace7f833d8b521b5..c8460d9d6b84d1e444e0842c449c9ea638efadab 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,9 +1,15 @@ <?php +/** + * BuddyPress - Blogs + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the blogs directory template file. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ do_action( 'bp_before_directory_blogs_page' ); ?> @@ -12,9 +18,9 @@ do_action( 'bp_before_directory_blogs_page' ); ?> <?php /** - * Fires before the display of the blogs + * Fires before the display of the blogs. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_blogs' ); ?> @@ -23,7 +29,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires before the display of the blogs listing content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_blogs_content' ); ?> @@ -36,7 +42,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires before the display of the blogs list tabs. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ do_action( 'bp_before_directory_blogs_tabs' ); ?> @@ -44,11 +50,11 @@ do_action( 'bp_before_directory_blogs_page' ); ?> <div class="item-list-tabs" role="navigation"> <ul> - <li class="selected" id="blogs-all"><a href="<?php bp_root_domain(); ?>/<?php bp_blogs_root_slug(); ?>"><?php printf( __( 'All Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count() ); ?></a></li> + <li class="selected" id="blogs-all"><a href="<?php bp_root_domain(); ?>/<?php bp_blogs_root_slug(); ?>"><?php printf( __( 'All Sites %s', 'buddypress' ), '<span>' . bp_get_total_blog_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() && bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ) : ?> - <li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug(); ?>"><?php printf( __( 'My Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + <li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug(); ?>"><?php printf( __( 'My Sites %s', 'buddypress' ), '<span>' . bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> @@ -57,7 +63,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires inside the unordered list displaying blog types. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_blogs_directory_blog_types' ); ?> @@ -72,7 +78,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires inside the unordered list displaying blog sub-types. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_blogs_directory_blog_sub_types' ); ?> @@ -89,7 +95,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires inside the select input listing blogs orderby options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_blogs_directory_order_options' ); ?> @@ -109,7 +115,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires inside and displays the blogs content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_blogs_content' ); ?> @@ -120,7 +126,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires after the display of the blogs listing content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_blogs_content' ); ?> @@ -131,7 +137,7 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires at the bottom of the blogs directory template file. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_directory_blogs' ); ?> @@ -142,6 +148,6 @@ do_action( 'bp_before_directory_blogs_page' ); ?> /** * Fires at the bottom of the blogs directory template file. * - * @since BuddyPress (2.3.0) + * @since 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 b7ca247e999a01db69e0eaa3001507841d3f1fd8..dccaafff8cdf5b2a1078e5cb3148a8747edc8d9b 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 @@ -1,9 +1,8 @@ <?php - /** * BuddyPress - Forums Loop * - * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter(). * * @package BuddyPress * @subpackage bp-legacy @@ -16,7 +15,7 @@ /** * Fires at the start of the forums loop. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ do_action( 'bp_before_forums_loop' ); ?> @@ -43,7 +42,7 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires before the display of the forums list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_forums_list' ); ?> @@ -59,7 +58,7 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires at the end of <tr> row holding the <th> tags. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_directory_forums_extra_cell_head' ); ?> @@ -117,7 +116,7 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires at the end of <tr> row holding the <td> tags. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_forums_extra_cell' ); ?> @@ -128,7 +127,7 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires after the <tr> for a forum listing display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_forums_extra_row' ); ?> @@ -142,7 +141,7 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires after the display of the forums list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_forums_list' ); ?> @@ -171,6 +170,6 @@ do_action( 'bp_before_forums_loop' ); ?> /** * Fires at the end of the forums loop. * - * @since BuddyPress (1.2.6) + * @since 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 0d175426e46df26661afb47b988269baf47db10a..3508f30e9db0c091f9b526e0291d77c0675ef880 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,3 +1,12 @@ +<?php +/** + * BuddyPress - Forums + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div id="buddypress"> <?php @@ -5,7 +14,7 @@ /** * Fires at the start of the forums template. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_forums' ); ?> @@ -16,7 +25,7 @@ /** * Fires before the display of the forums content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_forums_content' ); ?> @@ -32,7 +41,7 @@ /** * Fires before the display of the forum topics. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_topics' ); ?> @@ -40,11 +49,11 @@ <div class="item-list-tabs" role="navigation"> <ul> - <li class="selected" id="forums-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); ?>"><?php printf( __( 'All Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count() ); ?></a></li> + <li class="selected" id="forums-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); ?>"><?php printf( __( 'All Topics %s', 'buddypress' ), '<span>' . bp_get_forum_topic_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?> - <li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics' ); ?>"><?php printf( __( 'My Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + <li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics' ); ?>"><?php printf( __( 'My Topics %s', 'buddypress' ), '<span>' . bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> @@ -53,7 +62,7 @@ /** * Fires inside the forum group types list. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_forums_directory_group_types' ); ?> @@ -68,7 +77,7 @@ /** * Fires inside the forum group sub-types list. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_forums_directory_group_sub_types' ); ?> @@ -85,7 +94,7 @@ /** * Fires inside the select input for forums order options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_forums_directory_order_options' ); ?> @@ -105,7 +114,7 @@ /** * Fires and displays the forums content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_forums_content' ); ?> @@ -118,7 +127,7 @@ /** * Fires after the display of the forums. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_directory_forums' ); ?> @@ -127,7 +136,7 @@ /** * Fires before the display of the new topic form. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_new_topic_form' ); ?> @@ -144,7 +153,7 @@ /** * Fires inside the new topic form tag and before input display. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_forum_new_topic_before' ); ?> @@ -156,16 +165,16 @@ /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */ do_action( 'template_notices' ); ?> - <label><?php _e( 'Title:', 'buddypress' ); ?></label> + <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label> <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" /> - <label><?php _e( 'Content:', 'buddypress' ); ?></label> + <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> <textarea name="topic_text" id="topic_text"></textarea> - <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <label for="topic_tags"><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> <input type="text" name="topic_tags" id="topic_tags" value="" /> - <label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label> + <label for="topic_group_id"><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label> <select id="topic_group_id" name="topic_group_id"> <option value=""><?php /* translators: no option picked in select box */ _e( '----', 'buddypress' ); ?></option> @@ -187,7 +196,7 @@ /** * Fires before the new topic form submit actions. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_forum_new_topic_after' ); ?> @@ -218,7 +227,7 @@ /** * Fires after the display of the new topic form. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_new_topic_form' ); ?> @@ -227,7 +236,7 @@ /** * Fires before the display of the forums content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_forums_content' ); ?> 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 23deafc528e81d4437a96edbef5fddf449f3f559..b3510199c05ab44b424a1206f0ab6f70da6c0d18 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Create + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the groups creation template file. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_before_create_group_page' ); ?> @@ -14,7 +20,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of group creation content. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_before_create_group_content_template' ); ?> @@ -25,7 +31,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of group creation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_create_group' ); ?> @@ -52,7 +58,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of the group details creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_details_creation_step' ); ?> @@ -71,7 +77,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of the group details creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_details_creation_step' ); do_action( 'groups_custom_group_fields_editable' ); // @Deprecated @@ -88,37 +94,35 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of the group settings creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_settings_creation_step' ); ?> <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4> <div class="radio"> - <label><input type="radio" name="group-status" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong></label> - <ul> + + <label for="group-status-public"><input type="radio" name="group-status" id="group-status-public" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="public-group-description" /> <?php _e( 'This is a public group', 'buddypress' ); ?></label> + + <ul id="public-group-description"> <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> </ul> - <label> - <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> + <label for="group-status-private"><input type="radio" name="group-status" id="group-status-private" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="private-group-description" /> <?php _e( 'This is a private group', 'buddypress' ); ?></label> + + <ul id="private-group-description"> <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> </ul> - <label> - <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> + <label for="group-status-hidden"><input type="radio" name="group-status" id="group-status-hidden" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="hidden-group-description" /> <?php _e('This is a hidden group', 'buddypress' ); ?></label> + + <ul id="hidden-group-description"> <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> @@ -131,20 +135,13 @@ do_action( 'bp_before_create_group_page' ); ?> <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> <div class="radio"> - <label> - <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> - <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> - </label> - - <label> - <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> - <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> - </label> - - <label> - <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> - <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> - </label> + + <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label> + + <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label> + + <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label> + </div> <?php if ( bp_is_active( 'forums' ) ) : ?> @@ -156,7 +153,7 @@ do_action( 'bp_before_create_group_page' ); ?> <p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p> <div class="checkbox"> - <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> + <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> </div> <?php elseif ( is_super_admin() ) : ?> @@ -171,7 +168,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of the group settings creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_settings_creation_step' ); ?> @@ -187,7 +184,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of the group avatar creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_avatar_creation_step' ); ?> @@ -203,6 +200,7 @@ do_action( 'bp_before_create_group_page' ); ?> <p><?php _e( "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.", 'buddypress' ); ?></p> <p> + <label for="file" class="bp-screen-reader-text"><?php _e( 'Select an image', 'buddypress' ); ?></label> <input type="file" name="file" id="file" /> <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> @@ -215,7 +213,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Load the Avatar UI templates * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ bp_avatar_get_templates(); ?> @@ -247,7 +245,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of the group avatar creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_avatar_creation_step' ); ?> @@ -255,7 +253,38 @@ do_action( 'bp_before_create_group_page' ); ?> <?php endif; ?> - <?php /* Group creation step 4: Invite friends to group */ ?> + <?php /* Group creation step 4: Cover image */ ?> + <?php if ( bp_is_group_creation_step( 'group-cover-image' ) ) : ?> + + <?php + + /** + * Fires before the display of the group cover image creation step. + * + * @since 2.4.0 + */ + do_action( 'bp_before_group_cover_image_creation_step' ); ?> + + <div id="header-cover-image"></div> + + <p><?php _e( 'The Cover Image will be used to customize the header of your group.', 'buddypress' ); ?></p> + + <?php bp_attachments_get_template_part( 'cover-images/index' ); ?> + + <?php + + /** + * Fires after the display of the group cover image creation step. + * + * @since 2.4.0 + */ + do_action( 'bp_after_group_cover_image_creation_step' ); ?> + + <?php wp_nonce_field( 'groups_create_save_group-cover-image' ); ?> + + <?php endif; ?> + + <?php /* Group creation step 5: Invite friends to group */ ?> <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?> <?php @@ -263,7 +292,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of the group invites creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_invites_creation_step' ); ?> @@ -331,7 +360,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of the group invites creation step. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_invites_creation_step' ); ?> @@ -344,7 +373,7 @@ do_action( 'bp_before_create_group_page' ); ?> * * Allows plugins to add custom group creation steps. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_custom_create_steps' ); ?> @@ -353,7 +382,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires before the display of the group creation step buttons. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_creation_step_buttons' ); ?> @@ -397,7 +426,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of the group creation step buttons. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_creation_step_buttons' ); ?> @@ -409,7 +438,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires and displays the groups directory content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_groups_content' ); ?> @@ -420,7 +449,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of group creation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_create_group' ); ?> @@ -431,7 +460,7 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires after the display of group creation content. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_after_create_group_content_template' ); ?> @@ -442,6 +471,6 @@ do_action( 'bp_before_create_group_page' ); ?> /** * Fires at the bottom of the groups creation template file. * - * @since BuddyPress (1.7.0) + * @since 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 4c8c2736e22c753937ccc09a0027afee6cc5728d..a988259eeac673943ef5e1f2ce1fe48af3f7a373 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 @@ -1,9 +1,8 @@ <?php - /** * BuddyPress - Groups Loop * - * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter(). * * @package BuddyPress * @subpackage bp-legacy @@ -16,7 +15,7 @@ /** * Fires before the display of groups from the groups loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_groups_loop' ); ?> @@ -43,7 +42,7 @@ do_action( 'bp_before_groups_loop' ); ?> /** * Fires before the listing of the groups list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_groups_list' ); ?> @@ -69,7 +68,7 @@ do_action( 'bp_before_groups_loop' ); ?> /** * Fires inside the listing of an individual group listing item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_groups_item' ); ?> @@ -82,7 +81,7 @@ do_action( 'bp_before_groups_loop' ); ?> /** * Fires inside the action section of an individual group listing item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_groups_actions' ); ?> @@ -106,7 +105,7 @@ do_action( 'bp_before_groups_loop' ); ?> /** * Fires after the listing of the groups list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_groups_list' ); ?> @@ -139,6 +138,6 @@ do_action( 'bp_before_groups_loop' ); ?> /** * Fires after the display of groups from the groups loop. * - * @since BuddyPress (1.2.0) + * @since 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 2dbec7a9b76d8c31a2f0071447d623ba5a7b5e57..1379734000e77bd07d8099068e46de01ec27edd1 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the groups directory template file. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_groups_page' ); ?> @@ -14,7 +20,7 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires before the display of the groups. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_groups' ); ?> @@ -23,7 +29,7 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires before the display of the groups content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_groups_content' ); ?> @@ -40,10 +46,10 @@ do_action( 'bp_before_directory_groups_page' ); ?> <div class="item-list-tabs" role="navigation"> <ul> - <li class="selected" id="groups-all"><a href="<?php bp_groups_directory_permalink(); ?>"><?php printf( __( 'All Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count() ); ?></a></li> + <li class="selected" id="groups-all"><a href="<?php bp_groups_directory_permalink(); ?>"><?php printf( __( 'All Groups %s', 'buddypress' ), '<span>' . bp_get_total_group_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> - <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> + <li id="groups-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups/'; ?>"><?php printf( __( 'My Groups %s', 'buddypress' ), '<span>' . bp_get_total_group_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> <?php @@ -51,7 +57,7 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires inside the groups directory group filter input. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_groups_directory_group_filter' ); ?> @@ -65,7 +71,7 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires inside the groups directory group types. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_groups_directory_group_types' ); ?> @@ -84,7 +90,7 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires inside the groups directory group order options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_groups_directory_order_options' ); ?> </select> @@ -99,10 +105,10 @@ do_action( 'bp_before_directory_groups_page' ); ?> <?php /** - * Fires and displays the group content. - * - * @since BuddyPress (1.1.0) - */ + * Fires and displays the group content. + * + * @since 1.1.0 + */ do_action( 'bp_directory_groups_content' ); ?> <?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?> @@ -110,10 +116,10 @@ do_action( 'bp_before_directory_groups_page' ); ?> <?php /** - * Fires after the display of the groups content. - * - * @since BuddyPress (1.1.0) - */ + * Fires after the display of the groups content. + * + * @since 1.1.0 + */ do_action( 'bp_after_directory_groups_content' ); ?> </form><!-- #groups-directory-form --> @@ -121,10 +127,10 @@ do_action( 'bp_before_directory_groups_page' ); ?> <?php /** - * Fires after the display of the groups. - * - * @since BuddyPress (1.1.0) - */ + * Fires after the display of the groups. + * + * @since 1.1.0 + */ do_action( 'bp_after_directory_groups' ); ?> </div><!-- #buddypress --> @@ -134,6 +140,6 @@ do_action( 'bp_before_directory_groups_page' ); ?> /** * Fires at the bottom of the groups directory template file. * - * @since BuddyPress (1.5.0) + * @since 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 4c24fd29a4af908c1952a751f1caf98fcfa0bf82..80443eb4baf2b29380c8799a914285f63b7c19fa 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 @@ -1,3 +1,12 @@ +<?php +/** + * BuddyPress - Groups Activity + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <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> @@ -7,7 +16,7 @@ /** * Fires inside the syndication options list, after the RSS option. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_activity_syndication_options' ); ?> @@ -23,7 +32,7 @@ /** * Fires inside the select input for group activity filter options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_activity_filter_options' ); ?> </select> @@ -36,7 +45,7 @@ /** * Fires before the display of the group activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_activity_post_form' ); ?> @@ -51,7 +60,7 @@ do_action( 'bp_before_group_activity_post_form' ); ?> /** * Fires after the display of the group activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_activity_post_form' ); ?> <?php @@ -59,7 +68,7 @@ do_action( 'bp_after_group_activity_post_form' ); ?> /** * Fires before the display of the group activities list. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_activity_content' ); ?> @@ -74,6 +83,6 @@ do_action( 'bp_before_group_activity_content' ); ?> /** * Fires after the display of the group activities list. * - * @since BuddyPress (1.2.0) + * @since 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 1473801c1197c2c6b0fb9b089aa6ae6a3c27169f..fa8d23246e41b0bbb8394ec67f028638a7f240d4 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 @@ -1,3 +1,12 @@ +<?php +/** + * BuddyPress - Groups Admin + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <ul> <?php bp_group_admin_tabs(); ?> @@ -11,7 +20,7 @@ /** * Fires inside the group admin form and before the content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_admin_content' ); ?> @@ -23,7 +32,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires before the display of group admin details. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_details_admin' ); ?> @@ -38,13 +47,13 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires after the group description admin details. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_custom_group_fields_editable' ); ?> <p> <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' ); ?> + <input type="checkbox" name="group-notify-members" id="group-notify-members" value="1" /> <?php _e( 'Notify group members of these changes via email', 'buddypress' ); ?> </label> </p> @@ -53,7 +62,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires after the display of group admin details. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_details_admin' ); ?> @@ -70,7 +79,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires before the group settings admin display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_settings_admin' ); ?> @@ -79,7 +88,7 @@ do_action( 'bp_before_group_admin_content' ); ?> <?php if ( bp_forums_is_installed_correctly() ) : ?> <div class="checkbox"> - <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> + <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> </div> <hr /> @@ -91,35 +100,31 @@ do_action( 'bp_before_group_admin_content' ); ?> <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4> <div class="radio"> - <label> - <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> /> - <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong> - <ul> - <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> - <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> - <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> - </ul> - </label> - <label> - <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> /> - <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong> - <ul> - <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> - <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> - <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> - </ul> - </label> + <label for="group-status-public"><input type="radio" name="group-status" id="group-status-public" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="public-group-description" /> <?php _e( 'This is a public group', 'buddypress' ); ?></label> + + <ul id="public-group-description"> + <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> + </ul> + + <label for="group-status-private"><input type="radio" name="group-status" id="group-status-private" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="private-group-description" /> <?php _e( 'This is a private group', 'buddypress' ); ?></label> + + <ul id="private-group-description"> + <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> + + <label for="group-status-hidden"><input type="radio" name="group-status" id="group-status-hidden" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> aria-describedby="hidden-group-description" /> <?php _e('This is a hidden group', 'buddypress' ); ?></label> + + <ul id="hidden-group-description"> + <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> - <label> - <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> /> - <strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong> - <ul> - <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> - <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> - <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> - </ul> - </label> </div> <hr /> @@ -129,21 +134,14 @@ do_action( 'bp_before_group_admin_content' ); ?> <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> <div class="radio"> - <label> - <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> - <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> - </label> - <label> - <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> - <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> - </label> + <label for="group-invite-status-members"><input type="radio" name="group-invite-status" id="group-invite-status-members" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> <?php _e( 'All group members', 'buddypress' ); ?></label> - <label> - <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> - <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> - </label> - </div> + <label for="group-invite-status-mods"><input type="radio" name="group-invite-status" id="group-invite-status-mods" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ); ?></label> + + <label for="group-invite-status-admins"><input type="radio" name="group-invite-status" id="group-invite-status-admins" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> <?php _e( 'Group admins only', 'buddypress' ); ?></label> + + </div> <hr /> @@ -152,7 +150,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires after the group settings admin display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_settings_admin' ); ?> @@ -169,6 +167,7 @@ do_action( 'bp_before_group_admin_content' ); ?> <p><?php _e("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.", 'buddypress' ); ?></p> <p> + <label for="file" class="bp-screen-reader-text"><?php _e( 'Select an image', 'buddypress' ); ?></label> <input type="file" name="file" id="file" /> <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> @@ -186,7 +185,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Load the Avatar UI templates * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ bp_avatar_get_templates(); ?> @@ -218,6 +217,35 @@ do_action( 'bp_before_group_admin_content' ); ?> <?php endif; ?> +<?php /* Group Cover image Settings */ ?> +<?php if ( bp_is_group_admin_screen( 'group-cover-image' ) ) : ?> + + <h4><?php _e( 'Change Cover Image', 'buddypress' ); ?></h4> + + <?php + + /** + * Fires before the display of profile cover image upload content. + * + * @since 2.4.0 + */ + do_action( 'bp_before_group_settings_cover_image' ); ?> + + <p><?php _e( 'The Cover Image will be used to customize the header of your group.', 'buddypress' ); ?></p> + + <?php bp_attachments_get_template_part( 'cover-images/index' ); ?> + + <?php + + /** + * Fires after the display of group cover image upload content. + * + * @since 2.4.0 + */ + do_action( 'bp_after_group_settings_cover_image' ); ?> + +<?php endif; ?> + <?php /* Manage Group Members */ ?> <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> @@ -226,7 +254,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires before the group manage members admin display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_manage_members_admin' ); ?> @@ -285,7 +313,7 @@ do_action( 'bp_before_group_admin_content' ); ?> <div class="bp-widget"> - <h4><?php _e("Members", "buddypress"); ?></h4> + <h4><?php _e( "Members", 'buddypress' ); ?></h4> <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=0' ) ) : ?> @@ -337,7 +365,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires inside the display of a member admin item in group management area. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_manage_members_admin_item' ); ?> @@ -363,7 +391,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires after the group manage members admin display. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_manage_members_admin' ); ?> @@ -377,7 +405,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires before the display of group membership requests admin. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_membership_requests_admin' ); ?> @@ -392,7 +420,7 @@ do_action( 'bp_before_group_admin_content' ); ?> /** * Fires after the display of group membership requests admin. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_membership_requests_admin' ); ?> @@ -405,7 +433,7 @@ do_action( 'bp_before_group_admin_content' ); ?> * * Allows plugins to add custom group edit screens. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'groups_custom_edit_steps' ); ?> @@ -417,7 +445,7 @@ do_action( 'groups_custom_edit_steps' ); ?> /** * Fires before the display of group delete admin. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_delete_admin' ); ?> @@ -425,14 +453,14 @@ do_action( 'groups_custom_edit_steps' ); ?> <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> </div> - <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> + <label for="delete-group-understand"><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 /** * Fires after the display of group delete admin. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_delete_admin' ); ?> @@ -452,7 +480,7 @@ do_action( 'groups_custom_edit_steps' ); ?> /** * Fires inside the group admin form and after the content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_admin_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php new file mode 100644 index 0000000000000000000000000000000000000000..f371873249d42a7b07cd8a651a12bb829fb04adf --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php @@ -0,0 +1,123 @@ +<?php +/** + * BuddyPress - Groups Cover Image Header. + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +/** + * Fires before the display of a group's header. + * + * @since 1.2.0 + */ +do_action( 'bp_before_group_header' ); ?> + +<div id="cover-image-container"> + <a id="header-cover-image" href="<?php bp_group_permalink(); ?>"></a> + + <div id="item-header-cover-image"> + <?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(); ?> + + </a> + </div><!-- #item-header-avatar --> + <?php endif; ?> + + <div id="item-header-content"> + + <div id="item-buttons"><?php + + /** + * Fires in the group header actions section. + * + * @since 1.2.6 + */ + do_action( 'bp_group_header_actions' ); ?></div><!-- #item-buttons --> + + <?php + + /** + * Fires before the display of the group's header meta. + * + * @since 1.2.0 + */ + do_action( 'bp_before_group_header_meta' ); ?> + + <div id="item-meta"> + + <?php + + /** + * Fires after the group header actions section. + * + * @since 1.2.0 + */ + do_action( 'bp_group_header_meta' ); ?> + + <span class="highlight"><?php bp_group_type(); ?></span> + <span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span> + + <?php bp_group_description(); ?> + + </div> + </div><!-- #item-header-content --> + + <div id="item-actions"> + + <?php if ( bp_group_is_visible() ) : ?> + + <h3><?php _e( 'Group Admins', 'buddypress' ); ?></h3> + + <?php bp_group_list_admins(); + + /** + * Fires after the display of the group's administrators. + * + * @since 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 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 1.1.0 + */ + do_action( 'bp_after_group_menu_mods' ); + + endif; + + endif; ?> + + </div><!-- #item-actions --> + + </div><!-- #item-header-cover-image --> +</div><!-- #cover-image-container --> + +<?php + +/** + * Fires after the display of a group's header. + * + * @since 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' ); ?> 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 2557de1f55bd6823152c9a6a6f2466ead54ea4c9..5e5014f16bf3f37d286db5f6cadf46f44a122c90 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Single Forum + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of a group's forum content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_forum_content' ); @@ -70,7 +76,7 @@ else : ?> /** * Fires after the display of a group's forum content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_forum_content' ); ?> @@ -86,7 +92,7 @@ do_action( 'bp_after_group_forum_content' ); ?> /** * Fires before the display of a group forum new post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_forum_post_new' ); ?> @@ -97,13 +103,13 @@ do_action( 'bp_after_group_forum_content' ); ?> <p id="post-new"></p> <h4><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h4> - <label><?php _e( 'Title:', 'buddypress' ); ?></label> + <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label> <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" /> - <label><?php _e( 'Content:', 'buddypress' ); ?></label> + <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> <textarea name="topic_text" id="topic_text"></textarea> - <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <label for="topic_tags"><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> <input type="text" name="topic_tags" id="topic_tags" value="" /> <?php @@ -111,7 +117,7 @@ do_action( 'bp_after_group_forum_content' ); ?> /** * Fires after the display of a group forum new post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_forum_post_new' ); ?> 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 1f379c996d808fec20d9e83cb8a89fb6745bb7ce..ec10ce281bda0854357e1ee0e865ac273cf4042a 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Single Forum Edit. + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the group forum edit form. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_before_group_forum_edit_form' ); ?> @@ -46,7 +52,7 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires at the end of the group forum topic meta section. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 */ do_action( 'bp_group_forum_topic_meta' ); ?> @@ -61,7 +67,7 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires before the group forum topic form fields. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_before_edit_forum_topic' ); ?> @@ -71,7 +77,7 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea> - <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <label for="topic_tags"><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list(); ?>" /> <?php @@ -79,7 +85,7 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires after the group forum topic form fields. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_after_edit_forum_topic' ); ?> @@ -98,10 +104,11 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires before the group edit forum textarea. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_before_edit_forum_post' ); ?> + <label for="post_text" class="bp-screen-reader-text"><?php _e( 'Edit text', 'buddypress' ); ?></label> <textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea> <?php @@ -109,7 +116,7 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires after the group edit forum textarea. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_after_edit_forum_post' ); ?> @@ -136,6 +143,6 @@ do_action( 'bp_before_group_forum_edit_form' ); ?> /** * Fires at the end of the group forum edit form. * - * @since BuddyPress (1.2.4) + * @since 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 4f048098739aaeee00a1dce8937ec31044487da2..4b317350d2edd5cb0d99b13d3e3cf05dde4a708b 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Single Forum Topic. + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the group forum topic template. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_before_group_forum_topic' ); ?> @@ -57,7 +63,7 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires at the end of the group forum topic meta markup. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 */ do_action( 'bp_group_forum_topic_meta' ); ?> @@ -87,7 +93,7 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires before the listing of the group forum topic posts. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_before_group_forum_topic_posts' ); ?> @@ -116,7 +122,7 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires inside the group forum post meta markup. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 */ do_action( 'bp_group_forum_post_meta' ); ?> @@ -132,7 +138,7 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires before the listing of the group forum topic posts. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_after_group_forum_topic_posts' ); ?> @@ -174,12 +180,13 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires before the display of the group forum new reply section. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_forum_new_reply_before' ); ?> <h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4> + <label for="reply_text" class="bp-screen-reader-text"><?php _e( 'Reply', 'buddypress' ); ?></label> <textarea name="reply_text" id="reply_text"></textarea> <div class="submit"> @@ -191,7 +198,7 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires after the display of the group forum new reply section. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'groups_forum_new_reply_after' ); ?> @@ -217,6 +224,6 @@ do_action( 'bp_before_group_forum_topic' ); ?> /** * Fires at the end of the group forum topic template. * - * @since BuddyPress (1.2.4) + * @since 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 513a9e376ff58d7af69de964b94ae9a90f2bfccd..d3005b6138bc3accd135ec5252b4228dea756e73 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Header + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of a group's header. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_header' ); @@ -20,7 +26,7 @@ do_action( 'bp_before_group_header' ); /** * Fires after the display of the group's administrators. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_menu_admins' ); @@ -29,7 +35,7 @@ do_action( 'bp_before_group_header' ); /** * Fires before the display of the group's moderators, if there are any. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_menu_mods' ); ?> @@ -40,7 +46,7 @@ do_action( 'bp_before_group_header' ); /** * Fires after the display of the group's moderators, if there are any. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_menu_mods' ); @@ -69,7 +75,7 @@ do_action( 'bp_before_group_header' ); /** * Fires before the display of the group's header meta. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_header_meta' ); ?> @@ -84,7 +90,7 @@ do_action( 'bp_before_group_header' ); /** * Fires in the group header actions section. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ do_action( 'bp_group_header_actions' ); ?> @@ -95,7 +101,7 @@ do_action( 'bp_before_group_header' ); /** * Fires after the group header actions section. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_header_meta' ); ?> @@ -107,7 +113,7 @@ do_action( 'bp_before_group_header' ); /** * Fires after the display of a group's header. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_header' ); 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 6e2727c847282bde275d71884799cc9fcdf7da72..4fe26b8d766a0ad64dc5818e9e2df4472232207a 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 @@ -1,3 +1,12 @@ +<?php +/** + * BuddyPress - Groups Home + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div id="buddypress"> <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?> @@ -7,13 +16,22 @@ /** * Fires before the display of the group home content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_home_content' ); ?> <div id="item-header" role="complementary"> - <?php bp_get_template_part( 'groups/single/group-header' ); ?> + <?php + /** + * If the cover image feature is enabled, use a specific header + */ + if ( bp_group_use_cover_image_header() ) : + bp_get_template_part( 'groups/single/cover-image-header' ); + else : + bp_get_template_part( 'groups/single/group-header' ); + endif; + ?> </div><!-- #item-header --> @@ -28,7 +46,7 @@ /** * Fires after the display of group options navigation. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_group_options_nav' ); ?> @@ -43,7 +61,7 @@ /** * Fires before the display of the group home body. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_body' ); @@ -59,24 +77,15 @@ if ( bp_group_is_visible() ) { - // Use custom front if one exists - $custom_front = bp_locate_template( array( 'groups/single/front.php' ), false, true ); - if ( ! empty( $custom_front ) ) : load_template( $custom_front, true ); - - // Default to activity - elseif ( bp_is_active( 'activity' ) ) : bp_get_template_part( 'groups/single/activity' ); - - // Otherwise show members - elseif ( bp_is_active( 'members' ) ) : bp_groups_members_template_part(); - - endif; + // Load appropriate front template + bp_groups_front_template_part(); } else { /** * Fires before the display of the group status message. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_status_message' ); ?> @@ -89,7 +98,7 @@ /** * Fires after the display of the group status message. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_status_message' ); @@ -126,7 +135,7 @@ /** * Fires after the display of the group home body. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_body' ); ?> @@ -137,7 +146,7 @@ /** * Fires after the display of the group home content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_group_home_content' ); ?> 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 c37922aa55add95f9923a056a8cc6751e246ce70..c9db92fa528c3666166aad006bcfbfd424dea732 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,4 +1,12 @@ +<?php +/** + * BuddyPress - Group Invites Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ +?> <div class="left-menu"> <div id="invite-list"> @@ -20,7 +28,7 @@ /** * Fires before the display of the group send invites list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_send_invites_list' ); ?> @@ -58,7 +66,7 @@ /** * Fires inside the invite item listing. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_send_invites_item' ); ?> @@ -70,7 +78,7 @@ /** * Fires inside the action area for a send invites item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_send_invites_item_action' ); ?> </div> @@ -109,7 +117,7 @@ /** * Fires after the display of the group send invites list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_send_invites_list' ); ?> 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 0f7b6621b0fe1b1d37b6b1542d9d66459fa8215b..71ac12d686c9fdcd0e8acde612fe829448a64ae3 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,3 +1,13 @@ +<?php +/** + * BuddyPress - Groups Members + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) ) ) : ?> <?php @@ -5,7 +15,7 @@ /** * Fires before the display of the group members content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_members_content' ); ?> @@ -30,7 +40,7 @@ /** * Fires before the display of the group members list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_members_list' ); ?> @@ -53,7 +63,7 @@ /** * Fires inside the listing of an individual group member listing item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_members_list_item' ); ?> @@ -68,7 +78,7 @@ /** * Fires inside the action section of an individual group member listing item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_members_list_item_action' ); ?> @@ -86,7 +96,7 @@ /** * Fires after the display of the group members list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_members_list' ); ?> @@ -111,7 +121,7 @@ /** * Fires after the display of the group members content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_group_members_content' ); ?> 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 25647ee0d16d3e97cadf6b004852e4aba9b3b6a5..03d95de52d4f49186b642f67d68804d5f124bfe1 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups plugins + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of content for plugins using the BP_Group_Extension. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_group_plugin_template' ); ?> @@ -12,7 +18,7 @@ do_action( 'bp_before_group_plugin_template' ); ?> /** * Fires and displays content for plugins using the BP_Group_Extension. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_template_content' ); ?> @@ -21,6 +27,6 @@ do_action( 'bp_template_content' ); ?> /** * Fires after the display of content for plugins using the BP_Group_Extension. * - * @since BuddyPress (1.2.0) + * @since 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 de1b1c5ed5401cdaaf38616b343b2879ed1ea977..c05ac09c83fc5c81c7b2756d5830b240a9d422a1 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,14 +1,20 @@ <?php +/** + * BuddyPress - Groups Request Membership + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of the group membership request form. * - * @since BuddyPress (1.1.0) + * @since 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> + <p><?php printf( __( "You are requesting to become a member of the group '%s'.", 'buddypress' ), bp_get_group_name( false ) ); ?></p> <form action="<?php bp_group_form_action('request-membership' ); ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form"> <label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'buddypress' ); ?></label> @@ -19,7 +25,7 @@ do_action( 'bp_before_group_request_membership_content' ); ?> /** * Fires after the textarea for the group membership request form. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_request_membership_content' ); ?> @@ -34,6 +40,6 @@ do_action( 'bp_before_group_request_membership_content' ); ?> /** * Fires after the display of the group membership request form. * - * @since BuddyPress (1.1.0) + * @since 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 51a5c37ef7d3a205f487d3fc062852546cefbe8a..f41a5d4e66cfd9272f2b3b3755fc93c0315a5da6 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 @@ -1,3 +1,13 @@ +<?php +/** + * BuddyPress - Groups Requests Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <?php if ( bp_group_has_membership_requests( bp_ajax_querystring( 'membership_requests' ) ) ) : ?> <div id="pag-top" class="pagination"> @@ -29,7 +39,7 @@ /** * Fires inside the groups membership request list loop. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_membership_requests_admin_item' ); ?> @@ -44,7 +54,7 @@ /** * Fires inside the list of membership request actions. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_membership_requests_admin_item_action' ); ?> 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 657c12d8a0e6a23b9dd1bfaac5c3c216724ace14..64ac6906e34ad852af171c15db485d2af267ca0d 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,9 +1,15 @@ <?php +/** + * BuddyPress - Groups Send Invites + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the send invites content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_send_invites_content' ); ?> @@ -53,6 +59,6 @@ else : ?> /** * Fires after the send invites content. * - * @since BuddyPress (1.2.0) + * @since 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 66bac67fadec63177fb0761bbff1642115574fff..1e600a645f3e4c7b8690596a506754193b042595 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,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Activate + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <div id="buddypress"> <?php @@ -5,7 +15,7 @@ /** * Fires before the display of the member activation page. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_activation_page' ); ?> @@ -21,7 +31,7 @@ /** * Fires before the display of the member activation page content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_activate_content' ); ?> @@ -55,7 +65,7 @@ /** * Fires after the display of the member activation page content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_activate_content' ); ?> @@ -66,7 +76,7 @@ /** * Fires after the display of the member activation page. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_activation_page' ); ?> 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 6dc173be563772c3d28f933ec983f119828683ff..3c1a560ce51968e4079b0fc38ebf2c47a9fb6b66 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires at the top of the members directory template file. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_directory_members_page' ); ?> @@ -14,7 +20,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires before the display of the members. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_members' ); ?> @@ -23,7 +29,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires before the display of the members content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_members_content' ); ?> @@ -36,7 +42,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires before the display of the members list tabs. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ do_action( 'bp_before_directory_members_tabs' ); ?> @@ -44,10 +50,10 @@ do_action( 'bp_before_directory_members_page' ); ?> <div class="item-list-tabs" role="navigation"> <ul> - <li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li> + <li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members %s', 'buddypress' ), '<span>' . bp_get_total_member_count() . '</span>' ); ?></a></li> <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> - <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> + <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends %s', 'buddypress' ), '<span>' . bp_get_total_friend_count( bp_loggedin_user_id() ) . '</span>' ); ?></a></li> <?php endif; ?> <?php @@ -55,7 +61,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires inside the members directory member types. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_members_directory_member_types' ); ?> @@ -69,7 +75,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires inside the members directory member sub-types. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_directory_member_sub_types' ); ?> @@ -88,7 +94,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires inside the members directory member order options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_members_directory_order_options' ); ?> </select> @@ -103,10 +109,10 @@ do_action( 'bp_before_directory_members_page' ); ?> <?php /** - * Fires and displays the members content. - * - * @since BuddyPress (1.1.0) - */ + * Fires and displays the members content. + * + * @since 1.1.0 + */ do_action( 'bp_directory_members_content' ); ?> <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?> @@ -116,7 +122,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires after the display of the members content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_members_content' ); ?> @@ -127,7 +133,7 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires after the display of the members. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_members' ); ?> @@ -138,6 +144,6 @@ do_action( 'bp_before_directory_members_page' ); ?> /** * Fires at the bottom of the members directory template file. * - * @since BuddyPress (1.5.0) + * @since 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 e5f5ee03cbef7302548602d3c92a95385de887b0..f7ede463361257450b76410334c543a283aee7a9 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Members Loop * @@ -9,14 +8,10 @@ * @subpackage bp-legacy */ -?> - -<?php - /** * Fires before the display of the members loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_members_loop' ); ?> @@ -47,7 +42,7 @@ do_action( 'bp_before_members_loop' ); ?> /** * Fires before the display of the members list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_directory_members_list' ); ?> @@ -79,7 +74,7 @@ do_action( 'bp_before_members_loop' ); ?> /** * Fires inside the display of a directory member item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_members_item' ); ?> @@ -101,7 +96,7 @@ do_action( 'bp_before_members_loop' ); ?> /** * Fires inside the members action HTML markup to display actions. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_directory_members_actions' ); ?> @@ -119,7 +114,7 @@ do_action( 'bp_before_members_loop' ); ?> /** * Fires after the display of the members list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_directory_members_list' ); ?> @@ -154,6 +149,6 @@ do_action( 'bp_before_members_loop' ); ?> /** * Fires after the display of the members loop. * - * @since BuddyPress (1.2.0) + * @since 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 c131dbc5152e10ccb6b9a87ba36b7b579f22f5a4..34c558ef293fe92ef5110f0684b9e95d93da57ac 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,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Register + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <div id="buddypress"> <?php @@ -5,7 +15,7 @@ /** * Fires at the top of the BuddyPress member registration page template. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_register_page' ); ?> @@ -23,7 +33,7 @@ /** * Fires before the display of the registration disabled message. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_registration_disabled' ); ?> @@ -34,7 +44,7 @@ /** * Fires after the display of the registration disabled message. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_registration_disabled' ); ?> <?php endif; // registration-disabled signup step ?> @@ -53,7 +63,7 @@ /** * Fires before the display of member registration account details fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_account_details_fields' ); ?> @@ -69,7 +79,7 @@ /** * Fires and displays any member registration username errors. * - * @since BuddyPress (1.1.0) + * @since 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' ); ?>/> @@ -80,7 +90,7 @@ /** * Fires and displays any member registration email errors. * - * @since BuddyPress (1.1.0) + * @since 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' ); ?>/> @@ -91,7 +101,7 @@ /** * Fires and displays any member registration password errors. * - * @since BuddyPress (1.1.0) + * @since 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' ); ?>/> @@ -103,7 +113,7 @@ /** * Fires and displays any member registration password confirmation errors. * - * @since BuddyPress (1.1.0) + * @since 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' ); ?>/> @@ -113,7 +123,7 @@ /** * Fires and displays any extra member registration details fields. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ do_action( 'bp_account_details_fields' ); ?> @@ -124,7 +134,7 @@ /** * Fires after the display of member registration account details fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_account_details_fields' ); ?> @@ -137,7 +147,7 @@ /** * Fires before the display of member registration xprofile fields. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_before_signup_profile_fields' ); ?> @@ -159,13 +169,19 @@ /** * Fires before the display of the visibility options for xprofile fields. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> - <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a> + <?php + printf( + __( 'This field can be seen by: %s', 'buddypress' ), + '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' + ); + ?> + <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a> </p> <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> @@ -180,7 +196,12 @@ </div> <?php else : ?> <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> - <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> + <?php + printf( + __( 'This field can be seen by: %s', 'buddypress' ), + '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' + ); + ?> </p> <?php endif ?> @@ -189,7 +210,7 @@ /** * Fires after the display of the visibility options for xprofile fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_custom_profile_edit_fields' ); ?> @@ -208,7 +229,7 @@ /** * Fires and displays any extra member registration xprofile fields. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ do_action( 'bp_signup_profile_fields' ); ?> @@ -219,7 +240,7 @@ /** * Fires after the display of member registration xprofile fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_signup_profile_fields' ); ?> @@ -232,7 +253,7 @@ /** * Fires before the display of member registration blog details fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_blog_details_fields' ); ?> @@ -242,7 +263,7 @@ <h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4> - <p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></p> + <p><label for="signup_with_blog"><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></label></p> <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>> @@ -252,7 +273,7 @@ /** * Fires and displays any member registration blog URL errors. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_signup_blog_url_errors' ); ?> @@ -268,7 +289,7 @@ /** * Fires and displays any member registration blog title errors. * - * @since BuddyPress (1.1.0) + * @since 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(); ?>" /> @@ -279,19 +300,19 @@ /** * Fires and displays any member registration blog privacy errors. * - * @since BuddyPress (1.1.0) + * @since 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> + <label for="signup_blog_privacy_public"><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 for="signup_blog_privacy_private"><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 /** * Fires and displays any extra member registration blog details fields. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ do_action( 'bp_blog_details_fields' ); ?> @@ -304,7 +325,7 @@ /** * Fires after the display of member registration blog details fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_blog_details_fields' ); ?> @@ -315,7 +336,7 @@ /** * Fires before the display of the registration submit buttons. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_registration_submit_buttons' ); ?> @@ -328,7 +349,7 @@ /** * Fires after the display of the registration submit buttons. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_registration_submit_buttons' ); ?> @@ -347,7 +368,7 @@ /** * Fires before the display of the registration confirmed messages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_registration_confirmed' ); ?> @@ -362,7 +383,7 @@ /** * Fires after the display of the registration confirmed messages. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_registration_confirmed' ); ?> @@ -373,7 +394,7 @@ /** * Fires and displays any custom signup steps. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_custom_signup_steps' ); ?> @@ -386,7 +407,7 @@ /** * Fires at the bottom of the BuddyPress member registration page template. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_register_page' ); ?> 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 384472a30246cb97b1662a811d04e3570e41d695..b80ec0201459596a3e3e24ff805227f1dd3f9bdd 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Activity * @@ -26,7 +25,7 @@ /** * Fires inside the select input for member activity filter options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_member_activity_filter_options' ); ?> @@ -40,7 +39,7 @@ /** * Fires before the display of the member activity post form. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_activity_post_form' ); ?> @@ -51,14 +50,14 @@ if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_i /** * Fires after the display of the member activity post form. * - * @since BuddyPress (1.2.0) + * @since 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) + * @since 1.2.0 */ do_action( 'bp_before_member_activity_content' ); ?> @@ -73,6 +72,6 @@ do_action( 'bp_before_member_activity_content' ); ?> /** * Fires after the display of the member activities list. * - * @since BuddyPress (1.2.0) + * @since 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 3de9dc366c7cd0b48bb72f3847480dcee7f821cb..bad9c4b2817431bf3e45cb3164684a39c721ca56 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Blogs * @@ -27,7 +26,7 @@ /** * Fires inside the members blogs order options select input. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_member_blog_order_options' ); ?> @@ -45,7 +44,7 @@ switch ( bp_current_action() ) : /** * Fires before the display of member blogs content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_blogs_content' ); ?> @@ -60,7 +59,7 @@ switch ( bp_current_action() ) : /** * Fires after the display of member blogs content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_blogs_content' ); break; diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php new file mode 100644 index 0000000000000000000000000000000000000000..806568864ebe7935d72235ce01ce68a2b1465699 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/cover-image-header.php @@ -0,0 +1,103 @@ +<?php +/** + * BuddyPress - Users Cover Image Header + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php + +/** + * Fires before the display of a member's header. + * + * @since 1.2.0 + */ +do_action( 'bp_before_member_header' ); ?> + +<div id="cover-image-container"> + <a id="header-cover-image" href="<?php bp_displayed_user_link(); ?>"></a> + + <div id="item-header-cover-image"> + <div id="item-header-avatar"> + <a href="<?php bp_displayed_user_link(); ?>"> + + <?php bp_displayed_user_avatar( 'type=full' ); ?> + + </a> + </div><!-- #item-header-avatar --> + + <div id="item-header-content"> + + <?php if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) : ?> + <h2 class="user-nicename">@<?php bp_displayed_user_mentionname(); ?></h2> + <?php endif; ?> + + <div id="item-buttons"><?php + + /** + * Fires in the member header actions section. + * + * @since 1.2.6 + */ + do_action( 'bp_member_header_actions' ); ?></div><!-- #item-buttons --> + + <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span> + + <?php + + /** + * Fires before the display of the member's header meta. + * + * @since 1.2.0 + */ + do_action( 'bp_before_member_header_meta' ); ?> + + <div id="item-meta"> + + <?php if ( bp_is_active( 'activity' ) ) : ?> + + <div id="latest-update"> + + <?php bp_activity_latest_update( bp_displayed_user_id() ); ?> + + </div> + + <?php endif; ?> + + <?php + + /** + * 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 1.2.0 + */ + do_action( 'bp_profile_header_meta' ); + + ?> + + </div><!-- #item-meta --> + + </div><!-- #item-header-content --> + + </div><!-- #item-header-cover-image --> +</div><!-- #cover-image-container --> + +<?php + +/** + * Fires after the display of a member's header. + * + * @since 1.2.0 + */ +do_action( 'bp_after_member_header' ); ?> + +<?php + +/** 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/forums.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php index 93b1ae9426477f4b8cb9cd81b97aa020d66b7baa..0c943c2a2a7d4f71f1c3b1e984e4c7622c4d26ed 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Forums * @@ -26,7 +25,7 @@ /** * Fires inside the members forums order options select input. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_forums_directory_order_options' ); ?> @@ -45,7 +44,7 @@ else : /** * Fires before the display of member forums content. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_member_forums_content' ); ?> @@ -60,7 +59,7 @@ else : /** * Fires after the display of member forums content. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_after_member_forums_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php index a202e9e730719fb3edd6bae27dd4cf59f6ba832b..3f41fa8431fe19a6ecba9f810a96ef32e7393645 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php @@ -1,7 +1,8 @@ <?php -/* +/** * To change this template, choose Tools | Templates * and open the template in the editor. + * + * @package BuddyPress + * @subpackage bp-legacy */ - -?> 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 c58e2f1d1100a1e8bdba61dd4c5da6f069ef3c63..c6c2f291d450f97aa4a45aed35419d1de560bcc0 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Friends * @@ -28,7 +27,7 @@ /** * Fires inside the members friends order options select input. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_member_friends_order_options' ); ?> @@ -49,7 +48,7 @@ switch ( bp_current_action() ) : /** * Fires before the display of member friends content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_friends_content' ); ?> @@ -64,7 +63,7 @@ switch ( bp_current_action() ) : /** * Fires after the display of member friends content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_friends_content' ); break; 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 20e199c972a4ba0820ffc407d7c07b2acb3fb53e..78501c6c36a20f232f1498470856dbc42c3ccf85 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Friends Requests + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of member friend requests content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_friend_requests_content' ); ?> @@ -36,16 +42,16 @@ do_action( 'bp_before_member_friend_requests_content' ); ?> <div class="item"> <div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div> <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> - </div> - - <?php - /** - * Fires inside the display of a member friend request item. - * - * @since BuddyPress (1.1.0) - */ - do_action( 'bp_friend_requests_item' ); ?> + <?php + /** + * Fires inside the display of a member friend request item. + * + * @since 1.1.0 + */ + do_action( 'bp_friend_requests_item' ); + ?> + </div> <div class="action"> <a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> @@ -56,7 +62,7 @@ do_action( 'bp_before_member_friend_requests_content' ); ?> /** * Fires inside the member friend request actions markup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_friend_requests_item_action' ); ?> </div> @@ -70,7 +76,7 @@ do_action( 'bp_before_member_friend_requests_content' ); ?> /** * Fires and displays the member friend requests content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_friend_requests_content' ); ?> @@ -103,6 +109,6 @@ do_action( 'bp_before_member_friend_requests_content' ); ?> /** * Fires after the display of member friend requests content. * - * @since BuddyPress (1.2.0) + * @since 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 f9dfdc23cf2232a861b225abd92d704fbfb967fe..fcaab670725dc69f2e5838470d1b1c32cc386ac9 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Groups * @@ -29,7 +28,7 @@ /** * Fires inside the members group order options select input. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_member_group_order_options' ); ?> @@ -51,7 +50,7 @@ switch ( bp_current_action() ) : /** * Fires before the display of member groups content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_groups_content' ); ?> @@ -66,7 +65,7 @@ switch ( bp_current_action() ) : /** * Fires after the display of member groups content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_groups_content' ); break; 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 54877b24dbb643df0780e8aa7ff11fc75b1e9114..5f77a7ee4444340c42e627f9d547d3cc18ae6082 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Single Group Invites + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of member group invites content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_group_invites_content' ); ?> @@ -31,7 +37,7 @@ do_action( 'bp_before_group_invites_content' ); ?> /** * Fires inside the display of a member group invite item. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_invites_item' ); ?> @@ -44,7 +50,7 @@ do_action( 'bp_before_group_invites_content' ); ?> /** * Fires inside the member group item action markup. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_group_invites_item_action' ); ?> @@ -67,6 +73,6 @@ do_action( 'bp_before_group_invites_content' ); ?> /** * Fires after the display of member group invites content. * - * @since BuddyPress (1.1.0) + * @since 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 6b9f04cb8a3b8155c67d332d6f5731aea6ecafe9..b7e5ee9537d3dc63afebd25051d9fb91d10ce6a0 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,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Home + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <div id="buddypress"> <?php @@ -5,13 +15,22 @@ /** * Fires before the display of member home content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_home_content' ); ?> <div id="item-header" role="complementary"> - <?php bp_get_template_part( 'members/single/member-header' ) ?> + <?php + /** + * If the cover image feature is enabled, use a specific header + */ + if ( bp_displayed_user_use_cover_image_header() ) : + bp_get_template_part( 'members/single/cover-image-header' ); + else : + bp_get_template_part( 'members/single/member-header' ); + endif; + ?> </div><!-- #item-header --> @@ -26,7 +45,7 @@ /** * Fires after the display of member options navigation. * - * @since BuddyPress (1.2.4) + * @since 1.2.4 */ do_action( 'bp_member_options_nav' ); ?> @@ -41,7 +60,7 @@ /** * Fires before the display of member body content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_body' ); @@ -81,7 +100,7 @@ /** * Fires after the display of member body content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_body' ); ?> @@ -92,7 +111,7 @@ /** * Fires after the display of member home content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_home_content' ); ?> 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 ec3687e25558c2a37ad0a590d326cb92b1ea7657..6cf201cf851fa719729701a6fc53b354bcde508c 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Header * @@ -14,7 +13,7 @@ /** * Fires before the display of a member's header. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_header' ); ?> @@ -39,7 +38,7 @@ do_action( 'bp_before_member_header' ); ?> /** * Fires before the display of the member's header meta. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_header_meta' ); ?> @@ -62,7 +61,7 @@ do_action( 'bp_before_member_header' ); ?> /** * Fires in the member header actions section. * - * @since BuddyPress (1.2.6) + * @since 1.2.6 */ do_action( 'bp_member_header_actions' ); ?> @@ -76,7 +75,7 @@ do_action( 'bp_before_member_header' ); ?> * 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) + * @since 1.2.0 */ do_action( 'bp_profile_header_meta' ); @@ -91,7 +90,7 @@ do_action( 'bp_before_member_header' ); ?> /** * Fires after the display of a member's header. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_header' ); ?> 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 d803d6831362fa1b9064c4ff2c3e59bfca8054cb..ff97870639a3a90cca5ec39bab246aa8f3aa076a 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Messages * @@ -34,7 +33,7 @@ switch ( bp_current_action() ) : /** * Fires before the member messages content for inbox and sentbox. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_messages_content' ); ?> @@ -47,7 +46,7 @@ switch ( bp_current_action() ) : /** * Fires after the member messages content for inbox and sentbox. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_messages_content' ); break; @@ -68,7 +67,7 @@ switch ( bp_current_action() ) : /** * Fires before the member messages content for notices. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_messages_content' ); ?> @@ -81,7 +80,7 @@ switch ( bp_current_action() ) : /** * Fires after the member messages content for inbox and sentbox. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_messages_content' ); break; 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 54a78220b28c4d9f767da6997b4ac4416d877e7c..3eebb16fcfd18b34bf4265a5d8cae8630c8539dc 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,3 +1,12 @@ +<?php +/** + * BuddyPress - Members Single Messages Compose + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" enctype="multipart/form-data"> <?php @@ -5,7 +14,7 @@ /** * Fires before the display of message compose content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_messages_compose_content' ); ?> @@ -18,13 +27,13 @@ </ul> <?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?> - <input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?> + <p><label for="send-notice"><input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", 'buddypress' ); ?></label></p> <?php endif; ?> <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label> <input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" /> - <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label> + <label for="message_content"><?php _e( 'Message', 'buddypress' ); ?></label> <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea> <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(); ?>" /> @@ -34,7 +43,7 @@ /** * Fires after the display of message compose content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_messages_compose_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/message.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/message.php new file mode 100644 index 0000000000000000000000000000000000000000..be77d71e6c070e6529efc5b20d55d8392d8cf4e3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/message.php @@ -0,0 +1,86 @@ +<?php +/** + * BuddyPress - Private Message Content. + * + * This template is used in /messages/single.php during the message loop to + * display each message and when a new message is created via AJAX. + * + * @since 2.4.0 + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + + <div class="message-box <?php bp_the_thread_message_css_class(); ?>"> + + <div class="message-metadata"> + + <?php + + /** + * Fires before the single message header is displayed. + * + * @since 1.1.0 + */ + do_action( 'bp_before_message_meta' ); ?> + + <?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ); ?> + + <?php if ( bp_get_the_thread_message_sender_link() ) : ?> + + <strong><a href="<?php bp_the_thread_message_sender_link(); ?>" title="<?php bp_the_thread_message_sender_name(); ?>"><?php bp_the_thread_message_sender_name(); ?></a></strong> + + <?php else : ?> + + <strong><?php bp_the_thread_message_sender_name(); ?></strong> + + <?php endif; ?> + + <span class="activity"><?php bp_the_thread_message_time_since(); ?></span> + + <?php if ( bp_is_active( 'messages', 'star' ) ) : ?> + <div class="message-star-actions"> + <?php bp_the_message_star_action_link(); ?> + </div> + <?php endif; ?> + + <?php + + /** + * Fires after the single message header is displayed. + * + * @since 1.1.0 + */ + do_action( 'bp_after_message_meta' ); ?> + + </div><!-- .message-metadata --> + + <?php + + /** + * Fires before the message content for a private message. + * + * @since 1.1.0 + */ + do_action( 'bp_before_message_content' ); ?> + + <div class="message-content"> + + <?php bp_the_thread_message_content(); ?> + + </div><!-- .message-content --> + + <?php + + /** + * Fires after the message content for a private message. + * + * @since 1.1.0 + */ + do_action( 'bp_after_message_content' ); ?> + + <div class="clear"></div> + + </div><!-- .message-box --> 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 538be488795d9956be301d6a47d767f19f18a480..a99018f568289ce936e8ad94a03d46025a1f1196 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Messages Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the members messages loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_messages_loop' ); ?> @@ -26,7 +32,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> /** * Fires after the members messages pagination display. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_messages_pagination' ); ?> @@ -35,7 +41,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> /** * Fires before the members messages threads. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_messages_threads' ); ?> @@ -45,7 +51,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> <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-checkbox bulk-select-all"><input id="select-all-messages" type="checkbox"><label class="bp-screen-reader-text" for="select-all-messages"><?php _e( 'Select all', 'buddypress' ); ?></label></th> <th scope="col" class="thread-from"><?php _e( 'From', 'buddypress' ); ?></th> <th scope="col" class="thread-info"><?php _e( 'Subject', 'buddypress' ); ?></th> @@ -57,7 +63,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> * 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) + * @since 2.3.0 */ do_action( 'bp_messages_inbox_list_header' ); ?> @@ -75,7 +81,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> <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(); ?>" /> + <label for="bp-message-thread-<?php bp_message_thread_id(); ?>"><input type="checkbox" name="message_ids[]" id="bp-message-thread-<?php bp_message_thread_id(); ?>" class="message-check" value="<?php bp_message_thread_id(); ?>" /><span class="bp-screen-reader-text"><?php _e( 'Select this message', 'buddypress' ); ?></span></label> </td> <?php if ( 'sentbox' != bp_current_action() ) : ?> @@ -95,7 +101,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> <?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><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> @@ -107,7 +113,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> * 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) + * @since 1.1.0 */ do_action( 'bp_messages_inbox_list_item' ); ?> @@ -125,6 +131,15 @@ do_action( 'bp_before_member_messages_loop' ); ?> <?php endif; ?> | <a class="delete" href="<?php bp_message_thread_delete_link(); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> + + <?php + + /** + * Fires after the thread options links for each message in the messages loop list. + * + * @since 2.5.0 + */ + do_action( 'bp_messages_thread_options' ); ?> </td> </tr> @@ -146,7 +161,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> /** * Fires after the members messages threads. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_messages_threads' ); ?> @@ -155,7 +170,7 @@ do_action( 'bp_before_member_messages_loop' ); ?> /** * Fires and displays member messages options. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_member_messages_options' ); ?> @@ -172,6 +187,6 @@ do_action( 'bp_before_member_messages_loop' ); ?> /** * Fires after the members messages loop. * - * @since BuddyPress (1.2.0) + * @since 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 86c2617e1431e17a51451b1cfd47b2df52a66430..1dacb8f3197516e4d76f59fe5bb377f2775f4807 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Single Messages Notice Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the members notices loop. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_notices_loop' ); ?> @@ -26,7 +32,7 @@ do_action( 'bp_before_notices_loop' ); ?> /** * Fires after the members notices pagination display. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_notices_pagination' ); ?> <?php @@ -34,7 +40,7 @@ do_action( 'bp_before_notices_loop' ); ?> /** * Fires before the members notice items. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_notices' ); ?> @@ -62,13 +68,13 @@ do_action( 'bp_before_notices_loop' ); ?> /** * Fires inside the display of a member notice list item. * - * @since BuddyPress (1.2.0) + * @since 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> - <a class="button" href="<?php bp_message_notice_delete_link(); ?>" class="confirm" title="<?php esc_attr_e( "Delete Message", "buddypress" ); ?>">x</a> + <a class="button" href="<?php bp_message_notice_delete_link(); ?>" class="confirm" title="<?php esc_attr_e( "Delete Message", 'buddypress' ); ?>">x</a> </td> </tr> <?php endwhile; ?> @@ -79,7 +85,7 @@ do_action( 'bp_before_notices_loop' ); ?> /** * Fires after the members notice items. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_after_notices' ); ?> @@ -96,6 +102,6 @@ do_action( 'bp_before_notices_loop' ); ?> /** * Fires after the members notices loop. * - * @since BuddyPress (1.2.0) + * @since 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 d4b08e5a39c74ddedb1bc9ddb219a1a71da68f9f..abea94e15dbeeb29f8fe93669563445388ce28b6 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,3 +1,12 @@ +<?php +/** + * BuddyPress - Members Single Message + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div id="message-thread"> <?php @@ -5,7 +14,7 @@ /** * Fires before the display of a single member message thread content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_message_thread_content' ); ?> @@ -32,7 +41,16 @@ </span> - <a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Conversation", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> + <a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Conversation", 'buddypress' ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> + + <?php + + /** + * Fires after the action links in the header of a single message thread. + * + * @since 2.5.0 + */ + do_action( 'bp_after_message_thread_recipients' ); ?> </p> <?php @@ -40,68 +58,12 @@ /** * Fires before the display of the message thread list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_message_thread_list' ); ?> <?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?> - - <div class="message-box <?php bp_the_thread_message_css_class(); ?>"> - - <div class="message-metadata"> - - <?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' ); ?> - - <?php if ( bp_get_the_thread_message_sender_link() ) : ?> - - <strong><a href="<?php bp_the_thread_message_sender_link(); ?>" title="<?php bp_the_thread_message_sender_name(); ?>"><?php bp_the_thread_message_sender_name(); ?></a></strong> - - <?php else : ?> - - <strong><?php bp_the_thread_message_sender_name(); ?></strong> - - <?php endif; ?> - - <span class="activity"><?php bp_the_thread_message_time_since(); ?></span> - - <?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 - - /** This action is documented in bp-templates/bp-legacy/buddypress-functions.php */ - do_action( 'bp_before_message_content' ); ?> - - <div class="message-content"> - - <?php bp_the_thread_message_content(); ?> - - </div><!-- .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> - - </div><!-- .message-box --> - + <?php bp_get_template_part( 'members/single/messages/message' ); ?> <?php endwhile; ?> <?php @@ -109,7 +71,7 @@ /** * Fires after the display of the message thread list. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_message_thread_list' ); ?> @@ -118,7 +80,7 @@ /** * Fires before the display of the message thread reply form. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_message_thread_reply' ); ?> @@ -153,10 +115,11 @@ /** * Fires before the display of the message reply box. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_message_reply_box' ); ?> + <label for="message_content" class="bp-screen-reader-text"><?php _e( 'Reply to Message', 'buddypress' ); ?></label> <textarea name="content" id="message_content" rows="15" cols="40"></textarea> <?php @@ -164,7 +127,7 @@ /** * Fires after the display of the message reply box. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_message_reply_box' ); ?> @@ -187,7 +150,7 @@ /** * Fires after the display of the message thread reply form. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_message_thread_reply' ); ?> @@ -198,7 +161,7 @@ /** * Fires after the display of a single member message thread content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_message_thread_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php index c91d118c3901d6af3d9250bd55defb249d894802..bbe872206dc0d21425dbcb80bf9ce7fee7c1f0d4 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Notifications * @@ -22,17 +21,15 @@ <?php switch ( bp_current_action() ) : - // Unread case 'unread' : bp_get_template_part( 'members/single/notifications/unread' ); break; - // Read case 'read' : bp_get_template_part( 'members/single/notifications/read' ); break; - // Any other + // Any other actions. default : bp_get_template_part( 'members/single/plugins' ); break; diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php index 014947bdfb56c6eb43a39240b3f00dff914ccd88..4d7eeaa7442fd1c0d190fa87ebcf2a692ea9cd1d 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php @@ -1,3 +1,12 @@ +<?php +/** + * BuddyPress - Members Feedback No Notifications + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <div id="message" class="info"> <?php if ( bp_is_current_action( 'unread' ) ) : ?> @@ -11,9 +20,9 @@ <p><?php _e( 'This member has no unread notifications.', 'buddypress' ); ?></p> <?php endif; ?> - + <?php else : ?> - + <?php if ( bp_is_my_profile() ) : ?> <p><?php _e( 'You have no notifications.', 'buddypress' ); ?></p> 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 ccf11d1f4ae5c52c847207c8a84394db51857248..6cf1b7808a01921c1311ad5885d86786cca2a8bd 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,9 +1,18 @@ +<?php +/** + * BuddyPress - Members Notifications Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> <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="bulk-select-all"><input id="select-all-notifications" type="checkbox"><label class="bp-screen-reader-text" for="select-all-notifications"><?php _e( 'Select all', 'buddypress' ); ?></label></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> @@ -16,7 +25,7 @@ <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="bulk-select-check"><label for="<?php bp_the_notification_id(); ?>"><input id="<?php bp_the_notification_id(); ?>" type="checkbox" name="notifications[]" value="<?php bp_the_notification_id(); ?>" class="notification-check"><span class="bp-screen-reader-text"><?php _e( 'Select this notification', 'buddypress' ); ?></span></label></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> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/read.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/read.php index 85fcab77469a5f91c5110d647ccd63b06ff437de..ba03d82eda929acaa410822071f690a9a2e5ddbf 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/read.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/read.php @@ -1,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Read Notifications + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <?php if ( bp_has_notifications() ) : ?> <div id="pag-top" class="pagination no-ajax"> @@ -26,4 +36,4 @@ <?php bp_get_template_part( 'members/single/notifications/feedback-no-notifications' ); ?> -<?php endif; \ No newline at end of file +<?php endif; diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php index 85fcab77469a5f91c5110d647ccd63b06ff437de..62aa1a25b69e7c291427a96cac1b3204a961f86a 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/notifications/unread.php @@ -1,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Unread Notifications + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <?php if ( bp_has_notifications() ) : ?> <div id="pag-top" class="pagination no-ajax"> @@ -26,4 +36,4 @@ <?php bp_get_template_part( 'members/single/notifications/feedback-no-notifications' ); ?> -<?php endif; \ No newline at end of file +<?php endif; 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 c3c5afc7fa13f3da35f43b479a23d0d1ff2bf18c..07444b7691eb06d2bb253d5aedc0014fede4d146 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 @@ -8,14 +8,11 @@ * @package BuddyPress * @subpackage bp-legacy */ -?> - - <?php /** * Fires at the start of the member plugin template. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_member_plugin_template' ); ?> @@ -30,7 +27,7 @@ /** * Fires inside the member plugin template nav <ul> tag. * - * @since BuddyPress (1.2.2) + * @since 1.2.2 */ do_action( 'bp_member_plugin_options_nav' ); ?> </ul> @@ -38,21 +35,24 @@ <?php endif; ?> - <h3><?php + <?php if ( has_action( 'bp_template_title' ) ) : ?> + <h3><?php /** * Fires inside the member plugin template <h3> tag. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_template_title' ); ?></h3> + <?php endif; ?> + <?php /** * Fires and displays the member plugin template content. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_template_content' ); ?> @@ -61,6 +61,6 @@ /** * Fires at the end of the member plugin template. * - * @since BuddyPress (1.2.0) + * @since 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 165cd178e63a18fc817788717c395a275c313c46..0be493557128eb2cd4c655704ffdb03b1a69e667 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 @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Profile * @@ -20,7 +19,7 @@ /** * Fires before the display of member profile content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_profile_content' ); ?> @@ -38,6 +37,11 @@ do_action( 'bp_before_profile_content' ); ?> bp_get_template_part( 'members/single/profile/change-avatar' ); break; + // Change Cover Image + case 'change-cover-image' : + bp_get_template_part( 'members/single/profile/change-cover-image' ); + break; + // Compose case 'public' : @@ -63,6 +67,6 @@ endswitch; ?> /** * Fires after the display of member profile content. * - * @since BuddyPress (1.1.0) + * @since 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 bbdf4b7ba7dbdacb3e46dc2ca626782157810e45..9e8a811aa9ba8ec6fbbde866c076a14586cf56d3 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,3 +1,13 @@ +<?php +/** + * BuddyPress - Members Profile Change Avatar + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + <h4><?php _e( 'Change Profile Photo', 'buddypress' ); ?></h4> <?php @@ -5,7 +15,7 @@ /** * Fires before the display of profile avatar upload content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_profile_avatar_upload_content' ); ?> @@ -21,6 +31,7 @@ do_action( 'bp_before_profile_avatar_upload_content' ); ?> <p><?php _e( 'Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'buddypress' ); ?></p> <p id="avatar-upload"> + <label for="file" class="bp-screen-reader-text"><?php _e( 'Select an image', 'buddypress' ); ?></label> <input type="file" name="file" id="file" /> <input type="submit" name="upload" id="upload" value="<?php esc_attr_e( 'Upload Image', 'buddypress' ); ?>" /> <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> @@ -37,10 +48,10 @@ do_action( 'bp_before_profile_avatar_upload_content' ); ?> <h5><?php _e( 'Crop Your New Profile Photo', 'buddypress' ); ?></h5> - <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile Photo to crop', 'buddypress' ); ?>" /> + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php esc_attr_e( 'Profile photo to crop', 'buddypress' ); ?>" /> <div id="avatar-crop-pane"> - <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile Photo preview', 'buddypress' ); ?>" /> + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php esc_attr_e( 'Profile photo preview', 'buddypress' ); ?>" /> </div> <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php esc_attr_e( 'Crop Image', 'buddypress' ); ?>" /> @@ -61,7 +72,7 @@ do_action( 'bp_before_profile_avatar_upload_content' ); ?> /** * Load the Avatar UI templates * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ bp_avatar_get_templates(); ?> @@ -76,6 +87,6 @@ do_action( 'bp_before_profile_avatar_upload_content' ); ?> /** * Fires after the display of profile avatar upload content. * - * @since BuddyPress (1.1.0) + * @since 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/change-cover-image.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php new file mode 100644 index 0000000000000000000000000000000000000000..d1f9f91ffae8132901e23a6d562bb35802832d76 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php @@ -0,0 +1,33 @@ +<?php +/** + * BuddyPress - Members Profile Change Cover Image + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<h4><?php _e( 'Change Cover Image', 'buddypress' ); ?></h4> + +<?php + +/** + * Fires before the display of profile cover image upload content. + * + * @since 2.4.0 + */ +do_action( 'bp_before_profile_edit_cover_image' ); ?> + +<p><?php _e( 'Your Cover Image will be used to customize the header of your profile.', 'buddypress' ); ?></p> + +<?php bp_attachments_get_template_part( 'cover-images/index' ); ?> + +<?php + +/** + * Fires after the display of profile cover image upload content. + * + * @since 2.4.0 + */ +do_action( 'bp_after_profile_edit_cover_image' ); ?> 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 cd50612f48bc049c41e98c00db0679eb111967f3..d820b8daeefec7085b97054707f27ff6336f88b0 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Single Profile Edit + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires after the display of member profile edit content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_profile_edit_content' ); @@ -17,7 +23,7 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) /** 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> + <h4><?php printf( __( "Editing '%s' Profile Group", 'buddypress' ), bp_get_the_profile_group_name() ); ?></h4> <?php if ( bp_profile_has_multiple_groups() ) : ?> <ul class="button-nav"> @@ -40,14 +46,20 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) /** * Fires before the display of visibility options for the field. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 */ do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> - <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a> + <?php + printf( + __( 'This field can be seen by: %s', 'buddypress' ), + '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' + ); + ?> + <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a> </p> <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> @@ -61,7 +73,12 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) </div> <?php else : ?> <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> - <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> + <?php + printf( + __( 'This field can be seen by: %s', 'buddypress' ), + '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' + ); + ?> </div> <?php endif ?> @@ -70,7 +87,7 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) /** * Fires after the visibility options for a field. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_custom_profile_edit_fields' ); ?> @@ -101,6 +118,6 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) /** * Fires after the display of member profile edit content. * - * @since BuddyPress (1.1.0) + * @since 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 687340ce4c6889731c82f6ea14557ca8e70f0e96..c9483df87943cf33dc3b2c4be41f4a5e0d26edca 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,10 @@ <?php +/** + * BuddyPress - Members Profile Loop + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */ do_action( 'bp_before_profile_loop_content' ); ?> @@ -39,7 +45,7 @@ do_action( 'bp_before_profile_loop_content' ); ?> /** * Fires after the display of a field table row for profile data. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_profile_field_item' ); ?> 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 981e65b2387213a78c9de662dad68fd295a27518..59137b401c70f6e42101475bc70e02c86a0fb241 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Single Profile WP + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of member profile loop content. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ do_action( 'bp_before_profile_loop_content' ); ?> @@ -14,7 +20,7 @@ do_action( 'bp_before_profile_loop_content' ); ?> /** * Fires before the display of member profile field content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_before_profile_field_content' ); ?> @@ -85,7 +91,7 @@ do_action( 'bp_before_profile_loop_content' ); ?> /** * Fires after the display of member profile field content. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_after_profile_field_content' ); ?> @@ -94,7 +100,7 @@ do_action( 'bp_after_profile_field_content' ); ?> /** * Fires and displays the profile field buttons. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'bp_profile_field_buttons' ); ?> @@ -103,6 +109,6 @@ do_action( 'bp_profile_field_buttons' ); ?> /** * Fires after the display of member profile loop content. * - * @since BuddyPress (1.2.0) + * @since 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.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php index 58e5dfceb48da63a8c16dda6907cb1fd8391a138..bad78ebd5b7813c3baaebb0e92401e24d7597651 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php @@ -1,5 +1,4 @@ <?php - /** * BuddyPress - Users Settings * 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 01260c8ba890333027e67b4d15dc82e9b3f00310..b5c0f8881277c2baf3dcf51ff5f7f3ae4ff6468d 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,4 +1,10 @@ <?php +/** + * BuddyPress - Members Settings Capabilities + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */ do_action( 'bp_before_member_settings_template' ); ?> @@ -10,11 +16,11 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires before the display of the submit button for user capabilities saving. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_members_capabilities_account_before_submit' ); ?> - <label> + <label for="user-spammer"> <input type="checkbox" name="user-spammer" id="user-spammer" value="1" <?php checked( bp_is_user_spammer( bp_displayed_user_id() ) ); ?> /> <?php _e( 'This user is a spammer.', 'buddypress' ); ?> </label> @@ -28,7 +34,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of the submit button for user capabilities saving. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 */ do_action( 'bp_members_capabilities_account_after_submit' ); ?> 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 5355d35404a7db744c3a1777d33e41a4d7200d1e..0b628bde448931884aacb87cd5248e998b3530f5 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,10 @@ <?php +/** + * BuddyPress - Members Settings Delete Account + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */ do_action( 'bp_before_member_settings_template' ); ?> @@ -24,11 +30,11 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires before the display of the submit button for user delete account submitting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_delete_account_before_submit' ); ?> - <label> + <label for="delete-account-understand"> <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'; }" /> <?php _e( 'I understand the consequences.', 'buddypress' ); ?> </label> @@ -42,7 +48,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of the submit button for user delete account submitting. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_delete_account_after_submit' ); ?> 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 a2824083fdb5f4f7f8cc8c64adb11783c003091b..4d26f60d142c1ee5a2d453553f06fc66bb594a58 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,4 +1,10 @@ <?php +/** + * BuddyPress - Members Single Profile + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */ do_action( 'bp_before_member_settings_template' ); ?> @@ -18,6 +24,7 @@ do_action( 'bp_before_member_settings_template' ); ?> <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" <?php bp_form_field_attributes( 'password' ); ?>/> <?php _e( 'New Password', 'buddypress' ); ?><br /> <div id="pass-strength-result"></div> + <label for="pass2" class="bp-screen-reader-text"><?php _e( 'Repeat New Password', 'buddypress' ); ?></label> <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small password-entry-confirm" <?php bp_form_field_attributes( 'password' ); ?>/> <?php _e( 'Repeat New Password', 'buddypress' ); ?> <?php @@ -25,7 +32,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires before the display of the submit button for user general settings saving. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_core_general_settings_before_submit' ); ?> @@ -38,7 +45,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of the submit button for user general settings saving. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_core_general_settings_after_submit' ); ?> 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 ff729659c54b713dfa158e4308ccd531502d929f..3c736fccc857b74eaf54a5c867f443db9306a762 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,4 +1,10 @@ <?php +/** + * BuddyPress - Members Settings Notifications + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** This action is documented in bp-templates/bp-legacy/buddypress/members/single/settings/profile.php */ do_action( 'bp_before_member_settings_template' ); ?> @@ -11,7 +17,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires at the top of the member template notification settings form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'bp_notification_settings' ); ?> @@ -20,7 +26,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires before the display of the submit button for user notification saving. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_notification_settings_before_submit' ); ?> @@ -33,7 +39,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of the submit button for user notification saving. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_members_notification_settings_after_submit' ); ?> 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 c5156c229413bd6a9a6b17fec70bb062c81157fa..f8d447469e382d45a1ceff6dc1d8858f888e3b9d 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,9 +1,15 @@ <?php +/** + * BuddyPress - Members Single Profile + * + * @package BuddyPress + * @subpackage bp-legacy + */ /** * Fires before the display of member settings template. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ do_action( 'bp_before_member_settings_template' ); ?> @@ -48,7 +54,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires before the display of the submit button for user profile saving. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_core_xprofile_settings_before_submit' ); ?> @@ -61,7 +67,7 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of the submit button for user profile saving. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_core_xprofile_settings_after_submit' ); ?> @@ -76,6 +82,6 @@ do_action( 'bp_before_member_settings_template' ); ?> /** * Fires after the display of member settings template. * - * @since BuddyPress (1.5.0) + * @since 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 814d602445fd065875087a18c652dfdb4ede69ec..f089c4e02e5feddc8b5d1ee4221c0fdac2f13679 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 @@ -19,6 +19,7 @@ Hello, this is the BuddyPress Legacy stylesheet. 3.6 - Ajax Loading 3.7 - Topics and Tables - Forums and General 3.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums + 3.8.1 - Cover Image 3.9 - Private Messaging Threads 3.10 - Extended Profiles 3.11 - Widgets @@ -37,7 +38,7 @@ Hello, this is the BuddyPress Legacy stylesheet. #buddypress div.pagination { background: transparent; border: none; - color: #888; + color: #767676; font-size: small; margin: 0; position: relative; @@ -124,12 +125,14 @@ Hello, this is the BuddyPress Legacy stylesheet. } #buddypress form#whats-new-form textarea { background: #fff; + box-sizing: border-box; color: #555; font-family: inherit; font-size: medium; - height: 20px; + height: 2.2em; + line-height: 1.4; padding: 6px; - width: 98%; + width: 100%; } body.no-js #buddypress form#whats-new-form textarea { height: 50px; @@ -142,9 +145,10 @@ body.no-js #buddypress form#whats-new-form textarea { float: left; margin-top: 12px; } -#buddypress #whats-new-options { - overflow: auto; - height: 0; +#buddypress #whats-new-options:after { + clear: both; + content: ""; + display: table; } body.no-js #buddypress #whats-new-options { height: auto; @@ -204,7 +208,7 @@ body.activity-permalink #buddypress li.mini .activity-meta { margin-top: 4px; } #buddypress .activity-list li .activity-inreplyto { - color: #888; + color: #767676; font-size: 80%; } #buddypress .activity-list li .activity-inreplyto > p { @@ -237,7 +241,7 @@ body.activity-permalink #buddypress .activity-list li .activity-header > p { } #buddypress .activity-list .activity-content .activity-header, #buddypress .activity-list .activity-content .comment-header { - color: #888; + color: #767676; line-height: 220%; } #buddypress .activity-header { @@ -320,11 +324,11 @@ body.activity-permalink #buddypress div.activity-meta { padding: 4px 8px; } #buddypress a.activity-time-since { - color: #aaa; + color: #767676; text-decoration: none; } #buddypress a.activity-time-since:hover { - color: #888; + color: #767676; text-decoration: underline; } #buddypress a.bp-primary-action, @@ -335,7 +339,7 @@ body.activity-permalink #buddypress div.activity-meta { } #buddypress a.bp-primary-action span, #buddypress #reply-title small a span { - background: #999; + background: #767676; color: #fff; font-size: 90%; margin-right: 2px; @@ -419,7 +423,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { font-size: 90%; } #buddypress div.activity-comments div.acomment-meta { - color: #888; + color: #767676; font-size: 80%; } #buddypress div.activity-comments form.ac-form { @@ -466,7 +470,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { border: 1px solid #eee; } #buddypress div.activity-comments form div.ac-reply-content { - color: #888; + color: #767676; margin-right: 50px; padding-right: 15px; } @@ -478,7 +482,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { margin: 5px 40px 5px 0; } #buddypress .acomment-options a { - color: #999; + color: #767676; } #buddypress .acomment-options a:hover { color: inherit; @@ -637,7 +641,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { border: 1px solid #ccc; background: #fafafa; border-radius: 0; - color: #888; + color: #767676; font: inherit; font-size: 100%; padding: 6px; @@ -655,9 +659,14 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { margin: 15px 0 5px 0; width: auto; } +#buddypress .standard-form p label, +#buddypress .standard-form #invite-list label { + font-weight: normal; + margin: auto; +} #buddypress .standard-form div.checkbox label:nth-child(n+2), #buddypress .standard-form div.radio div label { - color: #888; + color: #767676; font-size: 100%; font-weight: normal; margin: 5px 0 0 0; @@ -701,7 +710,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { width: 97.5%; } #buddypress .standard-form p.description { - color: #888; + color: #767676; font-size: 80%; margin: 5px 0; } @@ -772,12 +781,12 @@ body.no-js #buddypress #messages-bulk-management #select-all-messages { #buddypress input[type=button], #buddypress input[type=reset], #buddypress ul.button-nav li a, -#buddypress div.generic-button a, +#buddypress .generic-button a, #buddypress .comment-reply-link, a.bp-title-button { background: #fff; /* Old browsers */ border: 1px solid #ccc; - color: #777; + color: #767676; font-size: small; cursor: pointer; outline: none; @@ -834,17 +843,25 @@ a.bp-title-button { #buddypress .wp-editor-wrap input[type=submit], #buddypress .wp-editor-wrap input[type=button], #buddypress .wp-editor-wrap input[type=reset] { - padding: 0 10px 1px; + padding: 0 8px 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; + margin: -1px; + padding: 0; + height: 1px; + width: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + border: 0; + word-wrap: normal !important; } /*-------------------------------------------------------------- @@ -883,7 +900,7 @@ a.bp-title-button { #buddypress a.loading:hover, #buddypress input.loading:hover { - color: #777; + color: #767676; } #buddypress input[type="submit"].pending, #buddypress input[type="button"].pending, @@ -896,9 +913,9 @@ a.bp-title-button { #buddypress button.disabled, #buddypress div.pending a, #buddypress a.disabled { - border-color: #eee; - color: #bbb; - cursor: default; + border-color: #eee; + color: #bbb; + cursor: default; } #buddypress input[type="submit"]:hover.pending, #buddypress input[type="button"]:hover.pending, @@ -911,7 +928,7 @@ a.bp-title-button { #buddypress div.pending a:hover, #buddypress a.disabled:hover { border-color: #eee; - color: #bbb; + color: #bbb; } /*-------------------------------------------------------------- @@ -929,7 +946,7 @@ a.bp-title-button { background: #f5f5f5; } #buddypress ul#topic-post-list li div.poster-meta { - color: #888; + color: #767676; margin-bottom: 10px; } #buddypress ul#topic-post-list li div.post-content { @@ -939,7 +956,7 @@ a.bp-title-button { font-size: 80%; } #buddypress div.admin-links { - color: #888; + color: #767676; font-size: 80%; position: absolute; top: 15px; @@ -1028,7 +1045,7 @@ a.bp-title-button { margin: 0; } #buddypress table tr td.thread-info p.thread-excerpt { - color: #888; + color: #767676; font-size: 80%; margin-top: 3px; } @@ -1081,7 +1098,7 @@ a.bp-title-button { padding-right: 35px; } #buddypress table.forum td p.topic-text { - color: #888; + color: #767676; font-size: 100%; } #buddypress table.forum tr > td:first-child, @@ -1108,7 +1125,7 @@ a.bp-title-button { } #buddypress table.forum td.td-freshness span.time-since { font-size: 80%; - color: #888; + color: #767676; } #buddypress table.forum td img.avatar { float: none; @@ -1145,7 +1162,7 @@ a.bp-title-button { padding: 0; } #buddypress span.user-nicename { - color: #777; + color: #767676; display: inline-block; font-size: 120%; font-weight: bold; @@ -1159,8 +1176,10 @@ a.bp-title-button { border: 1px solid #cb2; color: #440; } -#buddypress div#item-header { - overflow: hidden; +#buddypress #item-header:after { + clear: both; + content: ""; + display: table; } #buddypress div#item-header div#item-header-content { float: right; @@ -1171,7 +1190,7 @@ a.bp-title-button { margin: 0 0 15px 0; } #buddypress div#item-header h2 a { - color: #777; + color: #767676; text-decoration: none; } #buddypress div#item-header img.avatar { @@ -1203,7 +1222,7 @@ a.bp-title-button { } #buddypress div#item-header div#item-meta { font-size: 80%; - color: #aaa; + color: #767676; overflow: hidden; margin: 15px 0 5px 0; padding-bottom: 10px; @@ -1241,6 +1260,9 @@ a.bp-title-button { float: right; margin: 10px 0 0 10px; } +body.no-js #buddypress div#item-header .js-self-profile-button { + display:none; +} #buddypress div#item-header div#message.info { line-height: 80%; } @@ -1278,11 +1300,11 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { width: 75%; } #buddypress ul.item-list li div.item-title span { - color: #999; + color: #767676; font-size: 80%; } #buddypress ul.item-list li div.item-desc { - color: #888; + color: #767676; font-size: 80%; margin: 10px 60px 0 0; width: 50%; @@ -1297,7 +1319,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { text-align: left; } #buddypress ul.item-list li div.meta { - color: #888; + color: #767676; font-size: 80%; margin-top: 10px; } @@ -1344,7 +1366,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { background: #eee; border-radius: 50%; border: 1px solid #ccc; - color: #999; + color: #6c6c6c; display: inline; font-size: 70%; margin-right: 2px; @@ -1385,7 +1407,40 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { overflow: auto; list-style: none; } +#buddypress #item-buttons:empty { + display: none; +} + +/*-------------------------------------------------------------- +3.8.1 - Cover Image +--------------------------------------------------------------*/ + +#buddypress #cover-image-container { + position: relative; + z-index: 0; +} +#buddypress #header-cover-image { + background-color: #c5c5c5; + background-position: center top; + background-repeat: no-repeat; + background-size: cover; + border: 0; + display: block; + right: 0; + margin: 0; + padding: 0; + position: absolute; + top: 0; + width: 100%; + z-index: 1; +} + +#buddypress #item-header-cover-image { + padding: 0 1em; + position: relative; + z-index: 2; +} /*-------------------------------------------------------------- 3.9 - Private Messaging Threads @@ -1480,11 +1535,11 @@ a.message-action-star:hover { font-size: 18px; } .message-action-star span.icon:before { - color: #aaa; + color: #767676; content: "\f154"; } .message-action-unstar span.icon:before { - color: #FCDD77; + color: #fcdd77; content: "\f155"; } @@ -1517,7 +1572,7 @@ body.no-js #buddypress .field-visibility-settings-close { #buddypress .field-visibility-settings, #buddypress .field-visibility-settings-toggle, #buddypress .field-visibility-settings-notoggle { - color: #888; + color: #767676; } #buddypress .field-visibility-settings-toggle a, #buddypress .field-visibility-settings a { @@ -1541,6 +1596,26 @@ body.register #buddypress div.page ul { #buddypress .field-visibility select { margin: 0; } +#buddypress .wp-editor-container { + border: 1px solid #dedede; +} +#buddypress .html-active button.switch-html { + border-bottom-color: transparent; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #f5f5f5; +} +#buddypress .tmce-active button.switch-tmce { + border-bottom-color: transparent; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + background: #f5f5f5; +} +#buddypress .standard-form .wp-editor-container textarea { + width: 100%; + padding-top: 0; + padding-bottom: 0; +} /*-------------------------------------------------------------- 3.11 - Widgets 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 792879728fac4bf33a140d61829c2286b1605ea0..767c2b6453a11ad80cfc8cba37162e5c3988acac 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 +1 @@ -#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{margin-top:0;text-align:right;clear:right;float: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 +#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:#767676;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;box-sizing:border-box;color:#555;font-family:inherit;font-size:medium;height:2.2em;line-height:1.4;padding:6px;width:100%}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:after{clear:both;content:"";display:table}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:#767676;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:#767676;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:#767676;text-decoration:none}#buddypress a.activity-time-since:hover{color:#767676;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:#767676;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:#767676;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:#767676;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:#767676}#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:#767676;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 #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#767676;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:#767676;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 .generic-button a,#buddypress a.button,#buddypress button,#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:#767676;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 8px 1px}#buddypress form [disabled=disabled]{cursor:default;opacity:.4}.bp-screen-reader-text{position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip:rect(0 0 0 0);border:0;word-wrap:normal!important}#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:#767676}#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:#767676;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:#767676;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:#767676;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:#767676;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:#767676}#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:#767676;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 #item-header:after{clear:both;content:"";display:table}#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:#767676;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 ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span,body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#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:#767676;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 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:#767676;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#767676;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:#767676;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:#6c6c6c;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 #item-buttons:empty{display:none}#buddypress #cover-image-container{position:relative;z-index:0}#buddypress #header-cover-image{background-color:#c5c5c5;background-position:center top;background-repeat:no-repeat;background-size:cover;border:0;display:block;right:0;margin:0;padding:0;position:absolute;top:0;width:100%;z-index:1}#buddypress #item-header-cover-image{padding:0 1em;position:relative;z-index:2}#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:#767676;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:#767676}#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}#buddypress .wp-editor-container{border:1px solid #dedede}#buddypress .html-active button.switch-html,#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0;background:#f5f5f5}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom: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{margin-top:0;text-align:right;clear:right;float: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 1957cef87bdf7a57effead7caa5de39b8adff444..2946a205a7a461038c0343c57bd17c1327d5189e 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 @@ -19,6 +19,7 @@ Hello, this is the BuddyPress Legacy stylesheet. 3.6 - Ajax Loading 3.7 - Topics and Tables - Forums and General 3.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums + 3.8.1 - Cover Image 3.9 - Private Messaging Threads 3.10 - Extended Profiles 3.11 - Widgets @@ -37,7 +38,7 @@ Hello, this is the BuddyPress Legacy stylesheet. #buddypress div.pagination { background: transparent; border: none; - color: #888; + color: #767676; font-size: small; margin: 0; position: relative; @@ -124,12 +125,14 @@ Hello, this is the BuddyPress Legacy stylesheet. } #buddypress form#whats-new-form textarea { background: #fff; + box-sizing: border-box; color: #555; font-family: inherit; font-size: medium; - height: 20px; + height: 2.2em; + line-height: 1.4; padding: 6px; - width: 98%; + width: 100%; } body.no-js #buddypress form#whats-new-form textarea { height: 50px; @@ -142,9 +145,10 @@ body.no-js #buddypress form#whats-new-form textarea { float: right; margin-top: 12px; } -#buddypress #whats-new-options { - overflow: auto; - height: 0; +#buddypress #whats-new-options:after { + clear: both; + content: ""; + display: table; } body.no-js #buddypress #whats-new-options { height: auto; @@ -204,7 +208,7 @@ body.activity-permalink #buddypress li.mini .activity-meta { margin-top: 4px; } #buddypress .activity-list li .activity-inreplyto { - color: #888; + color: #767676; font-size: 80%; } #buddypress .activity-list li .activity-inreplyto > p { @@ -237,7 +241,7 @@ body.activity-permalink #buddypress .activity-list li .activity-header > p { } #buddypress .activity-list .activity-content .activity-header, #buddypress .activity-list .activity-content .comment-header { - color: #888; + color: #767676; line-height: 220%; } #buddypress .activity-header { @@ -320,11 +324,11 @@ body.activity-permalink #buddypress div.activity-meta { padding: 4px 8px; } #buddypress a.activity-time-since { - color: #aaa; + color: #767676; text-decoration: none; } #buddypress a.activity-time-since:hover { - color: #888; + color: #767676; text-decoration: underline; } #buddypress a.bp-primary-action, @@ -335,7 +339,7 @@ body.activity-permalink #buddypress div.activity-meta { } #buddypress a.bp-primary-action span, #buddypress #reply-title small a span { - background: #999; + background: #767676; color: #fff; font-size: 90%; margin-left: 2px; @@ -419,7 +423,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { font-size: 90%; } #buddypress div.activity-comments div.acomment-meta { - color: #888; + color: #767676; font-size: 80%; } #buddypress div.activity-comments form.ac-form { @@ -466,7 +470,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { border: 1px solid #eee; } #buddypress div.activity-comments form div.ac-reply-content { - color: #888; + color: #767676; margin-left: 50px; padding-left: 15px; } @@ -478,7 +482,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { margin: 5px 0 5px 40px; } #buddypress .acomment-options a { - color: #999; + color: #767676; } #buddypress .acomment-options a:hover { color: inherit; @@ -637,7 +641,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { border: 1px solid #ccc; background: #fafafa; border-radius: 0; - color: #888; + color: #767676; font: inherit; font-size: 100%; padding: 6px; @@ -655,9 +659,14 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { margin: 15px 0 5px 0; width: auto; } +#buddypress .standard-form p label, +#buddypress .standard-form #invite-list label { + font-weight: normal; + margin: auto; +} #buddypress .standard-form div.checkbox label:nth-child(n+2), #buddypress .standard-form div.radio div label { - color: #888; + color: #767676; font-size: 100%; font-weight: normal; margin: 5px 0 0 0; @@ -701,7 +710,7 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content { width: 97.5%; } #buddypress .standard-form p.description { - color: #888; + color: #767676; font-size: 80%; margin: 5px 0; } @@ -772,12 +781,12 @@ body.no-js #buddypress #messages-bulk-management #select-all-messages { #buddypress input[type=button], #buddypress input[type=reset], #buddypress ul.button-nav li a, -#buddypress div.generic-button a, +#buddypress .generic-button a, #buddypress .comment-reply-link, a.bp-title-button { background: #fff; /* Old browsers */ border: 1px solid #ccc; - color: #777; + color: #767676; font-size: small; cursor: pointer; outline: none; @@ -834,17 +843,25 @@ a.bp-title-button { #buddypress .wp-editor-wrap input[type=submit], #buddypress .wp-editor-wrap input[type=button], #buddypress .wp-editor-wrap input[type=reset] { - padding: 0 10px 1px; + padding: 0 8px 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; + margin: -1px; + padding: 0; + height: 1px; + width: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + border: 0; + word-wrap: normal !important; } /*-------------------------------------------------------------- @@ -883,7 +900,7 @@ a.bp-title-button { #buddypress a.loading:hover, #buddypress input.loading:hover { - color: #777; + color: #767676; } #buddypress input[type="submit"].pending, #buddypress input[type="button"].pending, @@ -896,9 +913,9 @@ a.bp-title-button { #buddypress button.disabled, #buddypress div.pending a, #buddypress a.disabled { - border-color: #eee; - color: #bbb; - cursor: default; + border-color: #eee; + color: #bbb; + cursor: default; } #buddypress input[type="submit"]:hover.pending, #buddypress input[type="button"]:hover.pending, @@ -911,7 +928,7 @@ a.bp-title-button { #buddypress div.pending a:hover, #buddypress a.disabled:hover { border-color: #eee; - color: #bbb; + color: #bbb; } /*-------------------------------------------------------------- @@ -929,7 +946,7 @@ a.bp-title-button { background: #f5f5f5; } #buddypress ul#topic-post-list li div.poster-meta { - color: #888; + color: #767676; margin-bottom: 10px; } #buddypress ul#topic-post-list li div.post-content { @@ -939,7 +956,7 @@ a.bp-title-button { font-size: 80%; } #buddypress div.admin-links { - color: #888; + color: #767676; font-size: 80%; position: absolute; top: 15px; @@ -1028,7 +1045,7 @@ a.bp-title-button { margin: 0; } #buddypress table tr td.thread-info p.thread-excerpt { - color: #888; + color: #767676; font-size: 80%; margin-top: 3px; } @@ -1081,7 +1098,7 @@ a.bp-title-button { padding-left: 35px; } #buddypress table.forum td p.topic-text { - color: #888; + color: #767676; font-size: 100%; } #buddypress table.forum tr > td:first-child, @@ -1108,7 +1125,7 @@ a.bp-title-button { } #buddypress table.forum td.td-freshness span.time-since { font-size: 80%; - color: #888; + color: #767676; } #buddypress table.forum td img.avatar { float: none; @@ -1145,7 +1162,7 @@ a.bp-title-button { padding: 0; } #buddypress span.user-nicename { - color: #777; + color: #767676; display: inline-block; font-size: 120%; font-weight: bold; @@ -1159,8 +1176,10 @@ a.bp-title-button { border: 1px solid #cb2; color: #440; } -#buddypress div#item-header { - overflow: hidden; +#buddypress #item-header:after { + clear: both; + content: ""; + display: table; } #buddypress div#item-header div#item-header-content { float: left; @@ -1171,7 +1190,7 @@ a.bp-title-button { margin: 0 0 15px 0; } #buddypress div#item-header h2 a { - color: #777; + color: #767676; text-decoration: none; } #buddypress div#item-header img.avatar { @@ -1203,7 +1222,7 @@ a.bp-title-button { } #buddypress div#item-header div#item-meta { font-size: 80%; - color: #aaa; + color: #767676; overflow: hidden; margin: 15px 0 5px 0; padding-bottom: 10px; @@ -1241,6 +1260,9 @@ a.bp-title-button { float: left; margin: 10px 10px 0 0; } +body.no-js #buddypress div#item-header .js-self-profile-button { + display:none; +} #buddypress div#item-header div#message.info { line-height: 80%; } @@ -1278,11 +1300,11 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { width: 75%; } #buddypress ul.item-list li div.item-title span { - color: #999; + color: #767676; font-size: 80%; } #buddypress ul.item-list li div.item-desc { - color: #888; + color: #767676; font-size: 80%; margin: 10px 0 0 60px; width: 50%; @@ -1297,7 +1319,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { text-align: right; } #buddypress ul.item-list li div.meta { - color: #888; + color: #767676; font-size: 80%; margin-top: 10px; } @@ -1344,7 +1366,7 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { background: #eee; border-radius: 50%; border: 1px solid #ccc; - color: #999; + color: #6c6c6c; display: inline; font-size: 70%; margin-left: 2px; @@ -1385,7 +1407,40 @@ body.activity-permalink #buddypress ul.item-list li.activity-item { overflow: auto; list-style: none; } +#buddypress #item-buttons:empty { + display: none; +} + +/*-------------------------------------------------------------- +3.8.1 - Cover Image +--------------------------------------------------------------*/ + +#buddypress #cover-image-container { + position: relative; + z-index: 0; +} +#buddypress #header-cover-image { + background-color: #c5c5c5; + background-position: center top; + background-repeat: no-repeat; + background-size: cover; + border: 0; + display: block; + left: 0; + margin: 0; + padding: 0; + position: absolute; + top: 0; + width: 100%; + z-index: 1; +} + +#buddypress #item-header-cover-image { + padding: 0 1em; + position: relative; + z-index: 2; +} /*-------------------------------------------------------------- 3.9 - Private Messaging Threads @@ -1480,11 +1535,11 @@ a.message-action-star:hover { font-size: 18px; } .message-action-star span.icon:before { - color: #aaa; + color: #767676; content: "\f154"; } .message-action-unstar span.icon:before { - color: #FCDD77; + color: #fcdd77; content: "\f155"; } @@ -1517,7 +1572,7 @@ body.no-js #buddypress .field-visibility-settings-close { #buddypress .field-visibility-settings, #buddypress .field-visibility-settings-toggle, #buddypress .field-visibility-settings-notoggle { - color: #888; + color: #767676; } #buddypress .field-visibility-settings-toggle a, #buddypress .field-visibility-settings a { @@ -1541,6 +1596,26 @@ body.register #buddypress div.page ul { #buddypress .field-visibility select { margin: 0; } +#buddypress .wp-editor-container { + border: 1px solid #dedede; +} +#buddypress .html-active button.switch-html { + border-bottom-color: transparent; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + background: #f5f5f5; +} +#buddypress .tmce-active button.switch-tmce { + border-bottom-color: transparent; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + background: #f5f5f5; +} +#buddypress .standard-form .wp-editor-container textarea { + width: 100%; + padding-top: 0; + padding-bottom: 0; +} /*-------------------------------------------------------------- 3.11 - Widgets 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 282cd1e911760a757850641aeacdbe4a0b8f8f2c..9a2ad114046bdcfe0a99640c09ac4cef5bd2d20f 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 +1 @@ -#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{margin-top:0;text-align:left;clear:left;float: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 +#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:#767676;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;box-sizing:border-box;color:#555;font-family:inherit;font-size:medium;height:2.2em;line-height:1.4;padding:6px;width:100%}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:after{clear:both;content:"";display:table}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:#767676;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:#767676;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:#767676;text-decoration:none}#buddypress a.activity-time-since:hover{color:#767676;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:#767676;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:#767676;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:#767676;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:#767676}#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:#767676;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 #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form div.checkbox label:nth-child(n+2),#buddypress .standard-form div.radio div label{color:#767676;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:#767676;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 .generic-button a,#buddypress a.button,#buddypress button,#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:#767676;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 8px 1px}#buddypress form [disabled=disabled]{cursor:default;opacity:.4}.bp-screen-reader-text{position:absolute;margin:-1px;padding:0;height:1px;width:1px;overflow:hidden;clip:rect(0 0 0 0);border:0;word-wrap:normal!important}#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:#767676}#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:#767676;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:#767676;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:#767676;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:#767676;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:#767676}#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:#767676;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 #item-header:after{clear:both;content:"";display:table}#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:#767676;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 ul h5,#buddypress div#item-header ul hr,#buddypress div#item-header ul span,body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#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:#767676;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 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:#767676;font-size:80%}#buddypress ul.item-list li div.item-desc{color:#767676;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:#767676;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:#6c6c6c;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 #item-buttons:empty{display:none}#buddypress #cover-image-container{position:relative;z-index:0}#buddypress #header-cover-image{background-color:#c5c5c5;background-position:center top;background-repeat:no-repeat;background-size:cover;border:0;display:block;left:0;margin:0;padding:0;position:absolute;top:0;width:100%;z-index:1}#buddypress #item-header-cover-image{padding:0 1em;position:relative;z-index:2}#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:#767676;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:#767676}#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}#buddypress .wp-editor-container{border:1px solid #dedede}#buddypress .html-active button.switch-html,#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;background:#f5f5f5}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom: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{margin-top:0;text-align:left;clear:left;float: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 index a5605c57ae1c67de01f7addf2454c3c71a19eb22..5b90a168cd8fbb0643b78e83b02e43b71597c788 100644 --- 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 @@ -1,63 +1,63 @@ @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 +/*------------------------------------------------------------------------------ + +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 -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 1.0 - Theme - Structural Elements & overrides +*------------------------------------------------------------------------------- */ #buddypress h1, #buddypress h2, @@ -119,10 +119,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 2.0 - Navigation - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- */ .buddypress #buddypress .item-list-tabs a, .buddypress #buddypress .activity-header a, @@ -142,12 +142,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border-bottom: 0; } -/** -*---------------------------------------------------------- -* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) -* -* The main navigational elements for all BP screens -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- */ #buddypress { /*__ Horizontal menus __*/ @@ -278,10 +278,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*---------------------------------------------------------- -* @section 2.2 - Pagination -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- */ #buddypress div.pagination { box-shadow: none; @@ -325,10 +325,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ left: auto; } -/** -*------------------------------------------------------------------------------- -* @section 4.0 - BP Lists / Loops Generic -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 4.0 - BP Lists / Loops Generic +*------------------------------------------------------------------------------- */ #buddypress .item-list .activity-header, #buddypress .item-list .activity-meta { @@ -443,24 +443,20 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ font-style: italic; } -/** -*---------------------------------------------------------- -* @section 4.1 - Activity -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 4.1 - Activity +*---------------------------------------------------------- */ -/** -*----------------------------------------------------- -* @section 4.1.1 - Activity Whats New -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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; @@ -493,11 +489,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -#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; @@ -530,10 +521,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ margin: 40px 0; } -/** -*----------------------------------------------------- -* @section 4.1.2 - Activity Listing -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @section 4.1.2 - Activity Listing +*----------------------------------------------------- */ #buddypress #activity-stream li { padding: 25px 0 15px; @@ -673,10 +664,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ padding: 20px; } -/** -*----------------------------------------------------- -* @section 4.1.3 - Activity Comments -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- */ #buddypress #activity-stream .activity-comments { margin: 10px 0 0; @@ -785,10 +776,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ background: #ededed; } -/** -*---------------------------------------------------------- -* @section 4.2 - Members Loop -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 4.2 - Members Loop +*---------------------------------------------------------- */ @media screen and (min-width: 59.6875em) { #buddypress #members-list li .item-avatar, @@ -800,15 +791,15 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 6.0 - Single Item screens: User Account & Single Group Screens -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- */ -/** -*----------------------------------------------------------- -* @subsection 6.1 - Item Header Global -*----------------------------------------------------------- +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- */ @media screen and (max-width: 46.25em) { .bp-user main header.entry-header, @@ -849,12 +840,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.1.1 - item-header Groups -* -* Group Specific Item Header -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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 { @@ -936,12 +927,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.1.2 - Item Header User Accounts -* -* User Accounts Specific Item Header -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @subsection 6.1.2 - Item Header User Accounts +* +* User Accounts Specific Item Header +*----------------------------------------------------- */ .bp-user #buddypress #item-header { padding: 20px 0; @@ -952,7 +943,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ 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; @@ -967,7 +957,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ .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; @@ -976,10 +965,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------------- -* @subsection 6.2 - Item Body: Global -*----------------------------------------------------------- +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- */ #item-body h1, #item-body h2, @@ -999,17 +988,17 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border-bottom: 0; } -/** -*---------------------------------------------------- -* @subsection 6.2.1 - Item Body Groups -* -* Groups specific item body rules - screens -*---------------------------------------------------- +/** +*---------------------------------------------------- +* @subsection 6.2.1 - Item Body Groups +* +* Groups specific item body rules - screens +*---------------------------------------------------- */ -/** -*----------------------------------------- -* @subsection 6.2.1.1 - Group Management -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.1 - Group Management +*----------------------------------------- */ .groups #group-settings-form h4 { background: #555; @@ -1104,10 +1093,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ margin: 0; } -/** -*----------------------------------------- -* @subsection 6.2.1.2 - Group members -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.2 - Group members +*----------------------------------------- */ /* Members loop */ @media screen and (max-width: 30em) { @@ -1176,10 +1165,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------- -* @subsection 6.2.1.3 - Group Send Invites -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.3 - Group Send Invites +*----------------------------------------- */ .groups.group-invites #item-body .item-list .action { margin-bottom: 0; @@ -1215,21 +1204,21 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.2.2 - Item Body User Accounts -* -* User Account specific item body rules -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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 -*-------------------------------------------- +/** +*-------------------------------------------- +* @subsection 6.2.2.1 - classes, pag, filters +*-------------------------------------------- */ .bp-user #buddypress table th { font-size: 14px; @@ -1326,13 +1315,13 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** - *------------------------------------------- - * @subsection 6.2.2.2 - Extended Profiles - *------------------------------------------- +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- */ .bp-user #buddypress .profile .bp-widget h4 { - background: #6e6e6e; + background: #6f6f6f; color: #fff; margin-bottom: 0; padding: 0.4em; @@ -1393,10 +1382,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ font-size: inherit; } -/** - *------------------------------------------- - * @subsection 6.2.2.3 - Groups - *------------------------------------------- +/** + *------------------------------------------- + * @subsection 6.2.2.3 - Groups + *------------------------------------------- */ @media screen and (min-width: 77.5em) { .bp-user #buddypress #groups-list li .item { @@ -1405,22 +1394,17 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** - *------------------------------------------- - * @subsection 6.2.2.5 - Private Messaging - *------------------------------------------- +/** + *------------------------------------------- + * @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; + background: #6f6f6f; color: #fff; padding: 0.3em 0.2em 0.3em 0; } @@ -1471,7 +1455,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } .bp-user #buddypress #message-threads thead tr { - background: #6e6e6e; + background: #6f6f6f; } .bp-user #buddypress #message-threads tr td { @@ -1580,18 +1564,39 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ width: 30px; } +.bp-user #buddypress .acfb-holder { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-right: 0; +} + .bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; margin-left: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-right: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; } .bp-user #buddypress .acfb-holder li.friend-tab a { border-bottom: 0; + text-decoration: none; } .bp-user #buddypress .acfb-holder li.friend-tab a img { display: inline; height: 20px; - margin-left: 0.5em; + vertical-align: middle; width: 20px !important; } @@ -1600,7 +1605,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } .bp-user #buddypress #message-threads.sitewide-notices td strong { - background: #6e6e6e; + background: #6f6f6f; color: #fff; display: block; margin-bottom: 0.4em; @@ -1642,10 +1647,27 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ text-indent: 0; } -/** - *------------------------------ - * @subsection 6.2.2.6 - Settings - *------------------------------ +.bp-user .ac_results { + background: #eee; + padding-right: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ */ .bp-user #buddypress #settings-form > p { font-size: 20px; @@ -1687,10 +1709,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ width: 100%; } -/** -*------------------------------------------------------------------------------- -* @section 7.0 - Forms - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 7.0 - Forms - General +*------------------------------------------------------------------------------- */ #buddypress div.activity-comments form .ac-textarea { background: #f7f7f7; @@ -1706,9 +1728,18 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border: 1px solid rgba(153, 153, 153, 0.5); } +#buddypress .wp-editor-wrap a.button, +#buddypress .wp-editor-wrap button, +#buddypress .wp-editor-wrap input[type=submit], +#buddypress .wp-editor-wrap input[type=button], +#buddypress .wp-editor-wrap input[type=reset] { + padding: 0 5px 1px; +} + #buddypress .standard-form li, #buddypress .group-create-form li { float: none; + list-style: none; } #buddypress .standard-form input[type='text'], @@ -1810,10 +1841,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 8.0 - Tables - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- */ #buddypress table { font-size: 14px; @@ -1822,7 +1853,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } #buddypress table tr th { - background: #6e6e6e; + background: #6f6f6f; border-color: #b7b7b7; color: #fff; } @@ -1881,10 +1912,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ text-align: center; } -/** -*------------------------------------------------------------------------------- -* @section 9.0 - Error / Success messages -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 9.0 - Error / Success messages +*------------------------------------------------------------------------------- */ #buddypress #item-body div#message { margin-top: 20px; @@ -1920,16 +1951,8 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ color: #1f0808; } -/** -*------------------------------------------------------------------------------- -* @section 10.0 - Ajax Loading, Widgets, General classes -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @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 index ea3f09c28031a26014272e9943a111f380549225..0df393530e5f7873369ecb2b3eac767f33ed291b 100644 --- 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 @@ -1 +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}.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}}#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 #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%}.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}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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}@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.sitewide-notices td:first-child+td+td,.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0}.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} \ No newline at end of file +@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}@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] #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}.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}}#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 #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%}.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}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{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}.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:#6f6f6f;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:#6f6f6f;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:#6f6f6f}.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}@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{list-style:none}.bp-user #buddypress .acfb-holder li{margin-right:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-left:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-right:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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{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:.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 .ac_results{background:#eee;padding-right:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.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 .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 5px 1px}#buddypress .group-create-form li,#buddypress .standard-form li{float:none;list-style: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:#6f6f6f;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} \ 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 index 494c6ba3d888d49ce91279a3b584b7e3beb4ff17..c3bc6de4fce398c820861fd61f57d00c6f9ad47b 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.css +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.css @@ -1,63 +1,63 @@ @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 +/*------------------------------------------------------------------------------ + +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 -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 1.0 - Theme - Structural Elements & overrides +*------------------------------------------------------------------------------- */ #buddypress h1, #buddypress h2, @@ -119,10 +119,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 2.0 - Navigation - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- */ .buddypress #buddypress .item-list-tabs a, .buddypress #buddypress .activity-header a, @@ -142,12 +142,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border-bottom: 0; } -/** -*---------------------------------------------------------- -* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) -* -* The main navigational elements for all BP screens -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- */ #buddypress { /*__ Horizontal menus __*/ @@ -278,10 +278,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*---------------------------------------------------------- -* @section 2.2 - Pagination -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- */ #buddypress div.pagination { box-shadow: none; @@ -325,10 +325,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ right: auto; } -/** -*------------------------------------------------------------------------------- -* @section 4.0 - BP Lists / Loops Generic -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 4.0 - BP Lists / Loops Generic +*------------------------------------------------------------------------------- */ #buddypress .item-list .activity-header, #buddypress .item-list .activity-meta { @@ -443,24 +443,20 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ font-style: italic; } -/** -*---------------------------------------------------------- -* @section 4.1 - Activity -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 4.1 - Activity +*---------------------------------------------------------- */ -/** -*----------------------------------------------------- -* @section 4.1.1 - Activity Whats New -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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; @@ -493,11 +489,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -#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; @@ -530,10 +521,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ margin: 40px 0; } -/** -*----------------------------------------------------- -* @section 4.1.2 - Activity Listing -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @section 4.1.2 - Activity Listing +*----------------------------------------------------- */ #buddypress #activity-stream li { padding: 25px 0 15px; @@ -673,10 +664,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ padding: 20px; } -/** -*----------------------------------------------------- -* @section 4.1.3 - Activity Comments -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- */ #buddypress #activity-stream .activity-comments { margin: 10px 0 0; @@ -785,10 +776,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ background: #ededed; } -/** -*---------------------------------------------------------- -* @section 4.2 - Members Loop -*---------------------------------------------------------- +/** +*---------------------------------------------------------- +* @section 4.2 - Members Loop +*---------------------------------------------------------- */ @media screen and (min-width: 59.6875em) { #buddypress #members-list li .item-avatar, @@ -800,15 +791,15 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 6.0 - Single Item screens: User Account & Single Group Screens -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- */ -/** -*----------------------------------------------------------- -* @subsection 6.1 - Item Header Global -*----------------------------------------------------------- +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- */ @media screen and (max-width: 46.25em) { .bp-user main header.entry-header, @@ -849,12 +840,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.1.1 - item-header Groups -* -* Group Specific Item Header -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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 { @@ -936,12 +927,12 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.1.2 - Item Header User Accounts -* -* User Accounts Specific Item Header -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @subsection 6.1.2 - Item Header User Accounts +* +* User Accounts Specific Item Header +*----------------------------------------------------- */ .bp-user #buddypress #item-header { padding: 20px 0; @@ -952,7 +943,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ 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; @@ -967,7 +957,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ .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; @@ -976,10 +965,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------------- -* @subsection 6.2 - Item Body: Global -*----------------------------------------------------------- +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- */ #item-body h1, #item-body h2, @@ -999,17 +988,17 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border-bottom: 0; } -/** -*---------------------------------------------------- -* @subsection 6.2.1 - Item Body Groups -* -* Groups specific item body rules - screens -*---------------------------------------------------- +/** +*---------------------------------------------------- +* @subsection 6.2.1 - Item Body Groups +* +* Groups specific item body rules - screens +*---------------------------------------------------- */ -/** -*----------------------------------------- -* @subsection 6.2.1.1 - Group Management -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.1 - Group Management +*----------------------------------------- */ .groups #group-settings-form h4 { background: #555; @@ -1104,10 +1093,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ margin: 0; } -/** -*----------------------------------------- -* @subsection 6.2.1.2 - Group members -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.2 - Group members +*----------------------------------------- */ /* Members loop */ @media screen and (max-width: 30em) { @@ -1176,10 +1165,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------- -* @subsection 6.2.1.3 - Group Send Invites -*----------------------------------------- +/** +*----------------------------------------- +* @subsection 6.2.1.3 - Group Send Invites +*----------------------------------------- */ .groups.group-invites #item-body .item-list .action { margin-bottom: 0; @@ -1215,21 +1204,21 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*----------------------------------------------------- -* @subsection 6.2.2 - Item Body User Accounts -* -* User Account specific item body rules -*----------------------------------------------------- +/** +*----------------------------------------------------- +* @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 -*-------------------------------------------- +/** +*-------------------------------------------- +* @subsection 6.2.2.1 - classes, pag, filters +*-------------------------------------------- */ .bp-user #buddypress table th { font-size: 14px; @@ -1326,13 +1315,13 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** - *------------------------------------------- - * @subsection 6.2.2.2 - Extended Profiles - *------------------------------------------- +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- */ .bp-user #buddypress .profile .bp-widget h4 { - background: #6e6e6e; + background: #6f6f6f; color: #fff; margin-bottom: 0; padding: 0.4em; @@ -1393,10 +1382,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ font-size: inherit; } -/** - *------------------------------------------- - * @subsection 6.2.2.3 - Groups - *------------------------------------------- +/** + *------------------------------------------- + * @subsection 6.2.2.3 - Groups + *------------------------------------------- */ @media screen and (min-width: 77.5em) { .bp-user #buddypress #groups-list li .item { @@ -1405,22 +1394,17 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** - *------------------------------------------- - * @subsection 6.2.2.5 - Private Messaging - *------------------------------------------- +/** + *------------------------------------------- + * @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; + background: #6f6f6f; color: #fff; padding: 0.3em 0 0.3em 0.2em; } @@ -1471,7 +1455,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } .bp-user #buddypress #message-threads thead tr { - background: #6e6e6e; + background: #6f6f6f; } .bp-user #buddypress #message-threads tr td { @@ -1580,18 +1564,39 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ width: 30px; } +.bp-user #buddypress .acfb-holder { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-left: 0; +} + .bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; margin-right: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-left: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; } .bp-user #buddypress .acfb-holder li.friend-tab a { border-bottom: 0; + text-decoration: none; } .bp-user #buddypress .acfb-holder li.friend-tab a img { display: inline; height: 20px; - margin-right: 0.5em; + vertical-align: middle; width: 20px !important; } @@ -1600,7 +1605,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } .bp-user #buddypress #message-threads.sitewide-notices td strong { - background: #6e6e6e; + background: #6f6f6f; color: #fff; display: block; margin-bottom: 0.4em; @@ -1642,10 +1647,27 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ text-indent: 0; } -/** - *------------------------------ - * @subsection 6.2.2.6 - Settings - *------------------------------ +.bp-user .ac_results { + background: #eee; + padding-left: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ */ .bp-user #buddypress #settings-form > p { font-size: 20px; @@ -1687,10 +1709,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ width: 100%; } -/** -*------------------------------------------------------------------------------- -* @section 7.0 - Forms - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 7.0 - Forms - General +*------------------------------------------------------------------------------- */ #buddypress div.activity-comments form .ac-textarea { background: #f7f7f7; @@ -1706,9 +1728,18 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ border: 1px solid rgba(153, 153, 153, 0.5); } +#buddypress .wp-editor-wrap a.button, +#buddypress .wp-editor-wrap button, +#buddypress .wp-editor-wrap input[type=submit], +#buddypress .wp-editor-wrap input[type=button], +#buddypress .wp-editor-wrap input[type=reset] { + padding: 0 5px 1px; +} + #buddypress .standard-form li, #buddypress .group-create-form li { float: none; + list-style: none; } #buddypress .standard-form input[type='text'], @@ -1810,10 +1841,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } } -/** -*------------------------------------------------------------------------------- -* @section 8.0 - Tables - General -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- */ #buddypress table { font-size: 14px; @@ -1822,7 +1853,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ } #buddypress table tr th { - background: #6e6e6e; + background: #6f6f6f; border-color: #b7b7b7; color: #fff; } @@ -1881,10 +1912,10 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ text-align: center; } -/** -*------------------------------------------------------------------------------- -* @section 9.0 - Error / Success messages -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @section 9.0 - Error / Success messages +*------------------------------------------------------------------------------- */ #buddypress #item-body div#message { margin-top: 20px; @@ -1920,16 +1951,8 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ color: #1f0808; } -/** -*------------------------------------------------------------------------------- -* @section 10.0 - Ajax Loading, Widgets, General classes -*------------------------------------------------------------------------------- +/** +*------------------------------------------------------------------------------- +* @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 index d55638c4adcef6270e0d0ff2c05d2db89a94b132..a78eb58c7cbddafc592efe541c50516eb737cf23 100644 --- 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 @@ -1 +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}.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}}#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 #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%}.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}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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}@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.sitewide-notices td:first-child+td+td,.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0}.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} \ No newline at end of file +@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}@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] #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}.bp-user #item-header-content,.bp-user h1,.single-item.groups #item-header-content,.single-item.groups h1{text-align:center}}#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 #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%}.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}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{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}.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:#6f6f6f;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:#6f6f6f;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:#6f6f6f}.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}@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{list-style:none}.bp-user #buddypress .acfb-holder li{margin-left:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-right:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-left:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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{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:.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 .ac_results{background:#eee;padding-left:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.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 .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 5px 1px}#buddypress .group-create-form li,#buddypress .standard-form li{float:none;list-style: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:#6f6f6f;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} \ 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 index 22c7eba0c68ba256eaad5363a444e589d8d815b9..ea5efd5ebef09105e20228e4297798a4c1054c4f 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.scss +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfifteen.scss @@ -1,2297 +1,2334 @@ -// 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; - } - } -} +// 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; +$link-action: #c82b2b; + +/*------------------------------------------------------------------------------ + +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; + } + + // 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] { + #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%; + + 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; + } + } + + #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%; + } + } + + } // close @media + } // close .item-body + +} // close .groups.group-invites + +/** +*----------------------------------------------------- +* @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; + } + } + + .acfb-holder { + list-style: none; + + li {margin-left: 0;} + + li.friend-tab { + background: lighten($notice-info, 20%); + border: inherit; + margin-right: 0; + padding: 0.5em; + + span.p { + // the 'X' close + padding-left: $spacing-val-sm; + + &:focus, + &:hover { + color: $link-action; + cursor: pointer; + } + } + + a { + border-bottom: 0; + text-decoration: none; + + img { + // this is the tiny user avatar + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; // override inline style + } + } + } + } + + #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 + + // acfb auto complete name list sits in doc footer before body close + .ac_results { + background: #eee; + padding-left: $spacing-val-sm; + + ul { margin: 0; } + + li { + margin: $spacing-val-sm 0; + + &:focus, + &:hover { + cursor: pointer; + } + } + } + +} // 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 +*------------------------------------------------------------------------------- +*/ + +#buddypress { + + // Match BP form elements to Themes(2015) styling where styles + // are not inherited or being overriden. + + 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);} + + // Overrides for embedded WP editors. + .wp-editor-wrap { + a.button, + button, + input[type=submit], + input[type=button], + input[type=reset] { + padding: 0 5px 1px; + } + } + +} // close #buddypress + + +#buddypress { + + // Manage form control widths override BP 75% width. + + .standard-form, + .group-create-form { + li { + float: none; + list-style: 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 + + @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 +*------------------------------------------------------------------------------- +*/ 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 index 73de1d4cf7b59bbd23997fe7cdac867089a993c1..205758c423126a224b1539a4bbc195a372e1cea1 100644 --- 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 @@ -422,14 +422,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ 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; @@ -779,9 +771,6 @@ body.activity-permalink #buddypress { 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%; @@ -815,7 +804,7 @@ body.activity-permalink #buddypress { #group-settings-form .radio ul, #create-group-form .radio ul { - color: #777777; + color: #787878; } #group-settings-form #group-creation-previous, @@ -1064,11 +1053,6 @@ body.activity-permalink #buddypress { * @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); @@ -1208,6 +1192,43 @@ body.activity-permalink #buddypress { margin-right: 0; } +#buddypress .acfb-holder { + list-style: none; + margin: 0; +} + +#buddypress .acfb-holder li { + margin-right: 0; +} + +#buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-left: 0; + padding: 0.5em; +} + +#buddypress .acfb-holder li.friend-tab span.p { + padding-right: 10px; +} + +#buddypress .acfb-holder li.friend-tab span.p:focus, #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +#buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +#buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + #buddypress #message-threads.sitewide-notices td { width: 100%; } @@ -1258,6 +1279,23 @@ body.activity-permalink #buddypress { text-indent: 0; } +.bp-user .ac_results { + background: #eee; + padding-right: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + /** *------------------------------ * @subsection 6.2.2.6 - Settings @@ -1456,11 +1494,3 @@ body.activity-permalink #buddypress { * @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 index 12aa925a844b822157fcba44fdd7b1976eec1d7a..5d6a7fe0a2ef13f8cc02d8f4dd77e26648c07ba0 100644 --- 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 @@ -1 +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 #item-body{border-right:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#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 #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} \ No newline at end of file +@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 #item-body{border-right:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#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 #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}@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-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:#787878}#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-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 .acfb-holder{list-style:none;margin:0}#buddypress .acfb-holder li{margin-right:0}#buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-left:0;padding:.5em}#buddypress .acfb-holder li.friend-tab span.p{padding-right:10px}#buddypress .acfb-holder li.friend-tab span.p:focus,#buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}#buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}#buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}#buddypress #message-threads.sitewide-notices td,#buddypress table.profile-settings{width:100%}#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}.bp-user .ac_results{background:#eee;padding-right:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}#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} \ 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 index 80791ef298a3208dd69d50a90b30ad1654b367e3..aed327987e405b20532e3a5a525fad393b532fc4 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.css +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.css @@ -422,14 +422,6 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ 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; @@ -779,9 +771,6 @@ body.activity-permalink #buddypress { 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%; @@ -815,7 +804,7 @@ body.activity-permalink #buddypress { #group-settings-form .radio ul, #create-group-form .radio ul { - color: #777777; + color: #787878; } #group-settings-form #group-creation-previous, @@ -1064,11 +1053,6 @@ body.activity-permalink #buddypress { * @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); @@ -1208,6 +1192,43 @@ body.activity-permalink #buddypress { margin-left: 0; } +#buddypress .acfb-holder { + list-style: none; + margin: 0; +} + +#buddypress .acfb-holder li { + margin-left: 0; +} + +#buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-right: 0; + padding: 0.5em; +} + +#buddypress .acfb-holder li.friend-tab span.p { + padding-left: 10px; +} + +#buddypress .acfb-holder li.friend-tab span.p:focus, #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +#buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +#buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + #buddypress #message-threads.sitewide-notices td { width: 100%; } @@ -1258,6 +1279,23 @@ body.activity-permalink #buddypress { text-indent: 0; } +.bp-user .ac_results { + background: #eee; + padding-left: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + /** *------------------------------ * @subsection 6.2.2.6 - Settings @@ -1456,11 +1494,3 @@ body.activity-permalink #buddypress { * @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 index 4c2f6805a399a71c9eb798d115f5c2cf9bbb3798..b6c4a4d72fa34fc2d6350bc9956e90ccdd085ebb 100644 --- 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 @@ -1 +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 #item-body{border-left:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#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 #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} \ No newline at end of file +@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 #item-body{border-left:1px solid #bebebe;overflow:hidden;padding:0 20px;width:auto}#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 #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}@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-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:#787878}#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-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 .acfb-holder{list-style:none;margin:0}#buddypress .acfb-holder li{margin-left:0}#buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-right:0;padding:.5em}#buddypress .acfb-holder li.friend-tab span.p{padding-left:10px}#buddypress .acfb-holder li.friend-tab span.p:focus,#buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}#buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}#buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}#buddypress #message-threads.sitewide-notices td,#buddypress table.profile-settings{width:100%}#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}.bp-user .ac_results{background:#eee;padding-left:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}#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} \ 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 index 8b9872ff291685827764ca61fd33a4b8baf63a7c..5e7f93ba4a4b96c3841ea66c69946b8f28d99773 100644 --- a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.scss +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentyfourteen.scss @@ -139,6 +139,7 @@ $notice-update: #ced98c; $stripe-odd: #ebf0ff; $stripe-even: #dbe5ff; $unread: #cddaff; +$link-action: #c82b2b; // 2014 font family @mixin default-font() { @@ -279,6 +280,7 @@ http://codex.buddypress.org/themes/buddypress-companion-stylesheets/ width: 50%; } } + @media screen and (min-width: 594px) { li { width: auto; @@ -672,17 +674,7 @@ $nav-background-border: #bebebe; 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; @@ -838,7 +830,6 @@ body.activity-permalink { #buddypress { .activity { .activity-comments { - // border-left: 1px solid $border-light; margin-left: 0; margin-top: 5px; @@ -1100,8 +1091,6 @@ body.activity-permalink { overflow: hidden; text-align: left; width: 20%; - - img {margin: 0;} } #item-header-content { @@ -1264,6 +1253,7 @@ body.activity-permalink { #search-members-form { @include box-model(border-box); float: left; + @media screen and (max-width: 400px) { margin: 0; width: 100%; @@ -1272,6 +1262,7 @@ body.activity-permalink { input[type="text"] {width: 100%;} } } + @media screen and (min-width: 783px) { margin-left: 3px; } @@ -1433,10 +1424,11 @@ body.activity-permalink { border-right: 1px solid $border-med; tbody > tr:first-child { + td.bulk-select-check, td.thread-from { border-top: 1px solid $border-med; - } + } } tr { @@ -1467,6 +1459,7 @@ body.activity-permalink { td.thread-from { border-left: 0; height: 2.6em; + @media screen and (max-width: 320px) { height: 5.2em; } @@ -1507,6 +1500,7 @@ body.activity-permalink { display: block; float: right; line-height: 2; + @media screen and (max-width: 320px) { clear: both; @include font-size(11); @@ -1543,7 +1537,6 @@ body.activity-permalink { } // close #messages-threads - /* Read Single thread */ #message-thread { #message-subject { @@ -1563,7 +1556,44 @@ body.activity-permalink { } } - /* Sitewide Notices loop */ + .acfb-holder { + list-style: none; + margin: 0; + + li {margin-left: 0;} + + li.friend-tab { + background: lighten($notice-info, 20%); + border: inherit; + margin-right: 0; + padding: 0.5em; + + span.p { + // the 'X' close + padding-left: $spacing-val-sm; + + &:focus, + &:hover { + color: $link-action; + cursor: pointer; + } + } + + a { + border-bottom: 0; + text-decoration: none; + + img { + // this is the tiny user avatar + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; // override inline style + } + } + } + } + #message-threads.sitewide-notices { td { width: 100%; @@ -1587,7 +1617,7 @@ body.activity-permalink { } td:first-child + td + td { - // notice date + // notice date border-bottom: 0; span { @@ -1596,13 +1626,13 @@ body.activity-permalink { } td:last-child { - // notice actions + // notice actions border-bottom-color: $border-med; line-height: 1; text-align: right; a:last-child { - // hide the 'x' text + // hide the 'x' text line-height: 0; margin-left: 0.7em; text-indent: -999em; @@ -1619,6 +1649,27 @@ body.activity-permalink { } // close #buddypress - user acounts item-body +.bp-user { + + // acfb auto complete name list sits in doc footer before body close + .ac_results { + background: #eee; + padding-left: $spacing-val-sm; + + ul { margin: 0; } + + li { + margin: $spacing-val-sm 0; + + &:focus, + &:hover { + cursor: pointer; + } + } + } + +} + /** *------------------------------ * @subsection 6.2.2.6 - Settings @@ -1715,8 +1766,8 @@ body.activity-permalink { 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 + // 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; @@ -1753,7 +1804,7 @@ body.activity-permalink { width: 20%; } - }// close form + }// close form } // close .dir-search, .message-search @@ -1851,15 +1902,3 @@ body.activity-permalink { * @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/twentysixteen-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..dc3489bb7ea6f67e120946278f01ec78b58c7c5e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen-rtl.css @@ -0,0 +1,1906 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentysixteen theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentysixteen 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, Register, activation +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.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, Globals +*------------------------------------------------------------------------------- +*/ +.buddypress div.clear { + display: none; +} + +.buddypress #page a { + box-shadow: none; + text-decoration: none !important; +} + +.buddypress .entry-title { + text-align: center; +} + +@media screen and (min-width: 61.5625em) { + .buddypress .entry-title { + text-align: right; + } +} + +@media screen and (min-width: 44.375em) { + .buddypress #primary { + float: none; + margin: 0; + width: auto; + } + .buddypress #primary .entry-header { + margin: 0; + } + .buddypress #primary .entry-content, + .buddypress #primary .content-bottom-widgets { + margin-right: 7.6923%; + margin-left: 7.6923%; + } + .buddypress .sidebar { + float: none; + margin-right: 0; + padding: 0 7.6923%; + width: auto; + } +} + +@media screen and (min-width: 61.5625em) { + .buddypress #primary { + float: right; + margin-left: -100%; + width: 70%; + } + .buddypress #primary .entry-content, + .buddypress #primary .content-bottom-widgets { + margin-right: 0; + margin-left: 0; + } + .buddypress .sidebar { + float: right; + margin-right: 75%; + padding: 0; + width: 25%; + } +} + +.buddypress.no-sidebar #primary { + float: none; + margin: 0; + width: auto; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul li.selected a { + background: inherit; + opacity: 1; +} + +#buddypress div.item-list-tabs ul { + background-color: #f7f5e7; + border-bottom: 1px solid rgba(234, 234, 234, 0.9); + border-top: 1px solid rgba(234, 234, 234, 0.9); + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 38.75em) { + .bp-user #buddypress #object-nav { + background: #f7f5e7; + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +#buddypress #object-nav ul li:not(.selected) a { + opacity: 0.7; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(.selected):focus, #buddypress #object-nav ul li:not(.selected):hover { + background: #f4f2df; + } +} + +@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; + margin-top: 5px; + 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: 0.875rem; +} + +#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; + } +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 55em) { + body.no-sidebar #buddypress #item-header, + body.no-sidebar #buddypress #item-body { + background: #fff; + } + body.no-sidebar #buddypress #object-nav { + border-left: 1px solid #ddd; + float: right; + margin-left: -1px; + width: 200px; + } + body.no-sidebar #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body.no-sidebar #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body.no-sidebar #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: left; + margin-left: 2px; + } + body.no-sidebar #buddypress #item-body { + border-right: 1px solid #ddd; + overflow: hidden; + padding: 0 20px 0 0; + width: auto; + } + body.no-sidebar #buddypress #item-body #subnav { + margin: 0 -20px 0 0; + } + body.no-sidebar #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding-bottom: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: right; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 0; + } +} + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ +#buddypress div.pagination { + box-shadow: none; + min-height: 0; +} + +#buddypress div.pagination:before, #buddypress div.pagination:after { + height: 0; + width: 0; +} + +#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: "Source Sans Pro", Helvetica, sans-serif; +} + +#buddypress .activity-meta .button:focus, #buddypress .activity-meta .button:hover { + background: inherit; + color: #000; +} + +#buddypress .action .generic-button a:focus, #buddypress .action .generic-button a:hover { + background: inherit; + color: #000; +} + +#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; + margin-bottom: 10px; +} + +@media screen and (min-width: 44.375em) { + #buddypress ul.item-list li .item-avatar img.avatar { + display: block; + float: right; + } +} + +#buddypress ul.item-list li .item { + overflow: hidden; +} + +@media screen and (min-width: 46.25em) { + #buddypress ul.item-list li .item { + margin-right: 15%; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin-right: 0; + width: 94%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.125rem; + line-height: 1.2; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 44.375em) { + #buddypress ul.item-list li .item .item-title { + text-align: right; + } +} + +#buddypress ul.item-list li .item .item-title .update { + display: block; + font-size: 12px; + font-size: 0.75rem; + padding: 10px 0; + text-align: right; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 61.5625em) { + #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: 5%; + margin-right: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 22px; + font-size: 1.375rem; + } +} + +#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: 61.5625em) { + #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: 61.5625em) { + #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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: right; + margin: 10px 0 20px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: right; + line-height: 1.5em; + margin-top: 12px; + padding-right: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: left; + margin: 0; + min-height: 1.5em; + padding-right: 0.4em; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #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: 0.875rem; +} + +@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: 1rem; + } +} + +#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: 14px; + font-size: 0.875rem; +} + +#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); + margin-top: 0; + 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-bottom: 5px; +} + +@media screen and (min-width: 38.75em) { + #buddypress #activity-stream .activity-content .activity-meta a { + display: inline-block; + margin-bottom: 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 #activity-stream li.activity-item { + padding: 20px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1rem; + margin-bottom: 40px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.25rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 20px; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + border-right: 1px solid #eaeaea; + margin-top: 5px; +} + +#buddypress #activity-stream .activity-comments ul { + background: rgba(247, 247, 247, 0.6); + margin: 15px 2px 0 0; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 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-stream .activity-comments .ac-form .ac-reply-cancel { + border: 1px solid rgba(212, 208, 186, 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: 61.5625em) { + #buddypress #members-list li .item-avatar, + #buddypress #members-list li .item { + float: right; + } + #buddypress #members-list li .action { + float: left; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: left; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: right; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 0.875rem; + text-align: right; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.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 { + border-right: 1px solid #eaeaea; + clear: none; + float: left; + padding-right: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-right: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + 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: 1rem; + } +} + +@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 a { + float: right; + } + .bp-user #buddypress #item-header #item-header-content { + float: left; + margin-left: 5%; + width: 69%; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 0.875rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 0.875rem; +} + +.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 +*----------------------------------------- +*/ +.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.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: 0.875rem; +} + +.bp-user #buddypress table td { + font-size: 12px; + font-size: 0.75rem; +} + +@media screen and (min-width: 61.5625em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 75em) { + .bp-user #buddypress table th { + font-size: 18px; + font-size: 1.125rem; + } + .bp-user #buddypress table td { + font-size: 16px; + font-size: 1rem; + } +} + +.bp-user #buddypress .pag-count { + font-style: italic; +} + +.bp-user #buddypress .notifications-options-nav { + border: 1px solid rgba(212, 208, 186, 0.5); + float: right; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + .bp-user #buddypress .notifications-options-nav { + width: 300px; + } +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .notifications-options-nav input { + border: 0; + font-size: 14px; + font-size: 0.875rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select { + float: right; + margin-left: 0; + width: 60%; +} + +.bp-user #buddypress .notifications-options-nav input { + float: left; + font-family: inherit; + line-height: 20px; + width: 40%; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile { + /* Edit profile */ +} + +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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.125rem; +} + +.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: 0.875rem; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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: #6f6f6f; +} + +.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: #ccc; + 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.thread-star { + vertical-align: middle; +} + +.bp-user #buddypress #message-threads tr td.thread-star .message-action-star { + line-height: 1.2; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@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: 0.75rem; +} + +.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: 0.75rem; + 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: 0.6875rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + background: #dce5ff; + border-color: #d4d0ba; +} + +.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 { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-right: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-left: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-right: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress #message-threads.sitewide-notices td { + width: 100%; +} + +.bp-user #buddypress #message-threads.sitewide-notices td strong { + background: #6f6f6f; + 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:nth-child(2) strong { + margin: -8px -8px 8px; +} + +.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; +} + +.bp-user .ac_results { + background: #eee; + padding-right: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.25rem; + margin: 20px 0 10px; +} + +.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 +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-left: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: right; + width: 70%; +} + +#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: 100%; +} + +#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: 0.875rem; + 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(212, 208, 186, 0.6); + 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: 30%; +} + +@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: 75em) { + #buddypress .dir-search form input[type='text'], + #buddypress .message-search form input[type='text'] { + font-size: 16px; + font-size: 1rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +#buddypress table { + font-size: 14px; + font-size: 0.875rem; + margin: 20px 0; +} + +#buddypress table tr th { + background: #6f6f6f; + 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: 1rem; + } +} + +/*__ 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 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 .acfb-holder li.friend-tab { + background: #9fd1e2; + border: inherit; +} diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..aea95e8bcf0e5b4f97fc06dd378fb5f91333a3fb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen-rtl.min.css @@ -0,0 +1 @@ +@charset "UTF-8";#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}.bp-user #buddypress #message-threads tr td.thread-star,.bp-user #buddypress table.notification-settings td.no,.bp-user #buddypress table.notification-settings td.yes{vertical-align:middle}.buddypress div.clear{display:none}.buddypress #page a{box-shadow:none;text-decoration:none!important}.buddypress .entry-title{text-align:center}@media screen and (min-width:44.375em){.buddypress #primary{float:none;margin:0;width:auto}.buddypress #primary .entry-header{margin:0}.buddypress #primary .content-bottom-widgets,.buddypress #primary .entry-content{margin-right:7.6923%;margin-left:7.6923%}.buddypress .sidebar{float:none;margin-right:0;padding:0 7.6923%;width:auto}}@media screen and (min-width:61.5625em){.buddypress .entry-title{text-align:right}.buddypress #primary{float:right;margin-left:-100%;width:70%}.buddypress #primary .content-bottom-widgets,.buddypress #primary .entry-content{margin-right:0;margin-left:0}.buddypress .sidebar{float:right;margin-right:75%;padding:0;width:25%}}.buddypress.no-sidebar #primary{float:none;margin:0;width:auto}#buddypress div.item-list-tabs ul li.selected a{background:inherit;opacity:1}#buddypress div.item-list-tabs ul{background-color:#f7f5e7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:38.75em){.bp-user #buddypress #object-nav{background:#f7f5e7;border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}#buddypress #object-nav ul li:not(.selected) a{opacity:.7}@media screen and (max-width:38.75em){#buddypress #object-nav ul li:not(.selected):focus,#buddypress #object-nav ul li:not(.selected):hover{background:#f4f2df}}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{background-color:#f7f7f7;border-bottom:0;margin-top:5px;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:.875rem}@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}}@media screen and (min-width:55em){body.no-sidebar #buddypress #item-body,body.no-sidebar #buddypress #item-header{background:#fff}body.no-sidebar #buddypress #object-nav{border-left:1px solid #ddd;float:right;margin-left:-1px;width:200px}body.no-sidebar #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body.no-sidebar #buddypress #object-nav ul li{float:none;overflow:hidden}body.no-sidebar #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:left;margin-left:2px}body.no-sidebar #buddypress #item-body{border-right:1px solid #ddd;overflow:hidden;padding:0 20px 0 0;width:auto}body.no-sidebar #buddypress #item-body #subnav{margin:0 -20px 0 0}body.no-sidebar #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding-bottom:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:right;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom:0}}#buddypress div.pagination{box-shadow:none;min-height:0}#buddypress div.pagination:after,#buddypress div.pagination:before{height:0;width:0}#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 .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#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:"Source Sans Pro",Helvetica,sans-serif}#buddypress .action .generic-button a:focus,#buddypress .action .generic-button a:hover,#buddypress .activity-meta .button:focus,#buddypress .activity-meta .button:hover{background:inherit;color:#000}#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;margin-bottom:10px}#buddypress ul.item-list li .item{overflow:hidden}@media screen and (min-width:46.25em){#buddypress ul.item-list li .item{margin-right:15%}}#buddypress ul.item-list li .item .item-desc{margin-right:0;width:94%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.125rem;line-height:1.2;text-align:center;width:100%}@media screen and (min-width:44.375em){#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:right}#buddypress ul.item-list li .item .item-title{text-align:right}}#buddypress ul.item-list li .item .item-title .update{display:block;font-size:12px;font-size:.75rem;padding:10px 0;text-align:right}@media screen and (min-width:61.5625em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:.875rem}#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:5%;margin-right:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:22px;font-size:1.375rem}}#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:61.5625em){#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:61.5625em){#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:right;margin:10px 0 20px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:right;line-height:1.5em;margin-top:12px;padding-right:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:left;margin:0;min-height:1.5em;padding-right:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #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:.875rem}@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:1rem}}#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:14px;font-size:.875rem}#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);margin-top:0;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-bottom:5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.25rem}}#buddypress #activity-stream .activity-comments{border-right:1px solid #eaeaea;margin-top:5px}#buddypress #activity-stream .activity-comments ul{background:rgba(247,247,247,.6);margin:15px 2px 0 0}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.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-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(212,208,186,.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:61.5625em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:right}#buddypress #members-list li .action{float:left}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:38.75em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:left}#buddypress #signup_form.standard-form #basic-details-section{float:right}}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:.875rem;text-align:right}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@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%}.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{border-right:1px solid #eaeaea;clear:none;float:left;padding-right:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-right:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem;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:1rem}.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{float:right}.bp-user #buddypress #item-header #item-header-content{float:left;margin-left:5%;width:69%}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:.875rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:.875rem}.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 h5,.groups.manage-members #group-settings-form .item-list li img{float:right}.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 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}.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%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:.875rem}.bp-user #buddypress table td{font-size:12px;font-size:.75rem}@media screen and (min-width:61.5625em){.bp-user #buddypress table th{font-size:16px;font-size:1rem}.bp-user #buddypress table td{font-size:14px;font-size:.875rem}}@media screen and (min-width:75em){.bp-user #buddypress table th{font-size:18px;font-size:1.125rem}.bp-user #buddypress table td{font-size:16px;font-size:1rem}}.bp-user #buddypress .notifications-options-nav{border:1px solid rgba(212,208,186,.5);float:right;width:100%}@media screen and (min-width:38.75em){.bp-user #buddypress .notifications-options-nav{width:300px}}.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{border:0;font-size:14px;font-size:.875rem;outline:0;padding:0}.bp-user #buddypress .notifications-options-nav select{float:right;margin-left:0;width:60%}.bp-user #buddypress .notifications-options-nav input{float:left;font-family:inherit;line-height:20px;width:40%}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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.125rem}.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:.875rem}.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:#6f6f6f;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:#6f6f6f}.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:#ccc;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-star .message-action-star{line-height:1.2}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.75rem}.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:.75rem;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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@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:.6875rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d4d0ba}.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{list-style:none}.bp-user #buddypress .acfb-holder li{margin-right:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-left:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-right:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td,.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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:nth-child(2) strong{margin:-8px -8px 8px}.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:.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 .ac_results{background:#eee;padding-right:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.25rem;margin:20px 0 10px}.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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-left:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:right;width:70%}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:.875rem;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:100%;border-left:1px solid rgba(212,208,186,.6);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:30%}@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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:75em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1rem}}#buddypress table{font-size:14px;font-size:.875rem;margin:20px 0}#buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff}#buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1rem}}#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 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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.css new file mode 100644 index 0000000000000000000000000000000000000000..7d3d46cceae8e40f58e18067f5aa5a58b9048b2e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.css @@ -0,0 +1,1906 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentysixteen theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentysixteen 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, Register, activation +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.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, Globals +*------------------------------------------------------------------------------- +*/ +.buddypress div.clear { + display: none; +} + +.buddypress #page a { + box-shadow: none; + text-decoration: none !important; +} + +.buddypress .entry-title { + text-align: center; +} + +@media screen and (min-width: 61.5625em) { + .buddypress .entry-title { + text-align: left; + } +} + +@media screen and (min-width: 44.375em) { + .buddypress #primary { + float: none; + margin: 0; + width: auto; + } + .buddypress #primary .entry-header { + margin: 0; + } + .buddypress #primary .entry-content, + .buddypress #primary .content-bottom-widgets { + margin-left: 7.6923%; + margin-right: 7.6923%; + } + .buddypress .sidebar { + float: none; + margin-left: 0; + padding: 0 7.6923%; + width: auto; + } +} + +@media screen and (min-width: 61.5625em) { + .buddypress #primary { + float: left; + margin-right: -100%; + width: 70%; + } + .buddypress #primary .entry-content, + .buddypress #primary .content-bottom-widgets { + margin-left: 0; + margin-right: 0; + } + .buddypress .sidebar { + float: left; + margin-left: 75%; + padding: 0; + width: 25%; + } +} + +.buddypress.no-sidebar #primary { + float: none; + margin: 0; + width: auto; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul li.selected a { + background: inherit; + opacity: 1; +} + +#buddypress div.item-list-tabs ul { + background-color: #f7f5e7; + border-bottom: 1px solid rgba(234, 234, 234, 0.9); + border-top: 1px solid rgba(234, 234, 234, 0.9); + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 38.75em) { + .bp-user #buddypress #object-nav { + background: #f7f5e7; + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +#buddypress #object-nav ul li:not(.selected) a { + opacity: 0.7; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(.selected):focus, #buddypress #object-nav ul li:not(.selected):hover { + background: #f4f2df; + } +} + +@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; + margin-top: 5px; + 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: 0.875rem; +} + +#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; + } +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 55em) { + body.no-sidebar #buddypress #item-header, + body.no-sidebar #buddypress #item-body { + background: #fff; + } + body.no-sidebar #buddypress #object-nav { + border-right: 1px solid #ddd; + float: left; + margin-right: -1px; + width: 200px; + } + body.no-sidebar #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body.no-sidebar #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body.no-sidebar #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: right; + margin-right: 2px; + } + body.no-sidebar #buddypress #item-body { + border-left: 1px solid #ddd; + overflow: hidden; + padding: 0 0 0 20px; + width: auto; + } + body.no-sidebar #buddypress #item-body #subnav { + margin: 0 0 0 -20px; + } + body.no-sidebar #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding-bottom: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: left; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 0; + } +} + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ +#buddypress div.pagination { + box-shadow: none; + min-height: 0; +} + +#buddypress div.pagination:before, #buddypress div.pagination:after { + height: 0; + width: 0; +} + +#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: "Source Sans Pro", Helvetica, sans-serif; +} + +#buddypress .activity-meta .button:focus, #buddypress .activity-meta .button:hover { + background: inherit; + color: #000; +} + +#buddypress .action .generic-button a:focus, #buddypress .action .generic-button a:hover { + background: inherit; + color: #000; +} + +#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; + margin-bottom: 10px; +} + +@media screen and (min-width: 44.375em) { + #buddypress ul.item-list li .item-avatar img.avatar { + display: block; + float: left; + } +} + +#buddypress ul.item-list li .item { + overflow: hidden; +} + +@media screen and (min-width: 46.25em) { + #buddypress ul.item-list li .item { + margin-left: 15%; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin-left: 0; + width: 94%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.125rem; + line-height: 1.2; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 44.375em) { + #buddypress ul.item-list li .item .item-title { + text-align: left; + } +} + +#buddypress ul.item-list li .item .item-title .update { + display: block; + font-size: 12px; + font-size: 0.75rem; + padding: 10px 0; + text-align: left; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 61.5625em) { + #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: 5%; + margin-left: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 22px; + font-size: 1.375rem; + } +} + +#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: 61.5625em) { + #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: 61.5625em) { + #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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: left; + margin: 10px 0 20px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: left; + line-height: 1.5em; + margin-top: 12px; + padding-left: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: right; + margin: 0; + min-height: 1.5em; + padding-left: 0.4em; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #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: 0.875rem; +} + +@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: 1rem; + } +} + +#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: 14px; + font-size: 0.875rem; +} + +#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); + margin-top: 0; + 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-bottom: 5px; +} + +@media screen and (min-width: 38.75em) { + #buddypress #activity-stream .activity-content .activity-meta a { + display: inline-block; + margin-bottom: 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 #activity-stream li.activity-item { + padding: 20px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1rem; + margin-bottom: 40px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.25rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 20px; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + border-left: 1px solid #eaeaea; + margin-top: 5px; +} + +#buddypress #activity-stream .activity-comments ul { + background: rgba(247, 247, 247, 0.6); + margin: 15px 0 0 2px; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 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-stream .activity-comments .ac-form .ac-reply-cancel { + border: 1px solid rgba(212, 208, 186, 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: 61.5625em) { + #buddypress #members-list li .item-avatar, + #buddypress #members-list li .item { + float: left; + } + #buddypress #members-list li .action { + float: right; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: right; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: left; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 0.875rem; + text-align: left; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.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 { + border-left: 1px solid #eaeaea; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-left: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + 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: 1rem; + } +} + +@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 a { + float: left; + } + .bp-user #buddypress #item-header #item-header-content { + float: right; + margin-right: 5%; + width: 69%; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 0.875rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 0.875rem; +} + +.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 +*----------------------------------------- +*/ +.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.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: 0.875rem; +} + +.bp-user #buddypress table td { + font-size: 12px; + font-size: 0.75rem; +} + +@media screen and (min-width: 61.5625em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 75em) { + .bp-user #buddypress table th { + font-size: 18px; + font-size: 1.125rem; + } + .bp-user #buddypress table td { + font-size: 16px; + font-size: 1rem; + } +} + +.bp-user #buddypress .pag-count { + font-style: italic; +} + +.bp-user #buddypress .notifications-options-nav { + border: 1px solid rgba(212, 208, 186, 0.5); + float: left; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + .bp-user #buddypress .notifications-options-nav { + width: 300px; + } +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .notifications-options-nav input { + border: 0; + font-size: 14px; + font-size: 0.875rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select { + float: left; + margin-right: 0; + width: 60%; +} + +.bp-user #buddypress .notifications-options-nav input { + float: right; + font-family: inherit; + line-height: 20px; + width: 40%; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile { + /* Edit profile */ +} + +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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.125rem; +} + +.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: 0.875rem; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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: #6f6f6f; +} + +.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: #ccc; + 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.thread-star { + vertical-align: middle; +} + +.bp-user #buddypress #message-threads tr td.thread-star .message-action-star { + line-height: 1.2; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@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: 0.75rem; +} + +.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: 0.75rem; + 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: 0.6875rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + background: #dce5ff; + border-color: #d4d0ba; +} + +.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 { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-left: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-right: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-left: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress #message-threads.sitewide-notices td { + width: 100%; +} + +.bp-user #buddypress #message-threads.sitewide-notices td strong { + background: #6f6f6f; + 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:nth-child(2) strong { + margin: -8px -8px 8px; +} + +.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; +} + +.bp-user .ac_results { + background: #eee; + padding-left: 10px; +} + +.bp-user .ac_results ul { + margin: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.25rem; + margin: 20px 0 10px; +} + +.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 +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-right: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: left; + width: 70%; +} + +#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: 100%; +} + +#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: 0.875rem; + 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(212, 208, 186, 0.6); + 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: 30%; +} + +@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: 75em) { + #buddypress .dir-search form input[type='text'], + #buddypress .message-search form input[type='text'] { + font-size: 16px; + font-size: 1rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +#buddypress table { + font-size: 14px; + font-size: 0.875rem; + margin: 20px 0; +} + +#buddypress table tr th { + background: #6f6f6f; + 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: 1rem; + } +} + +/*__ 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 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 .acfb-holder li.friend-tab { + background: #9fd1e2; + border: inherit; +} diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d9efd2715c1aea0a8d426c959974019743a3f225 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.min.css @@ -0,0 +1 @@ +@charset "UTF-8";#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}.bp-user #buddypress #message-threads tr td.thread-star,.bp-user #buddypress table.notification-settings td.no,.bp-user #buddypress table.notification-settings td.yes{vertical-align:middle}.buddypress div.clear{display:none}.buddypress #page a{box-shadow:none;text-decoration:none!important}.buddypress .entry-title{text-align:center}@media screen and (min-width:44.375em){.buddypress #primary{float:none;margin:0;width:auto}.buddypress #primary .entry-header{margin:0}.buddypress #primary .content-bottom-widgets,.buddypress #primary .entry-content{margin-left:7.6923%;margin-right:7.6923%}.buddypress .sidebar{float:none;margin-left:0;padding:0 7.6923%;width:auto}}@media screen and (min-width:61.5625em){.buddypress .entry-title{text-align:left}.buddypress #primary{float:left;margin-right:-100%;width:70%}.buddypress #primary .content-bottom-widgets,.buddypress #primary .entry-content{margin-left:0;margin-right:0}.buddypress .sidebar{float:left;margin-left:75%;padding:0;width:25%}}.buddypress.no-sidebar #primary{float:none;margin:0;width:auto}#buddypress div.item-list-tabs ul li.selected a{background:inherit;opacity:1}#buddypress div.item-list-tabs ul{background-color:#f7f5e7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:38.75em){.bp-user #buddypress #object-nav{background:#f7f5e7;border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}#buddypress #object-nav ul li:not(.selected) a{opacity:.7}@media screen and (max-width:38.75em){#buddypress #object-nav ul li:not(.selected):focus,#buddypress #object-nav ul li:not(.selected):hover{background:#f4f2df}}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{background-color:#f7f7f7;border-bottom:0;margin-top:5px;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:.875rem}@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}}@media screen and (min-width:55em){body.no-sidebar #buddypress #item-body,body.no-sidebar #buddypress #item-header{background:#fff}body.no-sidebar #buddypress #object-nav{border-right:1px solid #ddd;float:left;margin-right:-1px;width:200px}body.no-sidebar #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body.no-sidebar #buddypress #object-nav ul li{float:none;overflow:hidden}body.no-sidebar #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:right;margin-right:2px}body.no-sidebar #buddypress #item-body{border-left:1px solid #ddd;overflow:hidden;padding:0 0 0 20px;width:auto}body.no-sidebar #buddypress #item-body #subnav{margin:0 0 0 -20px}body.no-sidebar #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding-bottom:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:left;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom:0}}#buddypress div.pagination{box-shadow:none;min-height:0}#buddypress div.pagination:after,#buddypress div.pagination:before{height:0;width:0}#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 .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#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:"Source Sans Pro",Helvetica,sans-serif}#buddypress .action .generic-button a:focus,#buddypress .action .generic-button a:hover,#buddypress .activity-meta .button:focus,#buddypress .activity-meta .button:hover{background:inherit;color:#000}#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;margin-bottom:10px}#buddypress ul.item-list li .item{overflow:hidden}@media screen and (min-width:46.25em){#buddypress ul.item-list li .item{margin-left:15%}}#buddypress ul.item-list li .item .item-desc{margin-left:0;width:94%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.125rem;line-height:1.2;text-align:center;width:100%}@media screen and (min-width:44.375em){#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:left}#buddypress ul.item-list li .item .item-title{text-align:left}}#buddypress ul.item-list li .item .item-title .update{display:block;font-size:12px;font-size:.75rem;padding:10px 0;text-align:left}@media screen and (min-width:61.5625em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:.875rem}#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:5%;margin-left:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:22px;font-size:1.375rem}}#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:61.5625em){#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:61.5625em){#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:left;margin:10px 0 20px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:left;line-height:1.5em;margin-top:12px;padding-left:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:right;margin:0;min-height:1.5em;padding-left:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #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:.875rem}@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:1rem}}#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:14px;font-size:.875rem}#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);margin-top:0;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-bottom:5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.25rem}}#buddypress #activity-stream .activity-comments{border-left:1px solid #eaeaea;margin-top:5px}#buddypress #activity-stream .activity-comments ul{background:rgba(247,247,247,.6);margin:15px 0 0 2px}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.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-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(212,208,186,.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:61.5625em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:left}#buddypress #members-list li .action{float:right}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:38.75em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:right}#buddypress #signup_form.standard-form #basic-details-section{float:left}}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:.875rem;text-align:left}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@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%}.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{border-left:1px solid #eaeaea;clear:none;float:right;padding-left:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-left:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem;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:1rem}.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{float:left}.bp-user #buddypress #item-header #item-header-content{float:right;margin-right:5%;width:69%}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:.875rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:.875rem}.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 h5,.groups.manage-members #group-settings-form .item-list li img{float:left}.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 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}.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%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:.875rem}.bp-user #buddypress table td{font-size:12px;font-size:.75rem}@media screen and (min-width:61.5625em){.bp-user #buddypress table th{font-size:16px;font-size:1rem}.bp-user #buddypress table td{font-size:14px;font-size:.875rem}}@media screen and (min-width:75em){.bp-user #buddypress table th{font-size:18px;font-size:1.125rem}.bp-user #buddypress table td{font-size:16px;font-size:1rem}}.bp-user #buddypress .notifications-options-nav{border:1px solid rgba(212,208,186,.5);float:left;width:100%}@media screen and (min-width:38.75em){.bp-user #buddypress .notifications-options-nav{width:300px}}.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{border:0;font-size:14px;font-size:.875rem;outline:0;padding:0}.bp-user #buddypress .notifications-options-nav select{float:left;margin-right:0;width:60%}.bp-user #buddypress .notifications-options-nav input{float:right;font-family:inherit;line-height:20px;width:40%}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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.125rem}.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:.875rem}.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:#6f6f6f;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:#6f6f6f}.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:#ccc;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-star .message-action-star{line-height:1.2}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.75rem}.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:.75rem;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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@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:.6875rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d4d0ba}.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{list-style:none}.bp-user #buddypress .acfb-holder li{margin-left:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-right:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-left:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td,.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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:nth-child(2) strong{margin:-8px -8px 8px}.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:.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 .ac_results{background:#eee;padding-left:10px}.bp-user .ac_results ul{margin:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.25rem;margin:20px 0 10px}.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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-right:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:left;width:70%}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:.875rem;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:100%;border-right:1px solid rgba(212,208,186,.6);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:30%}@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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:75em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1rem}}#buddypress table{font-size:14px;font-size:.875rem;margin:20px 0}#buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff}#buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1rem}}#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 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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.scss b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.scss new file mode 100644 index 0000000000000000000000000000000000000000..3d9bcf686de8d4a27e1c9cec7cd8366ccda172ab --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentysixteen.scss @@ -0,0 +1,2417 @@ + +// 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 . + +// 2016 Media Queries / Breakpoints. +// @media screen and (min-width: 44.375em) +// @media screen and (min-width: 61.5625em) +// @media screen and (min-width: 75em) + + +// In addition BP will use the em breakpoints as referenced below to provide +// a series of finer breakpoints, these are be used sparingly though. +// @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: 87.6875em) + +// Mixins and Variables + +// simplify remembering/writing media queries +// written as: +// @include medium-up { +// body {property: value;} +// } +// + +@mixin small-up { + @media screen and (min-width: 44.375em) { + @content; + } +} + +@mixin medium-up { + @media screen and (min-width: 61.5625em) { + @content; + } +} + +@mixin large-up { + @media screen and (min-width: 75em) { + @content; + } +} + + +// Common spacing values +$spacing-val-lg: 40px; +$spacing-val-md: 20px; +$spacing-val-sm: 10px; +$spacing-val-xs: 5px; + +// A simple mixin to handle font-sizing +// 2016 uses a basic pixel font size approach, we'll stick with rem/px +@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) { + -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; +} + +// 2016 font family +@mixin default-font-sans() { + font-family: "Source Sans Pro", Helvetica, sans-serif; +} + +// Variables: color definitions +$body-text: #141412; +$content-background: #fff; +$off-white: lighten(#f9f8ee, 0.7); +$cream-background: #f7f5e7; +$light-background: #f7f7f7; +$medium-background: #ccc; +$dark-background: #555; +$border-color: #d4d0ba; // border color is varied using rgba +$border-light: #eaeaea; // BP dividers +$border-med: #ddd; +$background-hover: #db572f; // 2016 link background hover +$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; +$link-action: #c82b2b; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentysixteen theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentysixteen 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, Register, activation +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.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, Globals +*------------------------------------------------------------------------------- +*/ + + + +.buddypress { + // Remove any empty clearing elements, CSS provides clearing. + div.clear {display: none;} + + // Ensure no text decoration or box shadow causing underlined effect. + #page a { + box-shadow: none; + text-decoration: none !important; + } + + .entry-title { + text-align: center; + + @include medium-up { + text-align: left; + } + } + + // The breakpoint for main & sidebar could cut in earlier, elements wrap to blocks/columns + // but margins & padding still in effect for sidebar style.css L:2781. + + @include small-up { + #primary { + float: none; + margin: 0; + width: auto; + + .entry-header { + margin: 0; + } + + .entry-content, + .content-bottom-widgets { + margin-left: 7.6923%; + margin-right: 7.6923%; + } + } + + .sidebar { + float: none; + margin-left: 0; + padding: 0 7.6923%; + width: auto; + } + } + + @include medium-up { + #primary { + float: left; + margin-right: -100%; + width: 70%; + + .entry-content, + .content-bottom-widgets { + margin-left: 0; + margin-right: 0; + } + } + + .sidebar { + float: left; + margin-left: 75%; + padding: 0; + width: 25%; + } + + } + +} // .buddypress (body class) + +// 2016 defines the class 'no-sidebar' if the primary sidebar is empty/inactive in terms +// of widgets; if this is in effect on a site then adjust the BP screens for full width. + +.buddypress.no-sidebar { + + #primary { + float: none; + margin: 0; + width: auto; + } + +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ + + + +/** +*---------------------------------------------------------- +* @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 will appear over weighted in selectors + +#buddypress { + + // active/current states all navs + div.item-list-tabs { + ul { + li.selected { + a { + background: inherit; + opacity: 1; + } + } + } + } + // global nav styles + div.item-list-tabs { + ul { + background-color: $cream-background; + border-bottom: 1px solid rgba($border-light, 0.9); + border-top: 1px solid rgba($border-light, 0.9); + overflow: hidden; + padding: 0; + + li { + a { + span {border-radius: 25%;} + } + } + } + } // close item-list-tabs + +} // close #buddypress + +// .bp-user #object-nav @ small screen as a dropdown + +.bp-user { + + #buddypress { + + @media screen and (max-width: 38.75em) { + + #object-nav { + background: $cream-background; + border: 1px solid $border-light; + overflow: visible; + padding: $spacing-val-sm; + + ul { + border: 0; + height: 0; + // all latest vendor releases handle transitions, so no prefixes used. + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + + &:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + + &:hover, + &:focus { + &:before {content: "Menu \021E7";} + + ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + } + } + + #subnav { + clear: both; + } + + } // close @media + } +} + +/*__ Horizontal menus __*/ +#buddypress { + + #object-nav { + + ul { + overflow: hidden; + + li { + float: none; + } + + @media screen and (max-width: 38.75em) { + li:not(:last-child) { + border-bottom: 1px solid $border-light; + } + } + + li:not(.selected) { + a {opacity: 0.7;} + + @media screen and (max-width: 38.75em) { + &:focus, + &:hover { + background: darken($cream-background, 2%); + } + } + } + + @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; + margin-top: $spacing-val-xs; + 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 + +} // 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 +// 2016 right sidebar is displayed if the widget sidebar has widgets; +// we'll only display object nav as a vert menu if sidebar not present. + +@media screen and (min-width: 55em) { + + body.no-sidebar { + #buddypress { + + #item-header, + #item-body { + background: $content-background; + } + + #object-nav { + border-right: 1px solid $border-med; + float: left; + margin-right: -1px; + width: 200px; + + ul { + background: none; + 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); + + ul {margin-top: 0;} + } + } + + } // close #buddypress + } // close body:not(.sidebar) +} // close @media + + +// Tabbed Nav styling +// Primarilly used for group create screens & ? directory nav. + +@media screen and (min-width: 46.25em) { + #main { + #buddypress { + + #group-create-tabs.item-list-tabs { + + ul:before, + ul:after { + content: " "; + display: table; + } + + ul:after { + clear: both; + } + + ul { + background: none; + border: 0; + border-bottom: 1px solid $border-med; + overflow: visible; + padding-bottom: 0; + + li { + float: left; + width: auto; + } + + li.selected, + li.current { + border: 1px solid $border-med; + border-bottom-color: $content-background; + @include border-top-radius(4px); + margin-bottom: -1px; + + a { + background: none; + color: $body-text; + outline: none; + } + } + } + + } // close .item-list-tabs + + #subnav { + ul { + border-bottom: 0; + } + + } // close #subnav + } // close #buddypress + } +} // close @media + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ + +#buddypress { + + div.pagination { + box-shadow: none; + min-height: 0; + + &:before, + &:after { + height: 0; + width: 0; + } + + .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 2016 font-family +#buddypress { + .item-list { + .activity-header, + .activity-meta { + @include default-font-sans(); + } + } +} + +#buddypress { + .activity-meta { + .button { + &:focus, + &:hover { + background: inherit; + color: #000; + } + } + } + + .action { + .generic-button { + a { + &:focus, + &:hover { + background: inherit; + color: #000; + } + } + } + } +} // close #buddypress + +// 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 2016 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; + margin-bottom: $spacing-val-sm; + + // Quite early on we need to move avatars to the left(right) + @include small-up { + display: block; + float: left; + } + } + } + + .item { + overflow: hidden; + + @media screen and (min-width: 46.25em) { + margin-left: 15%; + } + + span.activity { + font-style: italic; + } + + .item-desc { + margin-left: 0; + width: 94%; + } + + .item-title { + @include font-size(18); + line-height: 1.2; + text-align: center; + + @include small-up { + text-align: left; + } + + width: 100%; + + .update { + display: block; + @include font-size(12); + + @include medium-up { + @include font-size(14); + } + + padding: $spacing-val-sm 0; + text-align: left; + } + } + + } + + @include medium-up { + .item-avatar, + .item, + .action { + float: left; + } + + .item { + left: 5%; + margin-left: 0; + position: relative; + width: 55%; + + .item-title { + @include font-size(22) + } + } + + }// close medium-up + + 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 + + @include medium-up { + 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 + + @include medium-up { + // 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; + } + + // corrective measure for clipped elements due to JS inline styling + + @media screen and (max-width: 46.25em) { + #whats-new-content { + clear: left; + margin: $spacing-val-sm 0 $spacing-val-md; + padding: $spacing-val-sm 0 0; + } + } + + #whats-new-content.active { + #whats-new-options[style] { + #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; + 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-content.active + + } // 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(14); + } + } + } + + .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); + margin-top: 0; + 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-bottom: $spacing-val-xs; + + @media screen and (min-width: 38.75em) { + display: inline-block; + margin-bottom: 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 { + #activity-stream { + + li.activity-item { + padding: $spacing-val-md; + } + + 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 { + border-left: 1px solid $border-light; + margin-top: 5px; + + ul { + background: rgba($light-background, 0.6); + margin: 15px 0 0 2px; + } + + .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 { + + @include medium-up { + li { + .item-avatar, + .item { + float: left; + } + + .action { + float: right; + } + } + } + + } // close #members-list +} //close #BuddyPress + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ + +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ + +#buddypress { + #signup_form.standard-form { + + #profile-details-section, + #basic-details-section, + #blog-details-section { + float: none; + width: 100%; + + @media screen and (min-width: 38.75em) { + width: 48%; + } + } + + @media screen and (min-width: 38.75em) { + #profile-details-section {float: right;} + #basic-details-section {float: left;} + } + + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ + + +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ + +.bp-user, +.single-item.groups { + #buddypress { + #item-header-content { + #item-meta { + @include font-size(14); + text-align: left; + + p {margin-bottom: 0.5em;} + } + } + } + + @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; + + h3 { + border-bottom: 1px solid $border-light; + text-align: center; + } + } + } + } // close @media + + div#item-header { + padding-bottom: $spacing-val-lg; + + div#item-actions { + margin: 0; + width: 100%; + + @media screen and (min-width: 38.75em) { + border-left: 1px solid $border-light; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } // close @media + + @media screen and (min-width: 46.25em) { + width: 40%; + } + + ul { + margin-top: 0; + padding-left: 0; + } + + 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%; + + a { + float: left; + } + } + + #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 +*----------------------------------------------------------- +*/ + +/** +*---------------------------------------------------- +* @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; + } + } +} + +.groups.edit-details { + #group-settings-form { + + label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; + } + + textarea + p label { + background: none; + color: inherit; + @include font-size(14); + width: auto; + } + + textarea { + height: auto; + min-height: 100px; + overflow: auto; + } + } +} // close .groups.edit-details + +.groups.group-settings { + #group-settings-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 +*----------------------------------------- +*/ + +// 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.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)} + + @include medium-up { + th {@include font-size(16)} + td {@include font-size(14)} + } + + @include large-up { + th {@include font-size(18)} + td {@include font-size(16)} + } + } + + .pag-count {font-style: italic;} + + .notifications-options-nav { + border: 1px solid rgba($border-color, 0.5); + float: left; + width: 100%; + + @media screen and (min-width: 38.75em) { + width: 300px; + } + + select, + input { + border: 0; + @include font-size(14); + outline: 0; + padding: 0; + } + + select { + float: left; + margin-right: 0; + width: 60%; + } + + input { + float: right; + font-family: inherit; + line-height: 20px; + width: 40%; + } + + } // 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 */ + + #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: $medium-background; + 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.thread-star { + vertical-align: middle; + + .message-action-star { + line-height: 1.2; + } + } + + td.bulk-select-check, + td.thread-from { + height: 3em; + + @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: " \2016 \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-color: $border-color; + } + } + + 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; + } + } + + .acfb-holder { + list-style: none; + + li {margin-left: 0;} + + li.friend-tab { + background: lighten($notice-info, 20%); + border: inherit; + margin-right: 0; + padding: 0.5em; + + span.p { + // the 'X' close + padding-left: $spacing-val-sm; + + &:focus, + &:hover { + color: $link-action; + cursor: pointer; + } + } + + a { + border-bottom: 0; + text-decoration: none; + + img { + // this is the tiny user avatar + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; // override inline style + } + } + } + } + + #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:nth-child(2) { + strong { + margin: -8px -8px 8px; + } + } + + 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; + } + } + } + + } // #buddypress + + // acfb auto complete name list sits in doc footer before body close + .ac_results { + background: #eee; + padding-left: $spacing-val-sm; + + ul { margin: 0; } + + li { + margin: $spacing-val-sm 0; + + &:focus, + &:hover { + cursor: pointer; + } + } + } + +} // 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 { + 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: 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 +*------------------------------------------------------------------------------- +*/ + +// Attempt to reset form control widths +#main { + #buddypress { + .standard-form { + + li {float: none;} + input[type='text'], + input[type='email'], + input[type='password'], + textarea { + width: 100%; + } + } + } +} + + +#buddypress { + + // Match BP form elements to Themes(2016) styling where styles + // are not inherited or being overriden. + div.activity-comments { + + form { + .ac-textarea { + background: $light-background; + border: 1px solid rgba($border-color, 0.5); + + textarea { + background: none; + border: 0; + } + } + } + } + + .standard-form { + + // Keep BP form element borders to 1px rather than 2013 2px + input[type="text"], + input[type="email"], + input[type="password"], + button, + select, + textarea { + border-color: rgba($border-color, 0.5); + border-width: 1px; + } + + } // close .standard-form + + #signup_form.standard-form { + div.submit { + float: none; + + input {margin-right: 0;} + } + } + +} // close #buddypress + +#buddypress { + 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 & 2016 + + form { // *sigh* only to bludgeon over specified rules + border: 1px solid rgba($border-color, 0.6); + overflow: hidden; + + label { + float: left; + width: 70%; + } + + input[type='text'] { + float: left; + margin: 0; + width: 100%; + } + + 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.6); + 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: 30%; + } + } // 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 + + + @include large-up { + + .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 { + 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 +// 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 { + + .acfb-holder { + + li.friend-tab { + background: $notice-info; + border: inherit; + } + } +} diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..006b3d18d0ba84e38fbbdba810311a5d1cd2cae5 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.css @@ -0,0 +1,1965 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentythirteen 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, Register, activation +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 div.clear { + display: none; +} + +@media (max-width: 999px) { + .buddypress #content { + padding: 0 20px; + } +} + +@media (max-width: 643px) { + .buddypress #content { + padding: 0; + } +} + +.buddypress .entry-header, +.buddypress .entry-content, +.buddypress .entry-summary, +.buddypress .entry-meta { + max-width: 890px; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul { + background-color: #f7f5e7; + border-bottom: 1px solid rgba(234, 234, 234, 0.9); + border-top: 1px solid rgba(234, 234, 234, 0.9); + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 38.75em) { + .bp-user #buddypress #object-nav { + background: #f7f5e7; + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus & small screen __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:focus, #buddypress #object-nav ul li:hover { + background: #f4f2df; + } +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +#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; + margin-top: 5px; + 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: 0.875rem; +} + +#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: none; + opacity: 1; +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 55em) { + body:not(.sidebar) #buddypress #item-header, + body:not(.sidebar) #buddypress #item-body { + background: #fff; + } + body:not(.sidebar) #buddypress #object-nav { + border-left: 1px solid #ddd; + float: right; + margin-left: -1px; + width: 200px; + } + body:not(.sidebar) #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body:not(.sidebar) #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body:not(.sidebar) #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: left; + margin-left: 2px; + } + body:not(.sidebar) #buddypress #item-body { + border-right: 1px solid #ddd; + overflow: hidden; + padding: 0 20px 0 0; + width: auto; + } + body:not(.sidebar) #buddypress #item-body #subnav { + margin: 0 -20px 0 0; + } + body:not(.sidebar) #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: right; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 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: "Source Sans Pro", Helvetica, sans-serif; +} + +#buddypress .activity-meta .button:focus, #buddypress .activity-meta .button:hover { + background: #e37a5a; + color: #f7f5e7; +} + +#buddypress .action .generic-button a:focus, #buddypress .action .generic-button a:hover { + background: #e37a5a; + color: #f7f5e7; +} + +#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 { + overflow: hidden; +} + +@media screen and (min-width: 46.25em) { + #buddypress ul.item-list li .item { + margin-right: 15%; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin: 0 auto; + width: 100%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.125rem; + line-height: 1.2; + margin: 0 auto; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress ul.item-list li .item .item-title { + text-align: right; + } +} + +#buddypress ul.item-list li .item .item-title .update { + font-size: 12px; + font-size: 0.75rem; + display: block; + padding: 10px 0; + text-align: right; +} + +@media screen and (min-width: 59.6875em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 0.875rem; + } +} + +@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: 5%; + margin-right: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 22px; + font-size: 1.375rem; + } +} + +#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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: right; + margin: 10px 0 20px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: right; + line-height: 1.5em; + margin-top: 12px; + padding-right: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: left; + margin: 0; + min-height: 1.5em; + padding-right: 0.4em; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #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: 0.875rem; +} + +@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: 1rem; + } +} + +#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: 14px; + font-size: 0.875rem; +} + +#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); + margin-top: 0; + 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-bottom: 5px; +} + +@media screen and (min-width: 38.75em) { + #buddypress #activity-stream .activity-content .activity-meta a { + display: inline-block; + margin-bottom: 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 #activity-stream li.activity-item { + padding: 20px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1rem; + margin-bottom: 40px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.25rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 20px; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + border-right: 1px solid #eaeaea; + margin-top: 5px; +} + +#buddypress #activity-stream .activity-comments ul { + background: rgba(247, 247, 247, 0.6); + margin: 15px 2px 0 0; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 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-stream .activity-comments .ac-form .ac-reply-cancel { + border: 1px solid rgba(212, 208, 186, 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 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: left; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: right; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user .entry-header, +.single-item.groups .entry-header { + margin-bottom: 0; +} + +.bp-user .entry-header .entry-title, +.single-item.groups .entry-header .entry-title { + color: #8c8c7f; + font-size: 32px; + font-size: 2rem; + margin-bottom: 10px; + text-align: center; +} + +@media screen and (min-width: 46.25em) { + .bp-user .entry-header .entry-title, + .single-item.groups .entry-header .entry-title { + text-align: right; + } +} + +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 0.875rem; + text-align: right; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.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 { + border-right: 1px solid #eaeaea; + clear: none; + float: left; + padding-right: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-right: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + 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: 1rem; + } +} + +@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 { + clear: both; + float: left; + width: 28%; + } + .single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + } +} + +.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + border: 0; + float: none; + width: auto; +} + +@media screen and (max-width: 46.25em) { + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + clear: both !important; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content { + padding-right: 10px; + } + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content #item-buttons { + margin-top: 0; + } + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + border-right: 1px solid #eaeaea; + clear: none; + float: left; + margin-top: 230px !important; + padding-top: 0 !important; + width: 20%; + } +} + +/** +*----------------------------------------------------- +* @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; +} + +.bp-user #buddypress #item-header #item-header-content .user-nicename, +.bp-user #buddypress #item-header #item-header-content span.activity { + display: block; + text-align: center; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header #item-header-avatar { + float: right; + width: auto; + } + .bp-user #buddypress #item-header #item-header-avatar a { + float: right; + } + .bp-user #buddypress #item-header #item-header-content { + float: none; + overflow: hidden; + } + .bp-user #buddypress #item-header #item-header-content .user-nicename, + .bp-user #buddypress #item-header #item-header-content span.activity { + text-align: right; + } + .bp-user #buddypress #item-header #item-header-content #item-meta { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header-cover-image #item-header-content .user-nicename { + margin-bottom: 20px; + } + .bp-user #buddypress #item-header-cover-image #item-header-content #item-buttons { + margin: 0; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 0.875rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 0.875rem; +} + +.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 +*----------------------------------------- +*/ +.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 +*----------------------------------------- +*/ +#buddypress div.invite .left-menu { + float: none; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite .left-menu { + float: right; + } +} + +#buddypress div.invite #invite-list { + border: 1px solid #eaeaea; + height: auto; + min-height: 3.125em; + padding: 0 0.3em 0.5em; + width: auto; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite #invite-list { + width: 220px; + } +} + +#buddypress div.invite #invite-list ul { + padding-right: 0; +} + +#buddypress div.invite .main-column { + margin-right: 0; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite .main-column { + margin-right: 235px; + } +} + +/** +*----------------------------------------------------- +* @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: 0.875rem; +} + +.bp-user #buddypress table td { + font-size: 13px; + font-size: 0.8125rem; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 77.5em) { + .bp-user #buddypress table th { + font-size: 18px; + font-size: 1.125rem; + } + .bp-user #buddypress table td { + font-size: 16px; + font-size: 1rem; + } +} + +.bp-user #buddypress .pag-count { + font-style: italic; +} + +.bp-user #buddypress .notifications-options-nav { + border: 1px solid rgba(212, 208, 186, 0.5); + float: right; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + .bp-user #buddypress .notifications-options-nav { + width: 300px; + } +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .notifications-options-nav input { + border: 0; + font-size: 14px; + font-size: 0.875rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select { + float: right; + margin-left: 0; + width: 60%; +} + +.bp-user #buddypress .notifications-options-nav input { + float: left; + font-family: inherit; + line-height: 20px; + width: 40%; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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; + padding: 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.125rem; +} + +.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: 0.875rem; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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: #6f6f6f; +} + +.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: #ccc; + 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.thread-star span.icon:before, + .bp-user #buddypress #message-threads tr td.thread-options span.icon:before { + font-size: 14px; + } +} + +.bp-user #buddypress #message-threads tr .thread-checkbox { + padding: 0 0.3em 0 0; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@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: 0.75rem; +} + +.bp-user #buddypress #message-threads tr td.thread-info .thread-excerpt { + font-size: 14px; + font-size: 0.875rem; +} + +.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: 0.75rem; + 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: 12px; + font-size: 0.75rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + background: #dce5ff; + border-color: #d4d0ba; +} + +.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 { + list-style: none; + margin: 0; + padding: 0; +} + +.bp-user #buddypress .acfb-holder li { + margin-right: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-left: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-right: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress .sitewide-notices tr td:first-child { + display: none; +} + +.bp-user #buddypress .sitewide-notices td strong { + background: #6f6f6f; + color: #fff; + display: block; + padding-right: 0.2em; +} + +.bp-user .ac_results { + background: #eee; + padding-right: 10px; +} + +.bp-user .ac_results ul { + list-style: none; + margin: 0; + padding: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form { + padding: 0 10px; +} + +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.25rem; + margin: 20px 0 10px; +} + +.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 +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-left: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: right; + width: 60%; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.dir-search form label, + #buddypress div.message-search form label, + #buddypress li.groups-members-search form label { + 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: 100%; +} + +#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: 0.875rem; + 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(212, 208, 186, 0.6); + 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: 40%; +} + +@media screen and (min-width: 46.25em) { + #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'] { + 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: 1rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +#buddypress table { + font-size: 14px; + font-size: 0.875rem; + margin: 20px 0; +} + +#buddypress table tr th { + background: #6f6f6f; + border-color: #b7b7b7; + color: #fff; +} + +#buddypress table th, +#buddypress table td { + padding: 0.3em; +} + +#buddypress table p { + margin-bottom: 0.5em; +} + +@media screen and (min-width: 55em) { + #buddypress table { + font-size: 16px; + font-size: 1rem; + } +} + +/*__ 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 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 +*------------------------------------------------------------------------------- +*/ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..e3bcdb13993ac2929c1e0fcf7ae22bf445bc5569 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen-rtl.min.css @@ -0,0 +1 @@ +@charset "UTF-8";#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 div.clear{display:none}@media (max-width:999px){.buddypress #content{padding:0 20px}}@media (max-width:643px){.buddypress #content{padding:0}}.buddypress .entry-content,.buddypress .entry-header,.buddypress .entry-meta,.buddypress .entry-summary{max-width:890px}#buddypress div.item-list-tabs ul{background-color:#f7f5e7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:38.75em){.bp-user #buddypress #object-nav{background:#f7f5e7;border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}#buddypress #object-nav ul li:focus,#buddypress #object-nav ul li:hover{background:#f4f2df}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}@media screen and (max-width:38.75em){#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}}#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;margin-top:5px;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:.875rem}@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:0 0;opacity:1}@media screen and (min-width:55em){body:not(.sidebar) #buddypress #item-body,body:not(.sidebar) #buddypress #item-header{background:#fff}body:not(.sidebar) #buddypress #object-nav{border-left:1px solid #ddd;float:right;margin-left:-1px;width:200px}body:not(.sidebar) #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body:not(.sidebar) #buddypress #object-nav ul li{float:none;overflow:hidden}body:not(.sidebar) #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:left;margin-left:2px}body:not(.sidebar) #buddypress #item-body{border-right:1px solid #ddd;overflow:hidden;padding:0 20px 0 0;width:auto}body:not(.sidebar) #buddypress #item-body #subnav{margin:0 -20px 0 0}body:not(.sidebar) #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:right;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom: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 .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#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:"Source Sans Pro",Helvetica,sans-serif}#buddypress .action .generic-button a:focus,#buddypress .action .generic-button a:hover,#buddypress .activity-meta .button:focus,#buddypress .activity-meta .button:hover{background:#e37a5a;color:#f7f5e7}#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{overflow:hidden}@media screen and (min-width:46.25em){#buddypress ul.item-list li .item{margin-right:15%}}#buddypress ul.item-list li .item .item-desc{margin:0 auto;width:100%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.125rem;line-height:1.2;margin:0 auto;text-align:center;width:100%}#buddypress ul.item-list li .item .item-title .update{font-size:12px;font-size:.75rem;display:block;padding:10px 0;text-align:right}@media screen and (min-width:59.6875em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:.875rem}#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:5%;margin-right:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:22px;font-size:1.375rem}}#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 .item .item-title{text-align:right}#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:right;margin:10px 0 20px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:right;line-height:1.5em;margin-top:12px;padding-right:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:left;margin:0;min-height:1.5em;padding-right:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #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:.875rem}@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:1rem}}#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:14px;font-size:.875rem}#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);margin-top:0;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-bottom:5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.25rem}}#buddypress #activity-stream .activity-comments{border-right:1px solid #eaeaea;margin-top:5px}#buddypress #activity-stream .activity-comments ul{background:rgba(247,247,247,.6);margin:15px 2px 0 0}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.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-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(212,208,186,.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}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:38.75em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:left}#buddypress #signup_form.standard-form #basic-details-section{float:right}}.bp-user .entry-header,.single-item.groups .entry-header{margin-bottom:0}.bp-user .entry-header .entry-title,.single-item.groups .entry-header .entry-title{color:#8c8c7f;font-size:32px;font-size:2rem;margin-bottom:10px;text-align:center}@media screen and (min-width:46.25em){.bp-user .entry-header .entry-title,.single-item.groups .entry-header .entry-title{text-align:right}}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:.875rem;text-align:right}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@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%}.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{border-right:1px solid #eaeaea;clear:none;float:left;padding-right:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-right:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem;padding:.2em}@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{clear:both;float:left;width:28%}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem}}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{border:0;float:none;width:auto}@media screen and (max-width:46.25em){.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{clear:both!important}}@media screen and (min-width:46.25em){.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content{padding-right:10px}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content #item-buttons{margin-top:0}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{border-right:1px solid #eaeaea;clear:none;float:left;margin-top:230px!important;padding-top:0!important;width:20%}}.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}.bp-user #buddypress #item-header #item-header-content .user-nicename,.bp-user #buddypress #item-header #item-header-content span.activity{display:block;text-align:center}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar{float:right;width:auto}.bp-user #buddypress #item-header #item-header-avatar a{float:right}.bp-user #buddypress #item-header #item-header-content{float:none;overflow:hidden}.bp-user #buddypress #item-header #item-header-content .user-nicename,.bp-user #buddypress #item-header #item-header-content span.activity{text-align:right}.bp-user #buddypress #item-header #item-header-content #item-meta{margin-top:0}.bp-user #buddypress #item-header-cover-image #item-header-content .user-nicename{margin-bottom:20px}.bp-user #buddypress #item-header-cover-image #item-header-content #item-buttons{margin:0}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:.875rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:.875rem}.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 h5,.groups.manage-members #group-settings-form .item-list li img{float:right}.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 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}.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%}}#buddypress div.invite .left-menu{float:none}#buddypress div.invite #invite-list{border:1px solid #eaeaea;height:auto;min-height:3.125em;padding:0 .3em .5em;width:auto}#buddypress div.invite #invite-list ul{padding-right:0}#buddypress div.invite .main-column{margin-right:0}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:.875rem}.bp-user #buddypress table td{font-size:13px;font-size:.8125rem}@media screen and (min-width:46.25em){#buddypress div.invite .left-menu{float:right}#buddypress div.invite #invite-list{width:220px}#buddypress div.invite .main-column{margin-right:235px}.bp-user #buddypress table th{font-size:16px;font-size:1rem}.bp-user #buddypress table td{font-size:14px;font-size:.875rem}}@media screen and (min-width:77.5em){.bp-user #buddypress table th{font-size:18px;font-size:1.125rem}.bp-user #buddypress table td{font-size:16px;font-size:1rem}}.bp-user #buddypress .notifications-options-nav{border:1px solid rgba(212,208,186,.5);float:right;width:100%}@media screen and (min-width:38.75em){.bp-user #buddypress .notifications-options-nav{width:300px}}.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{border:0;font-size:14px;font-size:.875rem;outline:0;padding:0}.bp-user #buddypress .notifications-options-nav select{float:right;margin-left:0;width:60%}.bp-user #buddypress .notifications-options-nav input{float:left;font-family:inherit;line-height:20px;width:40%}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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;padding: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.125rem}.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:.875rem}.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:#6f6f6f;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:#6f6f6f}.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:#ccc;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-options span.icon:before,.bp-user #buddypress #message-threads tr td.thread-star span.icon:before{font-size:14px}}.bp-user #buddypress #message-threads tr .thread-checkbox{padding:0 .3em 0 0}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.75rem}.bp-user #buddypress #message-threads tr td.thread-info .thread-excerpt{font-size:14px;font-size:.875rem}.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:.75rem;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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@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:12px;font-size:.75rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d4d0ba}.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{list-style:none;margin:0;padding:0}.bp-user #buddypress .acfb-holder li{margin-right:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-left:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-right:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress .sitewide-notices tr td:first-child{display:none}.bp-user #buddypress .sitewide-notices td strong{background:#6f6f6f;color:#fff;display:block;padding-right:.2em}.bp-user .ac_results{background:#eee;padding-right:10px}.bp-user .ac_results ul{list-style:none;margin:0;padding:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user #buddypress #settings-form{padding:0 10px}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.25rem;margin:20px 0 10px}.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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-left:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:right;width:60%}@media screen and (min-width:46.25em){#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{width:80%}}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:.875rem;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:100%;border-left:1px solid rgba(212,208,186,.6);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:40%}@media screen and (min-width:46.25em){#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]{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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:77.5em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1rem}}#buddypress table{font-size:14px;font-size:.875rem;margin:20px 0}#buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff}#buddypress table td,#buddypress table th{padding:.3em}#buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1rem}}#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 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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.css new file mode 100644 index 0000000000000000000000000000000000000000..c556d1b699e9e7031a692061d998c86d0712e2b4 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.css @@ -0,0 +1,1965 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentythirteen 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, Register, activation +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 div.clear { + display: none; +} + +@media (max-width: 999px) { + .buddypress #content { + padding: 0 20px; + } +} + +@media (max-width: 643px) { + .buddypress #content { + padding: 0; + } +} + +.buddypress .entry-header, +.buddypress .entry-content, +.buddypress .entry-summary, +.buddypress .entry-meta { + max-width: 890px; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul { + background-color: #f7f5e7; + border-bottom: 1px solid rgba(234, 234, 234, 0.9); + border-top: 1px solid rgba(234, 234, 234, 0.9); + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 38.75em) { + .bp-user #buddypress #object-nav { + background: #f7f5e7; + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus & small screen __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:focus, #buddypress #object-nav ul li:hover { + background: #f4f2df; + } +} + +@media screen and (max-width: 38.75em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +#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; + margin-top: 5px; + 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: 0.875rem; +} + +#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: none; + opacity: 1; +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 55em) { + body:not(.sidebar) #buddypress #item-header, + body:not(.sidebar) #buddypress #item-body { + background: #fff; + } + body:not(.sidebar) #buddypress #object-nav { + border-right: 1px solid #ddd; + float: left; + margin-right: -1px; + width: 200px; + } + body:not(.sidebar) #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body:not(.sidebar) #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body:not(.sidebar) #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: right; + margin-right: 2px; + } + body:not(.sidebar) #buddypress #item-body { + border-left: 1px solid #ddd; + overflow: hidden; + padding: 0 0 0 20px; + width: auto; + } + body:not(.sidebar) #buddypress #item-body #subnav { + margin: 0 0 0 -20px; + } + body:not(.sidebar) #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: left; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 0; + } +} + +/** +*---------------------------------------------------------- +* @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: "Source Sans Pro", Helvetica, sans-serif; +} + +#buddypress .activity-meta .button:focus, #buddypress .activity-meta .button:hover { + background: #e37a5a; + color: #f7f5e7; +} + +#buddypress .action .generic-button a:focus, #buddypress .action .generic-button a:hover { + background: #e37a5a; + color: #f7f5e7; +} + +#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 { + overflow: hidden; +} + +@media screen and (min-width: 46.25em) { + #buddypress ul.item-list li .item { + margin-left: 15%; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin: 0 auto; + width: 100%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.125rem; + line-height: 1.2; + margin: 0 auto; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress ul.item-list li .item .item-title { + text-align: left; + } +} + +#buddypress ul.item-list li .item .item-title .update { + font-size: 12px; + font-size: 0.75rem; + display: block; + padding: 10px 0; + text-align: left; +} + +@media screen and (min-width: 59.6875em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 0.875rem; + } +} + +@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: 5%; + margin-left: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 22px; + font-size: 1.375rem; + } +} + +#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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: left; + margin: 10px 0 20px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: left; + line-height: 1.5em; + margin-top: 12px; + padding-left: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: right; + margin: 0; + min-height: 1.5em; + padding-left: 0.4em; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #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: 0.875rem; +} + +@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: 1rem; + } +} + +#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: 14px; + font-size: 0.875rem; +} + +#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); + margin-top: 0; + 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-bottom: 5px; +} + +@media screen and (min-width: 38.75em) { + #buddypress #activity-stream .activity-content .activity-meta a { + display: inline-block; + margin-bottom: 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 #activity-stream li.activity-item { + padding: 20px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1rem; + margin-bottom: 40px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.25rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 20px; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + border-left: 1px solid #eaeaea; + margin-top: 5px; +} + +#buddypress #activity-stream .activity-comments ul { + background: rgba(247, 247, 247, 0.6); + margin: 15px 0 0 2px; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 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-stream .activity-comments .ac-form .ac-reply-cancel { + border: 1px solid rgba(212, 208, 186, 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 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 38.75em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: right; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: left; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user .entry-header, +.single-item.groups .entry-header { + margin-bottom: 0; +} + +.bp-user .entry-header .entry-title, +.single-item.groups .entry-header .entry-title { + color: #8c8c7f; + font-size: 32px; + font-size: 2rem; + margin-bottom: 10px; + text-align: center; +} + +@media screen and (min-width: 46.25em) { + .bp-user .entry-header .entry-title, + .single-item.groups .entry-header .entry-title { + text-align: left; + } +} + +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 0.875rem; + text-align: left; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.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 { + border-left: 1px solid #eaeaea; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-left: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + 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: 1rem; + } +} + +@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 { + clear: both; + float: right; + width: 28%; + } + .single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 0.875rem; + } +} + +.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + border: 0; + float: none; + width: auto; +} + +@media screen and (max-width: 46.25em) { + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + clear: both !important; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content { + padding-left: 10px; + } + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content #item-buttons { + margin-top: 0; + } + .single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions { + border-left: 1px solid #eaeaea; + clear: none; + float: right; + margin-top: 230px !important; + padding-top: 0 !important; + width: 20%; + } +} + +/** +*----------------------------------------------------- +* @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; +} + +.bp-user #buddypress #item-header #item-header-content .user-nicename, +.bp-user #buddypress #item-header #item-header-content span.activity { + display: block; + text-align: center; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header #item-header-avatar { + float: left; + width: auto; + } + .bp-user #buddypress #item-header #item-header-avatar a { + float: left; + } + .bp-user #buddypress #item-header #item-header-content { + float: none; + overflow: hidden; + } + .bp-user #buddypress #item-header #item-header-content .user-nicename, + .bp-user #buddypress #item-header #item-header-content span.activity { + text-align: left; + } + .bp-user #buddypress #item-header #item-header-content #item-meta { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header-cover-image #item-header-content .user-nicename { + margin-bottom: 20px; + } + .bp-user #buddypress #item-header-cover-image #item-header-content #item-buttons { + margin: 0; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 0.875rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 0.875rem; +} + +.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 +*----------------------------------------- +*/ +.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 +*----------------------------------------- +*/ +#buddypress div.invite .left-menu { + float: none; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite .left-menu { + float: left; + } +} + +#buddypress div.invite #invite-list { + border: 1px solid #eaeaea; + height: auto; + min-height: 3.125em; + padding: 0 0.3em 0.5em; + width: auto; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite #invite-list { + width: 220px; + } +} + +#buddypress div.invite #invite-list ul { + padding-left: 0; +} + +#buddypress div.invite .main-column { + margin-left: 0; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.invite .main-column { + margin-left: 235px; + } +} + +/** +*----------------------------------------------------- +* @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: 0.875rem; +} + +.bp-user #buddypress table td { + font-size: 13px; + font-size: 0.8125rem; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 0.875rem; + } +} + +@media screen and (min-width: 77.5em) { + .bp-user #buddypress table th { + font-size: 18px; + font-size: 1.125rem; + } + .bp-user #buddypress table td { + font-size: 16px; + font-size: 1rem; + } +} + +.bp-user #buddypress .pag-count { + font-style: italic; +} + +.bp-user #buddypress .notifications-options-nav { + border: 1px solid rgba(212, 208, 186, 0.5); + float: left; + width: 100%; +} + +@media screen and (min-width: 38.75em) { + .bp-user #buddypress .notifications-options-nav { + width: 300px; + } +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .notifications-options-nav input { + border: 0; + font-size: 14px; + font-size: 0.875rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select { + float: left; + margin-right: 0; + width: 60%; +} + +.bp-user #buddypress .notifications-options-nav input { + float: right; + font-family: inherit; + line-height: 20px; + width: 40%; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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; + padding: 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.125rem; +} + +.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: 0.875rem; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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: #6f6f6f; +} + +.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: #ccc; + 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.thread-star span.icon:before, + .bp-user #buddypress #message-threads tr td.thread-options span.icon:before { + font-size: 14px; + } +} + +.bp-user #buddypress #message-threads tr .thread-checkbox { + padding: 0 0 0 0.3em; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@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: 0.75rem; +} + +.bp-user #buddypress #message-threads tr td.thread-info .thread-excerpt { + font-size: 14px; + font-size: 0.875rem; +} + +.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: 0.75rem; + 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: 12px; + font-size: 0.75rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + background: #dce5ff; + border-color: #d4d0ba; +} + +.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 { + list-style: none; + margin: 0; + padding: 0; +} + +.bp-user #buddypress .acfb-holder li { + margin-left: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-right: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-left: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress .sitewide-notices tr td:first-child { + display: none; +} + +.bp-user #buddypress .sitewide-notices td strong { + background: #6f6f6f; + color: #fff; + display: block; + padding-left: 0.2em; +} + +.bp-user .ac_results { + background: #eee; + padding-left: 10px; +} + +.bp-user .ac_results ul { + list-style: none; + margin: 0; + padding: 0; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form { + padding: 0 10px; +} + +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.25rem; + margin: 20px 0 10px; +} + +.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 +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-right: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: left; + width: 60%; +} + +@media screen and (min-width: 46.25em) { + #buddypress div.dir-search form label, + #buddypress div.message-search form label, + #buddypress li.groups-members-search form label { + 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: 100%; +} + +#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: 0.875rem; + 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(212, 208, 186, 0.6); + 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: 40%; +} + +@media screen and (min-width: 46.25em) { + #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'] { + 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: 1rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +#buddypress table { + font-size: 14px; + font-size: 0.875rem; + margin: 20px 0; +} + +#buddypress table tr th { + background: #6f6f6f; + border-color: #b7b7b7; + color: #fff; +} + +#buddypress table th, +#buddypress table td { + padding: 0.3em; +} + +#buddypress table p { + margin-bottom: 0.5em; +} + +@media screen and (min-width: 55em) { + #buddypress table { + font-size: 16px; + font-size: 1rem; + } +} + +/*__ 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 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 +*------------------------------------------------------------------------------- +*/ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.min.css new file mode 100644 index 0000000000000000000000000000000000000000..0bfb4b6859eb40a5dc94fc0ef9c86b69f4e866be --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.min.css @@ -0,0 +1 @@ +@charset "UTF-8";#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 div.clear{display:none}@media (max-width:999px){.buddypress #content{padding:0 20px}}@media (max-width:643px){.buddypress #content{padding:0}}.buddypress .entry-content,.buddypress .entry-header,.buddypress .entry-meta,.buddypress .entry-summary{max-width:890px}#buddypress div.item-list-tabs ul{background-color:#f7f5e7;border-bottom:1px solid rgba(234,234,234,.9);border-top:1px solid rgba(234,234,234,.9);overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:38.75em){.bp-user #buddypress #object-nav{background:#f7f5e7;border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}#buddypress #object-nav ul li:focus,#buddypress #object-nav ul li:hover{background:#f4f2df}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}@media screen and (max-width:38.75em){#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}}#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;margin-top:5px;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:.875rem}@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:0 0;opacity:1}@media screen and (min-width:55em){body:not(.sidebar) #buddypress #item-body,body:not(.sidebar) #buddypress #item-header{background:#fff}body:not(.sidebar) #buddypress #object-nav{border-right:1px solid #ddd;float:left;margin-right:-1px;width:200px}body:not(.sidebar) #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body:not(.sidebar) #buddypress #object-nav ul li{float:none;overflow:hidden}body:not(.sidebar) #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:right;margin-right:2px}body:not(.sidebar) #buddypress #item-body{border-left:1px solid #ddd;overflow:hidden;padding:0 0 0 20px;width:auto}body:not(.sidebar) #buddypress #item-body #subnav{margin:0 0 0 -20px}body:not(.sidebar) #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:left;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom:0}}#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 .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#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:"Source Sans Pro",Helvetica,sans-serif}#buddypress .action .generic-button a:focus,#buddypress .action .generic-button a:hover,#buddypress .activity-meta .button:focus,#buddypress .activity-meta .button:hover{background:#e37a5a;color:#f7f5e7}#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{overflow:hidden}@media screen and (min-width:46.25em){#buddypress ul.item-list li .item{margin-left:15%}}#buddypress ul.item-list li .item .item-desc{margin:0 auto;width:100%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.125rem;line-height:1.2;margin:0 auto;text-align:center;width:100%}#buddypress ul.item-list li .item .item-title .update{font-size:12px;font-size:.75rem;display:block;padding:10px 0;text-align:left}@media screen and (min-width:59.6875em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:.875rem}#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:5%;margin-left:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:22px;font-size:1.375rem}}#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 .item .item-title{text-align:left}#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:left;margin:10px 0 20px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:left;line-height:1.5em;margin-top:12px;padding-left:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:right;margin:0;min-height:1.5em;padding-left:.4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #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:.875rem}@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:1rem}}#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:14px;font-size:.875rem}#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);margin-top:0;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-bottom:5px}@media screen and (min-width:38.75em){#buddypress #activity-stream .activity-content .activity-meta a{display:inline-block;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:20px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1rem;margin-bottom:40px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.25rem}}#buddypress #activity-stream .activity-comments{border-left:1px solid #eaeaea;margin-top:5px}#buddypress #activity-stream .activity-comments ul{background:rgba(247,247,247,.6);margin:15px 0 0 2px}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.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-stream .activity-comments .ac-form .ac-reply-cancel{border:1px solid rgba(212,208,186,.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}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:38.75em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:right}#buddypress #signup_form.standard-form #basic-details-section{float:left}}.bp-user .entry-header,.single-item.groups .entry-header{margin-bottom:0}.bp-user .entry-header .entry-title,.single-item.groups .entry-header .entry-title{color:#8c8c7f;font-size:32px;font-size:2rem;margin-bottom:10px;text-align:center}@media screen and (min-width:46.25em){.bp-user .entry-header .entry-title,.single-item.groups .entry-header .entry-title{text-align:left}}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:.875rem;text-align:left}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@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%}.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}@media screen and (max-width:46.25em){.single-item.groups #buddypress #item-header #item-meta{margin-bottom:20px}}.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{border-left:1px solid #eaeaea;clear:none;float:right;padding-left:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-left:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem;padding:.2em}@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{clear:both;float:right;width:28%}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:.875rem}}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{border:0;float:none;width:auto}@media screen and (max-width:46.25em){.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{clear:both!important}}@media screen and (min-width:46.25em){.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content{padding-left:10px}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-header-content #item-buttons{margin-top:0}.single-item.groups #buddypress div#item-header #item-header-cover-image #item-actions{border-left:1px solid #eaeaea;clear:none;float:right;margin-top:230px!important;padding-top:0!important;width:20%}}.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}.bp-user #buddypress #item-header #item-header-content .user-nicename,.bp-user #buddypress #item-header #item-header-content span.activity{display:block;text-align:center}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar{float:left;width:auto}.bp-user #buddypress #item-header #item-header-avatar a{float:left}.bp-user #buddypress #item-header #item-header-content{float:none;overflow:hidden}.bp-user #buddypress #item-header #item-header-content .user-nicename,.bp-user #buddypress #item-header #item-header-content span.activity{text-align:left}.bp-user #buddypress #item-header #item-header-content #item-meta{margin-top:0}.bp-user #buddypress #item-header-cover-image #item-header-content .user-nicename{margin-bottom:20px}.bp-user #buddypress #item-header-cover-image #item-header-content #item-buttons{margin:0}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:.875rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:.875rem}.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 h5,.groups.manage-members #group-settings-form .item-list li img{float:left}.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 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}.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%}}#buddypress div.invite .left-menu{float:none}#buddypress div.invite #invite-list{border:1px solid #eaeaea;height:auto;min-height:3.125em;padding:0 .3em .5em;width:auto}#buddypress div.invite #invite-list ul{padding-left:0}#buddypress div.invite .main-column{margin-left:0}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:14px;font-size:.875rem}.bp-user #buddypress table td{font-size:13px;font-size:.8125rem}@media screen and (min-width:46.25em){#buddypress div.invite .left-menu{float:left}#buddypress div.invite #invite-list{width:220px}#buddypress div.invite .main-column{margin-left:235px}.bp-user #buddypress table th{font-size:16px;font-size:1rem}.bp-user #buddypress table td{font-size:14px;font-size:.875rem}}@media screen and (min-width:77.5em){.bp-user #buddypress table th{font-size:18px;font-size:1.125rem}.bp-user #buddypress table td{font-size:16px;font-size:1rem}}.bp-user #buddypress .notifications-options-nav{border:1px solid rgba(212,208,186,.5);float:left;width:100%}@media screen and (min-width:38.75em){.bp-user #buddypress .notifications-options-nav{width:300px}}.bp-user #buddypress .notifications-options-nav input,.bp-user #buddypress .notifications-options-nav select{border:0;font-size:14px;font-size:.875rem;outline:0;padding:0}.bp-user #buddypress .notifications-options-nav select{float:left;margin-right:0;width:60%}.bp-user #buddypress .notifications-options-nav input{float:right;font-family:inherit;line-height:20px;width:40%}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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;padding: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.125rem}.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:.875rem}.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:#6f6f6f;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:#6f6f6f}.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:#ccc;border-bottom-width:2px;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-options span.icon:before,.bp-user #buddypress #message-threads tr td.thread-star span.icon:before{font-size:14px}}.bp-user #buddypress #message-threads tr .thread-checkbox{padding:0 0 0 .3em}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.75rem}.bp-user #buddypress #message-threads tr td.thread-info .thread-excerpt{font-size:14px;font-size:.875rem}.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:.75rem;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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@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:12px;font-size:.75rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{background:#dce5ff;border-color:#d4d0ba}.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{list-style:none;margin:0;padding:0}.bp-user #buddypress .acfb-holder li{margin-left:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-right:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-left:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress .sitewide-notices tr td:first-child{display:none}.bp-user #buddypress .sitewide-notices td strong{background:#6f6f6f;color:#fff;display:block;padding-left:.2em}.bp-user .ac_results{background:#eee;padding-left:10px}.bp-user .ac_results ul{list-style:none;margin:0;padding:0}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user #buddypress #settings-form{padding:0 10px}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.25rem;margin:20px 0 10px}.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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-right:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:left;width:60%}@media screen and (min-width:46.25em){#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{width:80%}}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:.875rem;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:100%;border-right:1px solid rgba(212,208,186,.6);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:40%}@media screen and (min-width:46.25em){#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]{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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:77.5em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1rem}}#buddypress table{font-size:14px;font-size:.875rem;margin:20px 0}#buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff}#buddypress table td,#buddypress table th{padding:.3em}#buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){#buddypress table{font-size:16px;font-size:1rem}}#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 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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.scss b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.scss new file mode 100644 index 0000000000000000000000000000000000000000..745c469f3ac02e29fa52e58452efe22ab76e839e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentythirteen.scss @@ -0,0 +1,2418 @@ +// 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 . + +// Twentythirteen Media Queries / Breakpoints. +// @media (max-width: 1599px) +// @media (max-width: 1069px) +// @media (max-width: 999px) +// @media (max-width: 767px) +// @media (max-width: 643px) +// @media (max-width: 359px) + +// These differ from other WP themes in using fewer breakpoints +// and in using max-width rather than min-width +// In addition BP will use the em breakpoints as used for twentyfifteen referenced below. +// @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 +// 2013 uses a basic pixel font size approach, we'll stick with rem/px +@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) { + -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; +} + +// 2013 font family +@mixin default-font-sans() { + font-family: "Source Sans Pro", Helvetica, sans-serif; +} + +// Variables: color definitions +$body-text: #141412; +$light-body: lighten(#141412, 45%); +$content-background: #fff; +$off-white: lighten(#f9f8ee, 10%); +$cream-background: #f7f5e7; +$light-background: #f7f7f7; +$medium-background: #ccc; +$dark-background: #555; +$border-color: #d4d0ba; // border color is varied using rgba +$border-light: #eaeaea; // BP dividers +$border-med: #ddd; +$background-hover: #db572f; // 2013 link background hover +$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; +$link-action: #c82b2b; + +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentythirteen 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, Register, activation +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 +*------------------------------------------------------------------------------- +*/ + +// 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;} + + // re-factor main themes primary elements widths for BP screens + @media (max-width: 999px) { + #content {padding: 0 $spacing-val-md;} + } + + @media (max-width: 643px) { + #content {padding: 0;} + } + + .entry-header, + .entry-content, + .entry-summary, + .entry-meta { + max-width: 890px; + } + +} // .buddypress (body class) + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ + + + +/** +*---------------------------------------------------------- +* @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 will appear over weighted in selectors + +#buddypress { + + // Global Nav Styles + div.item-list-tabs { + ul { + background-color: $cream-background; + border-bottom: 1px solid rgba($border-light, 0.9); + border-top: 1px solid rgba($border-light, 0.9); + overflow: hidden; + padding: 0; + + li { + a { + span {border-radius: 25%;} + } + } + } + } +} +// .bp-user #object-nav @ small screen as a dropdown + +.bp-user { + #buddypress { + @media screen and (max-width: 38.75em) { + + #object-nav { + background: $cream-background; + border: 1px solid $border-light; + overflow: visible; + padding: $spacing-val-sm; + + ul { + border: 0; + height: 0; + // all latest vendor releases handle transitions, so no prefixes used. + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + + &:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + + &:hover, + &:focus { + &:before {content: "Menu \021E7";} + + ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + } + } + + #subnav {clear: both;} + + } // close @media + } +} +/*__ Horizontal menus & small screen __*/ + +#buddypress { + + #object-nav { + + ul { + overflow: hidden; + + li { + @media screen and (max-width: 38.75em) { + &:focus, + &:hover { + background: darken($cream-background, 2%); + } + } + + float: none; + } + + @media screen and (max-width: 38.75em) { + li:not(:last-child) { + border-bottom: 1px solid $border-light; + } + } + + 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; + margin-top: $spacing-val-xs; + 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: none; + 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 +// As 2013 has an inner sidebar which if active can narrow screen too far +// for a columner nav we'll only use these rules if no sidebar 'body:not(.sidebar)'. + +@media screen and (min-width: 55em) { + + body:not(.sidebar) { + #buddypress { + + #item-header, + #item-body { + background: $content-background; + } + + #object-nav { + border-right: 1px solid $border-med; + float: left; + margin-right: -1px; + width: 200px; + + ul { + background: none; + 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); + + ul {margin-top: 0;} + } + } + + } // close #buddypress + } // close body:not(.sidebar) +} // close @media + + +// Tabbed Nav styling +// Primarilly used for group create screens & ? directory nav. + +@media screen and (min-width: 46.25em) { + #main { + #buddypress { + + #group-create-tabs.item-list-tabs { + + ul:before, + ul:after { + content: " "; + display: table; + } + + ul:after { + clear: both; + } + + ul { + background: none; + border: 0; + border-bottom: 1px solid $border-med; + overflow: visible; + padding: 0; + + li { + float: left; + width: auto; + } + + li.selected, + li.current { + border: 1px solid $border-med; + border-bottom-color: $content-background; + @include border-top-radius(4px); + margin-bottom: -1px; + + a { + background: none; + color: $body-text; + outline: none; + } + } + } + + } // close .item-list-tabs + + #subnav { + ul { + border-bottom: 0; + } + + } // close #subnav + } // 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 2013 font-family +#buddypress { + .item-list { + .activity-header, + .activity-meta { + @include default-font-sans(); + } + } +} + +#buddypress { + .activity-meta { + .button { + &:focus, + &:hover { + background: lighten($background-hover, 10%); + color: $cream-background; + } + } + } + + .action { + .generic-button { + a { + &:focus, + &:hover { + background: lighten($background-hover, 10%); + color: $cream-background; + } + } + } + } +} // close #buddypress + +// 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 2013 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 { + overflow: hidden; + + @media screen and (min-width: 46.25em) { + margin-left: 15%; + } + + span.activity { + font-style: italic; + } + + .item-desc { + margin: 0 auto; + width: 100%; + } + + .item-title { + @include font-size(18); + line-height: 1.2; + margin: 0 auto; + text-align: center; + + @media screen and (min-width: 38.75em) { + text-align: left; + } + + width: 100%; + + .update { + @include font-size(12); + display: block; + + @media screen and (min-width: 59.6875em) { + @include font-size(14); + } + + padding: $spacing-val-sm 0; + text-align: left; + } + + } // .item-title + + } + + @media screen and (min-width: 59.6875em) { + .item-avatar, + .item, + .action { + float: left; + } + + .item { + left: 5%; + margin-left: 0; + position: relative; + width: 55%; + + .item-title { + @include font-size(22) + } + } + + }// 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; + } + + // corrective measure for clipped elements due to JS inline styling + + @media screen and (max-width: 46.25em) { + #whats-new-content { + clear: left; + margin: $spacing-val-sm 0 $spacing-val-md; + padding: $spacing-val-sm 0 0; + } + } + + #whats-new-content.active { + #whats-new-options[style] { + #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; + 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-content.active + + } // 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(14); + } + } + } + + .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); + margin-top: 0; + 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-bottom: $spacing-val-xs; + + @media screen and (min-width: 38.75em) { + display: inline-block; + margin-bottom: 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 { + #activity-stream { + + li.activity-item { + padding: $spacing-val-md; + } + + 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 { + border-left: 1px solid $border-light; + margin-top: 5px; + + ul { + background: rgba($light-background, 0.6); + margin: 15px 0 0 2px; + } + + .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 5.0 - Directories +*------------------------------------------------------------------------------- +*/ + +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ + +#buddypress { + #signup_form.standard-form { + + #profile-details-section, + #basic-details-section, + #blog-details-section { + float: none; + width: 100%; + + @media screen and (min-width: 38.75em) { + width: 48%; + } + } + + @media screen and (min-width: 38.75em) { + #profile-details-section {float: right;} + #basic-details-section {float: left;} + } + + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ + + +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ + +.bp-user, +.single-item.groups { + + .entry-header { + margin-bottom: 0; + + .entry-title { + color: $light-body; + @include font-size(32); + margin-bottom: $spacing-val-sm; + text-align: center; + + @media screen and (min-width: 46.25em) { + text-align: left; + } + } + } + + #buddypress { + #item-header-content { + #item-meta { + @include font-size(14); + text-align: left; + + p {margin-bottom: 0.5em;} + } + } + } + + @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; + + h3 { + border-bottom: 1px solid $border-light; + text-align: center; + } + } + } + } // close @media + + div#item-header { + padding-bottom: $spacing-val-lg; + + div#item-actions { + margin: 0; + width: 100%; + + @media screen and (min-width: 38.75em) { + border-left: 1px solid $border-light; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } // close @media + + @media screen and (min-width: 46.25em) { + width: 40%; + } + + ul { + margin-top: 0; + padding-left: 0; + } + + h3 { + @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 { + clear: both; + float: right; + width: 28%; + + h3 { + @include font-size(14); + } + } + + } // close @media + + #item-header-cover-image { + + #item-actions { + border: 0; + + @media screen and (max-width: 46.25em) { + clear: both !important; + } + + float: none; + width: auto; + } + + @media screen and (min-width: 46.25em) { + #item-header-content { + padding-left: $spacing-val-sm; + + #item-buttons { + margin-top: 0; + } + } + + #item-actions { + border-left: 1px solid $border-light; + clear: none; + float: right; + margin-top: 230px !important; + padding-top: 0 !important; + width: 20%; + } + } + } + + } // 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; + } + } + + #item-header-content { + .user-nicename, + span.activity { + display: block; + text-align: center; + } + } + + @media screen and (min-width: 46.25em) { + #item-header-avatar { + float: left; + width: auto; + + a { + float: left; + } + } + + #item-header-content { + float: none; + overflow: hidden; + + .user-nicename, + span.activity { + text-align: left; + } + + #item-meta { + margin-top: 0; + } + } + + } // close @media + + } // close #item-header + + #item-header-cover-image { + + #item-header-content { + @media screen and (min-width: 46.25em) { + .user-nicename { + margin-bottom: $spacing-val-md; + } + + #item-buttons { + margin: 0; + } + } + } + } + + } // close #buddypress +} // close .bp-user + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ + +/** +*---------------------------------------------------- +* @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; + } + } +} + +.groups.edit-details { + #group-settings-form { + + label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; + } + + textarea + p label { + background: none; + color: inherit; + @include font-size(14); + width: auto; + } + + textarea { + height: auto; + min-height: 100px; + overflow: auto; + } + } +} // close .groups.edit-details + +.groups.group-settings { + #group-settings-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 +*----------------------------------------- +*/ + +// 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 +*----------------------------------------- +*/ +#buddypress { + + div.invite { + .left-menu { + float: none; + + @media screen and (min-width: 46.25em) { + float: left; + } + } + + #invite-list { + border: 1px solid $border-light; + height: auto; + min-height: 3.125em; + padding: 0 0.3em 0.5em; + width: auto; + + @media screen and (min-width: 46.25em) { + width: 220px; + } + + ul { + padding-left: 0; + } + } + + .main-column { + margin-left: 0; + + @media screen and (min-width: 46.25em) { + margin-left: 235px; + } + } + + } // close div.invite +} + +/** +*----------------------------------------------------- +* @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(13)} + + @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 { + border: 1px solid rgba($border-color, 0.5); + float: left; + width: 100%; + + @media screen and (min-width: 38.75em) { + width: 300px; + } + + select, + input { + border: 0; + @include font-size(14); + outline: 0; + padding: 0; + } + + select { + float: left; + margin-right: 0; + width: 60%; + } + + input { + float: right; + font-family: inherit; + line-height: 20px; + width: 40%; + } + + } // 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;} + } + + #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; + padding: 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%; + } + } + } + } + } +} + +/** + *------------------------------------------- + * @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: $medium-background; + 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; + span.icon:before {font-size: 14px;} + } + } + + .thread-checkbox { + padding: 0 0 0 0.3em; + } + + td.bulk-select-check, + td.thread-from { + height: 3em; + + @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); + } + + .thread-excerpt { + @include font-size(14); + } + } + + 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(12); + width: 100%; + } + } + } + + tr.unread { + td { + background: $unread; + border-color: $border-color; + } + } + + 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; + } + } + + .acfb-holder { + list-style: none; + margin: 0; + padding: 0; + + li {margin-left: 0;} + + li.friend-tab { + background: lighten($notice-info, 20%); + border: inherit; + margin-right: 0; + padding: 0.5em; + + span.p { + // the 'X' close + padding-left: $spacing-val-sm; + + &:focus, + &:hover { + color: $link-action; + cursor: pointer; + } + } + + a { + border-bottom: 0; + text-decoration: none; + + img { + // this is the tiny user avatar + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; // override inline style + } + } + } + } + + .sitewide-notices { + tr { + td:first-child { + display: none; + } + } + + td { + strong { + background: lighten($dark-background, 10%); + color: $content-background; + display: block; + padding-left: 0.2em; + } + } + } + } // close #buddypress + + // acfb auto complete name list sits in doc footer before body close + .ac_results { + background: #eee; + padding-left: $spacing-val-sm; + + ul { + list-style: none; + margin: 0; + padding: 0; + } + + li { + margin: $spacing-val-sm 0; + + &:focus, + &:hover { + cursor: pointer; + } + } + } + +} // close .bp-user + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ + +.bp-user { + + #buddypress { + + #settings-form { + padding: 0 $spacing-val-sm; + // 'p' = email notification screen sub heading + > p { + @include font-size(20); + margin: $spacing-val-md 0 $spacing-val-sm; + } + } + + 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: 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 +*------------------------------------------------------------------------------- +*/ +// Attempt to reset form control widths +#main { + #buddypress { + .standard-form { + + li {float: none;} + input[type='text'], + input[type='email'], + input[type='password'], + textarea { + width: 100%; + } + } + } +} + + +#buddypress { + + // Match BP form elements to Themes(2013) styling where styles + // are not inherited or being overriden. + div.activity-comments { + + form { + .ac-textarea { + background: $light-background; + border: 1px solid rgba($border-color, 0.5); + + textarea { + background: none; + border: 0; + } + } + } + } + + .standard-form { + + // Keep BP form element borders to 1px rather than 2013 2px + input[type="text"], + input[type="email"], + input[type="password"], + button, + select, + textarea { + border-color: rgba($border-color, 0.5); + border-width: 1px; + } + + } // close .standard-form + + #signup_form.standard-form { + div.submit { + float: none; + + input {margin-right: 0;} + } + } + +} // close #buddypress + +#buddypress { + 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 & twentythirteen + + form { // *sigh* only to bludgeon over specified rules + border: 1px solid rgba($border-color, 0.6); + overflow: hidden; + + label { + float: left; + width: 60%; + + @media screen and (min-width: 46.25em) { + width: 80%; + } + } + + input[type='text'] { + float: left; + margin: 0; + width: 100%; + } + + 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.6); + 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: 40%; + + @media screen and (min-width: 46.25em) { + 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 + + + @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; + } + + // twentythirteen removes left padding, replace! + th, + td { + padding: 0.3em; + } + + // 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 { + 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 +// 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 +*------------------------------------------------------------------------------- +*/ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..0faa9ef5935a88f8ba0fb4a663ab1e57f1334894 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.css @@ -0,0 +1,2013 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentytwelve theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentytwelve 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, Register, activation +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.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 + 6.2.2.7 - Notifications +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, Globals +*------------------------------------------------------------------------------- +*/ +.buddypress div.clear { + display: none; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul li.selected a, +#buddypress div.item-list-tabs ul li.current a { + background: inherit; + opacity: 1; +} + +#buddypress div.item-list-tabs ul { + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a:focus, #buddypress div.item-list-tabs ul li a:hover { + color: #555; +} + +#buddypress div.item-list-tabs ul li a:visited { + color: #21759b; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 30em) { + .bp-user #buddypress #object-nav { + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 37.5em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +@media screen and (max-width: 37.5em) { + #buddypress #object-nav ul li:not(.selected):focus, #buddypress #object-nav ul li:not(.selected):hover { + background: #f2f2f2; + } +} + +@media screen and (min-width: 37.5em) { + #buddypress #object-nav ul li { + float: right; + } +} + +#buddypress div#subnav.item-list-tabs { + margin-top: 0; +} + +#buddypress div#subnav.item-list-tabs ul { + border-bottom: 0; + border-top: 1px solid #d4d0ba; + margin-top: 5px; + padding: 0; +} + +#buddypress div#subnav.item-list-tabs ul li.last { + background: #fff; + float: left; + margin-top: 0; + padding: 5px 0 5px; + text-align: left; + width: 230px; +} + +@media screen and (max-width: 30em) { + #buddypress div#subnav.item-list-tabs ul li.last { + float: none; + width: auto; + } +} + +#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; + padding: 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: 1rem; +} + +#buddypress div#subnav.item-list-tabs ul li.last select { + font-style: italic; +} + +#buddypress div#subnav.item-list-tabs ul li.last select option { + font-style: normal; +} + +.bp-user #buddypress div#subnav.item-list-tabs li.last { + margin-right: 0; + text-align: left; +} + +@media screen and (max-width: 30em) { + .bp-user #buddypress div#subnav.item-list-tabs li.last { + clear: right; + float: none; + margin-right: 10px; + text-align: right; + } +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 60em) { + body.full-width #buddypress #item-header, + body.full-width #buddypress #item-body { + background: #fff; + } + body.full-width #buddypress #object-nav { + border-left: 1px solid #ddd; + float: right; + margin-left: -1px; + width: 200px; + } + body.full-width #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body.full-width #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body.full-width #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: left; + margin-left: 2px; + } + body.full-width #buddypress #item-body { + border-right: 1px solid #ddd; + overflow: hidden; + padding: 0 24px 0 0; + width: auto; + } + body.full-width #buddypress #item-body #subnav { + margin: 0 -24px 0 0; + } + body.full-width #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding-bottom: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: right; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 0; + } +} + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ +#buddypress div.pagination { + box-shadow: none; + min-height: 0; +} + +#buddypress div.pagination:before, #buddypress div.pagination:after { + height: 0; + width: 0; +} + +#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 ul.item-list { + border-top: 0; +} + +#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: 37.5em) { + #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; + margin-bottom: 10px; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li .item-avatar img.avatar { + display: block; + float: right; + } +} + +#buddypress ul.item-list li .item { + margin-right: 0; + overflow: hidden; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item { + margin-right: 15%; + } +} + +#buddypress ul.item-list li .item .item-meta { + text-align: center; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item .item-meta { + text-align: right; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin-right: 0; + width: 94%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 16px; + font-size: 1.1428571429rem; + line-height: 1.2; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li .item .item-title { + text-align: right; + } +} + +#buddypress ul.item-list li .item .item-title > a { + text-decoration: none; +} + +#buddypress ul.item-list li .item .item-title > a:visited { + color: #21759b; +} + +#buddypress ul.item-list li .item .item-title .update { + display: block; + font-size: 12px; + font-size: 0.8571428571rem; + padding: 10px 0; + text-align: right; +} + +@media screen and (min-width: 60em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 1rem; + } +} + +@media screen and (min-width: 60em) { + #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: 5%; + margin-right: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.2857142857rem; + } +} + +#buddypress ul.item-list li div.action { + clear: right; + float: none; + margin-bottom: -24px; + margin-right: 0; + padding: 24px 0 5px; + position: relative; + text-align: right; + top: 0; +} + +@media screen and (min-width: 60em) { + #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; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li div.action div { + margin: 0 0 10px 10px; + width: auto; + } +} + +@media screen and (min-width: 60em) { + #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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: right; + margin: 10px 0 24px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: right; + line-height: 1.5em; + margin-top: 12px; + padding-right: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: left; + margin: 0; + min-height: 1.5em; + padding: 0 0.4em 0 0; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit { + float: left; + } + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit input { + padding: 2px 6px; + } +} + +#buddypress #item-body form#whats-new-form { + margin: 48px 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: 24px; + margin-right: 0; + width: 60px; +} + +#buddypress #activity-stream li .activity-content, +#buddypress #activity-stream li .activity-comments { + margin-right: 0; +} + +#buddypress #activity-stream li .activity-header { + font-size: 14px; + font-size: 1rem; +} + +#buddypress #activity-stream li .activity-header a:visited { + color: #21759b; +} + +#buddypress #activity-stream li .activity-inner img { + height: auto; +} + +@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.1428571429rem; + } + #buddypress #activity-stream li .activity-comments { + margin-right: 70px; + } +} + +#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: 14px; + font-size: 1rem; +} + +#buddypress #activity-stream li.mini .activity-content .activity-meta a { + font-size: 12px; + font-size: 0.8571428571rem; +} + +#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 { + border-bottom: 1px solid rgba(234, 234, 234, 0.6); + margin-top: 0; + 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; + font-size: 14px; + font-size: 1rem; + margin-bottom: 5px; + padding: 0.2em 0.5em; +} + +@media screen and (min-width: 37.5em) { + #buddypress #activity-stream .activity-content .activity-meta a { + float: right; + margin-bottom: 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 a { + display: block; +} + +/* Single activity view - activity permalink */ +.activity-permalink #buddypress #activity-stream li.activity-item { + padding: 24px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1.1428571429rem; + margin-bottom: 48px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.4285714286rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 24px; +} + +.activity-permalink #buddypress #activity-stream .activity-comments { + margin-right: 0; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + position: relative; +} + +#buddypress #activity-stream .activity-comments > ul { + background: rgba(247, 247, 247, 0.6); + margin: 10px 2px 0 0; +} + +#buddypress #activity-stream .activity-comments > ul > li:hover * { + color: #555; +} + +#buddypress #activity-stream .activity-comments > ul > li .acomment-meta, +#buddypress #activity-stream .activity-comments > ul > li .acomment-content { + font-size: 12px; + font-size: 0.8571428571rem; +} + +#buddypress #activity-stream .activity-comments .ac-form { + border: 1px solid #d4d0ba; + box-sizing: border-box; + margin: 10px 0; + width: 100%; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 0.8); + display: inline-block; + font-family: inherit; + font-size: 12px; + font-size: 0.8571428571rem; + 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(212, 208, 186, 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: 60em) { + #buddypress #members-list li .item-avatar, + #buddypress #members-list li .item { + float: right; + } + #buddypress #members-list li .action { + float: left; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 37.5em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 37.5em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: left; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: right; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +.bp-user #buddypress a:visited { + color: #21759b; +} + +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 1rem; + text-align: right; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@media screen and (max-width: 37.5em) { + .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 main header.entry-header, + .single-item.groups main header.entry-header { + padding-bottom: 1rem; + } +} + +@media screen and (max-width: 37.5em) { + .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) { + .bp-user #buddypress #item-header .generic-button, + .single-item.groups #buddypress #item-header .generic-button { + float: none; + margin: 1.5em 0 0 0; + } +} + +/** +*----------------------------------------------------- +* @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: 24px; + } +} + +@media screen and (max-width: 50em) { + .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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.single-item.groups #buddypress div#item-header { + padding-bottom: 48px; +} + +.single-item.groups #buddypress div#item-header #item-header-content { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.single-item.groups #buddypress div#item-header div#item-actions { + margin: 0 !important; + width: 100%; +} + +@media screen and (min-width: 50em) { + .single-item.groups #buddypress div#item-header div#item-actions { + border-right: 1px solid #eaeaea; + clear: none; + float: left; + padding-right: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-right: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 1rem; + padding: 0.2em; +} + +.single-item.groups #buddypress div#item-header div#item-actions #group-admins li, +.single-item.groups #buddypress div#item-header div#item-actions #group-mods li { + margin: 0; +} + +@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-content { + margin-right: 2%; + padding: 0 0.5em; + } + .single-item.groups #buddypress div#item-header div#item-actions { + float: left; + width: 28%; + } +} + +@media screen and (min-width: 64em) { + .single-item.groups #buddypress div#item-header #item-header-content { + width: 40%; + } +} + +.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions { + margin-top: 225px !important; +} + +@media screen and (min-width: 50em) and (max-width: 60em) { + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-header-content { + max-width: 60% !important; + width: 60% !important; + } +} + +@media screen and (max-width: 64em) { + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions { + border: 0; + clear: both; + margin-top: 0 !important; + max-width: 100% !important; + padding-top: 0 !important; + width: auto; + } + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions h3 { + border-bottom: 1px solid #eaeaea; + } +} + +/** +*----------------------------------------------------- +* @subsection 6.1.2 - Item Header User Accounts +* +* User Accounts Specific Item Header +*----------------------------------------------------- +*/ +.bp-user #buddypress #item-header { + padding: 24px 0; +} + +.bp-user #buddypress #item-header #item-header-avatar { + text-align: center; +} + +.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; +} + +.bp-user #buddypress #item-header #item-header-content #item-buttons .generic-button { + margin-left: 5px; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header #item-header-avatar { + float: right; + } + .bp-user #buddypress #item-header #item-header-avatar a { + float: right; + } + .bp-user #buddypress #item-header #item-header-content { + float: left; + margin-left: 0%; + width: 69%; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 1rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 1rem; +} + +.groups.group-avatar form > p { + margin-top: 24px; +} + +.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: 37.5em) { + .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 +*----------------------------------------- +*/ +.groups.group-members #subnav li { + width: 100%; +} + +@media screen and (max-width: 37.5em) { + .groups.group-members #subnav li { + background: #fff; + padding: 24px 0; + } +} + +.groups.group-members #subnav li #search-members-form { + float: left; + margin: 5px 0 0 5px; +} + +@media screen and (max-width: 37.5em) { + .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.2 - Item Body User Accounts +* +* User Account specific component 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: 13px; + font-size: 0.9285714286rem; +} + +.bp-user #buddypress table td { + font-size: 12px; + font-size: 0.8571428571rem; +} + +@media screen and (min-width: 60em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1.1428571429rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 1rem; + } +} + +.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: 37.5em) { + .bp-user #buddypress .notifications-options-nav, + .bp-user #buddypress .messages-options-nav { + width: 40%; + } +} + +.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: 1rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .messages-options-nav select { + float: right; + margin-left: 0; + width: 49%; +} + +@media screen and (min-width: 37.5em) { + .bp-user #buddypress .notifications-options-nav select, + .bp-user #buddypress .messages-options-nav select { + width: auto; + } +} + +.bp-user #buddypress .notifications-options-nav input, +.bp-user #buddypress .messages-options-nav input { + float: right; + font-family: inherit; + line-height: 20px; + margin-right: 1%; + width: 50%; +} + +@media screen and (min-width: 37.5em) { + .bp-user #buddypress .notifications-options-nav input, + .bp-user #buddypress .messages-options-nav input { + width: auto; + } +} + +.bp-user #buddypress .notifications-options-nav input[disabled="disabled"]:focus, .bp-user #buddypress .notifications-options-nav input[disabled="disabled"]:hover, +.bp-user #buddypress .messages-options-nav input[disabled="disabled"]:focus, +.bp-user #buddypress .messages-options-nav input[disabled="disabled"]:hover { + background: none; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile { + /* Edit profile */ +} + +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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.2857142857rem; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle { + margin: 5px 0 24px; +} + +.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: 1rem; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link { + background: #6f6f6f; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + border-radius: 2px; + background-clip: padding-box; + color: #eee; + font-weight: bold; + padding: 0.1em 0.5em; + text-decoration: none; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:focus, .bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:hover, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:focus, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:hover { + color: #fff; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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-recipients .highlight { + font-size: 100%; +} + +.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: #6f6f6f; +} + +.bp-user #buddypress #message-threads tr td { + background: #fff; + box-sizing: border-box; + 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: 1px solid #ccc; + 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.thread-star { + vertical-align: middle; +} + +.bp-user #buddypress #message-threads tr td.thread-star .message-action-star, +.bp-user #buddypress #message-threads tr td.thread-star .message-action-unstar { + line-height: 1.2; +} + +.bp-user #buddypress #message-threads tr td.thread-star span.icon:before { + font-size: 14px; + font-size: 1rem; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@media screen and (max-width: 37.5em) { + .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: 0.8571428571rem; +} + +.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: 0.8571428571rem; + line-height: 1.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: 37.5em) { + .bp-user #buddypress #message-threads tr span.activity { + clear: both; + font-size: 11px; + font-size: 0.7857142857rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + border-color: #eaeaea; +} + +.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 #send_message_form input, +.bp-user #buddypress #send_message_form textarea { + box-sizing: border-box; +} + +.bp-user #buddypress .acfb-holder { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-right: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-left: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-right: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress #message-threads.sitewide-notices tr { + margin: 3em 0; +} + +.bp-user #buddypress #message-threads.sitewide-notices td { + width: 100%; +} + +.bp-user #buddypress #message-threads.sitewide-notices td strong { + background: #6f6f6f; + 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 a.button { + border: 1px solid #d4d0ba; + line-height: initial; + padding: 0.4em 0.3em; +} + +.bp-user #buddypress #message-threads.sitewide-notices td:first-child { + display: none; +} + +.bp-user #buddypress #message-threads.sitewide-notices td:nth-child(2) strong { + margin: -8px -8px 8px; +} + +.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 { + line-height: 1; + padding-bottom: 1em; + 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; +} + +.bp-user .ac_results { + background: #eee; + padding-right: 10px; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +.bp-user .ac_results li img { + vertical-align: bottom; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.4285714286rem; + margin: 24px 0 10px; +} + +.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%; +} + +/** + *------------------------------------ + * @subsection 6.2.2.6 - Notifications + *------------------------------------ + */ +/** +*------------------------------------------------------------------------------- +* @section 7.0 - Forms - General +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-left: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: right; + width: 70%; +} + +#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: 1rem; + border: 0; + border-radius: 0; + line-height: 1.8; + min-height: 2rem; +} + +#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(212, 208, 186, 0.6); + float: right; + margin: 0; + padding: 0 0.2em 0; + width: 100%; +} + +#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 1em; + text-align: center; + text-transform: none; + width: 30%; +} + +@media screen and (min-width: 37.5em) { + #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: 75em) { + #buddypress .dir-search form input[type='text'], + #buddypress .message-search form input[type='text'] { + font-size: 16px; + font-size: 1.1428571429rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1.1428571429rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +.bp-user #buddypress table { + font-size: 14px; + font-size: 1rem; + margin: 24px 0; +} + +.bp-user #buddypress table tr th { + background: #6f6f6f; + border-color: #b7b7b7; + color: #fff; + padding: 0 8px; +} + +.bp-user #buddypress table tr td { + padding: 8px; +} + +.bp-user #buddypress table p { + margin-bottom: 0.5em; +} + +@media screen and (min-width: 55em) { + .bp-user #buddypress table { + font-size: 16px; + font-size: 1.1428571429rem; + } +} + +.bp-user #buddypress .notifications th, +.bp-user #buddypress .messages-notices th { + width: 30%; +} + +.bp-user #buddypress .notifications th.bulk-select-all, +.bp-user #buddypress .messages-notices th.bulk-select-all { + text-align: center; + width: 10%; +} + +.bp-user #buddypress .notifications th.actions, +.bp-user #buddypress .messages-notices th.actions { + text-align: center; +} + +.bp-user #buddypress .notifications .bulk-select-check, +.bp-user #buddypress .notifications .thread-star, +.bp-user #buddypress .messages-notices .bulk-select-check, +.bp-user #buddypress .messages-notices .thread-star { + text-align: center; +} + +.bp-user #buddypress .notifications .notification-actions, +.bp-user #buddypress .notifications td.thread-options, +.bp-user #buddypress .messages-notices .notification-actions, +.bp-user #buddypress .messages-notices td.thread-options { + text-align: center; +} + +.bp-user #buddypress .notifications .notification-actions a, +.bp-user #buddypress .notifications td.thread-options a, +.bp-user #buddypress .messages-notices .notification-actions a, +.bp-user #buddypress .messages-notices td.thread-options a { + display: inline-block; + margin: 0; + padding: 0; +} + +.bp-user #buddypress .notifications td .button, +.bp-user #buddypress .messages-notices td .button { + border: 0; + display: block; + padding: 0; + text-align: center; +} + +/** +*------------------------------------------------------------------------------- +* @section 9.0 - Error / Success messages +*------------------------------------------------------------------------------- +*/ +#buddypress div#message p { + font-size: 18px; + font-size: 1.2857142857rem; + 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 +*------------------------------------------------------------------------------- +*/ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..793776ee3e984799640c3abf1997d84b4fc3d54a --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve-rtl.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.buddypress div.clear{display:none}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background:inherit;opacity:1}#buddypress div.item-list-tabs ul{overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a:focus,#buddypress div.item-list-tabs ul li a:hover{color:#555}#buddypress div.item-list-tabs ul li a:visited{color:#21759b}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:30em){.bp-user #buddypress #object-nav{border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}@media screen and (max-width:37.5em){#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}#buddypress #object-nav ul li:not(.selected):focus,#buddypress #object-nav ul li:not(.selected):hover{background:#f2f2f2}}@media screen and (min-width:37.5em){#buddypress #object-nav ul li{float:right}}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{border-bottom:0;border-top:1px solid #d4d0ba;margin-top:5px;padding:0}#buddypress div#subnav.item-list-tabs ul li.last{background:#fff;float:left;margin-top:0;padding:5px 0;text-align:left;width:230px}#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;padding: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:1rem}#buddypress div#subnav.item-list-tabs ul li.last select{font-style:italic}#buddypress div#subnav.item-list-tabs ul li.last select option{font-style:normal}#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}.bp-user #buddypress div#subnav.item-list-tabs li.last{margin-right:0;text-align:left}@media screen and (max-width:30em){#buddypress div#subnav.item-list-tabs ul li.last{float:none;width:auto}.bp-user #buddypress div#subnav.item-list-tabs li.last{clear:right;float:none;margin-right:10px;text-align:right}}@media screen and (min-width:60em){body.full-width #buddypress #item-body,body.full-width #buddypress #item-header{background:#fff}body.full-width #buddypress #object-nav{border-left:1px solid #ddd;float:right;margin-left:-1px;width:200px}body.full-width #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body.full-width #buddypress #object-nav ul li{float:none;overflow:hidden}body.full-width #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:left;margin-left:2px}body.full-width #buddypress #item-body{border-right:1px solid #ddd;overflow:hidden;padding:0 24px 0 0;width:auto}body.full-width #buddypress #item-body #subnav{margin:0 -24px 0 0}body.full-width #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding-bottom:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:right;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom:0}}#buddypress div.pagination{box-shadow:none;min-height:0}#buddypress div.pagination:after,#buddypress div.pagination:before{height:0;width:0}#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 #activity-stream li .activity-header a:visited,#buddypress ul.item-list li .item .item-title>a:visited{color:#21759b}#buddypress div.pagination .pagination-links .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#buddypress div.pagination .pagination-links .prev{right:auto;position:static}#buddypress div.pagination .pagination-links .next{position:static;left:auto}#buddypress ul.item-list{border-top:0}#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:37.5em){#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;margin-bottom:10px}#buddypress ul.item-list li .item{margin-right:0;overflow:hidden}#buddypress ul.item-list li .item .item-meta{text-align:center}@media screen and (min-width:61.5625em){#buddypress ul.item-list li .item{margin-right:15%}#buddypress ul.item-list li .item .item-meta{text-align:right}}#buddypress ul.item-list li .item .item-desc{margin-right:0;width:94%}#buddypress ul.item-list li .item .item-title{font-size:16px;font-size:1.1428571429rem;line-height:1.2;text-align:center;width:100%}@media screen and (min-width:37.5em){#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:right}#buddypress ul.item-list li .item .item-title{text-align:right}}#buddypress ul.item-list li .item .item-title>a{text-decoration:none}#buddypress ul.item-list li .item .item-title .update{display:block;font-size:12px;font-size:.8571428571rem;padding:10px 0;text-align:right}@media screen and (min-width:60em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:1rem}#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:5%;margin-right:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.2857142857rem}}#buddypress ul.item-list li div.action{clear:right;float:none;margin-bottom:-24px;margin-right:0;padding:24px 0 5px;position:relative;text-align:right;top:0}@media screen and (min-width:60em){#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}@media screen and (min-width:37.5em){#buddypress ul.item-list li div.action div{margin:0 0 10px 10px;width:auto}}@media screen and (min-width:60em){#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:right;margin:10px 0 24px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:right;line-height:1.5em;margin-top:12px;padding-right:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:left;margin:0;min-height:1.5em;padding:0 .4em 0 0}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit{float:left}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit input{padding:2px 6px}}#buddypress #item-body form#whats-new-form{margin:48px 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:24px;margin-right:0;width:60px}#buddypress #activity-stream li .activity-comments,#buddypress #activity-stream li .activity-content{margin-right:0}#buddypress #activity-stream li .activity-header{font-size:14px;font-size:1rem}#buddypress #activity-stream li .activity-inner img{height:auto}@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.1428571429rem}#buddypress #activity-stream li .activity-comments{margin-right:70px}}#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:14px;font-size:1rem}#buddypress #activity-stream li.mini .activity-content .activity-meta a{font-size:12px;font-size:.8571428571rem}#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{border-bottom:1px solid rgba(234,234,234,.6);margin-top:0;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;font-size:14px;font-size:1rem;margin-bottom:5px;padding:.2em .5em}@media screen and (min-width:37.5em){#buddypress #activity-stream .activity-content .activity-meta a{float:right;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:24px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1.1428571429rem;margin-bottom:48px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.4285714286rem}}.activity-permalink #buddypress #activity-stream .activity-comments{margin-right:0}#buddypress #activity-stream .activity-comments{position:relative}#buddypress #activity-stream .activity-comments>ul{background:rgba(247,247,247,.6);margin:10px 2px 0 0}#buddypress #activity-stream .activity-comments>ul>li:hover *{color:#555}#buddypress #activity-stream .activity-comments>ul>li .acomment-content,#buddypress #activity-stream .activity-comments>ul>li .acomment-meta{font-size:12px;font-size:.8571428571rem}#buddypress #activity-stream .activity-comments .ac-form{border:1px solid #d4d0ba;box-sizing:border-box;margin:10px 0;width:100%}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:.8571428571rem;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(212,208,186,.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:60em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:right}#buddypress #members-list li .action{float:left}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:37.5em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:left}#buddypress #signup_form.standard-form #basic-details-section{float:right}}.bp-user #buddypress a:visited{color:#21759b}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:1rem;text-align:right}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@media screen and (max-width:37.5em){.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){.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}.single-item.groups #buddypress #item-header #item-meta{margin-bottom:24px}}@media screen and (max-width:50em){.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}.single-item.groups #buddypress div#item-header{padding-bottom:48px}.single-item.groups #buddypress div#item-header #item-header-content{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.single-item.groups #buddypress div#item-header div#item-actions{margin:0!important;width:100%}@media screen and (min-width:50em){.single-item.groups #buddypress div#item-header div#item-actions{border-right:1px solid #eaeaea;clear:none;float:left;padding-right:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-right:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:1rem;padding:.2em}.single-item.groups #buddypress div#item-header div#item-actions #group-admins li,.single-item.groups #buddypress div#item-header div#item-actions #group-mods li{margin:0}@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-content{margin-right:2%;padding:0 .5em}.single-item.groups #buddypress div#item-header div#item-actions{float:left;width:28%}}@media screen and (min-width:64em){.single-item.groups #buddypress div#item-header #item-header-content{width:40%}}.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions{margin-top:225px!important}@media screen and (min-width:50em) and (max-width:60em){.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-header-content{max-width:60%!important;width:60%!important}}@media screen and (max-width:64em){.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions{border:0;clear:both;margin-top:0!important;max-width:100%!important;padding-top:0!important;width:auto}.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions h3{border-bottom:1px solid #eaeaea}}.bp-user #buddypress #item-header{padding:24px 0}.bp-user #buddypress #item-header #item-header-avatar{text-align:center}.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}.bp-user #buddypress #item-header #item-header-content #item-buttons .generic-button{margin-left:5px}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar,.bp-user #buddypress #item-header #item-header-avatar a{float:right}.bp-user #buddypress #item-header #item-header-content{float:left;margin-left:0;width:69%}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:1rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:1rem}.groups.group-avatar form>p{margin-top:24px}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid #eaeaea}.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 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 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:37.5em){.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}.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:37.5em){.groups.group-members #subnav li{background:#fff;padding:24px 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%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:13px;font-size:.9285714286rem}.bp-user #buddypress table td{font-size:12px;font-size:.8571428571rem}@media screen and (min-width:60em){.bp-user #buddypress table th{font-size:16px;font-size:1.1428571429rem}.bp-user #buddypress table td{font-size:14px;font-size:1rem}}.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{float:right;width:100%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{width:40%}}.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:1rem;outline:0;padding:0}.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{float:right;margin-left:0;width:49%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{width:auto}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{float:right;font-family:inherit;line-height:20px;margin-right:1%;width:50%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{width:auto}}.bp-user #buddypress .messages-options-nav input[disabled=disabled]:focus,.bp-user #buddypress .messages-options-nav input[disabled=disabled]:hover,.bp-user #buddypress .notifications-options-nav input[disabled=disabled]:focus,.bp-user #buddypress .notifications-options-nav input[disabled=disabled]:hover{background:0 0}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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.2857142857rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle{margin:5px 0 24px}.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:1rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link{background:#6f6f6f;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;background-clip:padding-box;color:#eee;font-weight:700;padding:.1em .5em;text-decoration:none}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:focus,.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:hover,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:focus,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:hover{color:#fff}.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:#6f6f6f;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-recipients .highlight{font-size:100%}.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:#6f6f6f}.bp-user #buddypress #message-threads tr td{background:#fff;box-sizing:border-box;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:1px solid #ccc;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-star{vertical-align:middle}.bp-user #buddypress #message-threads tr td.thread-star .message-action-star,.bp-user #buddypress #message-threads tr td.thread-star .message-action-unstar{line-height:1.2}.bp-user #buddypress #message-threads tr td.thread-star span.icon:before{font-size:14px;font-size:1rem}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.8571428571rem}.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:.8571428571rem;line-height:1.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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@media screen and (max-width:37.5em){.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:.7857142857rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{border-color:#eaeaea}.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 #send_message_form input,.bp-user #buddypress #send_message_form textarea{box-sizing:border-box}.bp-user #buddypress .acfb-holder{list-style:none}.bp-user #buddypress .acfb-holder li{margin-right:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-left:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-right:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td,.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress #message-threads.sitewide-notices tr{margin:3em 0}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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 a.button{border:1px solid #d4d0ba;line-height:initial;padding:.4em .3em}.bp-user #buddypress #message-threads.sitewide-notices td:first-child{display:none}.bp-user #buddypress #message-threads.sitewide-notices td:nth-child(2) strong{margin:-8px -8px 8px}.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{line-height:1;padding-bottom:1em;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 .ac_results{background:#eee;padding-right:10px}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user .ac_results li img{vertical-align:bottom}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.4285714286rem;margin:24px 0 10px}.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 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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-left:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:right;width:70%}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:1rem;border:0;border-radius:0;line-height:1.8;min-height:2rem}#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(212,208,186,.6);float:right;margin:0;padding:0 .2em;width:100%}#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:0 1em;text-align:center;text-transform:none;width:30%}@media screen and (min-width:37.5em){#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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:75em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1.1428571429rem}}.bp-user #buddypress table{font-size:14px;font-size:1rem;margin:24px 0}.bp-user #buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff;padding:0 8px}.bp-user #buddypress table tr td{padding:8px}.bp-user #buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){.bp-user #buddypress table{font-size:16px;font-size:1.1428571429rem}}.bp-user #buddypress .messages-notices th,.bp-user #buddypress .notifications th{width:30%}.bp-user #buddypress .messages-notices th.bulk-select-all,.bp-user #buddypress .notifications th.bulk-select-all{text-align:center;width:10%}.bp-user #buddypress .messages-notices .bulk-select-check,.bp-user #buddypress .messages-notices .notification-actions,.bp-user #buddypress .messages-notices .thread-star,.bp-user #buddypress .messages-notices td.thread-options,.bp-user #buddypress .messages-notices th.actions,.bp-user #buddypress .notifications .bulk-select-check,.bp-user #buddypress .notifications .notification-actions,.bp-user #buddypress .notifications .thread-star,.bp-user #buddypress .notifications td.thread-options,.bp-user #buddypress .notifications th.actions{text-align:center}.bp-user #buddypress .messages-notices .notification-actions a,.bp-user #buddypress .messages-notices td.thread-options a,.bp-user #buddypress .notifications .notification-actions a,.bp-user #buddypress .notifications td.thread-options a{display:inline-block;margin:0;padding:0}.bp-user #buddypress .messages-notices td .button,.bp-user #buddypress .notifications td .button{border:0;display:block;padding:0;text-align:center}#buddypress div#message p{font-size:18px;font-size:1.2857142857rem;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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.css new file mode 100644 index 0000000000000000000000000000000000000000..a16f2bda2b65b3af6b6a221565e4c6a1fc504f74 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.css @@ -0,0 +1,2013 @@ +@charset "UTF-8"; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentytwelve theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentytwelve 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, Register, activation +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.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 + 6.2.2.7 - Notifications +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, Globals +*------------------------------------------------------------------------------- +*/ +.buddypress div.clear { + display: none; +} + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ +/** +*---------------------------------------------------------- +* @section 2.1 - Navs Object Nav / Sub Nav (item-list-tabs) +* +* The main navigational elements for all BP screens +*---------------------------------------------------------- +*/ +#buddypress div.item-list-tabs ul li.selected a, +#buddypress div.item-list-tabs ul li.current a { + background: inherit; + opacity: 1; +} + +#buddypress div.item-list-tabs ul { + overflow: hidden; + padding: 0; +} + +#buddypress div.item-list-tabs ul li a:focus, #buddypress div.item-list-tabs ul li a:hover { + color: #555; +} + +#buddypress div.item-list-tabs ul li a:visited { + color: #21759b; +} + +#buddypress div.item-list-tabs ul li a span { + border-radius: 25%; +} + +@media screen and (max-width: 30em) { + .bp-user #buddypress #object-nav { + border: 1px solid #eaeaea; + overflow: visible; + padding: 10px; + } + .bp-user #buddypress #object-nav ul { + border: 0; + height: 0; + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + .bp-user #buddypress #object-nav:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + .bp-user #buddypress #object-nav:hover:before, .bp-user #buddypress #object-nav:focus:before { + content: "Menu \021E7"; + } + .bp-user #buddypress #object-nav:hover ul, .bp-user #buddypress #object-nav:focus ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + .bp-user #buddypress #subnav { + clear: both; + } +} + +/*__ Horizontal menus __*/ +#buddypress #object-nav ul { + overflow: hidden; +} + +#buddypress #object-nav ul li { + float: none; +} + +@media screen and (max-width: 37.5em) { + #buddypress #object-nav ul li:not(:last-child) { + border-bottom: 1px solid #eaeaea; + } +} + +@media screen and (max-width: 37.5em) { + #buddypress #object-nav ul li:not(.selected):focus, #buddypress #object-nav ul li:not(.selected):hover { + background: #f2f2f2; + } +} + +@media screen and (min-width: 37.5em) { + #buddypress #object-nav ul li { + float: left; + } +} + +#buddypress div#subnav.item-list-tabs { + margin-top: 0; +} + +#buddypress div#subnav.item-list-tabs ul { + border-bottom: 0; + border-top: 1px solid #d4d0ba; + margin-top: 5px; + padding: 0; +} + +#buddypress div#subnav.item-list-tabs ul li.last { + background: #fff; + float: right; + margin-top: 0; + padding: 5px 0 5px; + text-align: right; + width: 230px; +} + +@media screen and (max-width: 30em) { + #buddypress div#subnav.item-list-tabs ul li.last { + float: none; + width: auto; + } +} + +#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; + padding: 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: 1rem; +} + +#buddypress div#subnav.item-list-tabs ul li.last select { + font-style: italic; +} + +#buddypress div#subnav.item-list-tabs ul li.last select option { + font-style: normal; +} + +.bp-user #buddypress div#subnav.item-list-tabs li.last { + margin-left: 0; + text-align: right; +} + +@media screen and (max-width: 30em) { + .bp-user #buddypress div#subnav.item-list-tabs li.last { + clear: left; + float: none; + margin-left: 10px; + text-align: left; + } +} + +/*__ Vertical menu User Account / Group single screens __*/ +@media screen and (min-width: 60em) { + body.full-width #buddypress #item-header, + body.full-width #buddypress #item-body { + background: #fff; + } + body.full-width #buddypress #object-nav { + border-right: 1px solid #ddd; + float: left; + margin-right: -1px; + width: 200px; + } + body.full-width #buddypress #object-nav ul { + background: none; + border-bottom: 0; + padding: 0; + } + body.full-width #buddypress #object-nav ul li { + float: none; + overflow: hidden; + } + body.full-width #buddypress #object-nav ul li span { + background: #fff; + border-radius: 10%; + float: right; + margin-right: 2px; + } + body.full-width #buddypress #item-body { + border-left: 1px solid #ddd; + overflow: hidden; + padding: 0 0 0 24px; + width: auto; + } + body.full-width #buddypress #item-body #subnav { + margin: 0 0 0 -24px; + } + body.full-width #buddypress #item-body #subnav ul { + margin-top: 0; + } +} + +@media screen and (min-width: 46.25em) { + #main #buddypress #group-create-tabs.item-list-tabs ul:before, + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + content: " "; + display: table; + } + #main #buddypress #group-create-tabs.item-list-tabs ul:after { + clear: both; + } + #main #buddypress #group-create-tabs.item-list-tabs ul { + background: none; + border: 0; + border-bottom: 1px solid #ddd; + overflow: visible; + padding-bottom: 0; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li { + float: left; + width: auto; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current { + border: 1px solid #ddd; + 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; + } + #main #buddypress #group-create-tabs.item-list-tabs ul li.selected a, + #main #buddypress #group-create-tabs.item-list-tabs ul li.current a { + background: none; + color: #141412; + outline: none; + } + #main #buddypress #subnav ul { + border-bottom: 0; + } +} + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ +#buddypress div.pagination { + box-shadow: none; + min-height: 0; +} + +#buddypress div.pagination:before, #buddypress div.pagination:after { + height: 0; + width: 0; +} + +#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 ul.item-list { + border-top: 0; +} + +#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: 37.5em) { + #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; + margin-bottom: 10px; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li .item-avatar img.avatar { + display: block; + float: left; + } +} + +#buddypress ul.item-list li .item { + margin-left: 0; + overflow: hidden; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item { + margin-left: 15%; + } +} + +#buddypress ul.item-list li .item .item-meta { + text-align: center; +} + +@media screen and (min-width: 61.5625em) { + #buddypress ul.item-list li .item .item-meta { + text-align: left; + } +} + +#buddypress ul.item-list li .item span.activity { + font-style: italic; +} + +#buddypress ul.item-list li .item .item-desc { + margin-left: 0; + width: 94%; +} + +#buddypress ul.item-list li .item .item-title { + font-size: 16px; + font-size: 1.1428571429rem; + line-height: 1.2; + text-align: center; + width: 100%; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li .item .item-title { + text-align: left; + } +} + +#buddypress ul.item-list li .item .item-title > a { + text-decoration: none; +} + +#buddypress ul.item-list li .item .item-title > a:visited { + color: #21759b; +} + +#buddypress ul.item-list li .item .item-title .update { + display: block; + font-size: 12px; + font-size: 0.8571428571rem; + padding: 10px 0; + text-align: left; +} + +@media screen and (min-width: 60em) { + #buddypress ul.item-list li .item .item-title .update { + font-size: 14px; + font-size: 1rem; + } +} + +@media screen and (min-width: 60em) { + #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: 5%; + margin-left: 0; + position: relative; + width: 55%; + } + #buddypress ul.item-list li .item .item-title { + font-size: 18px; + font-size: 1.2857142857rem; + } +} + +#buddypress ul.item-list li div.action { + clear: left; + float: none; + margin-bottom: -24px; + margin-left: 0; + padding: 24px 0 5px; + position: relative; + text-align: left; + top: 0; +} + +@media screen and (min-width: 60em) { + #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; +} + +@media screen and (min-width: 37.5em) { + #buddypress ul.item-list li div.action div { + margin: 0 10px 10px 0; + width: auto; + } +} + +@media screen and (min-width: 60em) { + #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; +} + +@media screen and (max-width: 46.25em) { + #buddypress form#whats-new-form #whats-new-content { + clear: left; + margin: 10px 0 24px; + padding: 10px 0 0; + } +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + border: 1px solid rgba(212, 208, 186, 0.5); + float: left; + line-height: 1.5em; + margin-top: 12px; + padding-left: 0.2em; + width: 100%; +} + +#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select { + background: none; + border: 0; + float: right; + margin: 0; + min-height: 1.5em; + padding: 0 0 0 0.4em; +} + +@media screen and (min-width: 30em) { + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box { + width: auto; + } + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit { + float: right; + } + #buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit input { + padding: 2px 6px; + } +} + +#buddypress #item-body form#whats-new-form { + margin: 48px 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: 24px; + margin-left: 0; + width: 60px; +} + +#buddypress #activity-stream li .activity-content, +#buddypress #activity-stream li .activity-comments { + margin-left: 0; +} + +#buddypress #activity-stream li .activity-header { + font-size: 14px; + font-size: 1rem; +} + +#buddypress #activity-stream li .activity-header a:visited { + color: #21759b; +} + +#buddypress #activity-stream li .activity-inner img { + height: auto; +} + +@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.1428571429rem; + } + #buddypress #activity-stream li .activity-comments { + margin-left: 70px; + } +} + +#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: 14px; + font-size: 1rem; +} + +#buddypress #activity-stream li.mini .activity-content .activity-meta a { + font-size: 12px; + font-size: 0.8571428571rem; +} + +#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 { + border-bottom: 1px solid rgba(234, 234, 234, 0.6); + margin-top: 0; + 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; + font-size: 14px; + font-size: 1rem; + margin-bottom: 5px; + padding: 0.2em 0.5em; +} + +@media screen and (min-width: 37.5em) { + #buddypress #activity-stream .activity-content .activity-meta a { + float: left; + margin-bottom: 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 a { + display: block; +} + +/* Single activity view - activity permalink */ +.activity-permalink #buddypress #activity-stream li.activity-item { + padding: 24px; +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 16px; + font-size: 1.1428571429rem; + margin-bottom: 48px; +} + +@media screen and (min-width: 46.25em) { + .activity-permalink #buddypress #activity-stream li.mini .activity-header { + font-size: 20px; + font-size: 1.4285714286rem; + } +} + +.activity-permalink #buddypress #activity-stream li.mini .activity-header p { + padding: 24px; +} + +.activity-permalink #buddypress #activity-stream .activity-comments { + margin-left: 0; +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress #activity-stream .activity-comments { + position: relative; +} + +#buddypress #activity-stream .activity-comments > ul { + background: rgba(247, 247, 247, 0.6); + margin: 10px 0 0 2px; +} + +#buddypress #activity-stream .activity-comments > ul > li:hover * { + color: #555; +} + +#buddypress #activity-stream .activity-comments > ul > li .acomment-meta, +#buddypress #activity-stream .activity-comments > ul > li .acomment-content { + font-size: 12px; + font-size: 0.8571428571rem; +} + +#buddypress #activity-stream .activity-comments .ac-form { + border: 1px solid #d4d0ba; + box-sizing: border-box; + margin: 10px 0; + width: 100%; +} + +#buddypress #activity-stream .activity-comments .ac-form input[type="submit"], +#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel { + color: rgba(20, 20, 18, 0.8); + display: inline-block; + font-family: inherit; + font-size: 12px; + font-size: 0.8571428571rem; + 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(212, 208, 186, 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: 60em) { + #buddypress #members-list li .item-avatar, + #buddypress #members-list li .item { + float: left; + } + #buddypress #members-list li .action { + float: right; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ +#buddypress #signup_form.standard-form #profile-details-section, +#buddypress #signup_form.standard-form #basic-details-section, +#buddypress #signup_form.standard-form #blog-details-section { + float: none; + width: 100%; +} + +@media screen and (min-width: 37.5em) { + #buddypress #signup_form.standard-form #profile-details-section, + #buddypress #signup_form.standard-form #basic-details-section, + #buddypress #signup_form.standard-form #blog-details-section { + width: 48%; + } +} + +@media screen and (min-width: 37.5em) { + #buddypress #signup_form.standard-form #profile-details-section { + float: right; + } + #buddypress #signup_form.standard-form #basic-details-section { + float: left; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ +.bp-user #buddypress a:visited { + color: #21759b; +} + +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ +.bp-user #buddypress #item-header-content #item-meta, +.single-item.groups #buddypress #item-header-content #item-meta { + font-size: 14px; + font-size: 1rem; + text-align: left; +} + +.bp-user #buddypress #item-header-content #item-meta p, +.single-item.groups #buddypress #item-header-content #item-meta p { + margin-bottom: 0.5em; +} + +@media screen and (max-width: 37.5em) { + .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 main header.entry-header, + .single-item.groups main header.entry-header { + padding-bottom: 1rem; + } +} + +@media screen and (max-width: 37.5em) { + .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) { + .bp-user #buddypress #item-header .generic-button, + .single-item.groups #buddypress #item-header .generic-button { + float: none; + margin: 1.5em 0 0 0; + } +} + +/** +*----------------------------------------------------- +* @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: 24px; + } +} + +@media screen and (max-width: 50em) { + .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 #item-actions h3 { + border-bottom: 1px solid #eaeaea; + text-align: center; + } +} + +.single-item.groups #buddypress div#item-header { + padding-bottom: 48px; +} + +.single-item.groups #buddypress div#item-header #item-header-content { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.single-item.groups #buddypress div#item-header div#item-actions { + margin: 0 !important; + width: 100%; +} + +@media screen and (min-width: 50em) { + .single-item.groups #buddypress div#item-header div#item-actions { + border-left: 1px solid #eaeaea; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } +} + +@media screen and (min-width: 46.25em) { + .single-item.groups #buddypress div#item-header div#item-actions { + width: 40%; + } +} + +.single-item.groups #buddypress div#item-header div#item-actions ul { + margin-top: 0; + padding-left: 0; +} + +.single-item.groups #buddypress div#item-header div#item-actions h3 { + font-size: 14px; + font-size: 1rem; + padding: 0.2em; +} + +.single-item.groups #buddypress div#item-header div#item-actions #group-admins li, +.single-item.groups #buddypress div#item-header div#item-actions #group-mods li { + margin: 0; +} + +@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-content { + margin-left: 2%; + padding: 0 0.5em; + } + .single-item.groups #buddypress div#item-header div#item-actions { + float: right; + width: 28%; + } +} + +@media screen and (min-width: 64em) { + .single-item.groups #buddypress div#item-header #item-header-content { + width: 40%; + } +} + +.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions { + margin-top: 225px !important; +} + +@media screen and (min-width: 50em) and (max-width: 60em) { + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-header-content { + max-width: 60% !important; + width: 60% !important; + } +} + +@media screen and (max-width: 64em) { + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions { + border: 0; + clear: both; + margin-top: 0 !important; + max-width: 100% !important; + padding-top: 0 !important; + width: auto; + } + .single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions h3 { + border-bottom: 1px solid #eaeaea; + } +} + +/** +*----------------------------------------------------- +* @subsection 6.1.2 - Item Header User Accounts +* +* User Accounts Specific Item Header +*----------------------------------------------------- +*/ +.bp-user #buddypress #item-header { + padding: 24px 0; +} + +.bp-user #buddypress #item-header #item-header-avatar { + text-align: center; +} + +.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; +} + +.bp-user #buddypress #item-header #item-header-content #item-buttons .generic-button { + margin-right: 5px; +} + +@media screen and (min-width: 46.25em) { + .bp-user #buddypress #item-header #item-header-avatar { + float: left; + } + .bp-user #buddypress #item-header #item-header-avatar a { + float: left; + } + .bp-user #buddypress #item-header #item-header-content { + float: right; + margin-right: 0%; + width: 69%; + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ +/** +*---------------------------------------------------- +* @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.edit-details #group-settings-form label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; +} + +.groups.edit-details #group-settings-form textarea + p label { + background: none; + color: inherit; + font-size: 14px; + font-size: 1rem; + width: auto; +} + +.groups.edit-details #group-settings-form textarea { + height: auto; + min-height: 100px; + overflow: auto; +} + +.groups.group-settings #group-settings-form div.radio label { + border: 1px solid #eaeaea; + padding: 0.2em; +} + +.groups.group-settings #group-settings-form div.radio label ul { + color: rgba(20, 20, 18, 0.6); + font-size: 14px; + font-size: 1rem; +} + +.groups.group-avatar form > p { + margin-top: 24px; +} + +.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: 37.5em) { + .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 +*----------------------------------------- +*/ +.groups.group-members #subnav li { + width: 100%; +} + +@media screen and (max-width: 37.5em) { + .groups.group-members #subnav li { + background: #fff; + padding: 24px 0; + } +} + +.groups.group-members #subnav li #search-members-form { + float: right; + margin: 5px 5px 0 0; +} + +@media screen and (max-width: 37.5em) { + .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.2 - Item Body User Accounts +* +* User Account specific component 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: 13px; + font-size: 0.9285714286rem; +} + +.bp-user #buddypress table td { + font-size: 12px; + font-size: 0.8571428571rem; +} + +@media screen and (min-width: 60em) { + .bp-user #buddypress table th { + font-size: 16px; + font-size: 1.1428571429rem; + } + .bp-user #buddypress table td { + font-size: 14px; + font-size: 1rem; + } +} + +.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: 37.5em) { + .bp-user #buddypress .notifications-options-nav, + .bp-user #buddypress .messages-options-nav { + width: 40%; + } +} + +.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: 1rem; + outline: 0; + padding: 0; +} + +.bp-user #buddypress .notifications-options-nav select, +.bp-user #buddypress .messages-options-nav select { + float: left; + margin-right: 0; + width: 49%; +} + +@media screen and (min-width: 37.5em) { + .bp-user #buddypress .notifications-options-nav select, + .bp-user #buddypress .messages-options-nav select { + width: auto; + } +} + +.bp-user #buddypress .notifications-options-nav input, +.bp-user #buddypress .messages-options-nav input { + float: left; + font-family: inherit; + line-height: 20px; + margin-left: 1%; + width: 50%; +} + +@media screen and (min-width: 37.5em) { + .bp-user #buddypress .notifications-options-nav input, + .bp-user #buddypress .messages-options-nav input { + width: auto; + } +} + +.bp-user #buddypress .notifications-options-nav input[disabled="disabled"]:focus, .bp-user #buddypress .notifications-options-nav input[disabled="disabled"]:hover, +.bp-user #buddypress .messages-options-nav input[disabled="disabled"]:focus, +.bp-user #buddypress .messages-options-nav input[disabled="disabled"]:hover { + background: none; +} + +/** + *------------------------------------------- + * @subsection 6.2.2.2 - Extended Profiles + *------------------------------------------- + */ +.bp-user #buddypress .profile { + /* Edit profile */ +} + +.bp-user #buddypress .profile .bp-widget h4 { + background: #6f6f6f; + color: #fff; + margin-bottom: 0; + padding: 0.4em; +} + +.bp-user #buddypress .profile .bp-widget table { + margin-top: 0; +} + +.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.2857142857rem; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle { + margin: 5px 0 24px; +} + +.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: 1rem; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link { + background: #6f6f6f; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + -ms-border-radius: 2px; + border-radius: 2px; + background-clip: padding-box; + color: #eee; + font-weight: bold; + padding: 0.1em 0.5em; + text-decoration: none; +} + +.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:focus, .bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:hover, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:focus, +.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:hover { + color: #fff; +} + +.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 #message-thread a { + border-bottom: 0; +} + +.bp-user #buddypress #message-thread #message-subject { + background: #6f6f6f; + 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-recipients .highlight { + font-size: 100%; +} + +.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: #6f6f6f; +} + +.bp-user #buddypress #message-threads tr td { + background: #fff; + box-sizing: border-box; + 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: 1px solid #ccc; + 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.thread-star { + vertical-align: middle; +} + +.bp-user #buddypress #message-threads tr td.thread-star .message-action-star, +.bp-user #buddypress #message-threads tr td.thread-star .message-action-unstar { + line-height: 1.2; +} + +.bp-user #buddypress #message-threads tr td.thread-star span.icon:before { + font-size: 14px; + font-size: 1rem; +} + +.bp-user #buddypress #message-threads tr td.bulk-select-check, +.bp-user #buddypress #message-threads tr td.thread-from { + height: 3em; +} + +@media screen and (max-width: 37.5em) { + .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: 0.8571428571rem; +} + +.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: 0.8571428571rem; + line-height: 1.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: 37.5em) { + .bp-user #buddypress #message-threads tr span.activity { + clear: both; + font-size: 11px; + font-size: 0.7857142857rem; + width: 100%; + } +} + +.bp-user #buddypress #message-threads tr.unread td { + border-color: #eaeaea; +} + +.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 #send_message_form input, +.bp-user #buddypress #send_message_form textarea { + box-sizing: border-box; +} + +.bp-user #buddypress .acfb-holder { + list-style: none; +} + +.bp-user #buddypress .acfb-holder li { + margin-left: 0; +} + +.bp-user #buddypress .acfb-holder li.friend-tab { + background: #edf7fa; + border: inherit; + margin-right: 0; + padding: 0.5em; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p { + padding-left: 10px; +} + +.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus, .bp-user #buddypress .acfb-holder li.friend-tab span.p:hover { + color: #c82b2b; + cursor: pointer; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a { + border-bottom: 0; + text-decoration: none; +} + +.bp-user #buddypress .acfb-holder li.friend-tab a img { + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; +} + +.bp-user #buddypress #message-threads.sitewide-notices tr { + margin: 3em 0; +} + +.bp-user #buddypress #message-threads.sitewide-notices td { + width: 100%; +} + +.bp-user #buddypress #message-threads.sitewide-notices td strong { + background: #6f6f6f; + 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 a.button { + border: 1px solid #d4d0ba; + line-height: initial; + padding: 0.4em 0.3em; +} + +.bp-user #buddypress #message-threads.sitewide-notices td:first-child { + display: none; +} + +.bp-user #buddypress #message-threads.sitewide-notices td:nth-child(2) strong { + margin: -8px -8px 8px; +} + +.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 { + line-height: 1; + padding-bottom: 1em; + 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; +} + +.bp-user .ac_results { + background: #eee; + padding-left: 10px; +} + +.bp-user .ac_results li { + margin: 10px 0; +} + +.bp-user .ac_results li:focus, .bp-user .ac_results li:hover { + cursor: pointer; +} + +.bp-user .ac_results li img { + vertical-align: bottom; +} + +/** + *------------------------------ + * @subsection 6.2.2.6 - Settings + *------------------------------ + */ +.bp-user #buddypress #settings-form > p { + font-size: 20px; + font-size: 1.4285714286rem; + margin: 24px 0 10px; +} + +.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%; +} + +/** + *------------------------------------ + * @subsection 6.2.2.6 - Notifications + *------------------------------------ + */ +/** +*------------------------------------------------------------------------------- +* @section 7.0 - Forms - General +*------------------------------------------------------------------------------- +*/ +#main #buddypress .standard-form li { + float: none; +} + +#main #buddypress .standard-form input[type='text'], +#main #buddypress .standard-form input[type='email'], +#main #buddypress .standard-form input[type='password'], +#main #buddypress .standard-form textarea { + width: 100%; +} + +#buddypress div.activity-comments form .ac-textarea { + background: #f7f7f7; + border: 1px solid rgba(212, 208, 186, 0.5); +} + +#buddypress div.activity-comments form .ac-textarea textarea { + background: none; + border: 0; +} + +#buddypress .standard-form input[type="text"], +#buddypress .standard-form input[type="email"], +#buddypress .standard-form input[type="password"], +#buddypress .standard-form button, +#buddypress .standard-form select, +#buddypress .standard-form textarea { + border-color: rgba(212, 208, 186, 0.5); + border-width: 1px; +} + +#buddypress #signup_form.standard-form div.submit { + float: none; +} + +#buddypress #signup_form.standard-form div.submit input { + margin-right: 0; +} + +#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(212, 208, 186, 0.6); + overflow: hidden; +} + +#buddypress div.dir-search form label, +#buddypress div.message-search form label, +#buddypress li.groups-members-search form label { + float: left; + width: 70%; +} + +#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: 1rem; + border: 0; + border-radius: 0; + line-height: 1.8; + min-height: 2rem; +} + +#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(212, 208, 186, 0.6); + float: left; + margin: 0; + padding: 0 0.2em 0; + width: 100%; +} + +#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 1em; + text-align: center; + text-transform: none; + width: 30%; +} + +@media screen and (min-width: 37.5em) { + #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: 75em) { + #buddypress .dir-search form input[type='text'], + #buddypress .message-search form input[type='text'] { + font-size: 16px; + font-size: 1.1428571429rem; + } + #buddypress .dir-search form input[type='submit'], + #buddypress .message-search form input[type='submit'] { + font-size: 16px; + font-size: 1.1428571429rem; + } +} + +/** +*------------------------------------------------------------------------------- +* @section 8.0 - Tables - General +*------------------------------------------------------------------------------- +*/ +.bp-user #buddypress table { + font-size: 14px; + font-size: 1rem; + margin: 24px 0; +} + +.bp-user #buddypress table tr th { + background: #6f6f6f; + border-color: #b7b7b7; + color: #fff; + padding: 0 8px; +} + +.bp-user #buddypress table tr td { + padding: 8px; +} + +.bp-user #buddypress table p { + margin-bottom: 0.5em; +} + +@media screen and (min-width: 55em) { + .bp-user #buddypress table { + font-size: 16px; + font-size: 1.1428571429rem; + } +} + +.bp-user #buddypress .notifications th, +.bp-user #buddypress .messages-notices th { + width: 30%; +} + +.bp-user #buddypress .notifications th.bulk-select-all, +.bp-user #buddypress .messages-notices th.bulk-select-all { + text-align: center; + width: 10%; +} + +.bp-user #buddypress .notifications th.actions, +.bp-user #buddypress .messages-notices th.actions { + text-align: center; +} + +.bp-user #buddypress .notifications .bulk-select-check, +.bp-user #buddypress .notifications .thread-star, +.bp-user #buddypress .messages-notices .bulk-select-check, +.bp-user #buddypress .messages-notices .thread-star { + text-align: center; +} + +.bp-user #buddypress .notifications .notification-actions, +.bp-user #buddypress .notifications td.thread-options, +.bp-user #buddypress .messages-notices .notification-actions, +.bp-user #buddypress .messages-notices td.thread-options { + text-align: center; +} + +.bp-user #buddypress .notifications .notification-actions a, +.bp-user #buddypress .notifications td.thread-options a, +.bp-user #buddypress .messages-notices .notification-actions a, +.bp-user #buddypress .messages-notices td.thread-options a { + display: inline-block; + margin: 0; + padding: 0; +} + +.bp-user #buddypress .notifications td .button, +.bp-user #buddypress .messages-notices td .button { + border: 0; + display: block; + padding: 0; + text-align: center; +} + +/** +*------------------------------------------------------------------------------- +* @section 9.0 - Error / Success messages +*------------------------------------------------------------------------------- +*/ +#buddypress div#message p { + font-size: 18px; + font-size: 1.2857142857rem; + 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 +*------------------------------------------------------------------------------- +*/ diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.min.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.min.css new file mode 100644 index 0000000000000000000000000000000000000000..ac528eccd30473ab96e5dc2f34d19622f8a1ff3c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.min.css @@ -0,0 +1 @@ +@charset "UTF-8";.buddypress div.clear{display:none}#buddypress div.item-list-tabs ul li.current a,#buddypress div.item-list-tabs ul li.selected a{background:inherit;opacity:1}#buddypress div.item-list-tabs ul{overflow:hidden;padding:0}#buddypress div.item-list-tabs ul li a:focus,#buddypress div.item-list-tabs ul li a:hover{color:#555}#buddypress div.item-list-tabs ul li a:visited{color:#21759b}#buddypress div.item-list-tabs ul li a span{border-radius:25%}@media screen and (max-width:30em){.bp-user #buddypress #object-nav{border:1px solid #eaeaea;overflow:visible;padding:10px}.bp-user #buddypress #object-nav ul{border:0;height:0;transition:height .3s ease-in-out .7s;visibility:hidden}.bp-user #buddypress #object-nav:before{content:"Menu \021E9";display:inline;opacity:.7}.bp-user #buddypress #object-nav:focus:before,.bp-user #buddypress #object-nav:hover:before{content:"Menu \021E7"}.bp-user #buddypress #object-nav:focus ul,.bp-user #buddypress #object-nav:hover ul{height:320px;opacity:1;overflow-y:auto;visibility:visible}.bp-user #buddypress #subnav{clear:both}}#buddypress #object-nav ul{overflow:hidden}#buddypress #object-nav ul li{float:none}@media screen and (max-width:37.5em){#buddypress #object-nav ul li:not(:last-child){border-bottom:1px solid #eaeaea}#buddypress #object-nav ul li:not(.selected):focus,#buddypress #object-nav ul li:not(.selected):hover{background:#f2f2f2}}@media screen and (min-width:37.5em){#buddypress #object-nav ul li{float:left}}#buddypress div#subnav.item-list-tabs{margin-top:0}#buddypress div#subnav.item-list-tabs ul{border-bottom:0;border-top:1px solid #d4d0ba;margin-top:5px;padding:0}#buddypress div#subnav.item-list-tabs ul li.last{background:#fff;float:right;margin-top:0;padding:5px 0;text-align:right;width:230px}#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;padding: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:1rem}#buddypress div#subnav.item-list-tabs ul li.last select{font-style:italic}#buddypress div#subnav.item-list-tabs ul li.last select option{font-style:normal}#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}.bp-user #buddypress div#subnav.item-list-tabs li.last{margin-left:0;text-align:right}@media screen and (max-width:30em){#buddypress div#subnav.item-list-tabs ul li.last{float:none;width:auto}.bp-user #buddypress div#subnav.item-list-tabs li.last{clear:left;float:none;margin-left:10px;text-align:left}}@media screen and (min-width:60em){body.full-width #buddypress #item-body,body.full-width #buddypress #item-header{background:#fff}body.full-width #buddypress #object-nav{border-right:1px solid #ddd;float:left;margin-right:-1px;width:200px}body.full-width #buddypress #object-nav ul{background:0 0;border-bottom:0;padding:0}body.full-width #buddypress #object-nav ul li{float:none;overflow:hidden}body.full-width #buddypress #object-nav ul li span{background:#fff;border-radius:10%;float:right;margin-right:2px}body.full-width #buddypress #item-body{border-left:1px solid #ddd;overflow:hidden;padding:0 0 0 24px;width:auto}body.full-width #buddypress #item-body #subnav{margin:0 0 0 -24px}body.full-width #buddypress #item-body #subnav ul{margin-top:0}}@media screen and (min-width:46.25em){#main #buddypress #group-create-tabs.item-list-tabs ul:after,#main #buddypress #group-create-tabs.item-list-tabs ul:before{content:" ";display:table}#main #buddypress #group-create-tabs.item-list-tabs ul:after{clear:both}#main #buddypress #group-create-tabs.item-list-tabs ul{background:0 0;border:0;border-bottom:1px solid #ddd;overflow:visible;padding-bottom:0}#main #buddypress #group-create-tabs.item-list-tabs ul li{float:left;width:auto}#main #buddypress #group-create-tabs.item-list-tabs ul li.current,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected{border:1px solid #ddd;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}#main #buddypress #group-create-tabs.item-list-tabs ul li.current a,#main #buddypress #group-create-tabs.item-list-tabs ul li.selected a{background:0 0;color:#141412;outline:0}#main #buddypress #subnav ul{border-bottom:0}}#buddypress div.pagination{box-shadow:none;min-height:0}#buddypress div.pagination:after,#buddypress div.pagination:before{height:0;width:0}#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 #activity-stream li .activity-header a:visited,#buddypress ul.item-list li .item .item-title>a:visited{color:#21759b}#buddypress div.pagination .pagination-links .next:before,#buddypress div.pagination .pagination-links .prev:before{display:none}#buddypress div.pagination .pagination-links .prev{left:auto;position:static}#buddypress div.pagination .pagination-links .next{position:static;right:auto}#buddypress ul.item-list{border-top:0}#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:37.5em){#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;margin-bottom:10px}#buddypress ul.item-list li .item{margin-left:0;overflow:hidden}#buddypress ul.item-list li .item .item-meta{text-align:center}@media screen and (min-width:61.5625em){#buddypress ul.item-list li .item{margin-left:15%}#buddypress ul.item-list li .item .item-meta{text-align:left}}#buddypress ul.item-list li .item .item-desc{margin-left:0;width:94%}#buddypress ul.item-list li .item .item-title{font-size:16px;font-size:1.1428571429rem;line-height:1.2;text-align:center;width:100%}@media screen and (min-width:37.5em){#buddypress ul.item-list li .item-avatar img.avatar{display:block;float:left}#buddypress ul.item-list li .item .item-title{text-align:left}}#buddypress ul.item-list li .item .item-title>a{text-decoration:none}#buddypress ul.item-list li .item .item-title .update{display:block;font-size:12px;font-size:.8571428571rem;padding:10px 0;text-align:left}@media screen and (min-width:60em){#buddypress ul.item-list li .item .item-title .update{font-size:14px;font-size:1rem}#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:5%;margin-left:0;position:relative;width:55%}#buddypress ul.item-list li .item .item-title{font-size:18px;font-size:1.2857142857rem}}#buddypress ul.item-list li div.action{clear:left;float:none;margin-bottom:-24px;margin-left:0;padding:24px 0 5px;position:relative;text-align:left;top:0}@media screen and (min-width:60em){#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}@media screen and (min-width:37.5em){#buddypress ul.item-list li div.action div{margin:0 10px 10px 0;width:auto}}@media screen and (min-width:60em){#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}@media screen and (max-width:46.25em){#buddypress form#whats-new-form #whats-new-content{clear:left;margin:10px 0 24px;padding:10px 0 0}}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{border:1px solid rgba(212,208,186,.5);float:left;line-height:1.5em;margin-top:12px;padding-left:.2em;width:100%}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box select{background:0 0;border:0;float:right;margin:0;min-height:1.5em;padding:0 0 0 .4em}@media screen and (min-width:30em){#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-post-in-box{width:auto}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit{float:right}#buddypress form#whats-new-form #whats-new-content.active #whats-new-options[style] #whats-new-submit input{padding:2px 6px}}#buddypress #item-body form#whats-new-form{margin:48px 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:24px;margin-left:0;width:60px}#buddypress #activity-stream li .activity-comments,#buddypress #activity-stream li .activity-content{margin-left:0}#buddypress #activity-stream li .activity-header{font-size:14px;font-size:1rem}#buddypress #activity-stream li .activity-inner img{height:auto}@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.1428571429rem}#buddypress #activity-stream li .activity-comments{margin-left:70px}}#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:14px;font-size:1rem}#buddypress #activity-stream li.mini .activity-content .activity-meta a{font-size:12px;font-size:.8571428571rem}#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{border-bottom:1px solid rgba(234,234,234,.6);margin-top:0;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;font-size:14px;font-size:1rem;margin-bottom:5px;padding:.2em .5em}@media screen and (min-width:37.5em){#buddypress #activity-stream .activity-content .activity-meta a{float:left;margin-bottom:0}}#buddypress #activity-stream .load-more{background:#f7f7f7;border:1px solid transparent;padding:10px}.activity-permalink #buddypress #activity-stream li.activity-item,.activity-permalink #buddypress #activity-stream li.mini .activity-header p{padding:24px}#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 #activity-stream li.mini .activity-header{font-size:16px;font-size:1.1428571429rem;margin-bottom:48px}@media screen and (min-width:46.25em){.activity-permalink #buddypress #activity-stream li.mini .activity-header{font-size:20px;font-size:1.4285714286rem}}.activity-permalink #buddypress #activity-stream .activity-comments{margin-left:0}#buddypress #activity-stream .activity-comments{position:relative}#buddypress #activity-stream .activity-comments>ul{background:rgba(247,247,247,.6);margin:10px 0 0 2px}#buddypress #activity-stream .activity-comments>ul>li:hover *{color:#555}#buddypress #activity-stream .activity-comments>ul>li .acomment-content,#buddypress #activity-stream .activity-comments>ul>li .acomment-meta{font-size:12px;font-size:.8571428571rem}#buddypress #activity-stream .activity-comments .ac-form{border:1px solid #d4d0ba;box-sizing:border-box;margin:10px 0;width:100%}#buddypress #activity-stream .activity-comments .ac-form .ac-reply-cancel,#buddypress #activity-stream .activity-comments .ac-form input[type=submit]{color:rgba(20,20,18,.8);display:inline-block;font-family:inherit;font-size:12px;font-size:.8571428571rem;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(212,208,186,.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:60em){#buddypress #members-list li .item,#buddypress #members-list li .item-avatar{float:left}#buddypress #members-list li .action{float:right}}#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{float:none;width:100%}@media screen and (min-width:37.5em){#buddypress #signup_form.standard-form #basic-details-section,#buddypress #signup_form.standard-form #blog-details-section,#buddypress #signup_form.standard-form #profile-details-section{width:48%}#buddypress #signup_form.standard-form #profile-details-section{float:right}#buddypress #signup_form.standard-form #basic-details-section{float:left}}.bp-user #buddypress a:visited{color:#21759b}.bp-user #buddypress #item-header-content #item-meta,.single-item.groups #buddypress #item-header-content #item-meta{font-size:14px;font-size:1rem;text-align:left}.bp-user #buddypress #item-header-content #item-meta p,.single-item.groups #buddypress #item-header-content #item-meta p{margin-bottom:.5em}@media screen and (max-width:37.5em){.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){.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}.single-item.groups #buddypress #item-header #item-meta{margin-bottom:24px}}@media screen and (max-width:50em){.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 #item-actions h3{border-bottom:1px solid #eaeaea;text-align:center}}.single-item.groups #buddypress div#item-header{padding-bottom:48px}.single-item.groups #buddypress div#item-header #item-header-content{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.single-item.groups #buddypress div#item-header div#item-actions{margin:0!important;width:100%}@media screen and (min-width:50em){.single-item.groups #buddypress div#item-header div#item-actions{border-left:1px solid #eaeaea;clear:none;float:right;padding-left:.2em;width:30%}}.single-item.groups #buddypress div#item-header div#item-actions ul{margin-top:0;padding-left:0}.single-item.groups #buddypress div#item-header div#item-actions h3{font-size:14px;font-size:1rem;padding:.2em}.single-item.groups #buddypress div#item-header div#item-actions #group-admins li,.single-item.groups #buddypress div#item-header div#item-actions #group-mods li{margin:0}@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-content{margin-left:2%;padding:0 .5em}.single-item.groups #buddypress div#item-header div#item-actions{float:right;width:28%}}@media screen and (min-width:64em){.single-item.groups #buddypress div#item-header #item-header-content{width:40%}}.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions{margin-top:225px!important}@media screen and (min-width:50em) and (max-width:60em){.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-header-content{max-width:60%!important;width:60%!important}}@media screen and (max-width:64em){.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions{border:0;clear:both;margin-top:0!important;max-width:100%!important;padding-top:0!important;width:auto}.single-item.groups #buddypress #cover-image-container #item-header-cover-image #item-actions h3{border-bottom:1px solid #eaeaea}}.bp-user #buddypress #item-header{padding:24px 0}.bp-user #buddypress #item-header #item-header-avatar{text-align:center}.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}.bp-user #buddypress #item-header #item-header-content #item-buttons .generic-button{margin-right:5px}@media screen and (min-width:46.25em){.bp-user #buddypress #item-header #item-header-avatar,.bp-user #buddypress #item-header #item-header-avatar a{float:left}.bp-user #buddypress #item-header #item-header-content{float:right;margin-right:0;width:69%}}.groups #group-settings-form h4{background:#555;color:#fff;padding:.2em}.groups.edit-details #group-settings-form label{margin-bottom:0;padding:.2em;width:80%}.groups.edit-details #group-settings-form textarea+p label{background:0 0;color:inherit;font-size:14px;font-size:1rem;width:auto}.groups.edit-details #group-settings-form textarea{height:auto;min-height:100px;overflow:auto}.groups.group-settings #group-settings-form div.radio label{border:1px solid #eaeaea;padding:.2em}.groups.group-settings #group-settings-form div.radio label ul{color:rgba(20,20,18,.6);font-size:14px;font-size:1rem}.groups.group-avatar form>p{margin-top:24px}.groups.manage-members #group-settings-form .item-list li{border-bottom:1px solid #eaeaea}.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 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 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:37.5em){.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}.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:37.5em){.groups.group-members #subnav li{background:#fff;padding:24px 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%}}.bp-user .entry-title{margin-bottom:.5em}.bp-user #buddypress table th{font-size:13px;font-size:.9285714286rem}.bp-user #buddypress table td{font-size:12px;font-size:.8571428571rem}@media screen and (min-width:60em){.bp-user #buddypress table th{font-size:16px;font-size:1.1428571429rem}.bp-user #buddypress table td{font-size:14px;font-size:1rem}}.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{float:left;width:100%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav,.bp-user #buddypress .notifications-options-nav{width:40%}}.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:1rem;outline:0;padding:0}.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{float:left;margin-right:0;width:49%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav select,.bp-user #buddypress .notifications-options-nav select{width:auto}}.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{float:left;font-family:inherit;line-height:20px;margin-left:1%;width:50%}@media screen and (min-width:37.5em){.bp-user #buddypress .messages-options-nav input,.bp-user #buddypress .notifications-options-nav input{width:auto}}.bp-user #buddypress .messages-options-nav input[disabled=disabled]:focus,.bp-user #buddypress .messages-options-nav input[disabled=disabled]:hover,.bp-user #buddypress .notifications-options-nav input[disabled=disabled]:focus,.bp-user #buddypress .notifications-options-nav input[disabled=disabled]:hover{background:0 0}.bp-user #buddypress .profile .bp-widget h4{background:#6f6f6f;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.2857142857rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-toggle{margin:5px 0 24px}.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:1rem}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link{background:#6f6f6f;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;border-radius:2px;background-clip:padding-box;color:#eee;font-weight:700;padding:.1em .5em;text-decoration:none}.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:focus,.bp-user #buddypress .profile #profile-edit-form .field-visibility-settings-close:hover,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:focus,.bp-user #buddypress .profile #profile-edit-form .visibility-toggle-link:hover{color:#fff}.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:#6f6f6f;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-recipients .highlight{font-size:100%}.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:#6f6f6f}.bp-user #buddypress #message-threads tr td{background:#fff;box-sizing:border-box;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:1px solid #ccc;height:2.4em;padding-bottom:.2em;padding-top:.2em}@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.thread-star{vertical-align:middle}.bp-user #buddypress #message-threads tr td.thread-star .message-action-star,.bp-user #buddypress #message-threads tr td.thread-star .message-action-unstar{line-height:1.2}.bp-user #buddypress #message-threads tr td.thread-star span.icon:before{font-size:14px;font-size:1rem}.bp-user #buddypress #message-threads tr td.bulk-select-check,.bp-user #buddypress #message-threads tr td.thread-from{height:3em}.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:.8571428571rem}.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:.8571428571rem;line-height:1.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}#buddypress #signup_form.standard-form div.submit,#main #buddypress .standard-form li{float:none}@media screen and (max-width:37.5em){.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:.7857142857rem;width:100%}}.bp-user #buddypress #message-threads tr.unread td{border-color:#eaeaea}.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 #send_message_form input,.bp-user #buddypress #send_message_form textarea{box-sizing:border-box}.bp-user #buddypress .acfb-holder{list-style:none}.bp-user #buddypress .acfb-holder li{margin-left:0}.bp-user #buddypress .acfb-holder li.friend-tab{background:#edf7fa;border:inherit;margin-right:0;padding:.5em}.bp-user #buddypress .acfb-holder li.friend-tab span.p{padding-left:10px}.bp-user #buddypress .acfb-holder li.friend-tab span.p:focus,.bp-user #buddypress .acfb-holder li.friend-tab span.p:hover{color:#c82b2b;cursor:pointer}.bp-user #buddypress .acfb-holder li.friend-tab a{border-bottom:0;text-decoration:none}.bp-user #buddypress .acfb-holder li.friend-tab a img{display:inline;height:20px;vertical-align:middle;width:20px!important}.bp-user #buddypress #message-threads.sitewide-notices td,.bp-user #buddypress table.profile-settings{width:100%}.bp-user #buddypress #message-threads.sitewide-notices tr{margin:3em 0}.bp-user #buddypress #message-threads.sitewide-notices td strong{background:#6f6f6f;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 a.button{border:1px solid #d4d0ba;line-height:initial;padding:.4em .3em}.bp-user #buddypress #message-threads.sitewide-notices td:first-child{display:none}.bp-user #buddypress #message-threads.sitewide-notices td:nth-child(2) strong{margin:-8px -8px 8px}.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{line-height:1;padding-bottom:1em;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 .ac_results{background:#eee;padding-left:10px}.bp-user .ac_results li{margin:10px 0}.bp-user .ac_results li:focus,.bp-user .ac_results li:hover{cursor:pointer}.bp-user .ac_results li img{vertical-align:bottom}.bp-user #buddypress #settings-form>p{font-size:20px;font-size:1.4285714286rem;margin:24px 0 10px}.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 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%}#main #buddypress .standard-form input[type=password],#main #buddypress .standard-form input[type=text],#main #buddypress .standard-form input[type=email],#main #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(212,208,186,.5)}#buddypress div.activity-comments form .ac-textarea textarea{background:0 0;border:0}#buddypress .standard-form button,#buddypress .standard-form input[type=email],#buddypress .standard-form input[type=password],#buddypress .standard-form input[type=text],#buddypress .standard-form select,#buddypress .standard-form textarea{border-color:rgba(212,208,186,.5);border-width:1px}#buddypress #signup_form.standard-form div.submit input{margin-right:0}#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(212,208,186,.6);overflow:hidden}#buddypress div.dir-search form label,#buddypress div.message-search form label,#buddypress li.groups-members-search form label{float:left;width:70%}#buddypress div.dir-search form input[type=submit],#buddypress div.dir-search form input[type=text],#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text]{font-size:14px;font-size:1rem;border:0;border-radius:0;line-height:1.8;min-height:2rem}#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(212,208,186,.6);float:left;margin:0;padding:0 .2em;width:100%}#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:0 1em;text-align:center;text-transform:none;width:30%}@media screen and (min-width:37.5em){#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=submit],#buddypress div.dir-search form input[type=text],#buddypress div.dir-search form label,#buddypress div.message-search form input[type=submit],#buddypress div.message-search form input[type=text],#buddypress div.message-search form label,#buddypress li.groups-members-search form input[type=submit],#buddypress li.groups-members-search form input[type=text],#buddypress li.groups-members-search form label{width:auto}}@media screen and (min-width:75em){#buddypress .dir-search form input[type=submit],#buddypress .dir-search form input[type=text],#buddypress .message-search form input[type=submit],#buddypress .message-search form input[type=text]{font-size:16px;font-size:1.1428571429rem}}.bp-user #buddypress table{font-size:14px;font-size:1rem;margin:24px 0}.bp-user #buddypress table tr th{background:#6f6f6f;border-color:#b7b7b7;color:#fff;padding:0 8px}.bp-user #buddypress table tr td{padding:8px}.bp-user #buddypress table p{margin-bottom:.5em}@media screen and (min-width:55em){.bp-user #buddypress table{font-size:16px;font-size:1.1428571429rem}}.bp-user #buddypress .messages-notices th,.bp-user #buddypress .notifications th{width:30%}.bp-user #buddypress .messages-notices th.bulk-select-all,.bp-user #buddypress .notifications th.bulk-select-all{text-align:center;width:10%}.bp-user #buddypress .messages-notices .bulk-select-check,.bp-user #buddypress .messages-notices .notification-actions,.bp-user #buddypress .messages-notices .thread-star,.bp-user #buddypress .messages-notices td.thread-options,.bp-user #buddypress .messages-notices th.actions,.bp-user #buddypress .notifications .bulk-select-check,.bp-user #buddypress .notifications .notification-actions,.bp-user #buddypress .notifications .thread-star,.bp-user #buddypress .notifications td.thread-options,.bp-user #buddypress .notifications th.actions{text-align:center}.bp-user #buddypress .messages-notices .notification-actions a,.bp-user #buddypress .messages-notices td.thread-options a,.bp-user #buddypress .notifications .notification-actions a,.bp-user #buddypress .notifications td.thread-options a{display:inline-block;margin:0;padding:0}.bp-user #buddypress .messages-notices td .button,.bp-user #buddypress .notifications td .button{border:0;display:block;padding:0;text-align:center}#buddypress div#message p{font-size:18px;font-size:1.2857142857rem;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} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.scss b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.scss new file mode 100644 index 0000000000000000000000000000000000000000..759060a6f146c9be409db553eed0a928da7c6024 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/twentytwelve.scss @@ -0,0 +1,2514 @@ + +// 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 . + +// 2012 Media Queries / Breakpoints. +// 2012 works two breakpoints 600px/960px + +// @media screen and (min-width: 37.500em) +// @media screen and (min-width: 61.5625em) + + + +// In addition BP can use the em breakpoints as referenced below to provide +// a series of finer breakpoints. +// @media screen and (max-width: 20em) xtra small mobile only 320px +// @media screen and (min-width: 30em) small only 480px +// @media screen and (min-width: 46.25em) 740px +// @media screen and (min-width: 75em) 1200px + +// Mixins and Variables + +// simplify remembering/writing media queries +// written as: +// @include medium-up { +// body {property: value;} +// } + +// 600px +@mixin small-up { + @media screen and (min-width: 37.500em) { + @content; + } +} +// 960px +@mixin medium-up { + @media screen and (min-width: 60em) { + @content; + } +} +// 1200px +@mixin large-up { + @media screen and (min-width: 75em) { + @content; + } +} + + +// Common spacing values +$spacing-val-lg: 48px; // Matches 2012 stated values - virt rhythm +$spacing-val-md: 24px; // Matches 2012 stated values - virt rhythm +$spacing-val-sm: 10px; +$spacing-val-xs: 5px; + +// A simple mixin to handle font-sizing +// 2012 sets a html/body size @ 14px/87.50% +@mixin font-size($font-size: 14) { + $rem-font-value: ($font-size / 14); + 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; +} + +// 2012 font family +@mixin default-font-sans() { + font-family: "Source Sans Pro", Helvetica, sans-serif; +} + +// Variables: color definitions +$body-text: #141412; +$content-background: #fff; +$off-white: lighten(#f9f8ee, 0.7); +$cream-background: #f7f5e7; +$light-background: #f7f7f7; +$medium-background: #ccc; +$dark-background: #555; +$border-color: #d4d0ba; // border color is varied using rgba +$border-light: #eaeaea; // BP dividers +$border-med: #ddd; +$background-hover: #db572f; // 2012 link background hover +$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: #9dc3c8; +$link-action: #c82b2b; +/*-------------------------------------------------------------- + +This is the BuddyPress companion stylesheet for +the WordPress Twentytwelve theme. + +This sheet supports the primary BuddyPress styles in buddypress.css + +If you are running as a child theme of twentytwelve 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, Register, activation +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.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 + 6.2.2.7 - Notifications +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, Globals +*------------------------------------------------------------------------------- +*/ + + + +.buddypress { + // Remove any empty clearing elements, CSS provides clearing. + div.clear {display: none;} + +} // .buddypress (body class) + + +/** +*------------------------------------------------------------------------------- +* @section 2.0 - Navigation - General +*------------------------------------------------------------------------------- +*/ + + +/** +*---------------------------------------------------------- +* @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 will appear over weighted in selectors + +#buddypress { + + // active/current states all navs + div.item-list-tabs { + ul { + li.selected, + li.current { + a { + background: inherit; + opacity: 1; + } + } + } + } + // global nav styles + div.item-list-tabs { + ul { + overflow: hidden; + padding: 0; + + li { + a { + + &:focus, + &:hover { + color: #555; + } + // Keep links from inheriting :visited states + &:visited { + color: #21759b; + } + + span {border-radius: 25%;} + } + + } + } + } // close item-list-tabs + +} // close #buddypress + +// .bp-user #object-nav @ small screen as a dropdown + +.bp-user { + + #buddypress { + + @media screen and (max-width: 30em) { + + #object-nav { + border: 1px solid $border-light; + overflow: visible; + padding: $spacing-val-sm; + + ul { + border: 0; + height: 0; + // all latest vendor releases handle transitions, so no prefixes used. + transition: height 0.3s ease-in-out 0.7s; + visibility: hidden; + } + + &:before { + content: "Menu \021E9"; + display: inline; + opacity: 0.7; + } + + &:hover, + &:focus { + &:before {content: "Menu \021E7";} + + ul { + height: 320px; + opacity: 1; + overflow-y: auto; + visibility: visible; + } + } + } + + #subnav { + clear: both; + } + + } // close @media + } +} + +/*__ Horizontal menus __*/ +#buddypress { + + #object-nav { + + ul { + overflow: hidden; + + li { + float: none; + } + + @media screen and (max-width: 37.500em) { + li:not(:last-child) { + border-bottom: 1px solid $border-light; + } + } + + li:not(.selected) { + + @media screen and (max-width: 37.500em) { + &:focus, + &:hover { + background: darken($light-background, 2%); + } + } + } + + @media screen and (min-width: 37.500em) { + li { + float: left; + } + } + } + } + + div#subnav.item-list-tabs { + margin-top: 0; + + ul { + border-bottom: 0; + border-top: 1px solid $border-color; + margin-top: $spacing-val-xs; + padding: 0; + + li.last { + background: $content-background; + float: right; + margin-top: 0; + padding: $spacing-val-xs 0 $spacing-val-xs; + text-align: right; + width: 230px; + + @media screen and (max-width: 30em) { + float: none; + width: auto; + } + + select, + select:focus { + background: transparent; + border: 0; + outline: 0; + padding: 0; + } + + select, + label, + option { + @include font-size(14); + } + + select { + font-style: italic; + + option { + font-style: normal; + } + } + } + + } // close ul + } // close #subnav + +} // close #buddypress + +.bp-user { + #buddypress { + div#subnav.item-list-tabs { + li.last { + margin-left: 0; + text-align: right; + + @media screen and (max-width: 30em) { + clear: left; + float: none; + margin-left: 10px; + text-align: left; + } + } + } + } +} + +/*__ 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 +// 2012 right sidebar is displayed if the widget sidebar has widgets; +// we'll only display object nav as a vert menu if sidebar not present. + +@media screen and (min-width: 60em) { + + body.full-width { + #buddypress { + + #item-header, + #item-body { + background: $content-background; + } + + #object-nav { + border-right: 1px solid $border-med; + float: left; + margin-right: -1px; + width: 200px; + + ul { + background: none; + 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); + + ul {margin-top: 0;} + } + } + + } // close #buddypress + } // close body:not(.sidebar) +} // close @media + + +// Tabbed Nav styling +// Primarilly used for group create screens & ? directory nav. + +@media screen and (min-width: 46.25em) { + #main { + #buddypress { + + #group-create-tabs.item-list-tabs { + + ul:before, + ul:after { + content: " "; + display: table; + } + + ul:after { + clear: both; + } + + ul { + background: none; + border: 0; + border-bottom: 1px solid $border-med; + overflow: visible; + padding-bottom: 0; + + li { + float: left; + width: auto; + } + + li.selected, + li.current { + border: 1px solid $border-med; + border-bottom-color: $content-background; + @include border-top-radius(4px); + margin-bottom: -1px; + + a { + background: none; + color: $body-text; + outline: none; + } + } + } + + } // close .item-list-tabs + + #subnav { + ul { + border-bottom: 0; + } + + } // close #subnav + } // close #buddypress + } +} // close @media + +/** +*---------------------------------------------------------- +* @section 2.2 - Pagination +*---------------------------------------------------------- +*/ + +#buddypress { + + div.pagination { + box-shadow: none; + min-height: 0; + + &:before, + &:after { + height: 0; + width: 0; + } + + .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 +*------------------------------------------------------------------------------- +*/ + +// 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 2012 font-family + +#buddypress { + ul.item-list { + border-top: 0; + + 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: 37.500em) { + margin-bottom: 0; + } + + text-align: center; + + a {border-bottom: 0;} + + img.avatar { + display: inline-block; + float: none; + margin-bottom: $spacing-val-sm; + + // Quite early on we need to move avatars to the left(right) + @include small-up { + display: block; + float: left; + } + } + } //close .item-avatar + + .item { + + // counter the BP rule + margin-left: 0; + + @media screen and (min-width: 61.5625em) { + margin-left: 15%; + } + + overflow: hidden; + + .item-meta { + text-align: center; + + @media screen and (min-width: 61.5625em) { + text-align: left; + } + } + + span.activity { + font-style: italic; + } + + .item-desc { + margin-left: 0; + width: 94%; + } + + .item-title { + @include font-size(16); + line-height: 1.2; + text-align: center; + + @include small-up { + text-align: left; + } + + width: 100%; + + > a { + text-decoration: none; + + &:visited { color: #21759b;} + } + + .update { + display: block; + @include font-size(12); + + @include medium-up { + @include font-size(14); + } + + padding: $spacing-val-sm 0; + text-align: left; + } + } // close .item-title + + } // close .item + + @include medium-up { + .item-avatar, + .item, + .action { + float: left; + } + + .item { + left: 5%; + margin-left: 0; + position: relative; + width: 55%; + + .item-title { + @include font-size(18) + } + } + + }// close medium-up + + 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 + @include medium-up { + 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; + } + // Provisionally lets keep the 'action' div + //position but inline-block the buttons + + @media screen and (min-width: 37.500em) { + // keep buttons to a row small tablet up + margin: 0 $spacing-val-sm $spacing-val-sm 0; + width: auto; + } // close @media + + @include medium-up { + // 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; + } + + // corrective measure for clipped elements due to JS inline styling + + @media screen and (max-width: 46.25em) { + #whats-new-content { + clear: left; + margin: $spacing-val-sm 0 $spacing-val-md; + padding: $spacing-val-sm 0 0; + } + } + + #whats-new-content.active { + #whats-new-options[style] { + #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; + padding: 0 0 0 0.4em; + } + } + + @media screen and (min-width: 30em) { + #whats-new-post-in-box { + width: auto; + } + + #whats-new-submit { + float: right; + + input { + padding: 2px 6px; + } + } + } + + } // close #whats-new-options + } // close #whats-new-content.active + + } // 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, + .activity-comments { + margin-left: 0; + } + + .activity-header { + @include font-size(14); + + a:visited { + color: #21759b; + } + } + + .activity-inner { + img {height: auto;} + } + + @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); + } + } + + .activity-comments { + margin-left: 70px; + } + + } // 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(14); + } + + .activity-meta { + a { + @include font-size(12); + } + } + } + } // close li.mini + + .activity-content { + margin-top: -12px; + + .activity-header { + line-height: inherit; + margin-right: 0; + + p { + border-bottom: 1px solid rgba($border-light, 0.6); + margin-top: 0; + 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; + @include font-size(14); + margin-bottom: $spacing-val-xs; + + @media screen and (min-width: 37.500em) { + float: left; + margin-bottom: 0; + } + + padding: 0.2em 0.5em; + } + } + + } // 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 { + display: block; + } + } + + } // close #activity-stream +} // close #buddypress + +/* Single activity view - activity permalink */ + +.activity-permalink { + #buddypress { + #activity-stream { + + li.activity-item { + padding: $spacing-val-md; + } + + 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;} + } + } // close li.mini + + .activity-comments { + margin-left: 0; + } + + } + } +} + +/** +*----------------------------------------------------- +* @section 4.1.3 - Activity Comments +*----------------------------------------------------- +*/ +#buddypress { + + #activity-stream { + + .activity-comments { + position: relative; + + > ul { + background: rgba($light-background, 0.6); + margin: $spacing-val-sm 0 0 2px; + + > li { + + &:hover * { + color: #555; + } + + .acomment-meta, + .acomment-content { + @include font-size(12); + } + + } + + } + + .ac-form { + border: 1px solid $border-color; + box-sizing: border-box; + margin: $spacing-val-sm 0; + width: 100%; + + 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-steam + +} // close #buddypress + +/** +*---------------------------------------------------------- +* @section 4.2 - Members Loop +*---------------------------------------------------------- +*/ + +#buddypress { + #members-list { + + @include medium-up { + li { + .item-avatar, + .item { + float: left; + } + + .action { + float: right; + } + } + } + + } // close #members-list +} //close #BuddyPress + +/** +*------------------------------------------------------------------------------- +* @section 5.0 - Directories +*------------------------------------------------------------------------------- +*/ + +/** +*----------------------------------------------------------- +* @subsection Registration +*----------------------------------------------------------- +*/ + +#buddypress { + #signup_form.standard-form { + + #profile-details-section, + #basic-details-section, + #blog-details-section { + float: none; + width: 100%; + + @media screen and (min-width: 37.500em) { + width: 48%; + } + } + + @media screen and (min-width: 37.500em) { + #profile-details-section {float: right;} + #basic-details-section {float: left;} + } + + } +} + +/** +*------------------------------------------------------------------------------- +* @section 6.0 - Single Item screens: User Account & Single Group Screens +*------------------------------------------------------------------------------- +*/ + +.bp-user { + #buddypress { + // On object nav links, table links (notifications etc) we don't really need :visited + // inheritance, so set pseudo class to :link color. + a { + &:visited { + color: #21759b; + } + } + } +} + +/** +*----------------------------------------------------------- +* @subsection 6.1 - Item Header Global +*----------------------------------------------------------- +*/ + +.bp-user, +.single-item.groups { + #buddypress { + #item-header-content { + #item-meta { + @include font-size(14); + text-align: left; + + p {margin-bottom: 0.5em;} + } + } + } + + @media screen and (max-width: 37.500em) { + h1, + #item-header-content { + text-align: center; + } + } + + @media screen and (max-width: 46.25em) { + main { + header.entry-header { + padding-bottom: 1rem; + } + } + } + + #buddypress { + @media screen and (max-width: 37.500em) { + h1 { + margin-bottom: 0; + } + + #item-header-avatar { + img.avatar { + margin-right: 0; + } + } + + #item-header-content { + width: 100%; + } + } // close @media + + @media screen and (max-width: 46.25em) { + #item-header { + .generic-button { + float: none; + margin: 1.5em 0 0 0; + } + } + } + } // close #buddypress + +} + +/** +*----------------------------------------------------- +* @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: 50em) { + 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; + + h3 { + border-bottom: 1px solid $border-light; + text-align: center; + } + } + } + } // close @media + + div#item-header { + padding-bottom: $spacing-val-lg; + + #item-header-content { + @include box-model(border-box); + } + + div#item-actions { + margin: 0 !important; + width: 100%; + + @media screen and (min-width: 50em) { + border-left: 1px solid $border-light; + clear: none; + float: right; + padding-left: 0.2em; + width: 30%; + } // close @media + + @media screen and (min-width: 46.25em) { + width: 40%; + } + + ul { + margin-top: 0; + padding-left: 0; + } + + h3 { + @include font-size(14); + padding: 0.2em; + } + + #group-admins, + #group-mods { + li { + margin: 0; + } + } + + } // close item-actions + + @media screen and (min-width: 46.25em) { + + #item-header-avatar, + #item-header-content { + float: left; + } + + #item-header-content { + margin-left: 2%; + padding: 0 0.5em; + } + + div#item-actions { + float: right; + width: 28%; + } + + } // close @media + + @media screen and (min-width: 64em) { + #item-header-content { + width: 40%; + } + } + } // close #item-header + } // close #buddypress + + // These rules handle the specific instance of Cover Images on single groups + // activated & attempt to address positioning concerns arising from themes + // breakpoints. + // Due to cover image styles being applied via embedded styles & thus carrying + // heavier weight than linked styles the use of !important to override may be required. + #buddypress { + #cover-image-container { + #item-header-cover-image { + + #item-actions { + margin-top: 225px !important; + } + + @media screen and (min-width: 50em) and (max-width: 60em) { + #item-header-content { + max-width: 60% !important; + width: 60% !important; + } + } + + @media screen and (max-width: 64em) { + + #item-actions { + border: 0; + clear: both; + margin-top: 0 !important; + max-width: 100% !important; + padding-top: 0 !important; + width: auto; + + h3 {border-bottom: 1px solid $border-light;} + } + } // @media + + + } + } + } + +} // close .single-item.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; + + img.avatar, + a { + border-bottom: 0; + display: inline-block; + float: none; + } + } + + #item-header-content { + #item-buttons { + .generic-button { + margin-right: 5px; + } + } + } + + @media screen and (min-width: 46.25em) { + #item-header-avatar { + float: left; + + a { + float: left; + } + } + + #item-header-content { + float: right; + margin-right: 0%; + width: 69%; + } + + } // close @media + + } // close #item-header + + } // close #buddypress +} // close .bp-user + +/** +*----------------------------------------------------------- +* @subsection 6.2 - Item Body: Global +*----------------------------------------------------------- +*/ + +/** +*---------------------------------------------------- +* @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; + } + } +} + +.groups.edit-details { + #group-settings-form { + + label { + margin-bottom: 0; + padding: 0.2em; + width: 80%; + } + + textarea + p label { + background: none; + color: inherit; + @include font-size(14); + width: auto; + } + + textarea { + height: auto; + min-height: 100px; + overflow: auto; + } + } +} // close .groups.edit-details + +.groups.group-settings { + #group-settings-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: 37.500em) { + width: auto; + } + } + } + + h5 { + margin: 0; + } + + } + } + } +} // close .groups.manage-members + +/** +*----------------------------------------- +* @subsection 6.2.1.2 - Group members +*----------------------------------------- +*/ + +// Massage the members search for groups nav specifically. +.groups.group-members { + #subnav { + li { + @media screen and (max-width: 37.500em) { + background: $content-background; + padding: $spacing-val-md 0; + } + + width: 100%; + + #search-members-form { + float: right; + + @media screen and (max-width: 37.500em) { + margin: 0; + width: 100%; + + label { + input[type="text"] {width: 100%;} + } + } + + margin: $spacing-val-xs $spacing-val-xs 0 0; + } + } + } +} + +/** +*----------------------------------------------------- +* @subsection 6.2.2 - Item Body User Accounts +* +* User Account specific component 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(13)} + td {@include font-size(12)} + + @include medium-up { + th {@include font-size(16)} + td {@include font-size(14)} + } + } + + .pag-count {font-style: italic;} + + .notifications-options-nav, + .messages-options-nav { + float: left; + width: 100%; + + @media screen and (min-width: 37.500em) { + width: 40%; + } + + select, + input { + @include font-size(14); + outline: 0; + padding: 0; + } + + select { + float: left; + margin-right: 0; + width: 49%; + + @media screen and (min-width: 37.500em) { + width: auto; + } + } + + input { + float: left; + font-family: inherit; + line-height: 20px; + margin-left: 1%; + width: 50%; + + @media screen and (min-width: 37.500em) { + width: auto; + } + + &[disabled="disabled"]:focus, + &[disabled="disabled"]:hover { + background: none; + } + } + + } // close .notifications-options-nav/messages-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 */ + + #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 { + margin: $spacing-val-xs 0 $spacing-val-md; + } + + .field-visibility-settings-toggle, + .field-visibility-settings { + @include font-size(14); + } + + .field-visibility-settings-close, + .visibility-toggle-link { + background: lighten($dark-background, 10%); + @include border-radius(2px); + color: #eee; + font-weight: bold; + padding: 0.1em 0.5em; + text-decoration: none; + + &:focus, + &:hover { + color: #fff; + } + } + } // 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; + } + + .highlight { + font-size: 100%; + } + } + + .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; + box-sizing: border-box; + display: inline-block; + float: left; + } + + td.thread-star, + td.thread-options { + border-bottom: 1px solid $medium-background; + height: 2.4em; + padding-bottom: 0.2em; + padding-top: 0.2em; + + @media screen and (max-width: 46.25em) { + padding-top: 0; + } + } + + td.thread-star { + vertical-align: middle; + + .message-action-star, + .message-action-unstar { + line-height: 1.2; + } + + span.icon:before { + @include font-size(14); + } + } + + td.bulk-select-check, + td.thread-from { + height: 3em; + + @media screen and (max-width: 37.500em) { + 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: " \2016 \00a0"attr(title); + @include font-size(12); + } + } + + td.thread-options { + text-align: right; + + a { + @include font-size(12); + line-height: 1.2; + } + } + + span.from { + display: none; + } + + span.activity { + display: block; + float: right; + line-height: 2; + + @media screen and (max-width: 37.500em) { + clear: both; + @include font-size(11); + width: 100%; + } + } + } + + tr.unread { + td { + border-color: $border-light; + } + } + + 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; + } + } + + #send_message_form { + input, + textarea { + box-sizing: border-box; + } + } + + .acfb-holder { + list-style: none; + + li {margin-left: 0;} + + li.friend-tab { + background: lighten($notice-info, 20%); + border: inherit; + margin-right: 0; + padding: 0.5em; + + span.p { + // the 'X' close + padding-left: $spacing-val-sm; + + &:focus, + &:hover { + color: $link-action; + cursor: pointer; + } + } + + a { + border-bottom: 0; + text-decoration: none; + + img { + // this is the tiny user avatar + display: inline; + height: 20px; + vertical-align: middle; + width: 20px !important; // override inline style + } + } + } + } + + #message-threads.sitewide-notices { + tr {margin: 3em 0;} + 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; + } + + a.button { + border: 1px solid $border-color; + line-height: initial; + padding: 0.4em 0.3em; + } + } + + td:first-child { + display: none; + } + + td:nth-child(2) { + strong { + margin: -8px -8px 8px; + } + } + + td:first-child + td + td { + // notice date + border-bottom: 0; + + span { + line-height: 1; + } + } + + td:last-child { + // notice actions + line-height: 1; + padding-bottom: 1em; + 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; + } + } + } + + } // #buddypress + + // acfb auto complete name list sits in doc footer before body close + .ac_results { + background: #eee; + padding-left: $spacing-val-sm; + + li { + margin: $spacing-val-sm 0; + + &:focus, + &:hover { + cursor: pointer; + } + + img { vertical-align: bottom;} + + } + } + +} // 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 { + 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: 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 + +/** + *------------------------------------ + * @subsection 6.2.2.6 - Notifications + *------------------------------------ + */ + + +/** +*------------------------------------------------------------------------------- +* @section 7.0 - Forms - General +*------------------------------------------------------------------------------- +*/ + +// Attempt to reset form control widths +#main { + #buddypress { + .standard-form { + + li {float: none;} + input[type='text'], + input[type='email'], + input[type='password'], + textarea { + width: 100%; + } + } + } +} + + +#buddypress { + + // Match BP form elements to Themes(2012) styling where styles + // are not inherited or being overriden. + div.activity-comments { + + form { + .ac-textarea { + background: $light-background; + border: 1px solid rgba($border-color, 0.5); + + textarea { + background: none; + border: 0; + } + } + } + } + + .standard-form { + + // Keep BP form element borders to 1px rather than 2013 2px + input[type="text"], + input[type="email"], + input[type="password"], + button, + select, + textarea { + border-color: rgba($border-color, 0.5); + border-width: 1px; + } + + } // close .standard-form + + #signup_form.standard-form { + div.submit { + float: none; + + input {margin-right: 0;} + } + } + +} // close #buddypress + +#buddypress { + 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 & 2012 + + form { // *sigh* only to bludgeon over specified rules + border: 1px solid rgba($border-color, 0.6); + overflow: hidden; + + label { + float: left; + width: 70%; + } + + input[type='text'], + input[type='submit'] { + @include font-size(14); + border: 0; + border-radius: 0; + line-height: 1.8; + min-height: 2rem; + } + + input[type='text'] { + border-right: 1px solid rgba($border-color, 0.6); + float: left; + margin: 0; + padding: 0 0.2em 0; + width: 100%; + } + + input[type='submit'] { + float: right; + font-weight: normal; + padding: 0 1em; + text-align: center; + text-transform: none; + width: 30%; + } + } // close form + + } // close .dir-search, .message-search + + // Shift the search parent to the right and allow to shrinkwrap + + @media screen and (min-width: 37.500em) { + 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 + + + @include large-up { + + .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 +*------------------------------------------------------------------------------- +*/ +.bp-user { + #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; + padding: 0 8px; + } + + tr td { + padding: 8px; + } + + // Reduce the themes inherited paragraph margins in tables + p {margin-bottom: 0.5em;} + } + + @media screen and (min-width: 55em) { + table {@include font-size(16);} + } + + // 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%; + } + } + + th.actions { + text-align: center; + } + + .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 +} // .bp-user + +/** +*------------------------------------------------------------------------------- +* @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 mesages ( '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 +*------------------------------------------------------------------------------- +*/ 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 69fa96c17be69336bcf01ad696fd0c9146da44fc..0966774d2e557e9c5b181481042b01f7db4f018f 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 @@ -32,12 +32,10 @@ jq(document).ready( function() { if ( $whats_new.length && bp_get_querystring('r') ) { var $member_nicename = $whats_new.val(); - jq('#whats-new-options').animate({ - height:'50px' - }); + jq('#whats-new-options').slideDown(); $whats_new.animate({ - height:'50px' + height:'3.8em' }); jq.scrollTo( $whats_new, 500, { @@ -46,20 +44,25 @@ jq(document).ready( function() { } ); $whats_new.val('').focus().val( $member_nicename ); + } else { + jq('#whats-new-options').hide(); } /**** Activity Posting ********************************************************/ /* Textarea focus */ $whats_new.focus( function(){ - jq('#whats-new-options').animate({ - height:'50px' - }); - jq('#whats-new-form textarea').animate({ - height:'50px' + jq( '#whats-new-options' ).slideDown(); + + jq( this ).animate({ + height:'3.8em' }); + jq('#aw-whats-new-submit').prop('disabled', false); + jq( this ).parent().addClass( 'active' ); + jq( '#whats-new-content' ).addClass( 'active' ); + var $whats_new_form = jq('form#whats-new-form'), $activity_all = jq( '#activity-all' ); @@ -81,33 +84,62 @@ jq(document).ready( function() { } }); - /* On blur, shrink if it's empty */ - $whats_new.blur( function(){ - if ( document.activeElement !== this ) { - if (!this.value.match(/\S+/)) { - this.value = ''; - jq('#whats-new-options').animate({ - height:'0' - }); - jq('form#whats-new-form textarea').animate({ - height:'20px' + /* For the "What's New" form, do the following on focusout. */ + jq( '#whats-new-form' ).on( 'focusout', function( e ) { + var elem = jq( this ); + + // Let child hover actions passthrough. + // This allows click events to go through without focusout. + setTimeout( function () { + if ( ! elem.find(':hover').length ) { + // Do not slide up if textarea has content. + if ( '' !== $whats_new.val() ) { + return; + } + + $whats_new.animate({ + height:'2.2em' }); - jq('#aw-whats-new-submit').prop('disabled', true); + + jq( '#whats-new-options' ).slideUp(); + + jq('#aw-whats-new-submit').prop( 'disabled', true ); + + jq( '#whats-new-content' ).removeClass( 'active' ); + $whats_new.parent().removeClass( 'active' ); } - } - }); + }, 0 ); + } ); /* New posts */ jq('#aw-whats-new-submit').on( 'click', function() { var last_date_recorded = 0, button = jq(this), - form = button.closest('form#whats-new-form'); + form = button.closest('form#whats-new-form'), + inputs = {}, post_data; + + // Get all inputs and organize them into an object {name: value} + jq.each( form.serializeArray(), function( key, input ) { + // Only include public extra data + if ( '_' !== input.name.substr( 0, 1 ) && 'whats-new' !== input.name.substr( 0, 9 ) ) { + if ( ! inputs[ input.name ] ) { + inputs[ input.name ] = input.value; + } else { + // Checkboxes/dropdown list can have multiple selected value + if ( ! jq.isArray( inputs[ input.name ] ) ) { + inputs[ input.name ] = new Array( inputs[ input.name ], input.value ); + } else { + inputs[ input.name ].push( input.value ); + } + } + } + } ); - form.children().each( function() { - if ( jq.nodeName(this, 'textarea') || jq.nodeName(this, 'input') ) { + form.find( '*' ).each( function() { + if ( jq.nodeName( this, 'textarea' ) || jq.nodeName( this, 'input' ) ) { jq(this).prop( 'disabled', true ); } - }); + } ); /* Remove any errors */ jq('div.error').remove(); @@ -142,7 +174,7 @@ jq(document).ready( function() { object = jq('#whats-new-post-object').val(); } - jq.post( ajaxurl, { + post_data = jq.extend( { action: 'post_update', 'cookie': bp_get_cookies(), '_wpnonce_post_update': jq('#_wpnonce_post_update').val(), @@ -151,11 +183,11 @@ jq(document).ready( function() { 'item_id': item_id, 'since': last_date_recorded, '_bp_as_nonce': jq('#_bp_as_nonce').val() || '' - }, - function(response) { + }, inputs ); - form.children().each( function() { - if ( jq.nodeName(this, 'textarea') || jq.nodeName(this, 'input') ) { + jq.post( ajaxurl, post_data, function( response ) { + form.find( '*' ).each( function() { + if ( jq.nodeName( this, 'textarea' ) || jq.nodeName( this, 'input' ) ) { jq(this).prop( 'disabled', false ); } }); @@ -202,19 +234,19 @@ jq(document).ready( function() { jq('li.new-update').hide().slideDown( 300 ); jq('li.new-update').removeClass( 'new-update' ); jq('#whats-new').val(''); + form.get(0).reset(); // reset vars to get newest activities newest_activities = ''; activity_last_recorded = 0; } - jq('#whats-new-options').animate({ - height:'0px' - }); + jq('#whats-new-options').slideUp(); jq('#whats-new-form textarea').animate({ - height:'20px' + height:'2.2em' }); jq('#aw-whats-new-submit').prop('disabled', true).removeClass('loading'); + jq( '#whats-new-content' ).removeClass( 'active' ); }); return false; @@ -913,7 +945,7 @@ jq(document).ready( function() { var target = jq(event.target), el, css_id, object, search_terms, pagination_id, template, - url_parameters, page_number, + page_number, $gm_search, caller; @@ -938,20 +970,33 @@ jq(document).ready( function() { pagination_id = jq(target).closest('.pagination-links').attr('id'); template = null; - 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').val(); + search_terms = jq('.dir-search input'); - if ( ! search_terms && bp_get_querystring('s') ) { + if ( ! search_terms.val() && bp_get_querystring( search_terms.attr( 'name' ) ) ) { search_terms = jq('.dir-search input').prop('placeholder'); + } else { + search_terms = search_terms.val(); } } + // Page number + if ( jq(target).hasClass('next') || jq(target).hasClass('prev') ) { + page_number = jq('.pagination span.current').html(); + } else { + page_number = jq(target).html(); + } + + // Remove any non-numeric characters from page number text (commas, etc.) + page_number = Number( page_number.replace(/\D/g,'') ); + + if ( jq(target).hasClass('next') ) { + page_number++; + } else if ( jq(target).hasClass('prev') ) { + page_number--; + } + // The Group Members page has a different selector for // its search terms box $gm_search = jq( '.groups-members-search input' ); @@ -1911,12 +1956,16 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e /* Activity Loop Requesting */ function bp_activity_request(scope, filter) { /* Save the type and filter to a session cookie */ - jq.cookie( 'bp-activity-scope', scope, { - path: '/' - } ); - jq.cookie( 'bp-activity-filter', filter, { - path: '/' - } ); + if ( null !== scope ) { + jq.cookie( 'bp-activity-scope', scope, { + path: '/' + } ); + } + if ( null !== filter ) { + jq.cookie( 'bp-activity-filter', filter, { + path: '/' + } ); + } jq.cookie( 'bp-activity-oldestpage', 1, { path: '/' } ); @@ -2026,7 +2075,7 @@ function checkAll() { * Deselects any select options or input options for the specified field element. * * @param {String} container HTML ID of the field - * @since BuddyPress (1.2.0) + * @since 1.2.0 */ function clear( container ) { container = document.getElementById( container ); 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 84e31edfc1e2ab096fa2a9db142692ce33e6854d..226e9cd745564bbaaa7628d16461d780628624e9 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,4 +1,3 @@ -/*! buddypress - v2.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ -function bp_init_activity(){jq.cookie("bp-activity-oldestpage",1,{path:"/"}),void 0!==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),void 0!==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){void 0!==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),void 0!==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()}),void 0!==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(/ /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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 PM UTC - https://wordpress.org/plugins/buddypress/ */ +function bp_init_activity(){jq.cookie("bp-activity-oldestpage",1,{path:"/"}),void 0!==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),void 0!==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){void 0!==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),void 0!==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){null!==a&&jq.cookie("bp-activity-scope",a,{path:"/"}),null!==b&&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()}),void 0!==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&&(""===$("check_all").checked?b[a].checked="":b[a].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").slideDown(),b.animate({height:"3.8em"}),jq.scrollTo(b,500,{offset:-125,easing:"swing"}),b.val("").focus().val(c)}else jq("#whats-new-options").hide();if(b.focus(function(){jq("#whats-new-options").slideDown(),jq(this).animate({height:"3.8em"}),jq("#aw-whats-new-submit").prop("disabled",!1),jq(this).parent().addClass("active"),jq("#whats-new-content").addClass("active");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")))}),jq("#whats-new-form").on("focusout",function(a){var c=jq(this);setTimeout(function(){if(!c.find(":hover").length){if(""!==b.val())return;b.animate({height:"2.2em"}),jq("#whats-new-options").slideUp(),jq("#aw-whats-new-submit").prop("disabled",!0),jq("#whats-new-content").removeClass("active"),b.parent().removeClass("active")}},0)}),jq("#aw-whats-new-submit").on("click",function(){var a,b=0,c=jq(this),d=c.closest("form#whats-new-form"),e={};return jq.each(d.serializeArray(),function(a,b){"_"!==b.name.substr(0,1)&&"whats-new"!==b.name.substr(0,9)&&(e[b.name]?jq.isArray(e[b.name])?e[b.name].push(b.value):e[b.name]=new Array(e[b.name],b.value):e[b.name]=b.value)}),d.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),c.addClass("loading"),c.prop("disabled",!0),d.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&&(b=timestamp[1]),item_id>0&&(object=jq("#whats-new-post-object").val()),a=jq.extend({action:"post_update",cookie:bp_get_cookies(),_wpnonce_post_update:jq("#_wpnonce_post_update").val(),content:content,object:object,item_id:item_id,since:b,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},e),jq.post(ajaxurl,a,function(a){if(d.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),a[0]+a[1]==="-1")d.prepend(a.substr(2,a.length)),jq("#"+d.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(a),b||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length){var c=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=c+" "),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(""),d.get(0).reset(),newest_activities="",activity_last_recorded=0}jq("#whats-new-options").slideUp(),jq("#whats-new-form textarea").animate({height:"2.2em"}),jq("#aw-whats-new-submit").prop("disabled",!0).removeClass("loading"),jq("#whats-new-content").removeClass("active")}),!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=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,jq("div.dir-search input").length&&(e=jq(".dir-search input"),e=!e.val()&&bp_get_querystring(e.attr("name"))?jq(".dir-search input").prop("placeholder"):e.val()),h=jq(k).hasClass("next")||jq(k).hasClass("prev")?jq(".pagination span.current").html():jq(k).html(),h=Number(h.replace(/\D/g,"")),jq(k).hasClass("next")?h++:jq(k).hasClass("prev")&&h--,i=jq(".groups-members-search input"),i.length&&(e=i.val(),d="members"),"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(/ /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(c){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(b){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&&(e?d.text((d.text()>>0)+1):d.text((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(a){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(a){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(a){this.checked?jq(".message-check").each(function(){this.checked=!0}):jq(".message-check").each(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(a){this.checked?jq(".notification-check").each(function(){ +this.checked=!0}):jq(".notification-check").each(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 824360fce7fafc4524a9996c52274ec73ed61f38..3763242c808b958267b96c0811e730d2743643c8 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.3.5 - 2015-11-11 5:23:00 AM UTC - https://wordpress.org/plugins/buddypress/ */ +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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-xprofile/admin/css/admin-rtl.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin-rtl.css index ec28f76432780d1025b09cae244857a814b4e94e..2713cfe0343687aa9bbb56a57c7f6ff1e5711636 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 @@ -274,3 +274,13 @@ textarea#group_description { #bp-xprofile-add-field #post-body-content { margin-bottom: 0; } + +span.member-type-none-notice, +p.member-type-none-notice { + color: #f00; +} + +.hide { + display: none; + visibility: hidden; +} 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 31fa4d93cc9f2ec161938b4d964dc75fe78461c1..798441c5ec4e2e08a5b471809bca21adc74146f5 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 +1 @@ -#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;background:#fff;border-width:1px;border-color:#e5e5e5;border-style:solid;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom: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}div.field-group{clear:right}.field-group{cursor:default;border:1px solid #e5e5e5;background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);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 +#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;background:#fff;border-width:1px;border-color:#e5e5e5;border-style:solid;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom: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}div.field-group{clear:right}.field-group{cursor:default;border:1px solid #e5e5e5;background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);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}p.member-type-none-notice,span.member-type-none-notice{color:red}.hide{display:none;visibility:hidden} \ 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 f7374f7bbe2fd86be38e6d5dc6aec60df271fb43..6dd7a20a9189f473e2fe34029af970a6eef2a675 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css @@ -274,3 +274,13 @@ textarea#group_description { #bp-xprofile-add-field #post-body-content { margin-bottom: 0; } + +span.member-type-none-notice, +p.member-type-none-notice { + color: #f00; +} + +.hide { + display: none; + visibility: hidden; +} 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 b3ae86e261f8bf479b76ea2b12933fce03dc664d..62c4d5c00c131b5fcabd21301fd4017b360d825d 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 +1 @@ -#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;background:#fff;border-width:1px;border-color:#e5e5e5;border-style:solid;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom: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}div.field-group{clear:left}.field-group{cursor:default;border:1px solid #e5e5e5;background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);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 +#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;background:#fff;border-width:1px;border-color:#e5e5e5;border-style:solid;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);box-shadow:0 1px 1px rgba(0,0,0,.04);padding:10px;margin-bottom: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}div.field-group{clear:left}.field-group{cursor:default;border:1px solid #e5e5e5;background:#fff;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.04);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}p.member-type-none-notice,span.member-type-none-notice{color:red}.hide{display:none;visibility:hidden} \ 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 31ae10c9604e87f01a5ac0bcbe72d9f6a55914b6..53f6b1c7cf0b7ad35b2c6bed30f5cf2fdd2f0395 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js @@ -76,12 +76,23 @@ function add_option(forWhat) { * @param {string} forWhat Value of the field to show options for */ function show_options( forWhat ) { + var do_autolink; + for ( var i = 0; i < XProfileAdmin.supports_options_field_types.length; i++ ) { document.getElementById( XProfileAdmin.supports_options_field_types[i] ).style.display = 'none'; } if ( XProfileAdmin.supports_options_field_types.indexOf( forWhat ) >= 0 ) { document.getElementById( forWhat ).style.display = ''; + do_autolink = 'on'; + } else { + jQuery( '#do-autolink' ).val( '' ); + do_autolink = ''; + } + + // Only overwrite the do_autolink setting if no setting is saved in the database. + if ( '' === XProfileAdmin.do_autolink ) { + jQuery( '#do-autolink' ).val( do_autolink ); } } @@ -96,6 +107,34 @@ function hide( id ) { document.getElementById( field_id ).value = ''; } +/** + * @summary Toggles "no member type" notice. + * + * @since 2.4.0 + */ +function toggle_no_member_type_notice() { + var $member_type_checkboxes = jQuery( 'input.member-type-selector' ); + + // No checkboxes? Nothing to do. + if ( ! $member_type_checkboxes.length ) { + return; + } + + var has_checked = false; + $member_type_checkboxes.each( function() { + if ( jQuery( this ).is( ':checked' ) ) { + has_checked = true; + return false; + } + } ); + + if ( has_checked ) { + jQuery( 'p.member-type-none-notice' ).addClass( 'hide' ); + } else { + jQuery( 'p.member-type-none-notice' ).removeClass( 'hide' ); + } +} + var fixHelper = function(e, ui) { ui.children().each(function() { jQuery(this).width( jQuery(this).width() ); @@ -152,6 +191,12 @@ 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 the notice that shows when no member types are selected for a field. + toggle_no_member_type_notice(); + jQuery( 'input.member-type-selector' ).on( 'change', function() { + toggle_no_member_type_notice(); + } ); + // Set up deleting options ajax jQuery( 'a.ajax-option-delete' ).on( 'click', function() { var theId = this.id.split( '-' ); 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 c6aedf6384297b5d3f274478f6ce251800158aee..b9d654cd7a131ac0e70f1f4d3eb3dba8c4583b63 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.3.5 - 2015-11-11 5:23:00 AM 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 +/*! buddypress - v2.5.3 - 2016-05-24 5:17:45 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,c=0;c<XProfileAdmin.supports_options_field_types.length;c++)document.getElementById(XProfileAdmin.supports_options_field_types[c]).style.display="none";XProfileAdmin.supports_options_field_types.indexOf(a)>=0?(document.getElementById(a).style.display="",b="on"):(jQuery("#do-autolink").val(""),b=""),""===XProfileAdmin.do_autolink&&jQuery("#do-autolink").val(b)}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 toggle_no_member_type_notice(){var a=jQuery("input.member-type-selector");if(a.length){var b=!1;a.each(function(){return jQuery(this).is(":checked")?(b=!0,!1):void 0}),b?jQuery("p.member-type-none-notice").addClass("hide"):jQuery("p.member-type-none-notice").removeClass("hide")}}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(),toggle_no_member_type_notice(),jQuery("input.member-type-selector").on("change",function(){toggle_no_member_type_notice()}),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 54d73674ad68ab0d2aec16e732b6edb7145ba7fe..ea7ac6e42e93ded92869bfe6a04e1b1d6ca85800 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress XProfile Actions + * BuddyPress XProfile 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 user @@ -9,9 +8,10 @@ * * @package BuddyPress * @subpackage XProfileActions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -20,48 +20,50 @@ defined( 'ABSPATH' ) || exit; * * The function will delete the active avatar for a user. * - * @package BuddyPress Xprofile * @uses bp_core_delete_avatar() Deletes the active avatar for the logged in user. * @uses add_action() Runs a specific function for an action when it fires. */ function xprofile_action_delete_avatar() { - if ( !bp_is_user_change_avatar() || !bp_is_action_variable( 'delete-avatar', 0 ) ) + if ( ! bp_is_user_change_avatar() || ! bp_is_action_variable( 'delete-avatar', 0 ) ) { return false; + } - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_delete_avatar_link' ); - if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) ) + if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { return false; + } - if ( bp_core_delete_existing_avatar( array( 'item_id' => bp_displayed_user_id() ) ) ) + 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 + } else { bp_core_add_message( __( 'There was a problem deleting your profile photo. Please try again.', 'buddypress' ), 'error' ); + } bp_core_redirect( wp_get_referer() ); } add_action( 'bp_actions', 'xprofile_action_delete_avatar' ); /** - * Handles the saving of xprofile field visibilities + * Handles the saving of xprofile field visibilities. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 */ function bp_xprofile_action_settings() { - // Bail if not a POST action + // Bail if not a POST action. if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) { return; } - // Bail if no submit action + // Bail if no submit action. if ( ! isset( $_POST['xprofile-settings-submit'] ) ) { return; } - // Bail if not in settings + // Bail if not in settings. if ( ! bp_is_user_settings_profile() ) { return; } @@ -72,22 +74,22 @@ function bp_xprofile_action_settings() { return; } - // Nonce check + // Nonce check. check_admin_referer( 'bp_xprofile_settings' ); /** * Fires before saving xprofile field visibilities. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_xprofile_settings_before_save' ); - /** Save ******************************************************************/ + /* Save ******************************************************************/ - // Only save if there are field ID's being posted + // Only save if there are field ID's being posted. if ( ! empty( $_POST['field_ids'] ) ) { - // Get the POST'ed field ID's + // Get the POST'ed field ID's. $posted_field_ids = explode( ',', $_POST['field_ids'] ); // Backward compatibility: a bug in BP 2.0 caused only a single @@ -101,7 +103,7 @@ function bp_xprofile_action_settings() { } } - // Save the visibility settings + // Save the visibility settings. foreach ( $posted_field_ids as $field_id ) { $visibility_level = 'public'; @@ -114,16 +116,16 @@ function bp_xprofile_action_settings() { } } - /** Other *****************************************************************/ + /* Other *****************************************************************/ /** * Fires after saving xprofile field visibilities. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ do_action( 'bp_xprofile_settings_after_save' ); - // Redirect to the root domain + // Redirect to the root domain. bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/profile' ); } add_action( 'bp_actions', 'bp_xprofile_action_settings' ); 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 81367f2cbfd0126056b2a87f22ef9b280ebce98f..8f184cb1b03887eee4f7b6074755c99745cc7995 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php @@ -1,31 +1,30 @@ <?php - /** - * BuddyPress XProfile Activity & Notification Functions + * BuddyPress XProfile Activity & Notification Functions. * * These functions handle the recording, deleting and formatting of activity * items and notifications for the user and for this specific component. * * @package BuddyPress * @subpackage XProfileActivity + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Register the activity actions for the Extended Profile component + * Register the activity actions for the Extended Profile component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @uses bp_activity_set_action() To setup the individual actions + * @uses bp_activity_set_action() To setup the individual actions. */ function xprofile_register_activity_actions() { - // Register the activity stream actions for this component + // Register the activity stream actions for this component. bp_activity_set_action( - // older avatar activity items use 'profile' for component - // see r4273 + // Older avatar activity items use 'profile' for component. See r4273. 'profile', 'new_avatar', __( 'Member changed profile picture', 'buddypress' ), @@ -45,7 +44,7 @@ function xprofile_register_activity_actions() { /** * Fires after the registration of default activity actions for Extended Profile component. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ do_action( 'xprofile_register_activity_actions' ); } @@ -54,9 +53,9 @@ add_action( 'bp_register_activity_actions', 'xprofile_register_activity_actions' /** * Format 'new_avatar' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. + * @param string $action Static activity action. * @param object $activity Activity object. * @return string */ @@ -64,7 +63,7 @@ function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) { $userlink = bp_core_get_userlink( $activity->user_id ); $action = sprintf( __( '%s changed their profile picture', 'buddypress' ), $userlink ); - // Legacy filter - pass $user_id instead of $activity + // Legacy filter - pass $user_id instead of $activity. if ( has_filter( 'bp_xprofile_new_avatar_action' ) ) { $action = apply_filters( 'bp_xprofile_new_avatar_action', $action, $activity->user_id ); } @@ -72,7 +71,7 @@ function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) { /** * Filters the formatted 'new_avatar' activity stream action. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $action Formatted action for activity stream. * @param object $activity Activity object. @@ -83,9 +82,9 @@ function bp_xprofile_format_activity_action_new_avatar( $action, $activity ) { /** * Format 'updated_profile' activity actions. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param string $action Static activity action. + * @param string $action Static activity action. * @param object $activity Activity object. * @return string */ @@ -95,13 +94,13 @@ function bp_xprofile_format_activity_action_updated_profile( $action, $activity // his profile", requires that we know Joe's gender, which we don't. If // your language doesn't have this restriction, feel free to use a more // natural translation. - $profile_link = trailingslashit( bp_core_get_user_domain( $activity->user_id ) . buddypress()->profile->slug ); - $action = sprintf( __( '%s’s profile was updated', 'buddypress' ), '<a href="' . $profile_link . '">' . bp_core_get_user_displayname( $activity->user_id ) . '</a>' ); + $profile_link = trailingslashit( bp_core_get_user_domain( $activity->user_id ) . bp_get_profile_slug() ); + $action = sprintf( __( "%s'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) + * @since 2.0.0 * * @param string $action Formatted action for activity stream. * @param object $activity Activity object. @@ -111,23 +110,23 @@ function bp_xprofile_format_activity_action_updated_profile( $action, $activity /** * Records activity for the logged in user within the profile component so that - * it will show in the users activity stream (if installed) + * it will show in the users activity stream (if installed). * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @package BuddyPress - * @subpackage XProfileActivity - * @param string $args String containing all variables used after extract() call - * @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity + * @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity. + * + * @param array|string $args String containing all variables used after bp_parse_args() call. + * @return array */ function xprofile_record_activity( $args = '' ) { - // Bail if activity component is not active + // Bail if activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } - // Parse the arguments + // Parse the arguments. $r = bp_parse_args( $args, array( 'user_id' => bp_loggedin_user_id(), 'action' => '', @@ -146,43 +145,44 @@ function xprofile_record_activity( $args = '' ) { /** * Deletes activity for a user within the profile component so that it will be - * removed from the users activity stream and sitewide stream (if installed) + * removed from the users activity stream and sitewide stream (if installed). * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @package BuddyPress XProfile - * @param string $args Containing all variables used after extract() call * @uses bp_activity_delete() Deletes an entry to the activity component tables - * for a specific activity + * for a specific activity. + * + * @param array|string $args Containing all variables used after bp_parse_args() call. + * @return bool */ function xprofile_delete_activity( $args = '' ) { - // Bail if activity component is not active + // Bail if activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } - // Parse the arguments + // Parse the arguments. $r = bp_parse_args( $args, array( 'component' => buddypress()->profile->id ), 'xprofile_delete_activity' ); - // Delete the activity item + // Delete the activity item. bp_activity_delete_by_item_id( $r ); } /** - * Register an activity action for the Extended Profiles component + * Register an activity action for the Extended Profiles component. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param string $key - * @param string $value - * @return bool True if success, false on failure + * @param string $key Key. + * @param string $value Value. + * @return bool True if success, false on failure. */ function xprofile_register_activity_action( $key, $value ) { - // Bail if activity component is not active + // Bail if activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } @@ -190,7 +190,7 @@ function xprofile_register_activity_action( $key, $value ) { /** * Filters the return value of bp_activity_set_action. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param bool $value Whether or not an action was successfully registered. * @param string $key Key used for the registered action. @@ -203,17 +203,17 @@ function xprofile_register_activity_action( $key, $value ) { * Adds an activity stream item when a user has uploaded a new avatar. * * @since 1.0.0 - * @since 2.3.4 Add new parameter to get the user id the avatar was set for + * @since 2.3.4 Add new parameter to get the user id the avatar was set for. * - * @package BuddyPress XProfile * @uses bp_activity_add() Adds an entry to the activity component tables for a * specific activity * - * @param int $user_id The user id the avatar was set for + * @param int $user_id The user id the avatar was set for. + * @return bool */ function bp_xprofile_new_avatar_activity( $user_id = 0 ) { - // Bail if activity component is not active + // Bail if activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } @@ -231,7 +231,7 @@ function bp_xprofile_new_avatar_activity( $user_id = 0 ) { */ $user_id = apply_filters( 'bp_xprofile_new_avatar_user_id', $user_id ); - // Add the activity + // Add the activity. bp_activity_add( array( 'user_id' => $user_id, 'component' => 'profile', @@ -243,57 +243,54 @@ add_action( 'xprofile_avatar_uploaded', 'bp_xprofile_new_avatar_activity' ); /** * Add an activity item when a user has updated his profile. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $user_id ID of the user who has updated his profile. - * @param array $field_ids IDs of the fields submitted. - * @param bool $errors True if validation or saving errors occurred, otherwise - * false. - * @param array $old_values Pre-save xprofile field values and visibility - * levels. - * @param array $new_values Post-save xprofile field values and visibility - * levels. + * @param int $user_id ID of the user who has updated his profile. + * @param array $field_ids IDs of the fields submitted. + * @param bool $errors True if validation or saving errors occurred, otherwise false. + * @param array $old_values Pre-save xprofile field values and visibility levels. + * @param array $new_values Post-save xprofile field values and visibility levels. * @return bool True on success, false on failure. */ function bp_xprofile_updated_profile_activity( $user_id, $field_ids = array(), $errors = false, $old_values = array(), $new_values = array() ) { - // If there were errors, don't post + // If there were errors, don't post. if ( ! empty( $errors ) ) { return false; } - // Bail if activity component is not active + // Bail if activity component is not active. if ( ! bp_is_active( 'activity' ) ) { return false; } // Don't post if there have been no changes, or if the changes are - // related solely to non-public fields + // related solely to non-public fields. $public_changes = false; foreach ( $new_values as $field_id => $new_value ) { $old_value = isset( $old_values[ $field_id ] ) ? $old_values[ $field_id ] : ''; - // Don't register changes to private fields + // Don't register changes to private fields. if ( empty( $new_value['visibility'] ) || ( 'public' !== $new_value['visibility'] ) ) { continue; } - // Don't register if there have been no changes + // Don't register if there have been no changes. if ( $new_value === $old_value ) { continue; } - // Looks like we have public changes - no need to keep checking + // Looks like we have public changes - no need to keep checking. $public_changes = true; break; } - // Bail if no public changes + // Bail if no public changes. if ( empty( $public_changes ) ) { return false; } - // Throttle to one activity of this type per 2 hours + // Throttle to one activity of this type per 2 hours. $existing = bp_activity_get( array( 'max' => 1, 'filter' => array( @@ -303,13 +300,13 @@ function bp_xprofile_updated_profile_activity( $user_id, $field_ids = array(), $ ), ) ); - // Default throttle time is 2 hours. Filter to change (in seconds) + // 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) + * @since 2.0.0 * * @param int $value Throttle time, in seconds. */ @@ -317,14 +314,14 @@ function bp_xprofile_updated_profile_activity( $user_id, $field_ids = array(), $ $then = strtotime( $existing['activities'][0]->date_recorded ); $now = strtotime( bp_core_current_time() ); - // Bail if throttled + // Bail if throttled. if ( ( $now - $then ) < $throttle_period ) { return false; } } - // If we've reached this point, assemble and post the activity item - $profile_link = trailingslashit( bp_core_get_user_domain( $user_id ) . buddypress()->profile->slug ); + // If we've reached this point, assemble and post the activity item. + $profile_link = trailingslashit( bp_core_get_user_domain( $user_id ) . bp_get_profile_slug() ); return (bool) xprofile_record_activity( array( 'user_id' => $user_id, @@ -338,7 +335,7 @@ add_action( 'xprofile_updated_profile', 'bp_xprofile_updated_profile_activity', /** * Add filters for xprofile activity types to Show dropdowns. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * @todo Mark as deprecated */ function xprofile_activity_filter_options() { 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 1fb255ae86eea30850e9a32d1746eec15cbe9628..47cf27461f5f56d4c5d8cfb9ca52aac1c1038bba 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php @@ -1,27 +1,29 @@ <?php - /** - * BuddyPress XProfile Admin + * BuddyPress XProfile Admin. * * @package BuddyPress * @subpackage XProfileAdmin + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +require dirname( __FILE__ ) . '/classes/class-bp-xprofile-user-admin.php'; + /** * Creates the administration interface menus and checks to see if the DB * tables are set up. * - * @package BuddyPress XProfile - * @uses bp_current_user_can() returns true if the current user is a site admin, false if not - * @uses add_users_page() Adds a submenu tab to a top level tab in the admin area - * @return + * @uses bp_current_user_can() returns true if the current user is a site admin, false if not. + * @uses add_users_page() Adds a submenu tab to a top level tab in the admin area. + * + * @return bool */ function xprofile_add_admin_menu() { - // Bail if current user cannot moderate community + // Bail if current user cannot moderate community. if ( ! bp_current_user_can( 'bp_moderate' ) ) { return false; } @@ -33,6 +35,9 @@ add_action( bp_core_admin_hook(), 'xprofile_add_admin_menu' ); /** * Handles all actions for the admin area for creating, editing and deleting * profile groups and fields. + * + * @param string $message Message to display. + * @param string $type Type of action to be displayed. */ function xprofile_admin( $message = '', $type = 'error' ) { @@ -65,31 +70,29 @@ function xprofile_admin( $message = '', $type = 'error' ) { /** * Output the main XProfile management screen * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param string $message Feedback message - * @param string $type Feedback type + * @param string $message Feedback message. + * @param string $type Feedback type. * * @todo Improve error message output */ function xprofile_admin_screen( $message = '', $type = 'error' ) { - // Validate type + // Validate type. $type = preg_replace( '|[^a-z]|i', '', $type ); - // Get all of the profile groups & fields + // Get all of the profile groups & fields. $groups = bp_xprofile_get_groups( array( 'fetch_fields' => true ) ); ?> <div class="wrap"> - <?php screen_icon( 'users' ); ?> - - <h2> + <h1> <?php _ex( 'Profile Fields', 'Settings page header', 'buddypress'); ?> <a id="add_group" class="add-new-h2" href="users.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a> - </h2> + </h1> <form action="" id="profile-field-form" method="post"> @@ -114,7 +117,10 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { <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 + /** This filter is documented in bp-xprofile/bp-xprofile-template.php */ + echo esc_html( apply_filters( 'bp_get_the_profile_group_name', $group->name ) ); + ?> <?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); ?> @@ -130,7 +136,10 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?> <noscript> - <h3><?php echo esc_attr( $group->name ); ?></h3> + <h3><?php + /** This filter is documented in bp-xprofile/bp-xprofile-template.php */ + echo esc_html( apply_filters( 'bp_get_the_profile_group_name', $group->name ) ); + ?></h3> </noscript> <div id="tabs-<?php echo esc_attr( $group->id ); ?>" class="tab-wrapper"> @@ -152,7 +161,7 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { /** * Fires at end of action buttons in xprofile management admin. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_XProfile_Group $group BP_XProfile_Group object * for the current group. @@ -164,20 +173,26 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { <?php if ( ! empty( $group->description ) ) : ?> - <p><?php echo esc_html( $group->description ); ?></p> + <p><?php + /** This filter is documented in bp-xprofile/bp-xprofile-template.php */ + echo esc_html( apply_filters( 'bp_get_the_profile_group_description', $group->description ) ); + ?></p> <?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> + <legend class="screen-reader-text"><?php + /** This filter is documented in bp-xprofile/bp-xprofile-template.php */ + printf( esc_html__( 'Fields for "%s" Group', 'buddypress' ), apply_filters( 'bp_get_the_profile_group_name', $group->name ) ); + ?></legend> <?php if ( !empty( $group->fields ) ) : foreach ( $group->fields as $field ) { - // Load the field - $field = new BP_XProfile_Field( $field->id ); + // Load the field. + $field = xprofile_get_field( $field->id ); $class = ''; if ( empty( $field->can_delete ) ) { @@ -186,7 +201,7 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { /** * This function handles the WYSIWYG profile field - * display for the xprofile admin setup screen + * display for the xprofile admin setup screen. */ xprofile_admin_field( $field, $group, $class ); @@ -196,7 +211,7 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { <p class="nodrag nofields"><?php _e( 'There are no fields in this group.', 'buddypress' ); ?></p> - <?php endif; // end $group->fields ?> + <?php endif; // End $group->fields. ?> </fieldset> @@ -224,35 +239,37 @@ function xprofile_admin_screen( $message = '', $type = 'error' ) { /** * Handles the adding or editing of groups. + * + * @param int|null $group_id Group ID to manage. */ function xprofile_admin_manage_group( $group_id = null ) { global $message, $type; - // Get the field group + // Get the field group. $group = new BP_XProfile_Group( $group_id ); - // Updating + // Updating. if ( isset( $_POST['save_group'] ) ) { - // Validate $_POSTed data + // Validate $_POSTed data. if ( BP_XProfile_Group::admin_validate() ) { - // Set the group name + // Set the group name. $group->name = $_POST['group_name']; - // Set the group description + // Set the group description. if ( ! empty( $_POST['group_description'] ) ) { $group->description = $_POST['group_description']; } else { $group->description = ''; } - // Attempt to save the field group + // 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 + // Save successful. } else { $message = __( 'The group was saved successfully.', 'buddypress' ); $type = 'success'; @@ -265,7 +282,7 @@ function xprofile_admin_manage_group( $group_id = null ) { /** * Fires at the end of the group adding/saving process, if successful. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_Group $group Current BP_XProfile_Group object. */ @@ -285,6 +302,8 @@ function xprofile_admin_manage_group( $group_id = null ) { /** * Handles the deletion of profile data groups. + * + * @param int $group_id ID of the group to delete. */ function xprofile_admin_delete_group( $group_id ) { global $message, $type; @@ -301,7 +320,7 @@ function xprofile_admin_delete_group( $group_id ) { /** * Fires at the end of group deletion process, if successful. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_Group $group Current BP_XProfile_Group object. */ @@ -314,13 +333,21 @@ function xprofile_admin_delete_group( $group_id ) { /** * Handles the adding or editing of profile field data for a user. + * + * @param int $group_id ID of the group. + * @param int|null $field_id ID of the field being managed. */ function xprofile_admin_manage_field( $group_id, $field_id = null ) { global $wpdb, $message, $groups; $bp = buddypress(); - $field = new BP_XProfile_Field( $field_id ); + if ( is_null( $field_id ) ) { + $field = new BP_XProfile_Field(); + } else { + $field = xprofile_get_field( $field_id ); + } + $field->group_id = $group_id; if ( isset( $_POST['saveField'] ) ) { @@ -361,27 +388,46 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) { bp_update_option( 'bp-xprofile-fullname-field-name', $field->name ); } - // Validate default visibility + // Set member types. + if ( isset( $_POST['has-member-types'] ) ) { + $member_types = array(); + if ( isset( $_POST['member-types'] ) ) { + $member_types = stripslashes_deep( $_POST['member-types'] ); + } + + $field->set_member_types( $member_types ); + } + + // 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'] ); } - // Validate 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'] ); } - // Validate signup + // 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' ); } + // Save autolink settings. + if ( 1 != $field_id ) { + if ( isset( $_POST['do_autolink'] ) && 'on' === wp_unslash( $_POST['do_autolink'] ) ) { + bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'on' ); + } else { + bp_xprofile_update_field_meta( $field_id, 'do_autolink', 'off' ); + } + } + /** * Fires at the end of the process to save a field for a user, if successful. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_Field $field Current BP_XProfile_Field object. */ @@ -403,22 +449,23 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) { } /** - * Handles the deletion of a profile field (or field option) + * Handles the deletion of a profile field (or field option). * - * @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 - * @param string $field_type The type of field being deleted - * @param bool $delete_data Should the field data be deleted too? + * @since 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. + * @param string $field_type The type of field being deleted. + * @param bool $delete_data Should the field data be deleted too. */ function xprofile_admin_delete_field( $field_id, $field_type = 'field', $delete_data = false ) { global $message, $type; - // Switch type to 'option' if type is not 'field' - // @todo trust this param + // Switch type to 'option' if type is not 'field'. + // @todo trust this param. $field_type = ( 'field' == $field_type ) ? __( 'field', 'buddypress' ) : __( 'option', 'buddypress' ); - $field = new BP_XProfile_Field( $field_id ); + $field = xprofile_get_field( $field_id ); if ( !$field->delete( (bool) $delete_data ) ) { $message = sprintf( __( 'There was an error deleting the %s. Please try again.', 'buddypress' ), $field_type ); @@ -430,7 +477,7 @@ function xprofile_admin_delete_field( $field_id, $field_type = 'field', $delete_ /** * Fires at the end of the field deletion process, if successful. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_Field $field Current BP_XProfile_Field object. */ @@ -442,11 +489,13 @@ function xprofile_admin_delete_field( $field_id, $field_type = 'field', $delete_ } /** - * Handles the ajax reordering of fields within a group + * Handles the ajax reordering of fields within a group. + * + * @since 1.0.0 */ function xprofile_ajax_reorder_fields() { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_reorder_fields', '_wpnonce_reorder_fields' ); if ( empty( $_POST['field_order'] ) ) { @@ -457,18 +506,20 @@ function xprofile_ajax_reorder_fields() { $field_group_id = $_POST['field_group_id']; - foreach ( (array) $order['field'] as $position => $field_id ) { + foreach ( (array) $order['draggable_field'] as $position => $field_id ) { xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id ); } } add_action( 'wp_ajax_xprofile_reorder_fields', 'xprofile_ajax_reorder_fields' ); /** - * Handles the reordering of field groups + * Handles the reordering of field groups. + * + * @since 1.5.0 */ function xprofile_ajax_reorder_field_groups() { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_reorder_groups', '_wpnonce_reorder_groups' ); if ( empty( $_POST['group_order'] ) ) { @@ -484,28 +535,35 @@ function xprofile_ajax_reorder_field_groups() { add_action( 'wp_ajax_xprofile_reorder_groups', 'xprofile_ajax_reorder_field_groups' ); /** - * Handles the WYSIWYG display of each profile field on the edit screen + * Handles the WYSIWYG display of each profile field on the edit screen. + * + * @since 1.5.0 + * + * @param object $admin_field Admin field. + * @param object $admin_group Admin group object. + * @param string $class Classes to append to output. */ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { global $field; $field = $admin_field; ?> - <fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>"> + <fieldset id="draggable_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 ( 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 bp_the_profile_field_required_label(); ?> <?php if ( bp_xprofile_get_meta( $field->id, 'field', 'signup_position' ) ) : ?><?php esc_html_e( '(Sign-up)', 'buddypress' ); endif; ?> + <?php if ( bp_get_member_types() ) : echo $field->get_member_type_label(); endif; ?> <?php /** * Fires at end of legend above the name field in base xprofile group. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_XProfile_Field $field Current BP_XProfile_Field * object being rendered. @@ -524,7 +582,7 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { /** * Fires after the input if the current field is not in default field types. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param BP_XProfile_Field $field Current BP_XProfile_Field * object being rendered. @@ -556,7 +614,7 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { /** * Fires at end of field management links in xprofile management admin. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_XProfile_Group $group BP_XProfile_Group object * for the current group. @@ -573,8 +631,10 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { /** * Print <option> elements containing the xprofile field types. * - * @param string $select_field_type The name of the field type that should be selected. Will defaults to "textbox" if NULL is passed. - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @param string $select_field_type The name of the field type that should be selected. + * Will defaults to "textbox" if NULL is passed. */ function bp_xprofile_admin_form_field_types( $select_field_type ) { $categories = array(); @@ -583,12 +643,12 @@ function bp_xprofile_admin_form_field_types( $select_field_type ) { $select_field_type = 'textbox'; } - // Sort each field type into its category + // Sort each field type into its category. foreach ( bp_xprofile_get_field_types() as $field_name => $field_class ) { $field_type_obj = new $field_class; $the_category = $field_type_obj->category; - // Fallback to a catch-all if category not set + // Fallback to a catch-all if category not set. if ( ! $the_category ) { $the_category = _x( 'Other', 'xprofile field type category', 'buddypress' ); } @@ -600,14 +660,14 @@ function bp_xprofile_admin_form_field_types( $select_field_type ) { } } - // Sort the categories alphabetically. ksort()'s SORT_NATURAL is only in PHP >= 5.4 :(( + // Sort the categories alphabetically. ksort()'s SORT_NATURAL is only in PHP >= 5.4 :((. uksort( $categories, 'strnatcmp' ); - // Loop through each category and output form <options> + // Loop through each category and output form <options>. foreach ( $categories as $category => $fields ) { - printf( '<optgroup label="%1$s">', esc_attr( $category ) ); // Already i18n'd in each profile type class + printf( '<optgroup label="%1$s">', esc_attr( $category ) ); // Already i18n'd in each profile type class. - // Sort these fields types alphabetically + // Sort these fields types alphabetically. uasort( $fields, create_function( '$a, $b', 'return strnatcmp( $a[1]->name, $b[1]->name );' ) ); foreach ( $fields as $field_type_obj ) { @@ -621,472 +681,5 @@ function bp_xprofile_admin_form_field_types( $select_field_type ) { } } -if ( ! class_exists( 'BP_XProfile_User_Admin' ) ) : -/** - * Load xProfile Profile admin area. - * - * @package BuddyPress - * @subpackage xProfileAdministration - * - * @since BuddyPress (2.0.0) - */ -class BP_XProfile_User_Admin { - - /** - * Setup xProfile User Admin. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @uses buddypress() to get BuddyPress main instance - */ - public static function register_xprofile_user_admin() { - - // Bail if not in admin - if ( ! is_admin() ) { - return; - } - - $bp = buddypress(); - - if ( empty( $bp->profile->admin ) ) { - $bp->profile->admin = new self; - } - - return $bp->profile->admin; - } - - /** - * Constructor method. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function __construct() { - $this->setup_actions(); - } - - /** - * Set admin-related actions and filters. - * - * @access private - * @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 ); - - // Saves the profile actions for user ( avatar, profile fields ) - 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. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param int $user_id ID of the user being edited. - * @param string $screen_id Screen ID to load the metabox in. - * @param object $stats_metabox Context and priority for the stats metabox. - */ - public function register_metaboxes( $user_id = 0, $screen_id = '', $stats_metabox = null ) { - - // Set the screen ID if none was passed - if ( empty( $screen_id ) ) { - $screen_id = buddypress()->members->admin->user_page; - } - - // Setup a new metabox class if none was passed - if ( empty( $stats_metabox ) ) { - $stats_metabox = new StdClass(); - } - - // Moving the Stats Metabox - $stats_metabox->context = 'side'; - $stats_metabox->priority = 'low'; - - // Each Group of fields will have his own metabox - $profile_args = array( - 'fetch_fields' => false, - 'user_id' => $user_id, - ); - - if ( ! bp_is_user_spammer( $user_id ) && bp_has_profile( $profile_args ) ) { - - // Loop through field groups and add a metabox for each one - while ( bp_profile_groups() ) : bp_the_profile_group(); - add_meta_box( - 'bp_xprofile_user_admin_fields_' . sanitize_key( bp_get_the_profile_group_slug() ), - esc_html( bp_get_the_profile_group_name() ), - array( $this, 'user_admin_profile_metaboxes' ), - $screen_id, - 'normal', - 'core', - array( 'profile_group_id' => absint( bp_get_the_profile_group_id() ) ) - ); - endwhile; - - // If member is already a spammer, show a generic metabox - } else { - add_meta_box( - 'bp_xprofile_user_admin_empty_profile', - _x( 'User marked as a spammer', 'xprofile user-admin edit screen', 'buddypress' ), - array( $this, 'user_admin_spammer_metabox' ), - $screen_id, - 'normal', - 'core' - ); - } - - 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' - ); - } - } - - /** - * Save the profile fields in Members community profile page. - * - * Loaded before the page is rendered, this function is processing form - * requests. - * - * @access public - * @since BuddyPress (2.0.0) - */ - public function user_admin_load( $doaction = '', $user_id = 0, $request = array(), $redirect_to = '' ) { - - // Eventually delete avatar - if ( 'delete_avatar' === $doaction ) { - - check_admin_referer( 'delete_avatar' ); - - $redirect_to = remove_query_arg( '_wpnonce', $redirect_to ); - - if ( bp_core_delete_existing_avatar( array( 'item_id' => $user_id ) ) ) { - $redirect_to = add_query_arg( 'updated', 'avatar', $redirect_to ); - } else { - $redirect_to = add_query_arg( 'error', 'avatar', $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - - // Update profile fields - } elseif ( isset( $_POST['field_ids'] ) ) { - - // Check the nonce - check_admin_referer( 'edit-bp-profile_' . $user_id ); - - // Check we have field ID's - if ( empty( $_POST['field_ids'] ) ) { - $redirect_to = add_query_arg( 'error', '1', $redirect_to ); - bp_core_redirect( $redirect_to ); - } - - /** - * Unlike front-end edit-fields screens, the wp-admin/profile - * displays all groups of fields on a single page, so the list of - * field ids is an array gathering for each group of fields a - * distinct comma separated list of ids. - * - * As a result, before using the wp_parse_id_list() function, we - * must ensure that these ids are "merged" into a single comma - * separated list. - */ - $merge_ids = join( ',', $_POST['field_ids'] ); - - // Explode the posted field IDs into an array so we know which fields have been submitted - $posted_field_ids = wp_parse_id_list( $merge_ids ); - $is_required = array(); - - // Loop through the posted fields formatting any datebox values then validate the field - foreach ( (array) $posted_field_ids as $field_id ) { - if ( ! isset( $_POST['field_' . $field_id ] ) ) { - if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { - - // Concatenate the values - $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; - - // Turn the concatenated value into a timestamp - $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); - } - } - - $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ); - if ( $is_required[ $field_id ] && empty( $_POST['field_' . $field_id ] ) ) { - $redirect_to = add_query_arg( 'error', '2', $redirect_to ); - bp_core_redirect( $redirect_to ); - } - } - - // Set the errors var - $errors = false; - - // 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. - $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 ); - } - - // Save the visibility level - $visibility_level = ! empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public'; - 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 - if ( ! empty( $errors ) ) { - $redirect_to = add_query_arg( 'error', '3', $redirect_to ); - } else { - $redirect_to = add_query_arg( 'updated', '1', $redirect_to ); - } - - bp_core_redirect( $redirect_to ); - } - } - - /** - * Render the xprofile metabox for Community Profile screen. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object for the user being edited. - */ - public function user_admin_profile_metaboxes( $user = null, $args = array() ) { - - // Bail if no user ID - if ( empty( $user->ID ) ) { - return; - } - - $r = bp_parse_args( $args['args'], array( - 'profile_group_id' => 0, - 'user_id' => $user->ID - ), 'bp_xprofile_user_admin_profile_loop_args' ); - - // We really need these args - if ( empty( $r['profile_group_id'] ) || empty( $r['user_id'] ) ) { - return; - } - - // Bail if no profile fields are available - if ( ! bp_has_profile( $r ) ) { - return; - } - - // Loop through profile groups & fields - while ( bp_profile_groups() ) : bp_the_profile_group(); ?> - - <input type="hidden" name="field_ids[]" id="<?php echo esc_attr( 'field_ids_' . bp_get_the_profile_group_slug() ); ?>" value="<?php echo esc_attr( bp_get_the_profile_group_field_ids() ); ?>" /> - - <?php if ( bp_get_the_profile_group_description() ) : ?> - - <p class="description"><?php bp_the_profile_group_description(); ?></p> - - <?php endif; ?> - - <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> - - <div<?php bp_field_css_class( 'bp-profile-field' ); ?>> - - <?php - - $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); - $field_type->edit_field_html( array( 'user_id' => $r['user_id'] ) ); - - if ( bp_get_the_profile_field_description() ) : ?> - - <p class="description"><?php bp_the_profile_field_description(); ?></p> - - <?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' ); ?> - - <p class="field-visibility-settings-<?php echo $can_change_visibility ? 'toggle' : 'notoggle'; ?>" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id(); ?>"> - - <?php printf( __( 'This field can be seen by: <span class="%s">%s</span>', 'buddypress' ), esc_attr( 'current-visibility-level' ), bp_get_the_profile_field_visibility_level_label() ); ?> - - <?php if ( $can_change_visibility ) : ?> - - <a href="#" class="button visibility-toggle-link"><?php esc_html_e( 'Change', 'buddypress' ); ?></a> - - <?php endif; ?> - </p> - - <?php if ( $can_change_visibility ) : ?> - - <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> - <fieldset> - <legend><?php _e( 'Who can see this field?', 'buddypress' ); ?></legend> - - <?php bp_profile_visibility_radio_buttons(); ?> - - </fieldset> - <a class="button field-visibility-settings-close" href="#"><?php esc_html_e( 'Close', 'buddypress' ); ?></a> - </div> - - <?php endif; ?> - - <?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> - - <?php endwhile; // bp_profile_fields() ?> - - <?php endwhile; // bp_profile_groups - } - - /** - * Render the fallback metabox in case a user has been marked as a spammer. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object for the user being edited. - */ - public function user_admin_spammer_metabox( $user = null ) { - ?> - <p><?php printf( __( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) ) ;?></p> - <?php - } - - /** - * Render the Avatar metabox to moderate inappropriate images. - * - * @access public - * @since BuddyPress (2.0.0) - * - * @param WP_User $user The WP_User object for the user being edited. - */ - public function user_admin_avatar_metabox( $user = null ) { - - if ( empty( $user->ID ) ) { - return; - } ?> - - <div class="avatar"> - - <?php echo bp_core_fetch_avatar( array( - 'item_id' => $user->ID, - 'object' => 'user', - 'type' => 'full', - 'title' => $user->display_name - ) ); ?> - - <?php if ( bp_get_user_has_avatar( $user->ID ) ) : - - $query_args = array( - 'user_id' => $user->ID, - 'action' => 'delete_avatar' - ); - - if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { - $query_args['wp_http_referer'] = urlencode( wp_unslash( $_REQUEST['wp_http_referer'] ) ); - } - - $community_url = add_query_arg( $query_args, buddypress()->members->admin->edit_profile_url ); - $delete_link = wp_nonce_url( $community_url, 'delete_avatar' ); ?> - - <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> - <?php - } - -} -endif; // class_exists check - -// Load the xprofile user admin +// Load the xprofile user admin. add_action( 'bp_init', array( 'BP_XProfile_User_Admin', 'register_xprofile_user_admin' ), 11 ); 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 07e0ec1eee086b054eb648209546726b2a8c9059..12f9acfdf5f8809b45f9836062c10a42f9df9bac 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php @@ -1,23 +1,24 @@ <?php - /** - * BuddyPress XProfile Caching Functions + * BuddyPress XProfile Caching Functions. * * Caching functions handle the clearing of cached objects and pages on specific * actions throughout BuddyPress. * * @package BuddyPress + * @subpackage XProfileCache + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Determine which xprofile fields do not have cached values for a user. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param int $user_id User ID to check + * @param int $user_id User ID to check. * @param array $field_ids XProfile field IDs. * @return array */ @@ -47,107 +48,108 @@ function bp_xprofile_get_non_cached_field_ids( $user_id = 0, $field_ids = array( * * This function is called within a bp_has_profile() loop. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $object_ids Multi-dimensional array of object_ids, keyed by - * object type ('group', 'field', 'data') + * object type ('group', 'field', 'data'). + * @return bool */ function bp_xprofile_update_meta_cache( $object_ids = array() ) { global $wpdb; - // Bail if no objects + // Bail if no objects. if ( empty( $object_ids ) ) { return false; } $bp = buddypress(); - // Define the array where uncached object IDs will be stored + // Define the array where uncached object IDs will be stored. $uncached_object_ids = array( 'group', 'field', 'data' ); - // Define the cache groups for the 3 types of XProfile metadata + // 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 + // No reason to query yet. $do_query = false; - // Loop through object types and look for uncached data + // Loop through object types and look for uncached data. foreach ( $uncached_object_ids as $object_type ) { - // Skip if empty object type + // Skip if empty object type. if ( empty( $object_ids[ $object_type ] ) ) { continue; } - // Sanitize $object_ids passed to the function + // 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 + // 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 + // 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 + // Bail if no uncached items. if ( false === $do_query ) { return; } - // Setup where conditions for query + // Setup where conditions for query. $where_sql = ''; $where_conditions = array(); - // Loop through uncached objects and prepare to query for them + // Loop through uncached objects and prepare to query for them. foreach ( $uncached_object_ids as $otype => $oids ) { - // Skip empty object IDs + // Skip empty object IDs. if ( empty( $oids ) ) { continue; } - // Compile WHERE query conditions for uncached metadata + // 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 + // Bail if no where conditions. if ( empty( $where_conditions ) ) { return; } - // Setup the WHERE query part + // Setup the WHERE query part. $where_sql = implode( " OR ", $where_conditions ); - // Attempt to query meta values + // 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}" ); - // Bail if no results found + // Bail if no results found. if ( empty( $meta_list ) || is_wp_error( $meta_list ) ) { return; } - // Setup empty cache array + // Setup empty cache array. $cache = array(); - // Loop through metas + // 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 + // Force subkeys to be array type. if ( ! isset( $cache[ $otype ][ $oid ] ) || ! is_array( $cache[ $otype ][ $oid ] ) ) { $cache[ $otype ][ $oid ] = array(); } @@ -156,17 +158,17 @@ function bp_xprofile_update_meta_cache( $object_ids = array() ) { $cache[ $otype ][ $oid ][ $okey ] = array(); } - // Add to the cache array + // Add to the cache array. $cache[ $otype ][ $oid ][ $okey ][] = maybe_unserialize( $ovalue ); } - // Loop through data and cache to the appropriate object + // Loop through data and cache to the appropriate object. foreach ( $cache as $object_type => $object_caches ) { - // Determine the cache group for this data + // Determine the cache group for this data. $cache_group = $cache_groups[ $object_type ]; - // Loop through objects and cache appropriately + // Loop through objects and cache appropriately. foreach ( $object_caches as $object_id => $object_cache ) { wp_cache_set( $object_id, $object_cache, $cache_group ); } @@ -174,11 +176,11 @@ function bp_xprofile_update_meta_cache( $object_ids = array() ) { } /** - * Clear cached XProfile field group data + * Clear cached XProfile field group data. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param object $group_obj + * @param object $group_obj Groub object to clear. */ function xprofile_clear_profile_groups_object_cache( $group_obj ) { wp_cache_delete( 'all', 'bp_xprofile_groups' ); @@ -188,11 +190,11 @@ add_action( 'xprofile_group_after_delete', 'xprofile_clear_profile_groups_object add_action( 'xprofile_group_after_save', 'xprofile_clear_profile_groups_object_cache' ); /** - * Clear cached XProfile fullname data for user + * Clear cached XProfile fullname data for user. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param int $user_id ID of user whose fullname cache to delete + * @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' ); @@ -202,10 +204,12 @@ add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object_cach /** * Clear the fullname cache when field 1 is updated. * - * xprofile_clear_profile_data_object_cache() will make this redundant in most - * cases, except where the field is updated directly with xprofile_set_field_data() + * The xprofile_clear_profile_data_object_cache() will make this redundant in most + * cases, except where the field is updated directly with xprofile_set_field_data(). + * + * @since 2.0.0 * - * @since BuddyPress (2.0.0) + * @param object $data Data object to clear. */ function xprofile_clear_fullname_cache_on_profile_field_edit( $data ) { if ( 1 == $data->field_id ) { @@ -217,30 +221,40 @@ add_action( 'xprofile_data_after_save', 'xprofile_clear_fullname_cache_on_profil /** * Clear caches when a field object is modified. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_XProfile_Field + * @param BP_XProfile_Field $field_obj Field object cache to delete. */ function xprofile_clear_profile_field_object_cache( $field_obj ) { - // Clear default visibility level cache + // Clear default visibility level cache. 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 'all' cache + // 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_deleted_field', 'xprofile_clear_profile_field_object_cache' ); +/** + * Clears member_type cache when a field's member types are updated. + * + * @since 2.4.0 + */ +function bp_xprofile_clear_member_type_cache() { + wp_cache_delete( 'field_member_types', 'bp_xprofile' ); +} +add_action( 'bp_xprofile_field_set_member_type', 'bp_xprofile_clear_member_type_cache' ); + /** * Clear caches when a user's updates a field data object. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_XProfile_ProfileData $data_obj + * @param BP_XProfile_ProfileData $data_obj Field data object to delete. */ function xprofile_clear_profiledata_object_cache( $data_obj ) { wp_cache_delete( "{$data_obj->user_id}:{$data_obj->field_id}", 'bp_xprofile_data' ); @@ -261,12 +275,36 @@ add_action( 'xprofile_data_after_delete', 'xprofile_clear_profiledata_object_cac * presence of the non-hardcoded versions (and thus this bit of cache * invalidation) is thus for backward compatibility only. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function xprofile_clear_fullname_field_id_cache() { wp_cache_delete( 'fullname_field_id', 'bp_xprofile' ); } add_action( 'update_option_bp-xprofile-fullname-field-name', 'xprofile_clear_fullname_field_id_cache' ); -// List actions to clear super cached pages on, if super cache is installed +/** + * Clear a field's caches. + * + * @since 2.4.0 + * + * @param int|BP_XProfile_Field $field A field ID or a field object. + * @return bool False on failure. + */ +function bp_xprofile_clear_field_cache( $field ) { + if ( is_numeric( $field ) ) { + $field_id = (int) $field; + } elseif ( $field instanceof BP_XProfile_Field ) { + $field_id = (int) $field->id; + } + + if ( ! isset( $field_id ) ) { + return false; + } + + wp_cache_delete( $field_id, 'bp_xprofile_fields' ); + wp_cache_delete( $field_id, 'xprofile_meta' ); +} +add_action( 'xprofile_field_after_save', 'bp_xprofile_clear_field_cache' ); + +// List actions to clear super cached pages on, if super cache is installed. add_action( 'xprofile_updated_profile', 'bp_core_clear_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 24014f397822ddcc140e75ccf5a0193b73f5ac00..19575d330915074cf7ddc5a78240c67eaefe12f9 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php @@ -1,40 +1,40 @@ <?php - /** - * Roles and capabilities logic for the XProfile component + * Roles and capabilities logic for the XProfile component. * * @package BuddyPress - * @since BuddyPress (1.6.0) + * @subpackage XPRofileCaps + * @since 1.6.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Maps XProfile caps to built in WordPress caps + * Maps XProfile caps to built in WordPress caps. + * + * @since 1.6.0 * - * @since BuddyPress (1.6.0) + * @param array $caps Capabilities for meta capability. + * @param string $cap Capability name. + * @param int $user_id User id. + * @param mixed $args Arguments. * - * @param array $caps Capabilities for meta capability - * @param string $cap Capability name - * @param int $user_id User id - * @param mixed $args Arguments - * @uses get_post() To get the post - * @uses get_post_type_object() To get the post type object - * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user id and - * args - * @return array Actual capabilities for meta capability + * @uses get_post() To get the post. + * @uses get_post_type_object() To get the post type object. + * @uses apply_filters() Calls 'bp_map_meta_caps' with caps, cap, user id and args. + * @return array Actual capabilities for meta capability. */ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) { switch ( $cap ) { case 'bp_xprofile_change_field_visibility' : - $caps = array( 'exist' ); // Must allow for logged-out users during registration + $caps = array( 'exist' ); // Must allow for logged-out users during registration. - // You may pass args manually: $field_id, $profile_user_id + // You may pass args manually: $field_id, $profile_user_id. $field_id = isset( $args[0] ) ? (int)$args[0] : bp_get_the_profile_field_id(); $profile_user_id = isset( $args[1] ) ? (int)$args[1] : bp_displayed_user_id(); - // Visibility on the fullname field is not editable + // Visibility on the fullname field is not editable. if ( 1 == $field_id ) { $caps[] = 'do_not_allow'; break; @@ -46,7 +46,7 @@ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) { break; } - // Friends don't let friends edit each other's visibility + // Friends don't let friends edit each other's visibility. if ( $profile_user_id != bp_displayed_user_id() && !bp_current_user_can( 'bp_moderate' ) ) { $caps[] = 'do_not_allow'; break; @@ -58,7 +58,7 @@ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) { /** * Filters the XProfile caps to built in WordPress caps. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $caps Capabilities for meta capability. * @param string $cap Capability name. 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 6f8d8e9fd809296573f29dd00a8dbae450ea526a..3efc02aeee73cbca2af6ab4f3f70b6f8d07becf4 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php @@ -1,12 +1,13 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; require dirname( __FILE__ ) . '/classes/class-bp-xprofile-group.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 1dd30278c190192c3aa4720005206cde8791ce47..221cfaacacd36e27c0db12448559d0025539bf2d 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php @@ -1,23 +1,23 @@ <?php - /** - * BuddyPress XProfile CSS and JS + * BuddyPress XProfile CSS and JS. * * @package BuddyPress * @subpackage XProfileScripts + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** - * Enqueue the CSS for XProfile admin styling + * Enqueue the CSS for XProfile admin styling. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 */ function xprofile_add_admin_css() { if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); wp_enqueue_style( 'xprofile-admin-css', buddypress()->plugin_url . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() ); @@ -30,9 +30,9 @@ function xprofile_add_admin_css() { add_action( 'bp_admin_enqueue_scripts', 'xprofile_add_admin_css' ); /** - * Enqueue the jQuery libraries for handling drag/drop/sort + * Enqueue the jQuery libraries for handling drag/drop/sort. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 */ function xprofile_add_admin_js() { if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { @@ -43,15 +43,16 @@ function xprofile_add_admin_js() { wp_enqueue_script( 'jquery-ui-droppable' ); wp_enqueue_script( 'jquery-ui-sortable' ); - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + $min = bp_core_get_minified_asset_suffix(); wp_enqueue_script( 'xprofile-admin-js', buddypress()->plugin_url . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); // Localize strings. // supports_options_field_types is a dynamic list of field // types that support options, for use in showing/hiding the - // "please enter options for this field" section + // "please enter options for this field" section. $strings = array( 'supports_options_field_types' => array(), + 'do_autolink' => '', ); foreach ( bp_xprofile_get_field_types() as $field_type => $field_type_class ) { @@ -61,6 +62,14 @@ function xprofile_add_admin_js() { } } + // Load 'autolink' setting into JS so that we can provide smart defaults when switching field type. + if ( ! empty( $_GET['field_id'] ) ) { + $field_id = intval( $_GET['field_id'] ); + + // Pull the raw data from the DB so we can tell whether the admin has saved a value yet. + $strings['do_autolink'] = bp_xprofile_get_meta( $field_id, 'field', 'do_autolink' ); + } + wp_localize_script( 'xprofile-admin-js', 'XProfileAdmin', $strings ); } } 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 7918dd7bcc429293ef201b4f40f7412c2f21fd9d..fde1e11b0da146336b10948094fdc44f5110a8ec 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php @@ -1,15 +1,15 @@ <?php - /** - * BuddyPress XProfile Filters + * BuddyPress XProfile Filters. * - * Apply WordPress defined filters + * Apply WordPress defined filters. * * @package BuddyPress * @subpackage XProfileFilters + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; add_filter( 'bp_get_the_profile_group_name', 'wp_filter_kses', 1 ); @@ -24,14 +24,14 @@ add_filter( 'bp_get_the_profile_field_value', 'convert_chars' ); add_filter( 'bp_get_the_profile_field_value', 'wpautop' ); add_filter( 'bp_get_the_profile_field_value', 'force_balance_tags' ); add_filter( 'bp_get_the_profile_field_value', 'make_clickable' ); -add_filter( 'bp_get_the_profile_field_value', 'esc_html', 8 ); +add_filter( 'bp_get_the_profile_field_value', 'bp_xprofile_escape_field_data', 8, 3 ); add_filter( 'bp_get_the_profile_field_value', 'convert_smilies', 9 ); add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_field_value', 1, 2 ); -add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_field_value_by_type', 8, 2 ); -add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); +add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_field_value_by_type', 8, 3 ); +add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 3 ); add_filter( 'bp_get_the_profile_field_edit_value', 'force_balance_tags' ); -add_filter( 'bp_get_the_profile_field_edit_value', 'esc_html' ); +add_filter( 'bp_get_the_profile_field_edit_value', 'bp_xprofile_escape_field_data', 10, 3 ); add_filter( 'bp_get_the_profile_group_name', 'stripslashes' ); add_filter( 'bp_get_the_profile_group_description', 'stripslashes' ); @@ -40,7 +40,7 @@ add_filter( 'bp_get_the_profile_field_edit_value', 'stripslashes' ); add_filter( 'bp_get_the_profile_field_name', 'stripslashes' ); add_filter( 'bp_get_the_profile_field_description', 'stripslashes' ); -add_filter( 'xprofile_get_field_data', 'wp_filter_kses', 1 ); +add_filter( 'xprofile_get_field_data', 'xprofile_filter_kses', 1 ); add_filter( 'xprofile_field_name_before_save', 'wp_filter_kses', 1 ); add_filter( 'xprofile_field_description_before_save', 'wp_filter_kses', 1 ); @@ -55,30 +55,35 @@ 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 +// 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_group_name_before_save', 'stripslashes' ); +add_filter( 'xprofile_group_description_before_save', 'stripslashes' ); + +// 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 +// 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 + * Sanitize each field option name for saving to the database. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 + * + * @param mixed $field_options Options to sanitize. * - * @param mixed $field_options * @return mixed */ function bp_xprofile_sanitize_field_options( $field_options = '' ) { @@ -90,11 +95,12 @@ function bp_xprofile_sanitize_field_options( $field_options = '' ) { } /** - * Sanitize each field option default for saving to the database + * Sanitize each field option default for saving to the database. + * + * @since 2.3.0 * - * @since BuddyPress (2.3.0) + * @param mixed $field_default Field defaults to sanitize. * - * @param mixed $field_default * @return mixed */ function bp_xprofile_sanitize_field_default( $field_default = '' ) { @@ -106,12 +112,11 @@ function bp_xprofile_sanitize_field_default( $field_default = '' ) { } /** - * xprofile_filter_kses ( $content ) - * * Run profile field values through kses with filterable allowed tags. * - * @param string $content - * @param object $data_obj The BP_XProfile_ProfileData object + * @param string $content Content to filter. + * @param object|null $data_obj The BP_XProfile_ProfileData object. + * * @return string $content */ function xprofile_filter_kses( $content, $data_obj = null ) { @@ -120,10 +125,24 @@ function xprofile_filter_kses( $content, $data_obj = null ) { $xprofile_allowedtags = $allowedtags; $xprofile_allowedtags['a']['rel'] = array(); + // If the field supports rich text, we must allow tags that appear in wp_editor(). + if ( $data_obj instanceof BP_XProfile_ProfileData && bp_xprofile_is_richtext_enabled_for_field( $data_obj->field_id ) ) { + $richtext_tags = array( + 'img' => array( 'id' => 1, 'class' => 1, 'src' => 1, 'alt' => 1, 'width' => 1, 'height' => 1 ), + 'ul' => array( 'id' => 1, 'class' => 1 ), + 'ol' => array( 'id' => 1, 'class' => 1 ), + 'li' => array( 'id' => 1, 'class' => 1 ), + 'span' => array( 'style' => 1 ), + 'p' => array( 'style' => 1 ), + ); + + $xprofile_allowedtags = array_merge( $allowedtags, $richtext_tags ); + } + /** * Filters the allowed tags for use within xprofile_filter_kses(). * - * @since BuddyPress (1.5.0) + * @since 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. @@ -135,23 +154,24 @@ function xprofile_filter_kses( $content, $data_obj = null ) { /** * Safely runs profile field data through kses and force_balance_tags. * - * @param string $field_value - * @param int $field_id - * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true - * @param object $data_obj The BP_XProfile_ProfileData object + * @param string $field_value Field value being santized. + * @param int $field_id Field ID being sanitized. + * @param bool $reserialize Whether to reserialize arrays before returning. Defaults to true. + * @param object|null $data_obj The BP_XProfile_ProfileData object. + * * @return string */ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0, $reserialize = true, $data_obj = null ) { - // Return if empty + // Return if empty. if ( empty( $field_value ) ) { return $field_value; } - // Value might be serialized + // Value might be serialized. $field_value = maybe_unserialize( $field_value ); - // Filter single value + // Filter single value. 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 ) ); @@ -159,7 +179,7 @@ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0, /** * Filters the kses-filtered data before saving to database. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $filtered_field_value The filtered value. * @param string $field_value The original value before filtering. @@ -167,7 +187,7 @@ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0, */ $filtered_field_value = apply_filters( 'xprofile_filtered_data_value_before_save', $filtered_field_value, $field_value, $data_obj ); - // Filter each array item independently + // Filter each array item independently. } else { $filtered_values = array(); foreach ( (array) $field_value as $value ) { @@ -192,16 +212,17 @@ function xprofile_sanitize_data_value_before_save( $field_value, $field_id = 0, /** * Runs stripslashes on XProfile fields. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $field_value XProfile field_value to be filtered. - * @param string $field_type XProfile field_type to be filtered. + * @param string $field_type XProfile field_type to be filtered. + * * @return string $field_value Filtered XProfile field_value. False on failure. */ function xprofile_filter_format_field_value( $field_value, $field_type = '' ) { - // Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731 - if ( ! isset( $field_value ) || empty( $field_value ) && ( '0' !== $field_value ) ) { + // Valid field values of 0 or '0' get caught by empty(), so we have an extra check for these. See #BP5731. + if ( ! isset( $field_value ) || empty( $field_value ) && ( '0' !== $field_value ) ) { return false; } @@ -213,22 +234,25 @@ function xprofile_filter_format_field_value( $field_value, $field_type = '' ) { } /** - * Apply display_filter() filters as defined by the BP_XProfile_Field_Type classes, when fetched inside a bp_has_profile() loop. + * Apply display_filter() filters as defined by BP_XProfile_Field_Type classes, when inside a bp_has_profile() loop. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added `$field_id` parameter. + * + * @param mixed $field_value Field value. + * @param string $field_type Field type. + * @param string|int $field_id Optional. ID of the field. * - * @param mixed $field_value Field value. - * @param string $field_type Field type. * @return mixed */ -function xprofile_filter_format_field_value_by_type( $field_value, $field_type = '' ) { +function xprofile_filter_format_field_value_by_type( $field_value, $field_type = '', $field_id = '' ) { foreach ( bp_xprofile_get_field_types() as $type => $class ) { if ( $type !== $field_type ) { continue; } if ( method_exists( $class, 'display_filter' ) ) { - $field_value = call_user_func( array( $class, 'display_filter' ), $field_value ); + $field_value = call_user_func( array( $class, 'display_filter' ), $field_value, $field_id ); } } @@ -236,27 +260,28 @@ function xprofile_filter_format_field_value_by_type( $field_value, $field_type = } /** - * Apply display_filter() filters as defined by the BP_XProfile_Field_Type classes, when fetched by xprofile_get_field_data(). + * Apply display_filter() filters as defined by the BP_XProfile_Field_Type classes, when fetched + * by xprofile_get_field_data(). * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param mixed $field_value Field value. - * @param int $field_id Field type. + * @param int $field_id Field type. + * @return string */ function xprofile_filter_format_field_value_by_field_id( $field_value, $field_id ) { - $field = new BP_XProfile_Field( $field_id ); - return xprofile_filter_format_field_value_by_type( $field_value, $field->type ); + $field = xprofile_get_field( $field_id ); + return xprofile_filter_format_field_value_by_type( $field_value, $field->type, $field_id ); } /** * Apply pre_validate_filter() filters as defined by the BP_XProfile_Field_Type classes before validating. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param mixed $value Value passed to the bp_xprofile_set_field_data_pre_validate - * filter. - * @param BP_XProfile_Field $field Field object. - * @param BP_XProfile_Field_Type Field type object. + * @param mixed $value Value passed to the bp_xprofile_set_field_data_pre_validate filter. + * @param BP_XProfile_Field $field Field object. + * @param BP_XProfile_Field_Type $field_type_obj Field type object. * @return mixed */ function xprofile_filter_pre_validate_value_by_field_type( $value, $field, $field_type_obj ) { @@ -267,22 +292,60 @@ function xprofile_filter_pre_validate_value_by_field_type( $value, $field, $fiel return $value; } +/** + * Escape field value for display. + * + * Most field values are simply run through esc_html(). Those that support rich text (by default, `textarea` only) + * are sanitized using kses, which allows a whitelist of HTML tags. + * + * @since 2.4.0 + * + * @param string $value Field value. + * @param string $field_type Field type. + * @param int $field_id Field ID. + * @return string + */ +function bp_xprofile_escape_field_data( $value, $field_type, $field_id ) { + if ( bp_xprofile_is_richtext_enabled_for_field( $field_id ) ) { + // The xprofile_filter_kses() expects a BP_XProfile_ProfileData object. + $data_obj = null; + if ( bp_is_user() ) { + $data_obj = new BP_XProfile_ProfileData( $field_id, bp_displayed_user_id() ); + } + + $value = xprofile_filter_kses( $value, $data_obj ); + } else { + $value = esc_html( $value ); + } + + return $value; +} + /** * 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 ); + * - Not run on datebox field types. + * - Not run on values without commas with less than 5 words. + * - URL's are made clickable. + * + * To disable globally: + * remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 3 ); + * + * To disable for a single field, use the 'Autolink' settings in Dashboard > Users > Profile Fields. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * - * @param string $field_value - * @param string $field_type + * @param string $field_value Profile field data value. + * @param string $field_type Profile field type. * @return string */ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox' ) { + global $field; + + if ( ! $field->get_do_autolink() ) { + return $field_value; + } if ( 'datebox' === $field_type ) { return $field_value; @@ -302,16 +365,17 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox if ( preg_match( '@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', $value ) ) { $new_values[] = make_clickable( $value ); - // Is not clickable + // Is not clickable. } else { - // More than 5 spaces + // More than 5 spaces. if ( count( explode( ' ', $value ) ) > 5 ) { $new_values[] = $value; - // Less than 5 spaces + // Less than 5 spaces. } else { - $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() ); + $query_arg = bp_core_get_component_search_query_arg( 'members' ); + $search_url = add_query_arg( array( $query_arg => urlencode( $value ) ), bp_get_members_directory_permalink() ); $new_values[] = '<a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a>'; } } @@ -324,37 +388,38 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox } /** - * Ensures that BP data appears in comments array + * Ensures that BP data appears in comments array. * * This filter loops through the comments return by a normal WordPress request - * and swaps out user data with BP xprofile data, where available + * and swaps out user data with BP xprofile data, where available. + * + * @param array $comments Comments to filter in. + * @param int $post_id Post ID the comments are for. * - * @param array $comments - * @param int $post_id * @return array $comments */ function xprofile_filter_comments( $comments, $post_id = 0 ) { - // Locate comment authors with WP accounts + // Locate comment authors with WP accounts. foreach( (array) $comments as $comment ) { if ( $comment->user_id ) { $user_ids[] = $comment->user_id; } } - // If none are found, just return the comments array + // If none are found, just return the comments array. if ( empty( $user_ids ) ) { return $comments; } - // Pull up the xprofile fullname of each commenter + // Pull up the xprofile fullname of each commenter. if ( $fullnames = bp_core_get_user_displaynames( $user_ids ) ) { foreach( (array) $fullnames as $user_id => $user_fullname ) { $users[ $user_id ] = trim( stripslashes( $user_fullname ) ); } } - // Loop through and match xprofile fullname with commenters + // Loop through and match xprofile fullname with commenters. foreach( (array) $comments as $i => $comment ) { if ( ! empty( $comment->user_id ) ) { if ( ! empty( $users[ $comment->user_id ] ) ) { @@ -368,12 +433,12 @@ function xprofile_filter_comments( $comments, $post_id = 0 ) { add_filter( 'comments_array', 'xprofile_filter_comments', 10, 2 ); /** - * Filter BP_User_Query::populate_extras to override each queries users fullname + * Filter BP_User_Query::populate_extras to override each queries users fullname. * - * @since BuddyPress (1.7.0) + * @since 1.7.0 * - * @param BP_User_Query $user_query - * @param string $user_ids_sql + * @param BP_User_Query $user_query User query to filter. + * @param string $user_ids_sql SQL statement to use. */ function bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql = '' ) { @@ -383,7 +448,7 @@ function bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_quer $user_id_names = bp_core_get_user_displaynames( $user_query->user_ids ); - // Loop through names and override each user's fullname + // Loop through names and override each user's fullname. foreach ( $user_id_names as $user_id => $user_fullname ) { if ( isset( $user_query->results[ $user_id ] ) ) { $user_query->results[ $user_id ]->fullname = $user_fullname; @@ -395,13 +460,13 @@ add_filter( 'bp_user_query_populate_extras', 'bp_xprofile_filter_user_query_popu /** * Parse 'xprofile_query' argument passed to BP_User_Query. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * - * @param BP_User_Query User query object. + * @param BP_User_Query $q User query object. */ function bp_xprofile_add_xprofile_query_to_user_query( BP_User_Query $q ) { - // Bail if no `xprofile_query` clause + // Bail if no `xprofile_query` clause. if ( empty( $q->query_vars['xprofile_query'] ) ) { return; } @@ -419,7 +484,7 @@ add_action( 'bp_pre_user_query', 'bp_xprofile_add_xprofile_query_to_user_query' /** * Filter meta queries to modify for the xprofile data schema. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @access private Do not use. * @@ -439,14 +504,14 @@ function bp_xprofile_filter_meta_query( $q ) { preg_match_all( $quoted_regex, $q, $quoted_matches ); $q = preg_replace( $quoted_regex, '__QUOTE__', $q ); - // Get the first word of the command + // Get the first word of the command. preg_match( '/^(\S+)/', $q, $first_word_matches ); if ( empty( $first_word_matches[0] ) ) { return $raw_q; } - // Get the field type + // Get the field type. preg_match( '/xprofile_(group|field|data)_id/', $q, $matches ); if ( empty( $matches[0] ) || empty( $matches[1] ) ) { 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 d84f029c41c2f684f632fa5718920a61d26628e5..0996257967c7d263656f9607504e3bbbed9a8ee9 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress XProfile Filters + * BuddyPress XProfile Filters. * * Business functions are where all the magic happens in BuddyPress. They will * handle the actual saving or manipulation of information. Usually they will @@ -9,10 +8,11 @@ * true or false on success or failure. * * @package BuddyPress - * @subpackage XProfileFilters + * @subpackage XProfileFunctions + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /*** Field Group Management **************************************************/ @@ -22,10 +22,10 @@ defined( 'ABSPATH' ) || exit; * * Procedural wrapper for BP_XProfile_Group::get() method. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $args See {@link BP_XProfile_Group::get()} for description of - * arguments. + * arguments. * @return array $groups */ function bp_xprofile_get_groups( $args = array() ) { @@ -35,7 +35,7 @@ function bp_xprofile_get_groups( $args = array() ) { /** * Filters a set of field groups, populated with fields and field data. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $groups Array of field groups and field data. * @param array $args Array of arguments used to query for groups. @@ -44,16 +44,16 @@ function bp_xprofile_get_groups( $args = array() ) { } /** - * Insert a new profile field group + * Insert a new profile field group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param type $args + * @param array|string $args Array of arguments for field group insertion. * @return boolean */ function xprofile_insert_field_group( $args = '' ) { - // Parse the arguments + // Parse the arguments. $r = bp_parse_args( $args, array( 'field_group_id' => false, 'name' => false, @@ -61,12 +61,12 @@ function xprofile_insert_field_group( $args = '' ) { 'can_delete' => true ), 'xprofile_insert_field_group' ); - // Bail if no group name + // Bail if no group name. if ( empty( $r['name'] ) ) { return false; } - // Create new field group object, maybe using an existing ID + // Create new field group object, maybe using an existing ID. $field_group = new BP_XProfile_Group( $r['field_group_id'] ); $field_group->name = $r['name']; $field_group->description = $r['description']; @@ -76,70 +76,70 @@ function xprofile_insert_field_group( $args = '' ) { } /** - * Get a specific profile field group + * Get a specific profile field group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param int $field_group_id + * @param int $field_group_id Field group ID to fetch. * @return boolean|BP_XProfile_Group */ function xprofile_get_field_group( $field_group_id = 0 ) { - // Try to get a specific field group by ID + // Try to get a specific field group by ID. $field_group = new BP_XProfile_Group( $field_group_id ); - // Bail if group was not found + // Bail if group was not found. if ( empty( $field_group->id ) ) { return false; } - // Return field group + // Return field group. return $field_group; } /** - * Delete a specific profile field group + * Delete a specific profile field group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param int $field_group_id + * @param int $field_group_id Field group ID to delete. * @return boolean */ function xprofile_delete_field_group( $field_group_id = 0 ) { - // Try to get a specific field group by ID + // Try to get a specific field group by ID. $field_group = xprofile_get_field_group( $field_group_id ); - // Bail if group was not found + // Bail if group was not found. if ( false === $field_group ) { return false; } - // Return the results of trying to delete the field group + // Return the results of trying to delete the field group. return $field_group->delete(); } /** - * Update the position of a specific profile field group + * Update the position of a specific profile field group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param int $field_group_id - * @param int $position - * @return bool + * @param int $field_group_id Field group ID to update. + * @param int $position Field group position to update to. + * @return boolean */ function xprofile_update_field_group_position( $field_group_id = 0, $position = 0 ) { return BP_XProfile_Group::update_position( $field_group_id, $position ); } - /*** Field Management *********************************************************/ /** * Get details of all xprofile field types. * + * @since 2.0.0 + * * @return array Key/value pairs (field type => class name). - * @since BuddyPress (2.0.0) */ function bp_xprofile_get_field_types() { $fields = array( @@ -159,7 +159,7 @@ function bp_xprofile_get_field_types() { * * If you've added a custom field type in a plugin, register it with this filter. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $fields Array of field type/class name pairings. */ @@ -169,9 +169,11 @@ function bp_xprofile_get_field_types() { /** * Creates the specified field type object; used for validation and templating. * + * @since 2.0.0 + * * @param string $type Type of profile field to create. See {@link bp_xprofile_get_field_types()} for default core values. - * @return object If field type unknown, returns BP_XProfile_Field_Type_Textarea. Otherwise returns an instance of the relevant child class of BP_XProfile_Field_Type. - * @since BuddyPress (2.0.0) + * @return object $value If field type unknown, returns BP_XProfile_Field_Type_Textarea. + * Otherwise returns an instance of the relevant child class of BP_XProfile_Field_Type. */ function bp_xprofile_create_field_type( $type ) { @@ -191,7 +193,7 @@ function bp_xprofile_create_field_type( $type ) { /** * Insert or update an xprofile field. * - * @param array $args { + * @param array|string $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. @@ -231,7 +233,7 @@ function xprofile_insert_field( $args = '' ) { 'field_order' => null, ) ); - // field_group_id is required + // Field_group_id is required. if ( empty( $r['field_group_id'] ) ) { return false; } @@ -241,9 +243,9 @@ function xprofile_insert_field( $args = '' ) { return false; } - // Instantiate a new field object + // Instantiate a new field object. if ( ! empty( $r['field_id'] ) ) { - $field = new BP_XProfile_Field( $r['field_id'] ); + $field = xprofile_get_field( $r['field_id'] ); } else { $field = new BP_XProfile_Field; } @@ -268,30 +270,55 @@ function xprofile_insert_field( $args = '' ) { return $field->save(); } -function xprofile_get_field( $field_id ) { - return new BP_XProfile_Field( $field_id ); +/** + * Get a profile field object. + * + * @param int|object $field ID of the field or object representing field data. + * @return BP_XProfile_Field|null Field object if found, otherwise null. + */ +function xprofile_get_field( $field ) { + if ( $field instanceof BP_XProfile_Field ) { + $_field = $field; + } elseif ( is_object( $field ) ) { + $_field = new BP_XProfile_Field(); + $_field->fill_data( $field ); + } else { + $_field = BP_XProfile_Field::get_instance( $field ); + } + + if ( ! $_field ) { + return null; + } + + return $_field; } +/** + * Delete a profile field object. + * + * @param int|object $field_id ID of the field or object representing field data. + * @return bool Whether or not the field was deleted. + */ function xprofile_delete_field( $field_id ) { $field = new BP_XProfile_Field( $field_id ); return $field->delete(); } - /*** Field Data Management *****************************************************/ + /** * Fetches profile data for a specific field for the user. * * When the field value is serialized, this function unserializes and filters * each item in the array. * - * @package BuddyPress Core - * @param mixed $field The ID of the field, or the $name of the field. - * @param int $user_id The ID of the user - * @param string $multi_format How should array data be returned? 'comma' if you want a - * comma-separated string; 'array' if you want an array * @uses BP_XProfile_ProfileData::get_value_byid() Fetches the value based on the params passed. + * + * @param mixed $field The ID of the field, or the $name of the field. + * @param int $user_id The ID of the user. + * @param string $multi_format How should array data be returned? 'comma' if you want a + * comma-separated string; 'array' if you want an array. * @return mixed The profile field data. */ function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' ) { @@ -323,7 +350,7 @@ function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' /** * Filters the field data value for a specific field for the user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Value saved for the field. * @param int $field_id ID of the field being displayed. @@ -346,12 +373,12 @@ function xprofile_get_field_data( $field, $user_id = 0, $multi_format = 'array' /** * A simple function to set profile data for a specific field for a specific user. * - * @package BuddyPress Core - * @param int|string $field The ID of the field, or the $name of the field. - * @param int|$user_id The ID of the user - * @param mixed $value The value for the field you want to set for the user. - * @param $is_required Whether or not the field is required - * @uses xprofile_get_field_id_from_name() Gets the ID for the field based on the name. + * @uses xprofile_get_field_id_from_name() Gets the ID from the field based on the name. + * + * @param int|string $field The ID of the field, or the $name of the field. + * @param int $user_id The ID of the user. + * @param mixed $value The value for the field you want to set for the user. + * @param bool $is_required Whether or not the field is required. * @return bool True on success, false on failure. */ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false ) { @@ -366,7 +393,7 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false return false; } - $field = new BP_XProfile_Field( $field_id ); + $field = xprofile_get_field( $field_id ); $field_type = BP_XProfile_Field::get_type( $field_id ); $field_type_obj = bp_xprofile_create_field_type( $field_type ); @@ -376,15 +403,15 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false * Use this filter to modify the values submitted by users before * doing field-type-specific validation. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @param mixed $value Value passed to xprofile_set_field_data() - * @param BP_XProfile_Field $field Field object. + * @param mixed $value Value passed to xprofile_set_field_data(). + * @param BP_XProfile_Field $field Field object. * @param BP_XProfile_Field_Type $field_type_obj Field type object. */ $value = apply_filters( 'bp_xprofile_set_field_data_pre_validate', $value, $field, $field_type_obj ); - // Special-case support for integer 0 for the number field type + // Special-case support for integer 0 for the number field type. if ( $is_required && ! is_integer( $value ) && $value !== '0' && ( empty( $value ) || ! is_array( $value ) && ! strlen( trim( $value ) ) ) ) { return false; } @@ -399,7 +426,8 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false $value = array(); } - // If the value is empty, then delete any field data that exists, unless the field is of a type where null values are semantically meaningful + // If the value is empty, then delete any field data that exists, unless the field is of a type + // where null values are semantically meaningful. if ( empty( $value ) && ! is_integer( $value ) && $value !== '0' && ! $field_type_obj->accepts_null_value ) { xprofile_delete_field_data( $field_id, $user_id ); return true; @@ -424,11 +452,11 @@ function xprofile_set_field_data( $field, $user_id, $value, $is_required = false } /** - * Set the visibility level for this field + * Set the visibility level for this field. * - * @param int $field_id The ID of the xprofile field - * @param int $user_id The ID of the user to whom the data belongs - * @param string $visibility_level + * @param int $field_id The ID of the xprofile field. + * @param int $user_id The ID of the user to whom the data belongs. + * @param string $visibility_level What the visibity setting should be. * @return bool True on success */ function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visibility_level = '' ) { @@ -436,13 +464,13 @@ function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visi return false; } - // Check against a whitelist + // Check against a whitelist. $allowed_values = bp_xprofile_get_visibility_levels(); if ( !array_key_exists( $visibility_level, $allowed_values ) ) { return false; } - // Stored in an array in usermeta + // Stored in an array in usermeta. $current_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true ); if ( !$current_visibility_levels ) { @@ -457,7 +485,7 @@ function xprofile_set_field_visibility_level( $field_id = 0, $user_id = 0, $visi /** * Get the visibility level for a field. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param int $field_id The ID of the xprofile field. * @param int $user_id The ID of the user to whom the data belongs. @@ -473,8 +501,8 @@ function xprofile_get_field_visibility_level( $field_id = 0, $user_id = 0 ) { $current_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true ); $current_level = isset( $current_levels[ $field_id ] ) ? $current_levels[ $field_id ] : ''; - // Use the user's stored level, unless custom visibility is disabled - $field = new BP_XProfile_Field( $field_id ); + // Use the user's stored level, unless custom visibility is disabled. + $field = xprofile_get_field( $field_id ); if ( isset( $field->allow_custom_visibility ) && 'disabled' === $field->allow_custom_visibility ) { $current_level = $field->default_visibility; } @@ -488,39 +516,45 @@ function xprofile_get_field_visibility_level( $field_id = 0, $user_id = 0 ) { return $current_level; } +/** + * Delete XProfile field data. + * + * @param string $field Field to delete. + * @param int $user_id User ID to delete field from. + * @return bool Whether or not the field was deleted. + */ function xprofile_delete_field_data( $field = '', $user_id = 0 ) { - // Get the field ID + // Get the field ID. if ( is_numeric( $field ) ) { $field_id = (int) $field; } else { $field_id = xprofile_get_field_id_from_name( $field ); } - // Bail if field or user ID are empty + // Bail if field or user ID are empty. if ( empty( $field_id ) || empty( $user_id ) ) { return false; } - // Get the profile field data to delete + // Get the profile field data to delete. $field = new BP_XProfile_ProfileData( $field_id, $user_id ); - // Delete the field data + // Delete the field data. return $field->delete(); } +/** + * Check if field is a required field. + * + * @param int $field_id ID of the field to check for. + * @return bool Whether or not field is required. + */ function xprofile_check_is_required_field( $field_id ) { - $field = new BP_Xprofile_Field( $field_id ); - - // Define locale variable(s) + $field = new BP_XProfile_Field( $field_id ); $retval = false; - // Super admins can skip required check - 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 ) ) { + if ( isset( $field->is_required ) ) { $retval = $field->is_required; } @@ -535,19 +569,20 @@ function xprofile_check_is_required_field( $field_id ) { * @return int $field_id on success, false on failure. */ function xprofile_get_field_id_from_name( $field_name ) { - return BP_Xprofile_Field::get_id_from_name( $field_name ); + return BP_XProfile_Field::get_id_from_name( $field_name ); } /** * Fetches a random piece of profile data for the user. * - * @package BuddyPress Core - * @param int $user_id User ID of the user to get random data for - * @param bool $exclude_fullname Optional; whether or not to exclude the full name field as random data. Defaults to true. - * @global BuddyPress $bp The one true BuddyPress instance - * @global $wpdb WordPress DB access object. - * @global $current_user WordPress global variable containing current logged in user information + * @global BuddyPress $bp The one true BuddyPress instance. + * @global object $wpdb WordPress DB access object. + * @global object $current_user WordPress global variable containing current logged in user information. * @uses xprofile_format_profile_field() Formats profile field data so it is suitable for display. + * + * @param int $user_id User ID of the user to get random data for. + * @param bool $exclude_fullname Optional; whether or not to exclude the full name field as random data. + * Defaults to true. * @return string|bool The fetched random data for the user, or false if no data or no match. */ function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) { @@ -566,7 +601,7 @@ function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) /** * Filters a random piece of profile data for the user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param array $field_data Array holding random profile data. */ @@ -576,10 +611,9 @@ function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) /** * Formats a profile field according to its type. [ TODO: Should really be moved to filters ] * - * @package BuddyPress Core - * @param string $field_type The type of field: datebox, selectbox, textbox etc - * @param string $field_value The actual value - * @return string|bool The formatted value, or false if value is empty + * @param string $field_type The type of field: datebox, selectbox, textbox etc. + * @param string $field_value The actual value. + * @return string|bool The formatted value, or false if value is empty. */ function xprofile_format_profile_field( $field_type, $field_value ) { @@ -597,6 +631,14 @@ function xprofile_format_profile_field( $field_type, $field_value ) { return xprofile_filter_format_field_value_by_type( stripslashes_deep( $field_value ), $field_type ); } +/** + * Update the field position for a provided field. + * + * @param int $field_id ID of the field to update. + * @param int $position Position to update the field to. + * @param int $field_group_id Group ID for group the field is in. + * @return bool + */ function xprofile_update_field_position( $field_id, $position, $field_group_id ) { return BP_XProfile_Field::update_position( $field_id, $position, $field_group_id ); } @@ -612,7 +654,7 @@ function xprofile_update_field_position( $field_id, $position, $field_group_id ) * Runs at bp_setup_globals:100 to ensure that all components have loaded their * globals before attempting any overrides. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function xprofile_override_user_fullnames() { // If sync is enabled, the two names will match. No need to continue. @@ -633,23 +675,22 @@ add_action( 'bp_setup_globals', 'xprofile_override_user_fullnames', 100 ); /** * Setup the avatar upload directory for a user. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @package BuddyPress Core * * @param string $directory The root directory name. Optional. * @param int $user_id The user ID. Optional. - * - * @return array() Array containing the path, URL, and other helpful settings. + * @return array Array containing the path, URL, and other helpful settings. */ function xprofile_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) { - // Use displayed user if no user ID was passed + // Use displayed user if no user ID was passed. if ( empty( $user_id ) ) { $user_id = bp_displayed_user_id(); } - // Failsafe against accidentally nooped $directory parameter + // Failsafe against accidentally nooped $directory parameter. if ( empty( $directory ) ) { $directory = 'avatars'; } @@ -663,7 +704,7 @@ function xprofile_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) { /** * Filters the avatar upload directory for a user. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $value Array containing the path, URL, and other helpful settings. */ @@ -680,10 +721,11 @@ function xprofile_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) { /** * When search_terms are passed to BP_User_Query, search against xprofile fields. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param array $sql Clauses in the user_id SQL query. - * @param BP_User_Query User query object. + * @param array $sql Clauses in the user_id SQL query. + * @param BP_User_Query $query User query object. + * @return array */ function bp_xprofile_bp_user_query_search( $sql, BP_User_Query $query ) { global $wpdb; @@ -708,7 +750,7 @@ function bp_xprofile_bp_user_query_search( $sql, BP_User_Query $query ) { } // Combine the core search (against wp_users) into a single OR clause - // with the xprofile_data search + // with the xprofile_data search. $search_xprofile = $wpdb->prepare( "u.{$query->uid_name} IN ( SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s OR value LIKE %s )", $search_terms_nospace, @@ -726,11 +768,12 @@ add_action( 'bp_user_query_uid_clauses', 'bp_xprofile_bp_user_query_search', 10, /** * Syncs Xprofile data to the standard built in WordPress profile data. * - * @package BuddyPress Core + * @param int $user_id ID of the user to sync. + * @return bool */ function xprofile_sync_wp_profile( $user_id = 0 ) { - // Bail if profile syncing is disabled + // Bail if profile syncing is disabled. if ( bp_disable_profile_sync() ) { return true; } @@ -766,16 +809,18 @@ add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' ); add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); add_action( 'bp_core_activated_user', 'xprofile_sync_wp_profile' ); - /** * Syncs the standard built in WordPress profile data to XProfile. * - * @since BuddyPress (1.2.4) - * @package BuddyPress Core + * @since 1.2.4 + * + * @param object $errors Array of errors. Passed by reference. + * @param bool $update Whether or not being upated. + * @param object $user User object whose profile is being synced. Passed by reference. */ function xprofile_sync_bp_profile( &$errors, $update, &$user ) { - // Bail if profile syncing is disabled + // Bail if profile syncing is disabled. if ( bp_disable_profile_sync() || ! $update || $errors->get_error_codes() ) { return; } @@ -790,8 +835,7 @@ add_action( 'user_profile_update_errors', 'xprofile_sync_bp_profile', 10, 3 ); * profile data from each table. Also we need to clean anything up in the * usermeta table that this component uses. * - * @package BuddyPress XProfile - * @param int $user_id The ID of the deleted user + * @param int $user_id The ID of the deleted user. */ function xprofile_remove_data( $user_id ) { BP_XProfile_ProfileData::delete_data_for_user( $user_id ); @@ -805,33 +849,33 @@ add_action( 'bp_make_spam_user', 'xprofile_remove_data' ); /** * Delete a piece of xprofile metadata. * - * @param int $object_id ID of the object the metadata belongs to. - * @param string $object_type Type of object. 'group', 'field', or 'data'. - * @param string $meta_key Key of the metadata being deleted. If omitted, all - * metadata for the object will be deleted. - * @param mixed $meta_value Optional. If provided, only metadata that matches - * the value will be permitted. - * @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 object. - * Default: false. + * @param int $object_id ID of the object the metadata belongs to. + * @param string $object_type Type of object. 'group', 'field', or 'data'. + * @param string|bool $meta_key Key of the metadata being deleted. If omitted, all + * metadata for the object will be deleted. + * @param mixed $meta_value Optional. If provided, only metadata that matches + * the value will be permitted. + * @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 object. + * Default: false. * @return bool True on success, false on failure. */ function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $meta_value = false, $delete_all = false ) { global $wpdb; - // Sanitize object type + // Sanitize object type. if ( ! in_array( $object_type, array( 'group', 'field', 'data' ) ) ) { return false; } - // Legacy - if no meta_key is passed, delete all for the item + // Legacy - if no meta_key is passed, delete all for the item. if ( empty( $meta_key ) ) { $table_key = 'xprofile_' . $object_type . 'meta'; $table_name = $wpdb->{$table_key}; $keys = $wpdb->get_col( $wpdb->prepare( "SELECT meta_key FROM {$table_name} WHERE object_type = %s AND object_id = %d", $object_type, $object_id ) ); - // Force delete_all to false if deleting all for object + // Force delete_all to false if deleting all for object. $delete_all = false; } else { $keys = array( $meta_key ); @@ -857,17 +901,17 @@ function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $ * Note that the default value of $single is true, unlike in the case of the * underlying get_metadata() function. This is for backward compatibility. * - * @param int $object_id ID of the object the metadata belongs to. + * @param int $object_id ID of the object the metadata belongs to. * @param string $object_type Type of object. 'group', 'field', or 'data'. - * @param string $meta_key Key of the metadata being fetched. If omitted, all - * metadata for the object will be retrieved. - * @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 string $meta_key Key of the metadata being fetched. If omitted, all + * metadata for the object will be retrieved. + * @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 Meta value if found. False on failure. */ function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '', $single = true ) { - // Sanitize object type + // Sanitize object type. if ( ! in_array( $object_type, array( 'group', 'field', 'data' ) ) ) { return false; } @@ -884,16 +928,16 @@ function bp_xprofile_get_meta( $object_id, $object_type, $meta_key = '', $single /** * Update a piece of xprofile metadata. * - * @param int $object_id ID of the object the metadata belongs to. + * @param int $object_id ID of the object the metadata belongs to. * @param string $object_type Type of object. 'group', 'field', or 'data'. - * @param string $meta_key Key of the metadata being updated. - * @param mixed $meta_value Value of the metadata being updated. - * @param mixed $prev_value Optional. If specified, only update existing - * metadata entries with the specified value. Otherwise, update all - * entries. + * @param string $meta_key Key of the metadata being updated. + * @param mixed $meta_value Value of the metadata being updated. + * @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_xprofile_update_meta( $object_id, $object_type, $meta_key, $meta_value, $prev_value = '' ) { add_filter( 'query', 'bp_filter_metaid_column_name' ); @@ -908,15 +952,16 @@ function bp_xprofile_update_meta( $object_id, $object_type, $meta_key, $meta_val /** * Add a piece of xprofile metadata. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param int $object_id ID of the object the metadata belongs to. + * @param int $object_id ID of the object the metadata belongs to. * @param string $object_type Type of object. 'group', 'field', or 'data'. - * @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 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_xprofile_add_meta( $object_id, $object_type, $meta_key, $meta_value, $unique = false ) { @@ -929,14 +974,38 @@ function bp_xprofile_add_meta( $object_id, $object_type, $meta_key, $meta_value, return $retval; } +/** + * Updates the fieldgroup metadata. + * + * @param int $field_group_id Group ID for the group field belongs to. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ function bp_xprofile_update_fieldgroup_meta( $field_group_id, $meta_key, $meta_value ) { return bp_xprofile_update_meta( $field_group_id, 'group', $meta_key, $meta_value ); } +/** + * Updates the field metadata. + * + * @param int $field_id Field ID to update. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ function bp_xprofile_update_field_meta( $field_id, $meta_key, $meta_value ) { return bp_xprofile_update_meta( $field_id, 'field', $meta_key, $meta_value ); } +/** + * Updates the fielddata metadata. + * + * @param int $field_data_id Field ID to update. + * @param string $meta_key Meta key to update. + * @param string $meta_value Meta value to update to. + * @return bool|int + */ function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_value ) { return bp_xprofile_update_meta( $field_data_id, 'data', $meta_key, $meta_value ); } @@ -944,7 +1013,7 @@ function bp_xprofile_update_fielddata_meta( $field_data_id, $meta_key, $meta_val /** * Return the field ID for the Full Name xprofile field. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @return int Field ID. */ @@ -964,27 +1033,59 @@ function bp_xprofile_fullname_field_id() { } /** - * Return the field name for the Full Name xprofile field + * Return the field name for the Full Name xprofile field. * - * @package BuddyPress - * @since BuddyPress (1.5.0) + * @since 1.5.0 * - * @return string The field name + * @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) + * @since 1.5.0 * - * @param string BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant. + * @param string $value BP_XPROFILE_FULLNAME_FIELD_NAME Full name field constant. */ return apply_filters( 'bp_xprofile_fullname_field_name', BP_XPROFILE_FULLNAME_FIELD_NAME ); } /** - * Get visibility levels out of the $bp global + * Is rich text enabled for this profile field? + * + * By default, rich text is enabled for textarea fields and disabled for all other field types. + * + * @since 2.4.0 + * + * @param int|null $field_id Optional. Default current field ID. + * @return bool + */ +function bp_xprofile_is_richtext_enabled_for_field( $field_id = null ) { + if ( ! $field_id ) { + $field_id = bp_get_the_profile_field_id(); + } + + $field = xprofile_get_field( $field_id ); + + $enabled = false; + if ( $field instanceof BP_XProfile_Field ) { + $enabled = (bool) $field->type_obj->supports_richtext; + } + + /** + * Filters whether richtext is enabled for the given field. + * + * @since 2.4.0 + * + * @param bool $enabled True if richtext is enabled for the field, otherwise false. + * @param int $field_id ID of the field. + */ + return apply_filters( 'bp_xprofile_is_richtext_enabled_for_field', $enabled, $field_id ); +} + +/** + * Get visibility levels out of the $bp global. * * @return array */ @@ -993,7 +1094,7 @@ function bp_xprofile_get_visibility_levels() { /** * Filters the visibility levels out of the $bp global. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param array $visibility_levels Array of visibility levels. */ @@ -1001,20 +1102,20 @@ function bp_xprofile_get_visibility_levels() { } /** - * Get the ids of fields that are hidden for this displayed/loggedin user pair + * Get the ids of fields that are hidden for this displayed/loggedin user pair. * * This is the function primarily responsible for profile field visibility. It works by determining * the relationship between the displayed_user (ie the profile owner) and the current_user (ie the * 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.0) + * @since 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 + * or if you have added your own custom levels. * - * @param int $displayed_user_id The id of the user the profile fields belong to - * @param int $current_user_id The id of the user viewing the profile + * @param int $displayed_user_id The id of the user the profile fields belong to. + * @param int $current_user_id The id of the user viewing the profile. * @return array An array of field ids that should be excluded from the profile query */ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $current_user_id = 0 ) { @@ -1037,7 +1138,7 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren /** * Filters the ids of fields that are hidden for this displayed/loggedin user pair. * - * @since BuddyPress (1.6.0) + * @since 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. @@ -1047,7 +1148,7 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren } /** - * Get the visibility levels that should be hidden for this user pair + * Get the visibility levels that should be hidden for this user pair. * * Field visibility is determined based on the relationship between the * logged-in user, the displayed user, and the visibility setting for the @@ -1055,28 +1156,28 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren * utility function speeds up this matching by fetching the visibility levels * that should be hidden for the current user pair. * - * @since BuddyPress (1.8.2) + * @since 1.8.2 * @see bp_xprofile_get_hidden_fields_for_user() * - * @param int $displayed_user_id The id of the user the profile fields belong to - * @param int $current_user_id The id of the user viewing the profile - * @return array An array of visibility levels hidden to the current user + * @param int $displayed_user_id The id of the user the profile fields belong to. + * @param int $current_user_id The id of the user viewing the profile. + * @return array An array of visibility levels hidden to the current user. */ function bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id = 0, $current_user_id = 0 ) { - // Current user is logged in + // Current user is logged in. if ( ! empty( $current_user_id ) ) { // Nothing's private when viewing your own profile, or when the - // current user is an admin + // current user is an admin. if ( $displayed_user_id == $current_user_id || bp_current_user_can( 'bp_moderate' ) ) { $hidden_levels = array(); - // If the current user and displayed user are friends, show all + // If the current user and displayed user are friends, show all. } elseif ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) { $hidden_levels = array( 'adminsonly', ); - // current user is logged in but not friends, so exclude friends-only + // Current user is logged in but not friends, so exclude friends-only. } else { $hidden_levels = array( 'friends', 'adminsonly', ); } @@ -1089,7 +1190,7 @@ function bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id = 0, $c /** * Filters the visibility levels that should be hidden for this user pair. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -1099,15 +1200,15 @@ function bp_xprofile_get_hidden_field_types_for_user( $displayed_user_id = 0, $c } /** - * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels + * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * @see bp_xprofile_get_hidden_fields_for_user() * - * @param int $user_id The id of the profile owner - * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', 'adminsonly' etc) to be - * checked against - * @return array $field_ids The fields that match the requested visibility levels for the given user + * @param int $user_id The id of the profile owner. + * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', 'adminsonly' etc) to be + * checked against. + * @return array $field_ids The fields that match the requested visibility levels for the given user. */ function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array() ) { if ( !is_array( $levels ) ) { @@ -1117,12 +1218,12 @@ function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array( $user_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true ); // Parse the user-provided visibility levels with the default levels, which may take - // precedence + // precedence. $default_visibility_levels = BP_XProfile_Group::fetch_default_visibility_levels(); foreach( (array) $default_visibility_levels as $d_field_id => $defaults ) { // If the admin has forbidden custom visibility levels for this field, replace - // the user-provided setting with the default specified by the admin + // the user-provided setting with the default specified by the admin. if ( isset( $defaults['allow_custom'] ) && isset( $defaults['default'] ) && 'disabled' == $defaults['allow_custom'] ) { $user_visibility_levels[$d_field_id] = $defaults['default']; } @@ -1135,7 +1236,7 @@ function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array( } } - // Never allow the fullname field to be excluded + // Never allow the fullname field to be excluded. if ( in_array( 1, $field_ids ) ) { $key = array_search( 1, $field_ids ); unset( $field_ids[$key] ); 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 31474cc7650acb5d4573b9c89c061d65dcc35f53..185ec6d8afc1ac4cd9a59c73d44d64fbf7d9734e 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php @@ -1,403 +1,23 @@ <?php - /** - * BuddyPress XProfile Loader + * BuddyPress XProfile Loader. * * An extended profile component for users. This allows site admins to create * groups of fields for users to enter information about themselves. * * @package BuddyPress * @subpackage XProfileLoader + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; -class BP_XProfile_Component extends BP_Component { - - /** - * Profile field types - * - * @since BuddyPress (1.5.0) - * @var array - */ - public $field_types; - - /** - * The acceptable visibility levels for xprofile fields. - * - * @see bp_xprofile_get_visibility_levels() - * @since BuddyPress (1.6.0) - * @var array - */ - public $visibility_levels = array(); - - /** - * Start the xprofile component creation process - * - * @since BuddyPress (1.5.0) - */ - public function __construct() { - parent::start( - 'xprofile', - _x( 'Extended Profiles', 'Component page <title>', 'buddypress' ), - buddypress()->plugin_dir, - array( - 'adminbar_myaccount_order' => 20 - ) - ); - - $this->setup_hooks(); - } - - /** - * Include files - */ - public function includes( $includes = array() ) { - $includes = array( - 'cssjs', - 'cache', - 'actions', - 'activity', - 'screens', - 'caps', - 'classes', - 'filters', - 'settings', - 'template', - 'functions', - ); - - if ( is_admin() ) { - $includes[] = 'admin'; - } - - parent::includes( $includes ); - } - - /** - * Setup globals - * - * The BP_XPROFILE_SLUG constant is deprecated, and only used here for - * backwards compatibility. - * - * @since BuddyPress (1.5.0) - */ - public function setup_globals( $args = array() ) { - $bp = buddypress(); - - // Define a slug, if necessary - 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_core_get_root_option( 'avatar_default' ) ) ); - } - - if ( ! defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ) { - define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( bp_core_get_root_option( 'bp-xprofile-fullname-field-name' ) ) ); - } - - /** - * 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 - // does not have an associated BP_XProfile_Field_Type class, - // but it must be whitelisted - $this->field_types[] = 'option'; - - // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter - $this->visibility_levels = array( - 'public' => array( - 'id' => 'public', - 'label' => _x( 'Everyone', 'Visibility level setting', 'buddypress' ) - ), - 'adminsonly' => array( - 'id' => 'adminsonly', - 'label' => _x( 'Only Me', 'Visibility level setting', 'buddypress' ) - ), - 'loggedin' => array( - 'id' => 'loggedin', - 'label' => _x( 'All Members', 'Visibility level setting', 'buddypress' ) - ) - ); - - if ( bp_is_active( 'friends' ) ) { - $this->visibility_levels['friends'] = array( - 'id' => 'friends', - 'label' => _x( 'My Friends', 'Visibility level setting', 'buddypress' ) - ); - } - - // Tables - $global_tables = array( - 'table_name_data' => $bp->table_prefix . 'bp_xprofile_data', - 'table_name_groups' => $bp->table_prefix . 'bp_xprofile_groups', - 'table_name_fields' => $bp->table_prefix . 'bp_xprofile_fields', - 'table_name_meta' => $bp->table_prefix . 'bp_xprofile_meta', - ); - - $meta_tables = array( - 'xprofile_group' => $bp->table_prefix . 'bp_xprofile_meta', - 'xprofile_field' => $bp->table_prefix . 'bp_xprofile_meta', - 'xprofile_data' => $bp->table_prefix . 'bp_xprofile_meta', - ); - - $globals = array( - 'slug' => BP_XPROFILE_SLUG, - 'has_directory' => false, - 'notification_callback' => 'xprofile_format_notifications', - 'global_tables' => $global_tables, - 'meta_tables' => $meta_tables, - ); - - parent::setup_globals( $globals ); - } - - /** - * Set up navigation. - * - * @global BuddyPress $bp The one true BuddyPress instance - */ - public function setup_nav( $main_nav = array(), $sub_nav = array() ) { - - $sub_nav = array(); - - // Add 'Profile' to the main navigation - $main_nav = array( - 'name' => _x( 'Profile', 'Profile header menu', 'buddypress' ), - 'slug' => $this->slug, - 'position' => 20, - 'screen_function' => 'xprofile_screen_display_profile', - 'default_subnav_slug' => 'public', - 'item_css_id' => $this->id - ); - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - $profile_link = trailingslashit( $user_domain . $this->slug ); - - // Add the subnav items to the profile - $sub_nav[] = array( - 'name' => _x( 'View', 'Profile header sub menu', 'buddypress' ), - 'slug' => 'public', - 'parent_url' => $profile_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'xprofile_screen_display_profile', - 'position' => 10 - ); - - // Edit Profile - $sub_nav[] = array( - 'name' => _x( 'Edit','Profile header sub menu', 'buddypress' ), - 'slug' => 'edit', - 'parent_url' => $profile_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'xprofile_screen_edit_profile', - 'position' => 20, - 'user_has_access' => bp_core_can_edit_settings() - ); - - // Change Avatar - if ( buddypress()->avatar->show_avatars ) { - $sub_nav[] = array( - 'name' => _x( 'Change Profile Photo', 'Profile header sub menu', 'buddypress' ), - 'slug' => 'change-avatar', - 'parent_url' => $profile_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'xprofile_screen_change_avatar', - 'position' => 30, - 'user_has_access' => bp_core_can_edit_settings() - ); - } - - // The Settings > Profile nav item can only be set up after - // the Settings component has run its own nav routine - add_action( 'bp_settings_setup_nav', array( $this, 'setup_settings_nav' ) ); - - parent::setup_nav( $main_nav, $sub_nav ); - } - - /** - * Set up the Settings > Profile nav item. - * - * Loaded in a separate method because the Settings component may not - * be loaded in time for BP_XProfile_Component::setup_nav(). - * - * @since BuddyPress (2.1.0) - */ - public function setup_settings_nav() { - if ( ! bp_is_active( 'settings' ) ) { - return; - } - - // Determine user to use - if ( bp_displayed_user_domain() ) { - $user_domain = bp_displayed_user_domain(); - } elseif ( bp_loggedin_user_domain() ) { - $user_domain = bp_loggedin_user_domain(); - } else { - return; - } - - // Get the settings slug - $settings_slug = bp_get_settings_slug(); - - bp_core_new_subnav_item( array( - 'name' => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ), - 'slug' => 'profile', - 'parent_url' => trailingslashit( $user_domain . $settings_slug ), - 'parent_slug' => $settings_slug, - 'screen_function' => 'bp_xprofile_screen_settings', - 'position' => 30, - 'user_has_access' => bp_core_can_edit_settings() - ) ); - } - - /** - * Set up the Toolbar - */ - public function setup_admin_bar( $wp_admin_nav = array() ) { - $bp = buddypress(); - - // Prevent debug notices - $wp_admin_nav = array(); - - // Menus for logged in user - if ( is_user_logged_in() ) { - - // Profile link - $profile_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); - - // Add the "Profile" sub menu - $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, - 'id' => 'my-account-' . $this->id, - 'title' => _x( 'Profile', 'My Account Profile', 'buddypress' ), - 'href' => trailingslashit( $profile_link ) - ); - - // View Profile - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-public', - 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), - 'href' => trailingslashit( $profile_link . 'public' ) - ); - - // Edit Profile - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-edit', - 'title' => _x( 'Edit', 'My Account Profile sub nav', 'buddypress' ), - 'href' => trailingslashit( $profile_link . 'edit' ) - ); - - // Edit Avatar - if ( buddypress()->avatar->show_avatars ) { - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . $this->id, - 'id' => 'my-account-' . $this->id . '-change-avatar', - 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ), - 'href' => trailingslashit( $profile_link . 'change-avatar' ) - ); - } - - } - - parent::setup_admin_bar( $wp_admin_nav ); - } - - /** - * Add custom hooks. - * - * @since BuddyPress (2.0.0) - */ - public function setup_hooks() { - add_filter( 'bp_settings_admin_nav', array( $this, 'setup_settings_admin_nav' ), 2 ); - } - - /** - * Sets up the title for pages and <title> - */ - public function setup_title() { - $bp = buddypress(); - - if ( bp_is_profile_component() ) { - if ( bp_is_my_profile() ) { - $bp->bp_options_title = _x( 'My Profile', 'Page title', 'buddypress' ); - } else { - $bp->bp_options_avatar = bp_core_fetch_avatar( array( - 'item_id' => bp_displayed_user_id(), - 'type' => 'thumb', - 'alt' => sprintf( _x( 'Profile picture of %s', 'Avatar alt', 'buddypress' ), bp_get_displayed_user_fullname() ) - ) ); - $bp->bp_options_title = bp_get_displayed_user_fullname(); - } - } - - 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. - * - * @since BuddyPress (2.0.0) - * - * @param array $wp_admin_nav The settings adminbar nav array. - * @return array - */ - public function setup_settings_admin_nav( $wp_admin_nav ) { - // Setup the logged in user variables - $settings_link = trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() ); - - // Add the "Profile" subnav item - $wp_admin_nav[] = array( - 'parent' => 'my-account-' . buddypress()->settings->id, - 'id' => 'my-account-' . buddypress()->settings->id . '-profile', - 'title' => _x( 'Profile', 'My Account Settings sub nav', 'buddypress' ), - 'href' => trailingslashit( $settings_link . 'profile' ) - ); - - return $wp_admin_nav; - } -} +require dirname( __FILE__ ) . '/classes/class-bp-xprofile-component.php'; +/** + * Bootstrap the XProfile component. + */ function bp_setup_xprofile() { $bp = buddypress(); diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-notifications.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-notifications.php new file mode 100644 index 0000000000000000000000000000000000000000..570e66573b5a08ed031bda5ee51260ad47536502 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-notifications.php @@ -0,0 +1,55 @@ +<?php +/** + * BuddyPress XProfile Notifications. + * + * @package BuddyPress + * @subpackage XProfileSettings + * @since 1.0.0 + */ + +/** Notifications *************************************************************/ + +/** + * Format notifications for the extended profile (Xprofile) component. + * + * @since 2.4.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'. + * @return string + */ +function xprofile_format_notifications( $action, $item_id, $secondary_item_id, $total_items, $format = 'string' ) { + switch ( $action ) { + default: + + /** + * Allows plugins to filter extended profile-related custom notifications. + * Notifications must have a 'component_name' of 'xprofile' to be routed + * to this function. + * + * @since 2.4.0 + * + * @param string $notification Null value. + * @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. + */ + $custom_action_notification = apply_filters( 'bp_xprofile_' . $action . '_notification', null, $item_id, $secondary_item_id, $total_items, $format ); + + if ( ! is_null( $custom_action_notification ) ) { + return $custom_action_notification; + } + + break; + } + + return false; +} 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 67213f9f3b564a5242856169766f29a02eeff742..103e24e491e28c00f44e71e3ec5ebe28f1195953 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php @@ -1,7 +1,6 @@ <?php - /** - * BuddyPress XProfile Screens + * BuddyPress XProfile 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 @@ -9,16 +8,16 @@ * * @package BuddyPress * @subpackage XProfileScreens + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Handles the display of the profile page by loading the correct template file. * - * @package BuddyPress XProfile - * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) + * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename). */ function xprofile_screen_display_profile() { $new = isset( $_GET['new'] ) ? $_GET['new'] : ''; @@ -26,7 +25,7 @@ function xprofile_screen_display_profile() { /** * Fires right before the loading of the XProfile screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $new $_GET parameter holding the "new" parameter. */ @@ -35,7 +34,7 @@ function xprofile_screen_display_profile() { /** * Filters the template to load for the XProfile screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the XProfile template to load. */ @@ -46,74 +45,74 @@ function xprofile_screen_display_profile() { * Handles the display of the profile edit page by loading the correct template file. * Also checks to make sure this can only be accessed for the logged in users profile. * - * @package BuddyPress XProfile - * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user - * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) + * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user. + * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename). */ function xprofile_screen_edit_profile() { - if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) ) + if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { return false; - - $bp = buddypress(); + } // Make sure a group is set. - if ( !bp_action_variable( 1 ) ) - bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/1' ) ); + if ( ! bp_action_variable( 1 ) ) { + bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/1' ) ); + } - // Check the field group exists - if ( !bp_is_action_variable( 'group' ) || !xprofile_get_field_group( bp_action_variable( 1 ) ) ) { + // Check the field group exists. + if ( ! bp_is_action_variable( 'group' ) || ! xprofile_get_field_group( bp_action_variable( 1 ) ) ) { bp_do_404(); return; } - // No errors + // No errors. $errors = false; - // Check to see if any new information has been submitted + // Check to see if any new information has been submitted. if ( isset( $_POST['field_ids'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_xprofile_edit' ); - // Check we have field ID's - if ( empty( $_POST['field_ids'] ) ) - bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) ); + // Check we have field ID's. + if ( empty( $_POST['field_ids'] ) ) { + bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . bp_action_variable( 1 ) ) ); + } // Explode the posted field IDs into an array so we know which - // fields have been submitted + // fields have been submitted. $posted_field_ids = wp_parse_id_list( $_POST['field_ids'] ); $is_required = array(); // Loop through the posted fields formatting any datebox values - // then validate the field + // then validate the field. foreach ( (array) $posted_field_ids as $field_id ) { if ( !isset( $_POST['field_' . $field_id] ) ) { if ( !empty( $_POST['field_' . $field_id . '_day'] ) && !empty( $_POST['field_' . $field_id . '_month'] ) && !empty( $_POST['field_' . $field_id . '_year'] ) ) { - // Concatenate the values + // Concatenate the values. $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; - // Turn the concatenated value into a timestamp + // Turn the concatenated value into a timestamp. $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); } } - $is_required[$field_id] = xprofile_check_is_required_field( $field_id ); + $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); if ( $is_required[$field_id] && empty( $_POST['field_' . $field_id] ) ) { $errors = true; } } - // There are errors + // There are errors. if ( !empty( $errors ) ) { bp_core_add_message( __( 'Please make sure you fill in all required fields in this profile field group before saving.', 'buddypress' ), 'error' ); - // No errors + // No errors. } else { - // Reset the errors var + // Reset the errors var. $errors = false; // Now we've checked for required fields, lets save the values. @@ -127,13 +126,13 @@ function xprofile_screen_edit_profile() { // Save the old and new values. They will be // passed to the filter and used to determine - // whether an activity item should be posted + // whether an activity item should be posted. $old_values[ $field_id ] = array( 'value' => xprofile_get_field_data( $field_id, bp_displayed_user_id() ), 'visibility' => xprofile_get_field_visibility_level( $field_id, bp_displayed_user_id() ), ); - // Update the field data and visibility level + // Update the field data and visibility level. xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level ); $field_updated = xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[ $field_id ] ); $value = xprofile_get_field_data( $field_id, bp_displayed_user_id() ); @@ -150,7 +149,7 @@ function xprofile_screen_edit_profile() { /** * Fires on each iteration of an XProfile field being saved with no error. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $field_id ID of the field that was saved. * @param string $value Value that was saved to the field. @@ -162,7 +161,7 @@ function xprofile_screen_edit_profile() { /** * Fires after all XProfile fields have been saved for the current profile. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param int $value Displayed user ID. * @param array $posted_field_ids Array of field IDs that were edited. @@ -172,29 +171,29 @@ function xprofile_screen_edit_profile() { */ do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors, $old_values, $new_values ); - // Set the feedback messages + // 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' ); } else { bp_core_add_message( __( 'Changes saved.', 'buddypress' ) ); } - // Redirect back to the edit screen to display the updates and message - bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) ); + // Redirect back to the edit screen to display the updates and message. + bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . bp_action_variable( 1 ) ) ); } } /** * Fires right before the loading of the XProfile edit screen template file. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 */ do_action( 'xprofile_screen_edit_profile' ); /** * Filters the template to load for the XProfile edit screen. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $template Path to the XProfile edit template to load. */ @@ -204,17 +203,17 @@ function xprofile_screen_edit_profile() { /** * Handles the uploading and cropping of a user avatar. Displays the change avatar page. * - * @package BuddyPress XProfile - * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user - * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) + * @uses bp_is_my_profile() Checks to make sure the current user being viewed equals the logged in user. + * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename). */ function xprofile_screen_change_avatar() { - // Bail if not the correct screen - if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) ) + // Bail if not the correct screen. + if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { return false; + } - // Bail if there are action variables + // Bail if there are action variables. if ( bp_action_variables() ) { bp_do_404(); return; @@ -222,29 +221,30 @@ function xprofile_screen_change_avatar() { $bp = buddypress(); - if ( ! isset( $bp->avatar_admin ) ) + if ( ! isset( $bp->avatar_admin ) ) { $bp->avatar_admin = new stdClass(); + } $bp->avatar_admin->step = 'upload-image'; if ( !empty( $_FILES ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_avatar_upload' ); - // Pass the file to the avatar upload handler + // Pass the file to the avatar upload handler. if ( bp_core_avatar_handle_upload( $_FILES, 'xprofile_avatar_upload_dir' ) ) { $bp->avatar_admin->step = 'crop-image'; - // Make sure we include the jQuery jCrop file for image cropping + // Make sure we include the jQuery jCrop file for image cropping. add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' ); } } - // If the image cropping is done, crop the image and save a full/thumb version + // If the image cropping is done, crop the image and save a full/thumb version. if ( isset( $_POST['avatar-crop-submit'] ) ) { - // Check the nonce + // Check the nonce. check_admin_referer( 'bp_avatar_cropstore' ); $args = array( @@ -265,10 +265,10 @@ function xprofile_screen_change_avatar() { * * @since 1.1.0 * @since 2.3.4 Add two new parameters to inform about the user id and - * about the way the avatar was set (eg: 'crop' or 'camera') + * about the way the avatar was set (eg: 'crop' or 'camera'). * - * @param string $item_id Inform about the user id the avatar was set for - * @param string $value Inform about the way the avatar was set ('crop') + * @param string $item_id Inform about the user id the avatar was set for. + * @param string $value Inform about the way the avatar was set ('crop'). */ do_action( 'xprofile_avatar_uploaded', (int) $args['item_id'], 'crop' ); bp_core_add_message( __( 'Your new profile photo was uploaded successfully.', 'buddypress' ) ); @@ -279,14 +279,14 @@ function xprofile_screen_change_avatar() { /** * Fires right before the loading of the XProfile change avatar screen template file. * - * @since BuddyPress (1.0.0) + * @since 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) + * @since 1.0.0 * * @param string $template Path to the XProfile change avatar template to load. */ @@ -294,13 +294,44 @@ function xprofile_screen_change_avatar() { } /** - * Show the xprofile settings template + * Displays the change cover image page. + * + * @package BuddyPress XProfile + * + * @since 2.4.0 + */ +function xprofile_screen_change_cover_image() { + + // Bail if not the correct screen. + if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) { + return false; + } + + /** + * Fires right before the loading of the XProfile change cover image screen template file. + * + * @since 2.4.0 + */ + do_action( 'xprofile_screen_change_cover_image' ); + + /** + * Filters the template to load for the XProfile cover image screen. + * + * @since 2.4.0 + * + * @param string $template Path to the XProfile cover image template to load. + */ + bp_core_load_template( apply_filters( 'xprofile_template_cover_image', 'members/single/home' ) ); +} + +/** + * Show the xprofile settings template. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ function bp_xprofile_screen_settings() { - // Redirect if no privacy settings page is accessible + // Redirect if no privacy settings page is accessible. if ( bp_action_variables() || ! bp_is_active( 'xprofile' ) ) { bp_do_404(); return; @@ -309,7 +340,7 @@ function bp_xprofile_screen_settings() { /** * Filters the template to load for the XProfile settings screen. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $template Path to the XProfile change avatar template to load. */ 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 aef3a137742f9edeffb6090dd5aff92bd968d625..7795c19811c480a7f379cbcd79eb18558d4bf5a4 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-settings.php @@ -1,18 +1,26 @@ <?php - /** - * Query all profile fields and their visibility data for display in settings - * - * @since BuddyPress (2.0.0) + * BuddyPress XProfile Settings. * - * @param array $args + * @package BuddyPress + * @subpackage XProfileSettings + * @since 2.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Query all profile fields and their visibility data for display in settings. * + * @since 2.0.0 * + * @param array|string $args Array of args for the settings fields. * @return array */ function bp_xprofile_get_settings_fields( $args = '' ) { - // Parse the possible arguments + // Parse the possible arguments. $r = bp_parse_args( $args, array( 'user_id' => bp_displayed_user_id(), 'profile_group_id' => false, @@ -29,25 +37,25 @@ function bp_xprofile_get_settings_fields( $args = '' ) { } /** - * Adds feedback messages when successfully saving profile field settings + * Adds feedback messages when successfully saving profile field settings. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @uses bp_core_add_message() * @uses bp_is_my_profile() */ function bp_xprofile_settings_add_feedback_message() { - // Default message type is success + // Default message type is success. $type = 'success'; $message = __( 'Your profile settings have been saved.', 'buddypress' ); - // Community moderator editing another user's settings + // Community moderator editing another user's settings. if ( ! bp_is_my_profile() && bp_core_can_edit_settings() ) { $message = __( "This member's profile settings have been saved.", 'buddypress' ); } - // Add the message + // Add the message. bp_core_add_message( $message, $type ); } add_action( 'bp_xprofile_settings_after_save', '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 fbbb1249ce53ea523e0221eb9fcf84a551be99e6..df7472ee8166f5e3e4aad58d991130c6cf3159a2 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php @@ -1,318 +1,37 @@ <?php - /** - * BuddyPress XProfile Template Tags + * BuddyPress XProfile Template Tags. * * @package BuddyPress * @subpackage XProfileTemplate + * @since 1.5.0 */ -// Exit if accessed directly +// Exit if accessed directly. 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 { - - /** - * 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->groups = bp_xprofile_get_groups( $r ); - $this->group_count = count( $this->groups ); - $this->user_id = $r['user_id']; - } - - public function has_groups() { - if ( ! empty( $this->group_count ) ) { - return true; - } - - return false; - } - - public function next_group() { - $this->current_group++; - - $this->group = $this->groups[ $this->current_group ]; - $this->field_count = 0; - - 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 ); - } - - return $this->group; - } - - public function rewind_groups() { - $this->current_group = -1; - if ( $this->group_count > 0 ) { - $this->group = $this->groups[0]; - } - } - - public function profile_groups() { - if ( $this->current_group + 1 < $this->group_count ) { - return true; - } elseif ( $this->current_group + 1 == $this->group_count ) { - - /** - * 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(); - } - - $this->in_the_loop = false; - return false; - } - - public function the_profile_group() { - global $group; - - $this->in_the_loop = true; - $group = $this->next_group(); - - // 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 ****************************************************************/ - - public function next_field() { - $this->current_field++; - - $this->field = $this->group->fields[ $this->current_field ]; - - return $this->field; - } - - public function rewind_fields() { - $this->current_field = -1; - if ( $this->field_count > 0 ) { - $this->field = $this->group->fields[0]; - } - } - - public function has_fields() { - $has_data = false; - - for ( $i = 0, $count = count( $this->group->fields ); $i < $count; ++$i ) { - $field = &$this->group->fields[ $i ]; - - if ( ! empty( $field->data ) && ( $field->data->value != null ) ) { - $has_data = true; - } - } - - return $has_data; - } - - public function profile_fields() { - if ( $this->current_field + 1 < $this->field_count ) { - return true; - } elseif ( $this->current_field + 1 == $this->field_count ) { - // Do some cleaning up after the loop - $this->rewind_fields(); - } - - return false; - } - - 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 ) ) ) { - $value = maybe_unserialize( $field->data->value ); - } else { - $value = false; - } - - if ( ! empty( $value ) || ( '0' === $value ) ) { - $this->field_has_data = true; - } else { - $this->field_has_data = false; - } - } -} +require dirname( __FILE__ ) . '/classes/class-bp-xprofile-data-template.php'; /** - * Query for XProfile groups and fields + * Query for XProfile groups and fields. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global object $profile_template - * @param array $args + * @see BP_XProfile_Group::get() for full description of `$args` array. + * + * @param array|string $args { + * Array of arguments. See BP_XProfile_Group::get() for full description. Those arguments whose defaults differ + * from that method are described here: + * @type string|array $member_type Default: 'any'. + * @type bool $hide_empty_groups Default: true. + * @type bool $hide_empty_fields Defaults to true on the Dashboard, on a user's Edit Profile page, + * or during registration. Otherwise false. + * @type bool $fetch_visibility_level Defaults to true when an admin is viewing a profile, or when a user is + * viewing her own profile, or during registration. Otherwise false. + * @type bool $fetch_fields Default: true. + * @type bool $fetch_field_data Default: true. + * } * * @return bool */ @@ -320,37 +39,38 @@ 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 + // 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 + // 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() ) { $fetch_visibility_level_default = true; } else { $fetch_visibility_level_default = false; } - // Parse arguments + // Parse arguments. $r = bp_parse_args( $args, array( 'user_id' => bp_displayed_user_id(), + 'member_type' => 'any', '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 + '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' ); - // Populate the template loop global + // Populate the template loop global. $profile_template = new BP_XProfile_Data_Template( $r ); /** * Filters whether or not a group has a profile to display. * - * @since BuddyPress (1.1.0) + * @since 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. @@ -358,47 +78,83 @@ function bp_has_profile( $args = '' ) { return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template ); } +/** + * Start off the profile groups. + * + * @return mixed + */ function bp_profile_groups() { global $profile_template; return $profile_template->profile_groups(); } +/** + * Set up the profile groups. + * + * @return mixed + */ function bp_the_profile_group() { global $profile_template; return $profile_template->the_profile_group(); } +/** + * Whether or not the group has fields to display. + * + * @return mixed + */ function bp_profile_group_has_fields() { global $profile_template; return $profile_template->has_fields(); } +/** + * Output the class attribute for a field. + * + * @since 1.0.0 + * + * @param array|string $class Extra classes to append to class attribute. + * Pass mutiple class names as an array or + * space-delimited string. + * + * @return string + */ function bp_field_css_class( $class = false ) { echo bp_get_field_css_class( $class ); } + + /** + * Return the class attribute for a field. + * + * @param string|bool $class Extra classes to append to class attribute. + * @return string + */ function bp_get_field_css_class( $class = false ) { global $profile_template; $css_classes = array(); if ( ! empty( $class ) ) { - $css_classes[] = sanitize_title( esc_attr( $class ) ); + if ( ! is_array( $class ) ) { + $class = preg_split( '#\s+#', $class ); + } + $css_classes = array_map( 'sanitize_html_class', $class ); } - // Set a class with the field ID + // Set a class with the field ID. $css_classes[] = 'field_' . $profile_template->field->id; - // Set a class with the field name (sanitized) + // Set a class with the field name (sanitized). $css_classes[] = 'field_' . sanitize_title( $profile_template->field->name ); - // Set a class indicating whether the field is required or optional + // Set a class indicating whether the field is required or optional. if ( ! empty( $profile_template->field->is_required ) ) { $css_classes[] = 'required-field'; } else { $css_classes[] = 'optional-field'; } - // Add the field visibility level + // Add the field visibility level. $css_classes[] = 'visibility-' . esc_attr( bp_get_the_profile_field_visibility_level() ); if ( $profile_template->current_field % 2 == 1 ) { @@ -410,7 +166,7 @@ function bp_field_css_class( $class = false ) { /** * Filters the field classes to be applied to a field. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param array $css_classes Array of classes to be applied to field. Passed by reference. */ @@ -419,18 +175,28 @@ function bp_field_css_class( $class = false ) { /** * Filters the class HTML attribute to be used on a field. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value class HTML attribute with imploded classes. */ return apply_filters( 'bp_get_field_css_class', ' class="' . implode( ' ', $css_classes ) . '"' ); } +/** + * Whether or not the XProfile field has data to display. + * + * @return mixed + */ function bp_field_has_data() { global $profile_template; return $profile_template->field_has_data; } +/** + * Whether or not the XProfile field has public data to display. + * + * @return bool + */ function bp_field_has_public_data() { global $profile_template; @@ -441,92 +207,147 @@ function bp_field_has_public_data() { return false; } +/** + * Output the XProfile group ID. + */ function bp_the_profile_group_id() { echo bp_get_the_profile_group_id(); } + + /** + * Return the XProfile group ID. + * + * @return mixed|void + */ function bp_get_the_profile_group_id() { global $group; /** - * Filters the profile group ID. + * Filters the XProfile group ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $id ID for the profile group. */ return apply_filters( 'bp_get_the_profile_group_id', $group->id ); } +/** + * Output the XProfile group name. + */ function bp_the_profile_group_name() { echo bp_get_the_profile_group_name(); } + + /** + * Return the XProfile group name. + * + * @return mixed|void + */ function bp_get_the_profile_group_name() { global $group; /** - * Filters the profile group name. + * Filters the XProfile group name. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $name Name for the profile group. */ return apply_filters( 'bp_get_the_profile_group_name', $group->name ); } +/** + * Output the XProfile group slug. + */ function bp_the_profile_group_slug() { echo bp_get_the_profile_group_slug(); } + + /** + * Return the XProfile group slug. + * + * @return mixed|void + */ function bp_get_the_profile_group_slug() { global $group; /** - * Filters the profile group slug. + * Filters the XProfile group slug. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Slug for the profile group. */ return apply_filters( 'bp_get_the_profile_group_slug', sanitize_title( $group->name ) ); } +/** + * Output the XProfile group description. + */ function bp_the_profile_group_description() { echo bp_get_the_profile_group_description(); } + + /** + * Return the XProfile group description. + * + * @return mixed|void + */ function bp_get_the_profile_group_description() { global $group; /** - * Filters the profile group description. + * Filters the XProfile group description. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $description Description for the profile group. */ return apply_filters( 'bp_get_the_profile_group_description', $group->description ); } +/** + * Output the XProfile group edit form action. + */ function bp_the_profile_group_edit_form_action() { echo bp_get_the_profile_group_edit_form_action(); } + + /** + * Return the XProfile group edit form action. + * + * @return mixed|void + */ function bp_get_the_profile_group_edit_form_action() { global $group; - $bp = buddypress(); + // Build the form action URL. + $form_action = trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . $group->id ); /** - * Filters the action for the profile group edit form. + * Filters the action for the XProfile group edit form. * - * @since BuddyPress (1.1.0) + * @since 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 ) ); + return apply_filters( 'bp_get_the_profile_group_edit_form_action', $form_action ); } +/** + * Output the XProfile group field IDs. + */ function bp_the_profile_group_field_ids() { echo bp_get_the_profile_group_field_ids(); } + + /** + * Return the XProfile group field IDs. + * + * @return string + */ function bp_get_the_profile_group_field_ids() { global $group; @@ -544,7 +365,7 @@ function bp_the_profile_group_field_ids() { /** * Output a comma-separated list of field IDs that are to be submitted on profile edit. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 */ function bp_the_profile_field_ids() { echo bp_get_the_profile_field_ids(); @@ -552,7 +373,7 @@ function bp_the_profile_field_ids() { /** * Generate a comma-separated list of field IDs that are to be submitted on profile edit. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return string */ @@ -571,67 +392,103 @@ function bp_the_profile_field_ids() { /** * Filters the comma-separated list of field IDs. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param string $field_ids Comma-separated field IDs. */ return apply_filters( 'bp_get_the_profile_field_ids', $field_ids ); } +/** + * Return the XProfile fields. + * + * @return mixed + */ function bp_profile_fields() { global $profile_template; return $profile_template->profile_fields(); } +/** + * Sets up the XProfile field. + * + * @return mixed + */ function bp_the_profile_field() { global $profile_template; return $profile_template->the_profile_field(); } +/** + * Output the XProfile field ID. + */ function bp_the_profile_field_id() { echo bp_get_the_profile_field_id(); } + + /** + * Return the XProfile field ID. + * @return mixed|void + */ function bp_get_the_profile_field_id() { global $field; /** - * Filters the profile field ID. + * Filters the XProfile field ID. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param int $id ID for the profile field. */ return apply_filters( 'bp_get_the_profile_field_id', $field->id ); } +/** + * Outputs the XProfile field name. + */ function bp_the_profile_field_name() { echo bp_get_the_profile_field_name(); } + + /** + * Returns the XProfile field name. + * + * @return mixed|void + */ function bp_get_the_profile_field_name() { global $field; /** - * Filters the profile field name. + * Filters the XProfile field name. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $name Name for the profile field. */ return apply_filters( 'bp_get_the_profile_field_name', $field->name ); } +/** + * Outputs the XProfile field value. + */ function bp_the_profile_field_value() { echo bp_get_the_profile_field_value(); } + + /** + * Returns the XProfile field value. + * + * @return mixed|void + */ function bp_get_the_profile_field_value() { global $field; $field->data->value = bp_unserialize_profile_field( $field->data->value ); /** - * Filters the profile field value. + * Filters the XProfile field value. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Value for the profile field. * @param string $type Type for the profile field. @@ -640,9 +497,18 @@ function bp_the_profile_field_value() { return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id ); } +/** + * Outputs the XProfile field edit value. + */ function bp_the_profile_field_edit_value() { echo bp_get_the_profile_field_edit_value(); } + + /** + * Returns the XProfile field edit value. + * + * @return mixed|void + */ function bp_get_the_profile_field_edit_value() { global $field; @@ -669,9 +535,9 @@ function bp_the_profile_field_edit_value() { $field_value = isset( $field->data->value ) ? bp_unserialize_profile_field( $field->data->value ) : ''; /** - * Filters the profile field edit value. + * Filters the XProfile field edit value. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $field_value Current field edit value. * @param string $type Type for the profile field. @@ -680,48 +546,75 @@ function bp_the_profile_field_edit_value() { return apply_filters( 'bp_get_the_profile_field_edit_value', $field_value, $field->type, $field->id ); } +/** + * Outputs the XProfile field type. + */ function bp_the_profile_field_type() { echo bp_get_the_profile_field_type(); } + + /** + * Returns the XProfile field type. + * + * @return mixed|void + */ function bp_get_the_profile_field_type() { global $field; /** - * Filters the profile field type. + * Filters the XProfile field type. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $type Type for the profile field. */ return apply_filters( 'bp_the_profile_field_type', $field->type ); } +/** + * Outputs the XProfile field description. + */ function bp_the_profile_field_description() { echo bp_get_the_profile_field_description(); } + + /** + * Returns the XProfile field description. + * + * @return mixed|void + */ function bp_get_the_profile_field_description() { global $field; /** - * Filters the profile field description. + * Filters the XProfile field description. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $description Description for the profile field. */ return apply_filters( 'bp_get_the_profile_field_description', $field->description ); } +/** + * Outputs the XProfile field input name. + */ function bp_the_profile_field_input_name() { echo bp_get_the_profile_field_input_name(); } + + /** + * Retursn the XProfile field input name. + * + * @return mixed|void + */ function bp_get_the_profile_field_input_name() { global $field; /** * Filters the profile field input name. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Value used for the name attribute on an input. */ @@ -729,7 +622,7 @@ function bp_the_profile_field_input_name() { } /** - * Returns the action name for any signup errors related to this profile field + * Returns the action name for any signup errors related to this profile field. * * In the registration templates, signup errors are pulled from the global * object and rendered at actions that look like 'bp_field_12_errors'. This @@ -737,8 +630,9 @@ function bp_the_profile_field_input_name() { * following fashion: * do_action( bp_get_the_profile_field_errors_action() ); * - * @since BuddyPress (1.8.0) - * @return string The _errors action name corresponding to this profile field + * @since 1.8.0 + * + * @return string The _errors action name corresponding to this profile field. */ function bp_get_the_profile_field_errors_action() { global $field; @@ -746,13 +640,10 @@ function bp_get_the_profile_field_errors_action() { } /** - * bp_the_profile_field_options() - * * Displays field options HTML for field types of 'selectbox', 'multiselectbox', * 'radio', 'checkbox', and 'datebox'. * - * @package BuddyPress Xprofile - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses bp_get_the_profile_field_options() * @@ -762,23 +653,22 @@ function bp_the_profile_field_options( $args = array() ) { echo bp_get_the_profile_field_options( $args ); } /** - * bp_get_the_profile_field_options() - * * Retrieves field options HTML for field types of 'selectbox', 'multiselectbox', 'radio', 'checkbox', and 'datebox'. * - * @package BuddyPress Xprofile - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @uses BP_XProfile_Field::get_children() * @uses BP_XProfile_ProfileData::get_value_byid() * * @param array $args { * Array of optional arguments. - * @type string|bool $type Type of datebox. False if it's not a - * datebox, otherwise 'day, 'month', or 'year'. Default: false. - * @type int $user_id ID of the user whose profile values should be - * used when rendering options. Default: displayed user. + * @type string|bool $type Type of datebox. False if it's not a + * datebox, otherwise 'day, 'month', or 'year'. Default: false. + * @type int $user_id ID of the user whose profile values should be + * used when rendering options. Default: displayed user. * } + * + * @return string $vaue Field options markup. */ function bp_get_the_profile_field_options( $args = array() ) { global $field; @@ -793,7 +683,7 @@ function bp_the_profile_field_options( $args = array() ) { * However, we have to make sure that all data originally in $field gets merged back in, after reinstantiation. */ if ( ! method_exists( $field, 'get_children' ) ) { - $field_obj = new BP_XProfile_Field( $field->id ); + $field_obj = xprofile_get_field( $field->id ); foreach ( $field as $field_prop => $field_prop_value ) { if ( ! isset( $field_obj->{$field_prop} ) ) { @@ -812,28 +702,30 @@ function bp_the_profile_field_options( $args = array() ) { return $html; } +/** + * Render whether or not a profile field is required. + */ function bp_the_profile_field_is_required() { echo bp_get_the_profile_field_is_required(); } + + /** + * Return whether or not a profile field is required. + * @return mixed|void + */ function bp_get_the_profile_field_is_required() { global $field; - // Define locale variable(s) $retval = false; - // Super admins can skip required check - 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 ) ) { + if ( isset( $field->is_required ) ) { $retval = $field->is_required; } /** * Filters whether or not a profile field is required. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param bool $retval Whether or not the field is required. */ @@ -841,20 +733,23 @@ function bp_the_profile_field_is_required() { } /** - * Echo the visibility level of this field + * Output the visibility level of this field. */ function bp_the_profile_field_visibility_level() { echo bp_get_the_profile_field_visibility_level(); } + /** - * Return the visibility level of this field + * Return the visibility level of this field. + * + * @return mixed|void */ function bp_get_the_profile_field_visibility_level() { global $field; // On the registration page, values stored in POST should take // precedence over default visibility, so that submitted values - // are not lost on failure + // are not lost on failure. if ( bp_is_register_page() && ! empty( $_POST['field_' . $field->id . '_visibility'] ) ) { $retval = esc_attr( $_POST['field_' . $field->id . '_visibility'] ); } else { @@ -864,7 +759,7 @@ function bp_the_profile_field_visibility_level() { /** * Filters the profile field visibility level. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $retval Field visibility level. */ @@ -872,20 +767,23 @@ function bp_the_profile_field_visibility_level() { } /** - * Echo the visibility level label of this field + * Echo the visibility level label of this field. */ function bp_the_profile_field_visibility_level_label() { echo bp_get_the_profile_field_visibility_level_label(); } + /** - * Return the visibility level label of this field + * Return the visibility level label of this field. + * + * @return mixed|void */ function bp_get_the_profile_field_visibility_level_label() { global $field; // On the registration page, values stored in POST should take // precedence over default visibility, so that submitted values - // are not lost on failure + // are not lost on failure. if ( bp_is_register_page() && ! empty( $_POST['field_' . $field->id . '_visibility'] ) ) { $level = esc_html( $_POST['field_' . $field->id . '_visibility'] ); } else { @@ -897,14 +795,19 @@ function bp_the_profile_field_visibility_level_label() { /** * Filters the profile field visibility level label. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $retval Field visibility level label. */ return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[ $level ]['label'] ); } - +/** + * Return unserialized profile field data. + * + * @param string $value Content to maybe unserialize. + * @return mixed|string + */ function bp_unserialize_profile_field( $value ) { if ( is_serialized($value) ) { $field_value = maybe_unserialize($value); @@ -915,9 +818,21 @@ function bp_unserialize_profile_field( $value ) { return $value; } +/** + * Output XProfile field data. + * + * @param string|array $args Array of arguments for field data. + */ function bp_profile_field_data( $args = '' ) { echo bp_get_profile_field_data( $args ); } + + /** + * Return XProfile field data. + * + * @param string|array $args Array of arguments for field data. + * @return mixed|void + */ function bp_get_profile_field_data( $args = '' ) { $r = wp_parse_args( $args, array( @@ -928,7 +843,7 @@ function bp_profile_field_data( $args = '' ) { /** * Filters the profile field data. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @param mixed $value Profile data for a specific field for the user. */ @@ -938,9 +853,9 @@ function bp_profile_field_data( $args = '' ) { /** * Get all profile field groups. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * - * @return object $groups + * @return array $groups */ function bp_profile_get_field_groups() { @@ -953,7 +868,7 @@ function bp_profile_get_field_groups() { /** * Filters all profile field groups. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param array $groups Array of available profile field groups. */ @@ -963,7 +878,7 @@ function bp_profile_get_field_groups() { /** * Check if there is more than one group of fields for the profile being edited. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @return bool True if there is more than one profile field group. */ @@ -973,7 +888,7 @@ function bp_profile_has_multiple_groups() { /** * Filters if there is more than one group of fields for the profile being edited. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param bool $has_multiple_groups Whether or not there are multiple groups. */ @@ -983,9 +898,7 @@ function bp_profile_has_multiple_groups() { /** * Output the tabs to switch between profile field groups. * - * @since BuddyPress (1.0.0) - * - * @return string Field group tabs markup. + * @since 1.0.0 */ function bp_profile_group_tabs() { echo bp_get_profile_group_tabs(); @@ -994,43 +907,43 @@ function bp_profile_group_tabs() { * 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) + * @since 1.0.0 */ do_action( 'xprofile_profile_group_tabs' ); } /** - * Return the XProfile group tabs + * Return the XProfile group tabs. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @return string */ function bp_get_profile_group_tabs() { - // Get field group data + // Get field group data. $groups = bp_profile_get_field_groups(); $group_name = bp_get_profile_group_name(); $tabs = array(); - // Loop through field groups and put a tab-lst together + // Loop through field groups and put a tab-lst together. for ( $i = 0, $count = count( $groups ); $i < $count; ++$i ) { - // Setup the selected class + // Setup the selected class. $selected = ''; if ( $group_name === $groups[ $i ]->name ) { $selected = ' class="current"'; } - // Skip if group has no fields + // 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 ); + // Build the profile field group link. + $link = trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit/group/' . $groups[ $i ]->id ); - // Add tab to end of tabs array + // Add tab to end of tabs array. $tabs[] = sprintf( '<li %1$s><a href="%2$s">%3$s</a></li>', $selected, @@ -1042,7 +955,7 @@ function bp_get_profile_group_tabs() { /** * Filters the tabs to display for profile field groups. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param array $tabs Array of tabs to display. * @param array $groups Array of profile groups. @@ -1053,6 +966,12 @@ function bp_get_profile_group_tabs() { return join( '', $tabs ); } +/** + * Output the XProfile group name. + * + * @param bool $deprecated Deprecated boolean parameter. + * @return mixed|void + */ function bp_profile_group_name( $deprecated = true ) { if ( !$deprecated ) { return bp_get_profile_group_name(); @@ -1060,27 +979,36 @@ function bp_profile_group_name( $deprecated = true ) { echo bp_get_profile_group_name(); } } + + /** + * Return the XProfile group name. + * + * @return mixed|void + */ function bp_get_profile_group_name() { - // Check action variable + // Check action variable. $group_id = bp_action_variable( 1 ); if ( empty( $group_id ) || ! is_numeric( $group_id ) ) { $group_id = 1; } - // Check for cached group + // Check for cached group. $group = new BP_XProfile_Group( $group_id ); /** * Filters the profile group name. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $name Name of the profile group. */ return apply_filters( 'bp_get_profile_group_name', $group->name ); } +/** + * Render a formatted string displaying when a profile was last updated. + */ function bp_profile_last_updated() { $last_updated = bp_get_profile_last_updated(); @@ -1091,6 +1019,12 @@ function bp_profile_last_updated() { echo $last_updated; } } + + /** + * Return a formatted string displaying when a profile was last updated. + * + * @return bool|mixed|void + */ function bp_get_profile_last_updated() { $last_updated = bp_get_user_meta( bp_displayed_user_id(), 'profile_last_updated', true ); @@ -1100,7 +1034,7 @@ function bp_profile_last_updated() { /** * Filters the formatted string used to display when a profile was last updated. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param string $value Formatted last updated indicator string. */ @@ -1110,9 +1044,20 @@ function bp_profile_last_updated() { return false; } +/** + * Display the current profile group ID. + */ function bp_current_profile_group_id() { echo bp_get_current_profile_group_id(); } + + /** + * Return the current profile group ID. + * + * @since 1.1.0 + * + * @return mixed|void + */ function bp_get_current_profile_group_id() { $profile_group_id = bp_action_variable( 1 ); if ( empty( $profile_group_id ) ) { @@ -1122,40 +1067,50 @@ function bp_current_profile_group_id() { /** * Filters the current profile group ID. * - * Possible values are admin/profile/edit/[group-id] + * Possible values are admin/profile/edit/[group-id]. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $profile_group_id Current profile group ID. */ return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); } +/** + * Render an avatar delete link. + */ function bp_avatar_delete_link() { echo bp_get_avatar_delete_link(); } + + /** + * Return an avatar delete link. + * + * @since 1.1.0 + * @return mixed|void + */ function bp_get_avatar_delete_link() { - $bp = buddypress(); /** * Filters the link used for deleting an avatar. * - * @since BuddyPress (1.1.0) + * @since 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' ) ); + return apply_filters( 'bp_get_avatar_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_profile_slug() . '/change-avatar/delete-avatar/', 'bp_delete_avatar_link' ) ); } +/** + * Render an edit profile button. + */ function bp_edit_profile_button() { - $bp = buddypress(); - bp_button( array( 'id' => 'edit_profile', 'component' => 'xprofile', 'must_be_logged_in' => true, 'block_self' => true, - 'link_href' => trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit' ), + 'link_href' => trailingslashit( bp_displayed_user_domain() . bp_get_profile_slug() . '/edit' ), 'link_class' => 'edit', 'link_text' => __( 'Edit Profile', 'buddypress' ), 'link_title' => __( 'Edit Profile', 'buddypress' ), @@ -1165,17 +1120,22 @@ function bp_edit_profile_button() { /** Visibility ****************************************************************/ /** - * Echo the field visibility radio buttons + * Echo the field visibility radio buttons. + * + * @param array|string $args Args for the radio buttons. */ function bp_profile_visibility_radio_buttons( $args = '' ) { echo bp_profile_get_visibility_radio_buttons( $args ); } /** - * Return the field visibility radio buttons + * Return the field visibility radio buttons. + * + * @param array|string $args Args for the radio buttons. + * @return string $retval */ function bp_profile_get_visibility_radio_buttons( $args = '' ) { - // Parse optional arguments + // Parse optional arguments. $r = bp_parse_args( $args, array( 'field_id' => bp_get_the_profile_field_id(), 'before' => '<ul class="radio">', @@ -1185,16 +1145,16 @@ function bp_profile_visibility_radio_buttons( $args = '' ) { 'class' => 'bp-xprofile-visibility' ), 'xprofile_visibility_radio_buttons' ); - // Empty return value, filled in below if a valid field ID is found + // Empty return value, filled in below if a valid field ID is found. $retval = ''; - // Only do-the-do if there's a valid field ID + // Only do-the-do if there's a valid field ID. if ( ! empty( $r['field_id'] ) ) : - // Start the output buffer + // Start the output buffer. ob_start(); - // Output anything before + // Output anything before. echo $r['before']; ?> <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> @@ -1214,17 +1174,17 @@ function bp_profile_visibility_radio_buttons( $args = '' ) { <?php endif; - // Output anything after + // Output anything after. echo $r['after']; - // Get the output buffer and empty it + // Get the output buffer and empty it. $retval = ob_get_clean(); endif; /** * Filters the radio buttons for setting visibility. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * * @param string $retval HTML output for the visibility radio buttons. * @param array $r Parsed arguments to be used with display. @@ -1234,21 +1194,26 @@ function bp_profile_visibility_radio_buttons( $args = '' ) { } /** - * Output the XProfile field visibility select list for settings + * Output the XProfile field visibility select list for settings. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 + * + * @param array|string $args Args for the select list. */ function bp_profile_settings_visibility_select( $args = '' ) { echo bp_profile_get_settings_visibility_select( $args ); } /** - * Return the XProfile field visibility select list for settings + * Return the XProfile field visibility select list for settings. + * + * @since 2.0.0 * - * @since BuddyPress (2.0.0) + * @param array|string $args Args for the select list. + * @return string $retval */ function bp_profile_get_settings_visibility_select( $args = '' ) { - // Parse optional arguments + // Parse optional arguments. $r = bp_parse_args( $args, array( 'field_id' => bp_get_the_profile_field_id(), 'before' => '', @@ -1256,21 +1221,22 @@ function bp_profile_settings_visibility_select( $args = '' ) { 'class' => 'bp-xprofile-visibility' ), 'xprofile_settings_visibility_select' ); - // Empty return value, filled in below if a valid field ID is found + // Empty return value, filled in below if a valid field ID is found. $retval = ''; - // Only do-the-do if there's a valid field ID + // Only do-the-do if there's a valid field ID. if ( ! empty( $r['field_id'] ) ) : - // Start the output buffer + // Start the output buffer. ob_start(); - // Output anything before + // Output anything before. echo $r['before']; ?> <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> - <select class="<?php echo esc_attr( $r['class'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility"> + <label for="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" class="bp-screen-reader-text"><?php _e( 'Select visibility', 'buddypress' ); ?></label> + <select class="<?php echo esc_attr( $r['class'] ); ?>" name="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility" id="<?php echo esc_attr( 'field_' . $r['field_id'] ) ; ?>_visibility"> <?php foreach ( bp_xprofile_get_visibility_levels() as $level ) : ?> @@ -1286,17 +1252,17 @@ function bp_profile_settings_visibility_select( $args = '' ) { <?php endif; - // Output anything after + // Output anything after. echo $r['after']; - // Get the output buffer and empty it + // Get the output buffer and empty it. $retval = ob_get_clean(); endif; /** * Filters the dropdown list for setting visibility. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $retval HTML output for the visibility dropdown list. * @param array $r Parsed arguments to be used with display. @@ -1304,3 +1270,34 @@ function bp_profile_settings_visibility_select( $args = '' ) { */ return apply_filters( 'bp_profile_settings_visibility_select', $retval, $r, $args ); } + +/** + * Output the 'required' markup in extended profile field labels. + * + * @since 2.4.0 + */ +function bp_the_profile_field_required_label() { + echo bp_get_the_profile_field_required_label(); +} + + /** + * Return the 'required' markup in extended profile field labels. + * + * @since 2.4.0 + * + * @return string HTML for the required label. + */ + function bp_get_the_profile_field_required_label() { + $retval = ''; + + if ( bp_get_the_profile_field_is_required() ) { + $translated_string = __( '(required)', 'buddypress' ); + + $retval = ' <span class="bp-required-field-label">'; + $retval .= apply_filters( 'bp_get_the_profile_field_required_label', $translated_string, bp_get_the_profile_field_id() ); + $retval .= '</span>'; + + } + + return $retval; + } diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-component.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-component.php new file mode 100644 index 0000000000000000000000000000000000000000..0547151557eba793adf63872b77abaf34be7b26b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-component.php @@ -0,0 +1,436 @@ +<?php +/** + * BuddyPress XProfile Loader. + * + * An extended profile component for users. This allows site admins to create + * groups of fields for users to enter information about themselves. + * + * @package BuddyPress + * @subpackage XProfileLoader + * @since 1.5.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * Creates our XProfile component. + */ +class BP_XProfile_Component extends BP_Component { + + /** + * Profile field types. + * + * @since 1.5.0 + * @var array + */ + public $field_types; + + /** + * The acceptable visibility levels for xprofile fields. + * + * @see bp_xprofile_get_visibility_levels() + * @since 1.6.0 + * @var array + */ + public $visibility_levels = array(); + + /** + * Start the xprofile component creation process. + * + * @since 1.5.0 + */ + public function __construct() { + parent::start( + 'xprofile', + _x( 'Extended Profiles', 'Component page <title>', 'buddypress' ), + buddypress()->plugin_dir, + array( + 'adminbar_myaccount_order' => 20 + ) + ); + + $this->setup_hooks(); + } + + /** + * Include files. + * + * @param array $includes Array of files to include. + */ + public function includes( $includes = array() ) { + $includes = array( + 'cssjs', + 'cache', + 'actions', + 'activity', + 'screens', + 'caps', + 'classes', + 'filters', + 'settings', + 'template', + 'functions', + 'notifications', + ); + + if ( is_admin() ) { + $includes[] = 'admin'; + } + + parent::includes( $includes ); + } + + /** + * Setup globals. + * + * The BP_XPROFILE_SLUG constant is deprecated, and only used here for + * backwards compatibility. + * + * @since 1.5.0 + * + * @param array $args Array of globals to set up. + */ + public function setup_globals( $args = array() ) { + $bp = buddypress(); + + // Define a slug, if necessary. + 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_core_get_root_option( 'avatar_default' ) ) ); + } + + if ( ! defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ) { + define( 'BP_XPROFILE_FULLNAME_FIELD_NAME', stripslashes( bp_core_get_root_option( 'bp-xprofile-fullname-field-name' ) ) ); + } + + /** + * Filters the supported field type IDs. + * + * @since 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 + // does not have an associated BP_XProfile_Field_Type class, + // but it must be whitelisted. + $this->field_types[] = 'option'; + + // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter. + $this->visibility_levels = array( + 'public' => array( + 'id' => 'public', + 'label' => _x( 'Everyone', 'Visibility level setting', 'buddypress' ) + ), + 'adminsonly' => array( + 'id' => 'adminsonly', + 'label' => _x( 'Only Me', 'Visibility level setting', 'buddypress' ) + ), + 'loggedin' => array( + 'id' => 'loggedin', + 'label' => _x( 'All Members', 'Visibility level setting', 'buddypress' ) + ) + ); + + if ( bp_is_active( 'friends' ) ) { + $this->visibility_levels['friends'] = array( + 'id' => 'friends', + 'label' => _x( 'My Friends', 'Visibility level setting', 'buddypress' ) + ); + } + + // Tables. + $global_tables = array( + 'table_name_data' => $bp->table_prefix . 'bp_xprofile_data', + 'table_name_groups' => $bp->table_prefix . 'bp_xprofile_groups', + 'table_name_fields' => $bp->table_prefix . 'bp_xprofile_fields', + 'table_name_meta' => $bp->table_prefix . 'bp_xprofile_meta', + ); + + $meta_tables = array( + 'xprofile_group' => $bp->table_prefix . 'bp_xprofile_meta', + 'xprofile_field' => $bp->table_prefix . 'bp_xprofile_meta', + 'xprofile_data' => $bp->table_prefix . 'bp_xprofile_meta', + ); + + $globals = array( + 'slug' => BP_XPROFILE_SLUG, + 'has_directory' => false, + 'notification_callback' => 'xprofile_format_notifications', + 'global_tables' => $global_tables, + 'meta_tables' => $meta_tables, + ); + + parent::setup_globals( $globals ); + } + + /** + * Set up navigation. + * + * @global BuddyPress $bp The one true BuddyPress instance + * + * @param array $main_nav Array of main nav items to set up. + * @param array $sub_nav Array of sub nav items to set up. + */ + public function setup_nav( $main_nav = array(), $sub_nav = array() ) { + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $access = bp_core_can_edit_settings(); + $slug = bp_get_profile_slug(); + $profile_link = trailingslashit( $user_domain . $slug ); + + // Add 'Profile' to the main navigation. + $main_nav = array( + 'name' => _x( 'Profile', 'Profile header menu', 'buddypress' ), + 'slug' => $slug, + 'position' => 20, + 'screen_function' => 'xprofile_screen_display_profile', + 'default_subnav_slug' => 'public', + 'item_css_id' => $this->id + ); + + // Add the subnav items to the profile. + $sub_nav[] = array( + 'name' => _x( 'View', 'Profile header sub menu', 'buddypress' ), + 'slug' => 'public', + 'parent_url' => $profile_link, + 'parent_slug' => $slug, + 'screen_function' => 'xprofile_screen_display_profile', + 'position' => 10 + ); + + // Edit Profile. + $sub_nav[] = array( + 'name' => _x( 'Edit','Profile header sub menu', 'buddypress' ), + 'slug' => 'edit', + 'parent_url' => $profile_link, + 'parent_slug' => $slug, + 'screen_function' => 'xprofile_screen_edit_profile', + 'position' => 20, + 'user_has_access' => $access + ); + + // Change Avatar. + if ( buddypress()->avatar->show_avatars ) { + $sub_nav[] = array( + 'name' => _x( 'Change Profile Photo', 'Profile header sub menu', 'buddypress' ), + 'slug' => 'change-avatar', + 'parent_url' => $profile_link, + 'parent_slug' => $slug, + 'screen_function' => 'xprofile_screen_change_avatar', + 'position' => 30, + 'user_has_access' => $access + ); + } + + // Change Cover image. + if ( bp_displayed_user_use_cover_image_header() ) { + $sub_nav[] = array( + 'name' => _x( 'Change Cover Image', 'Profile header sub menu', 'buddypress' ), + 'slug' => 'change-cover-image', + 'parent_url' => $profile_link, + 'parent_slug' => $slug, + 'screen_function' => 'xprofile_screen_change_cover_image', + 'position' => 40, + 'user_has_access' => $access + ); + } + + // The Settings > Profile nav item can only be set up after + // the Settings component has run its own nav routine. + add_action( 'bp_settings_setup_nav', array( $this, 'setup_settings_nav' ) ); + + parent::setup_nav( $main_nav, $sub_nav ); + } + + /** + * Set up the Settings > Profile nav item. + * + * Loaded in a separate method because the Settings component may not + * be loaded in time for BP_XProfile_Component::setup_nav(). + * + * @since 2.1.0 + */ + public function setup_settings_nav() { + if ( ! bp_is_active( 'settings' ) ) { + return; + } + + // Determine user to use. + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + // Get the settings slug. + $settings_slug = bp_get_settings_slug(); + + bp_core_new_subnav_item( array( + 'name' => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ), + 'slug' => 'profile', + 'parent_url' => trailingslashit( $user_domain . $settings_slug ), + 'parent_slug' => $settings_slug, + 'screen_function' => 'bp_xprofile_screen_settings', + 'position' => 30, + 'user_has_access' => bp_core_can_edit_settings() + ) ); + } + + /** + * Set up the Admin Bar. + * + * @param array $wp_admin_nav Admin Bar items. + */ + public function setup_admin_bar( $wp_admin_nav = array() ) { + + // Menus for logged in user. + if ( is_user_logged_in() ) { + + // Profile link. + $profile_link = trailingslashit( bp_loggedin_user_domain() . bp_get_profile_slug() ); + + // Add the "Profile" sub menu. + $wp_admin_nav[] = array( + 'parent' => buddypress()->my_account_menu_id, + 'id' => 'my-account-' . $this->id, + 'title' => _x( 'Profile', 'My Account Profile', 'buddypress' ), + 'href' => $profile_link + ); + + // View Profile. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-public', + 'title' => _x( 'View', 'My Account Profile sub nav', 'buddypress' ), + 'href' => $profile_link, + 'position' => 10 + ); + + // Edit Profile. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-edit', + 'title' => _x( 'Edit', 'My Account Profile sub nav', 'buddypress' ), + 'href' => trailingslashit( $profile_link . 'edit' ), + 'position' => 20 + ); + + // Edit Avatar. + if ( buddypress()->avatar->show_avatars ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-change-avatar', + 'title' => _x( 'Change Profile Photo', 'My Account Profile sub nav', 'buddypress' ), + 'href' => trailingslashit( $profile_link . 'change-avatar' ), + 'position' => 30 + ); + } + + if ( bp_displayed_user_use_cover_image_header() ) { + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . $this->id, + 'id' => 'my-account-' . $this->id . '-change-cover-image', + 'title' => _x( 'Change Cover Image', 'My Account Profile sub nav', 'buddypress' ), + 'href' => trailingslashit( $profile_link . 'change-cover-image' ), + 'position' => 40 + ); + } + } + + parent::setup_admin_bar( $wp_admin_nav ); + } + + /** + * Add custom hooks. + * + * @since 2.0.0 + */ + public function setup_hooks() { + add_filter( 'bp_settings_admin_nav', array( $this, 'setup_settings_admin_nav' ), 2 ); + } + + /** + * Sets up the title for pages and <title>. + */ + public function setup_title() { + + if ( bp_is_profile_component() ) { + $bp = buddypress(); + + if ( bp_is_my_profile() ) { + $bp->bp_options_title = _x( 'My Profile', 'Page title', 'buddypress' ); + } else { + $bp->bp_options_avatar = bp_core_fetch_avatar( array( + 'item_id' => bp_displayed_user_id(), + 'type' => 'thumb', + 'alt' => sprintf( _x( 'Profile picture of %s', 'Avatar alt', 'buddypress' ), bp_get_displayed_user_fullname() ) + ) ); + $bp->bp_options_title = bp_get_displayed_user_fullname(); + } + } + + parent::setup_title(); + } + + /** + * Setup cache groups. + * + * @since 2.2.0 + */ + public function setup_cache_groups() { + + // Global groups. + wp_cache_add_global_groups( array( + 'bp_xprofile', + 'bp_xprofile_data', + 'bp_xprofile_fields', + 'bp_xprofile_groups', + 'xprofile_meta' + ) ); + + parent::setup_cache_groups(); + } + + /** + * Adds "Settings > Profile" subnav item under the "Settings" adminbar menu. + * + * @since 2.0.0 + * + * @param array $wp_admin_nav The settings adminbar nav array. + * @return array + */ + public function setup_settings_admin_nav( $wp_admin_nav ) { + + // Setup the logged in user variables. + $settings_link = trailingslashit( bp_loggedin_user_domain() . bp_get_settings_slug() ); + + // Add the "Profile" subnav item. + $wp_admin_nav[] = array( + 'parent' => 'my-account-' . buddypress()->settings->id, + 'id' => 'my-account-' . buddypress()->settings->id . '-profile', + 'title' => _x( 'Profile', 'My Account Settings sub nav', 'buddypress' ), + 'href' => trailingslashit( $settings_link . 'profile' ) + ); + + return $wp_admin_nav; + } +} diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-data-template.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-data-template.php new file mode 100644 index 0000000000000000000000000000000000000000..18e9f8fb310f7f6c65dfb30e7fa9ee96cd3db5a9 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-data-template.php @@ -0,0 +1,344 @@ +<?php +/** + * BuddyPress XProfile Template Loop Class. + * + * @package BuddyPress + * @since 1.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +/** + * The main profile template loop class. + * + * This is responsible for loading profile field, group, and data and displaying it. + * + * @since 1.0.0 + */ +class BP_XProfile_Data_Template { + + /** + * The loop iterator. + * + * @since 1.5.0 + * @var int + */ + public $current_group = -1; + + /** + * The number of groups returned by the paged query. + * + * @since 1.5.0 + * @var int + */ + public $group_count; + + /** + * Array of groups located by the query. + * + * @since 1.5.0 + * @var array + */ + public $groups; + + /** + * The group object currently being iterated on. + * + * @since 1.5.0 + * @var object + */ + public $group; + + /** + * The current field. + * + * @since 1.5.0 + * @var int + */ + public $current_field = -1; + + /** + * The field count. + * + * @since 1.5.0 + * @var int + */ + public $field_count; + + /** + * Field has data. + * + * @since 1.5.0 + * @var bool + */ + public $field_has_data; + + /** + * The field. + * + * @since 1.5.0 + * @var int + */ + public $field; + + /** + * A flag for whether the loop is currently being iterated. + * + * @since 1.5.0 + * @var bool + */ + public $in_the_loop; + + /** + * The user ID. + * + * @since 1.5.0 + * @var int + */ + public $user_id; + + /** + * Get activity items, as specified by parameters. + * + * @see BP_XProfile_Group::get() for more details about parameters. + * + * @since 2.4.0 Introduced `$member_type` argument. + * + * @param array|string $args { + * An array of arguments. All items are optional. + * + * @type int $user_id Fetch field data for this user ID. + * @type string|array $member_type Limit results to those matching member type(s). + * @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, + 'member_type' => 'any', + '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->groups = bp_xprofile_get_groups( $r ); + $this->group_count = count( $this->groups ); + $this->user_id = $r['user_id']; + } + + /** + * Whether or not the loop has field groups. + * + * @return bool + */ + public function has_groups() { + if ( ! empty( $this->group_count ) ) { + return true; + } + + return false; + } + + /** + * Increments to the next group of fields. + * + * @return object + */ + public function next_group() { + $this->current_group++; + + $this->group = $this->groups[ $this->current_group ]; + $this->field_count = 0; + + if ( ! empty( $this->group->fields ) ) { + + /** + * Filters the group fields for the next_group method. + * + * @since 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 ); + } + + return $this->group; + } + + /** + * Rewinds to the start of the groups list. + */ + public function rewind_groups() { + $this->current_group = -1; + if ( $this->group_count > 0 ) { + $this->group = $this->groups[0]; + } + } + + /** + * Kicks off the profile groups. + * + * @return bool + */ + public function profile_groups() { + if ( $this->current_group + 1 < $this->group_count ) { + return true; + } elseif ( $this->current_group + 1 == $this->group_count ) { + + /** + * Fires right before the rewinding of profile groups. + * + * @since 1.1.0 + */ + do_action( 'xprofile_template_loop_end' ); + + // Do some cleaning up after the loop. + $this->rewind_groups(); + } + + $this->in_the_loop = false; + return false; + } + + /** + * Sets up the profile group. + */ + public function the_profile_group() { + global $group; + + $this->in_the_loop = true; + $group = $this->next_group(); + + // Loop has just started. + if ( 0 === $this->current_group ) { + + /** + * Fires if the current group is the first in the loop. + * + * @since 1.1.0 + */ + do_action( 'xprofile_template_loop_start' ); + } + } + + /** Fields ****************************************************************/ + + /** + * Increments to the next field. + * + * @return int + */ + public function next_field() { + $this->current_field++; + + $this->field = $this->group->fields[ $this->current_field ]; + + return $this->field; + } + + /** + * Rewinds to the start of the fields. + */ + public function rewind_fields() { + $this->current_field = -1; + if ( $this->field_count > 0 ) { + $this->field = $this->group->fields[0]; + } + } + + /** + * Whether or not the loop has fields. + * + * @return bool + */ + public function has_fields() { + $has_data = false; + + for ( $i = 0, $count = count( $this->group->fields ); $i < $count; ++$i ) { + $field = &$this->group->fields[ $i ]; + + if ( ! empty( $field->data ) && ( $field->data->value != null ) ) { + $has_data = true; + } + } + + return $has_data; + } + + /** + * Kick off the profile fields. + * + * @return bool + */ + public function profile_fields() { + if ( $this->current_field + 1 < $this->field_count ) { + return true; + } elseif ( $this->current_field + 1 == $this->field_count ) { + // Do some cleaning up after the loop. + $this->rewind_fields(); + } + + return false; + } + + /** + * Set up the profile fields. + */ + 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 ) ) ) { + $value = maybe_unserialize( $field->data->value ); + } else { + $value = false; + } + + if ( ! empty( $value ) || ( '0' === $value ) ) { + $this->field_has_data = true; + } else { + $this->field_has_data = false; + } + } +} 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 index 88019460db3ac834f8c0b58b2902ffd090c85f9f..48af638b75c1f46363fabd052a43b2dd60f8fd2a 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Checkbox xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { /** - * Constructor for the checkbox field type + * Constructor for the checkbox field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -36,7 +37,7 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Checkbox class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Checkbox $this Current instance of * the field type checkbox. @@ -49,12 +50,15 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that we pass to + // 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']; @@ -66,9 +70,7 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -96,18 +98,34 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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'] ) ); + + /* + * Determine whether to pre-select the default option. + * + * If there's no saved value, take the following into account: + * If the user has never saved a value for this field, + * $option_values will be an empty string, and we should pre-select the default option. + * If the user has specifically chosen none of the options, + * $option_values will be an empty array, and we should respect that value. + */ + $select_default_option = false; + if ( empty( $option_values ) && ! is_array( $option_values ) ) { + $select_default_option = true; + } + $option_values = ( $option_values ) ? (array) $option_values : array(); $html = ''; // Check for updated posted values, but errors preventing them from - // being saved first time + // 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] ); @@ -117,11 +135,11 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) { $selected = ''; - // First, check to see whether the user's saved values match the option + // 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 + // 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 ) ) { @@ -131,12 +149,12 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { } // 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 ) ) { + // see whether there is a default value available. + if ( empty( $selected ) && $select_default_option && ! 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>', + $new_html = sprintf( '<label for="%3$s"><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}" ), @@ -147,7 +165,7 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { /** * Filters the HTML output for an individual field options checkbox. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $new_html Label and checkbox input field. * @param object $value Current option being rendered for. @@ -166,8 +184,9 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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(); @@ -178,9 +197,11 @@ class BP_XProfile_Field_Type_Checkbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 5a39a6f331bcf01c03fc4c1ad56549a88d652e95..5869f26f557000c73c6c4fe8b33632b79bb50413 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Datebox xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { /** - * Constructor for the datebox field type + * Constructor for the datebox field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -32,7 +33,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Datebox class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Datebox $this Current instance of * the field type datebox. @@ -45,12 +46,15 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that we pass to + // 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']; @@ -76,7 +80,11 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { <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> + <label for="<?php bp_the_profile_field_input_name(); ?>_day"> + <?php bp_the_profile_field_name(); ?> + <?php bp_the_profile_field_required_label(); ?> + </label> + <?php /** @@ -87,10 +95,11 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { * where the 12 is the field ID. Simply replace the 12 with * your needed target ID. * - * @since BuddyPress (1.8.0) + * @since 1.8.0 */ do_action( bp_get_the_profile_field_errors_action() ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="bp-screen-reader-text"><?php esc_html_e( 'Select day', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'day', @@ -98,6 +107,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { ) ); ?> </select> + <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="bp-screen-reader-text"><?php esc_html_e( 'Select month', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'month', @@ -105,6 +115,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { ) ); ?> </select> + <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="bp-screen-reader-text"><?php esc_html_e( 'Select year', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'year', @@ -127,8 +138,9 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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() ) { @@ -139,19 +151,19 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { $html = ''; $eng_months = array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ); - // Set day, month, year defaults + // Set day, month, year defaults. if ( ! empty( $date ) ) { - // If Unix timestamp + // If Unix timestamp. if ( is_numeric( $date ) ) { $day = date( 'j', $date ); $month = date( 'F', $date ); $year = date( 'Y', $date ); - // If MySQL timestamp + // If MySQL timestamp. } else { $day = mysql2date( 'j', $date ); - $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below + $month = mysql2date( 'F', $date, false ); // Not localized, so that selected() works below. $year = mysql2date( 'Y', $date ); } } @@ -178,7 +190,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { $year = ( $year != $new_year ) ? $new_year : $year; } - // $type will be passed by calling function when needed + // $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' ) ); @@ -223,7 +235,7 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { /** * Filters the output for the profile field datebox. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $html HTML output for the field. * @param string $value Which date type is being rendered for. @@ -241,8 +253,9 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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() ) { @@ -261,14 +274,17 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { 'name' => bp_get_the_profile_field_input_name() . '_year' ) ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="screen-reader-text"><?php esc_html_e( 'Select day', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'day' ) ); ?> </select> + <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="screen-reader-text"><?php esc_html_e( 'Select month', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'month' ) ); ?> </select> + <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="screen-reader-text"><?php esc_html_e( 'Select year', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>> <?php bp_the_profile_field_options( array( 'type' => 'year' ) ); ?> </select> @@ -280,24 +296,28 @@ class BP_XProfile_Field_Type_Datebox extends BP_XProfile_Field_Type { * 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. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {} /** * Format Date values for display. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. * - * @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). + * @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). + * @param string|int $field_id Optional. ID of the field. * @return string Date formatted by bp_format_time(). */ - public static function display_filter( $field_value ) { + public static function display_filter( $field_value, $field_id = '' ) { - // If Unix timestamp + // If Unix timestamp. if ( ! is_numeric( $field_value ) ) { $field_value = strtotime( $field_value ); } 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 index 6c26e7ad4725b20292aff8d6076a7c646def3f22..0db5d4bb3a3609333e3dce1f74a69a42efdfe892 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Multi-selectbox xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { /** - * Constructor for the multi-selectbox field type + * Constructor for the multi-selectbox field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -36,7 +37,7 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Multiselectbox class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Multiselectbox $this Current instance of * the field type multiple select box. @@ -49,12 +50,15 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that we pass to + // 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']; @@ -69,7 +73,10 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { '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> + <label for="<?php bp_the_profile_field_input_name(); ?>[]"> + <?php bp_the_profile_field_name(); ?> + <?php bp_the_profile_field_required_label(); ?> + </label> <?php @@ -103,8 +110,9 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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'] ) ); @@ -121,7 +129,7 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { $selected = ''; // Check for updated posted values, but errors preventing them from - // being saved first time + // 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] ) ) { @@ -131,15 +139,15 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { } // Run the allowed option name through the before_save filter, so - // we'll be sure to get a match + // 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 + // 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 + // 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"'; } @@ -147,7 +155,7 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { /** * Filters the HTML output for options in a multiselect input. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $value Option tag for current value being rendered. * @param object $value Current option being rendered for. @@ -166,14 +174,16 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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' ) ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $r ); ?>> <?php bp_the_profile_field_options(); ?> </select> @@ -182,13 +192,16 @@ class BP_XProfile_Field_Type_Multiselectbox extends BP_XProfile_Field_Type { } /** - * Output HTML for this field type's children options on the wp-admin Profile Fields "Add Field" and "Edit Field" screens. + * 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. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 0e75057767dffe59e232b611c84a1e2e4557d174..977dbf7da20746934d1c7a80110da2e3c02a79ef 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Number xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { /** - * Constructor for the number field type + * Constructor for the number field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -32,7 +33,7 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Number class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Number $this Current instance of * the field type number. @@ -45,12 +46,15 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that certain other fields + // 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'] ); @@ -63,9 +67,7 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -83,14 +85,16 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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' ) ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Number field', 'buddypress' ); ?></label> <input <?php echo $this->get_edit_field_html_elements( $r ); ?>> <?php } @@ -99,9 +103,11 @@ class BP_XProfile_Field_Type_Number extends BP_XProfile_Field_Type { * 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. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 6bc038f9175d96079afa3d2e4cf96795dfe00968..195b52c9bdaa34cdc09fda151d3115d1abe15707 100644 --- 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 @@ -1,12 +1,13 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.1 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -14,14 +15,14 @@ defined( 'ABSPATH' ) || exit; * * Used if an existing field has an unknown type (e.g. one provided by a missing third-party plugin). * - * @since BuddyPress (2.0.1) + * @since 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) + * @since 2.0.1 */ public function __construct() { $this->set_format( '/.*/', 'replace' ); @@ -30,8 +31,11 @@ class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type { /** * 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) + * @since 2.0.1 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { } @@ -39,8 +43,9 @@ class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type { /** * Prevent any HTML being output for this field type. * + * @since 2.0.1 + * * @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() ) { } @@ -48,9 +53,11 @@ class BP_XProfile_Field_Type_Placeholder extends BP_XProfile_Field_Type { /** * Prevent any HTML being output for this field type. * + * @since 2.0.1 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 40f04da5170233805c1673a43459e801503cff83..d0637e534d27a005460ad79ea60ccc55ca10985b 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Radio button xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 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) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -34,7 +35,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Radiobutton class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Radiobutton $this Current instance of * the field type radio button. @@ -47,12 +48,15 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that we pass to + // 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']; @@ -65,9 +69,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -101,8 +103,9 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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'] ); @@ -113,7 +116,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { for ( $k = 0, $count = count( $options ); $k < $count; ++$k ) { // Check for updated posted values, but errors preventing them from - // being saved first time + // 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] ); @@ -121,7 +124,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { } // Run the allowed option name through the before_save filter, so - // we'll be sure to get a match + // we'll be sure to get a match. $allowed_options = xprofile_sanitize_data_value_before_save( $options[$k]->name, false, false ); $selected = ''; @@ -129,7 +132,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { $selected = ' checked="checked"'; } - $new_html = sprintf( '<label><input %1$s type="radio" name="%2$s" id="%3$s" value="%4$s">%5$s</label>', + $new_html = sprintf( '<label for="%3$s"><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}" ), @@ -140,7 +143,7 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { /** * Filters the HTML output for an individual field options radio button. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $new_html Label and radio input field. * @param object $value Current option being rendered for. @@ -159,8 +162,9 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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(); @@ -181,9 +185,11 @@ class BP_XProfile_Field_Type_Radiobutton extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 85578fc1b9ed7a68cef9010914ee4938b4ba6ded..73187ec68ed3a40054d4d21110ae5cc34a9ea6ed 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Selectbox xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { /** - * Constructor for the selectbox field type + * Constructor for the selectbox field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -34,7 +35,7 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Selectbox class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Selectbox $this Current instance of * the field type select box. @@ -47,12 +48,15 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that we pass to + // 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']; @@ -63,9 +67,7 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -91,8 +93,9 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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'] ) ); @@ -109,7 +112,7 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { $selected = ''; // Check for updated posted values, but errors preventing them from - // being saved first time + // 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] ) ) { @@ -119,15 +122,15 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { } // Run the allowed option name through the before_save filter, so - // we'll be sure to get a match + // 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 + // 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 + // 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"'; } @@ -135,7 +138,7 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { /** * Filters the HTML output for options in a select input. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @param string $value Option tag for current value being rendered. * @param object $value Current option being rendered for. @@ -154,12 +157,14 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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() ) { ?> + <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Select', 'buddypress' ); ?></label> <select <?php echo $this->get_edit_field_html_elements( $raw_properties ); ?>> <?php bp_the_profile_field_options(); ?> </select> @@ -172,9 +177,11 @@ class BP_XProfile_Field_Type_Selectbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index fb985e067c5514b078734888e5de976b8d20a070..19f1871d3ee038505022b33fba77e516eb66ff5b 100644 --- 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 @@ -1,38 +1,40 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Textarea xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type { /** - * Constructor for the textarea field type + * Constructor for the textarea field type. * - * @since BuddyPress (2.0.0) - */ + * @since 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->supports_richtext = true; $this->set_format( '/^.*$/m', 'replace' ); /** * Fires inside __construct() method for BP_XProfile_Field_Type_Textarea class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Textarea $this Current instance of * the field type textarea. @@ -45,37 +47,76 @@ class BP_XProfile_Field_Type_Textarea extends BP_XProfile_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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that certain other fields + // 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, - ) ); ?> + $richtext_enabled = bp_xprofile_is_richtext_enabled_for_field(); ?> <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; ?> + <?php bp_the_profile_field_required_label(); ?> </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 + do_action( bp_get_the_profile_field_errors_action() ); + + if ( ! $richtext_enabled ) { + $r = wp_parse_args( $raw_properties, array( + 'cols' => 40, + 'rows' => 5, + ) ); + + ?> + + <textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>><?php bp_the_profile_field_edit_value(); ?></textarea> + + <?php + + } else { + + /** + * Filters the arguments passed to `wp_editor()` in richtext xprofile fields. + * + * @since 2.4.0 + * + * @param array $args { + * Array of optional arguments. See `wp_editor()`. + * @type bool $teeny Whether to use the teeny version of TinyMCE. Default true. + * @type bool $media_buttons Whether to show media buttons. Default false. + * @type bool $quicktags Whether to show the quicktags buttons. Default true. + * @type int $textarea_rows Number of rows to display in the editor. Defaults to 1 in the + * 'admin' context, and 10 in the 'edit' context. + * } + * @param string $context The display context. 'edit' when the markup is intended for the + * profile edit screen, 'admin' when intended for the Profile Fields + * Dashboard panel. + */ + $editor_args = apply_filters( 'bp_xprofile_field_type_textarea_editor_args', array( + 'teeny' => true, + 'media_buttons' => false, + 'quicktags' => true, + 'textarea_rows' => 10, + ), 'edit' ); + + wp_editor( + bp_get_the_profile_field_edit_value(), + bp_get_the_profile_field_input_name(), + $editor_args + ); + } } /** @@ -83,27 +124,50 @@ class BP_XProfile_Field_Type_Textarea extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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, - ) ); ?> + $richtext_enabled = bp_xprofile_is_richtext_enabled_for_field(); - <textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>></textarea> + if ( ! $richtext_enabled ) { - <?php + $r = bp_parse_args( $raw_properties, array( + 'cols' => 40, + 'rows' => 5, + ) ); ?> + + <textarea <?php echo $this->get_edit_field_html_elements( $r ); ?>></textarea> + + <?php + } else { + + /** This filter is documented in bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php */ + $editor_args = apply_filters( 'bp_xprofile_field_type_textarea_editor_args', array( + 'teeny' => true, + 'media_buttons' => false, + 'quicktags' => true, + 'textarea_rows' => 1, + ), 'admin' ); + + wp_editor( + '', + 'xprofile_textarea_' . bp_get_the_profile_field_id(), + $editor_args + ); + } } /** * 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. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ 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 index 80cc45a254d42208fab864ca1f48b0d019beb458..ebd02d6de70180a1aa1da06ead2afabf54d0b7fa 100644 --- 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 @@ -1,26 +1,27 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * Textbox xprofile field type. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { /** - * Constructor for the textbox field type + * Constructor for the textbox field type. * - * @since BuddyPress (2.0.0) - */ + * @since 2.0.0 + */ public function __construct() { parent::__construct(); @@ -32,7 +33,7 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_Textbox class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_Textbox $this Current instance of * the field type text box. @@ -42,15 +43,17 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { /** * 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) + * @since 2.0.0 + * + * @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. */ public function edit_field_html( array $raw_properties = array() ) { - // user_id is a special optional parameter that certain other fields + // 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'] ); @@ -63,9 +66,7 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -83,8 +84,9 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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() ) { @@ -92,6 +94,7 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { 'type' => 'text' ) ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'Textbox', 'buddypress' ); ?></label> <input <?php echo $this->get_edit_field_html_elements( $r ); ?>> <?php @@ -101,9 +104,11 @@ class BP_XProfile_Field_Type_Textbox extends BP_XProfile_Field_Type { * 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. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the + * current field's child options. */ 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 index c1a2dc71598f19ce081c396cfbeae5e0951ede16..26c929cd0080a387d5784c29cf3211b97465eacd 100644 --- 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 @@ -1,25 +1,26 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.1.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** * URL xprofile field type. * - * @since BuddyPress (2.1.0) + * @since 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) + * @since 2.1.0 */ public function __construct() { parent::__construct(); @@ -32,7 +33,7 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { /** * Fires inside __construct() method for BP_XProfile_Field_Type_URL class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type_URL $this Current instance of * the field type URL. @@ -45,10 +46,11 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.1.0 + * * @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) + * {@link http://dev.w3.org/html5/markup/input.number.html permitted attributes} + * that you want to add. */ public function edit_field_html( array $raw_properties = array() ) { @@ -66,9 +68,7 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { <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; ?> + <?php bp_the_profile_field_required_label(); ?> </label> <?php @@ -86,9 +86,10 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.1.0 + * * @param array $raw_properties Optional key/value array of permitted - * attributes that you want to add. - * @since BuddyPress (2.1.0) + * attributes that you want to add. */ public function admin_field_html( array $raw_properties = array() ) { @@ -96,6 +97,7 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { 'type' => 'url' ) ); ?> + <label for="<?php bp_the_profile_field_input_name(); ?>" class="screen-reader-text"><?php esc_html_e( 'URL', 'buddypress' ); ?></label> <input <?php echo $this->get_edit_field_html_elements( $r ); ?>> <?php @@ -106,9 +108,11 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { * 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. * + * @since 2.1.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) {} @@ -122,19 +126,21 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { * the protocol is missing, we prepend 'http://' before passing to * is_valid(). * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. * - * @param string $submitted_value Raw value submitted by the user. + * @param string $submitted_value Raw value submitted by the user. + * @param string|int $field_id Optional. ID of the field. * @return string */ - public static function pre_validate_filter( $submitted_value = '' ) { + public static function pre_validate_filter( $submitted_value = '', $field_id = '' ) { - // Allow empty URL values + // Allow empty URL values. if ( empty( $submitted_value ) ) { return ''; } - // Run some checks on the submitted value + // Run some checks on the submitted value. if ( false === strpos( $submitted_value, ':' ) && substr( $submitted_value, 0, 1 ) !== '/' && substr( $submitted_value, 0, 1 ) !== '#' @@ -149,12 +155,14 @@ class BP_XProfile_Field_Type_URL extends BP_XProfile_Field_Type { /** * Format URL values for display. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. * - * @param string $field_value The URL value, as saved in the database. + * @param string $field_value The URL value, as saved in the database. + * @param string|int $field_id Optional. ID of the field. * @return string URL converted to a link. */ - public static function display_filter( $field_value ) { + public static function display_filter( $field_value, $field_id = '' ) { $link = strip_tags( $field_value ); $no_scheme = preg_replace( '#^https?://#', '', rtrim( $link, '/' ) ); $url_text = str_replace( $link, $no_scheme, $field_value ); 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 index 46d412a4a1f555582adc21ae32646c5c5c71b8de..0c8ba4357d66ea231570a949e3a626b36e39d1c1 100644 --- 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 @@ -1,49 +1,58 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.0.0 */ -// Exit if accessed directly +// 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) + * @since 2.0.0 */ abstract class BP_XProfile_Field_Type { /** - * @since BuddyPress (2.0.0) - * @var array Field type validation regexes + * Validation regex rules for field type. + * + * @since 2.0.0 + * @var array Field type validation regexes. */ protected $validation_regex = array(); /** - * @since BuddyPress (2.0.0) - * @var array Field type whitelisted values + * Whitelisted values for field type. + * + * @since 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 + * Name for field type. + * + * @since 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) + * @since 2.0.0 * @var string */ public $category = ''; /** - * @since BuddyPress (2.0.0) + * If allowed to store null/empty values. + * + * @since 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; @@ -51,34 +60,47 @@ abstract class BP_XProfile_Field_Type { /** * 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) + * @since 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) + * If allowed to support multiple options as default. + * + * @since 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. + * If the field type supports rich text by default. + * + * @since 2.4.0 + * @var bool + */ + public $supports_richtext = false; + + /** + * If object is created by an BP_XProfile_Field object. + * + * @since 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 + * Constructor. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 */ public function __construct() { /** * Fires inside __construct() method for BP_XProfile_Field_Type class. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param BP_XProfile_Field_Type $this Current instance of * the field type class. @@ -92,17 +114,19 @@ abstract class BP_XProfile_Field_Type { * 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'. + * @since 2.0.0 + * + * @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) + * @since 2.0.0 * * @param string $format Regex string. * @param string $replace_format Optional replace format If "replace", replaces the @@ -126,9 +150,10 @@ abstract class BP_XProfile_Field_Type { * 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 + * @since 2.0.0 + * + * @param string|array $values Whitelisted values. * @return BP_XProfile_Field_Type - * @since BuddyPress (2.0.0) */ public function set_whitelist_values( $values ) { foreach ( (array) $values as $value ) { @@ -136,7 +161,7 @@ abstract class BP_XProfile_Field_Type { /** * Filters values for field type's whitelist that profile data will be asserted against. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param string $value Field value. * @param array $values Original array of values. @@ -153,14 +178,15 @@ abstract class BP_XProfile_Field_Type { * * This method doesn't support chaining. * - * @param string|array $values Value to check against the registered formats + * @since 2.0.0 + * + * @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 + // 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). @@ -175,22 +201,25 @@ abstract class BP_XProfile_Field_Type { } } - // Handle field types with accepts_null_value set if $values is an empty array + // 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 there's a whitelist set, make sure that each value is a whitelisted value. if ( ( true === $validated ) && ! empty( $values ) && ! empty( $this->validation_whitelist ) ) { foreach ( (array) $values as $value ) { - $validated = in_array( $value, $this->validation_whitelist, true ); + if ( ! in_array( $value, $this->validation_whitelist, true ) ) { + $validated = false; + break; + } } } /** * Filters whether or not field type is a valid format. * - * @since BuddyPress (2.0.0) + * @since 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. @@ -204,11 +233,25 @@ abstract class BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. - * @since BuddyPress (2.0.0) + * @return void */ abstract public function edit_field_html( array $raw_properties = 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. + * + * @since 2.0.0 + * + * @param array $raw_properties Optional key/value array of permitted attributes that you want to add. + * @return void + */ + abstract public function admin_field_html( array $raw_properties = array() ); + /** * Output the edit field options HTML for this field type. * @@ -221,21 +264,12 @@ abstract class BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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. * @@ -245,9 +279,11 @@ abstract class BP_XProfile_Field_Type { * * Must be used inside the {@link bp_profile_fields()} template loop. * + * @since 2.0.0 + * * @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) + * @param string $control_type Optional. HTML input type used to render the current + * field's child options. */ public function admin_new_field_html( BP_XProfile_Field $current_field, $control_type = '' ) { $type = array_search( get_class( $this ), bp_xprofile_get_field_types() ); @@ -294,7 +330,7 @@ abstract class BP_XProfile_Field_Type { $is_default_option = false; } - // Grab the values from $_POST to use as the form's options + // Grab the values from $_POST to use as the form's options. $options[] = (object) array( 'id' => -1, 'is_default_option' => $is_default_option, @@ -314,7 +350,7 @@ abstract class BP_XProfile_Field_Type { } } - // Render the markup for the children options + // Render the markup for the children options. if ( ! empty( $options ) ) { $default_name = ''; @@ -329,9 +365,10 @@ abstract class BP_XProfile_Field_Type { <div id="<?php echo esc_attr( "{$type}_div{$j}" ); ?>" class="bp-option sortable"> <span class="bp-option-icon grabber"></span> + <label for="<?php echo esc_attr( "{$type}_option{$j}" ); ?>" class="screen-reader-text"><?php esc_html_e( 'Add an option', 'buddypress' ); ?></label> <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 ); ?>" /> + <label for="<?php echo esc_attr( "{$type}_option{$default_name}" ); ?>"> + <input type="<?php echo esc_attr( $control_type ); ?>" id="<?php echo esc_attr( "{$type}_option{$default_name}" ); ?>" 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> @@ -356,7 +393,7 @@ abstract class BP_XProfile_Field_Type { /** * Fires at the end of the new field additional settings area. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param BP_XProfile_Field $current_field Current field being rendered. */ @@ -382,12 +419,14 @@ abstract class BP_XProfile_Field_Type { * override in your own field type if you need this kind of pre- * validation filtering. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added the `$field_id` parameter. * - * @param mixed $submitted_value Submitted value. + * @param mixed $field_value Submitted field value. + * @param string|int $field_id Optional. ID of the field. * @return mixed */ - public static function pre_validate_filter( $field_value ) { + public static function pre_validate_filter( $field_value, $field_id = '' ) { return $field_value; } @@ -398,12 +437,14 @@ abstract class BP_XProfile_Field_Type { * override in your own field type if you need to provide custom * filtering for output values. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 + * @since 2.4.0 Added `$field_id` parameter. * - * @param mixed $field_value Field value. + * @param mixed $field_value Field value. + * @param string|int $field_id ID of the field. * @return mixed */ - public static function display_filter( $field_value ) { + public static function display_filter( $field_value, $field_id = '' ) { return $field_value; } @@ -415,9 +456,10 @@ abstract class BP_XProfile_Field_Type { * 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. * + * @since 2.0.0 + * * @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() ) { @@ -430,12 +472,10 @@ abstract class BP_XProfile_Field_Type { $r['aria-required'] = 'true'; } - $html = ''; - /** * Filters the edit html elements and attributes. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $r Array of parsed arguments. * @param string $value Class name for the current class instance. 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 index 8913109754606e388963f1ead7692f396255bfe0..c24db3f689378bb9aec91c245b2d3bd924223510 100644 --- 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 @@ -1,143 +1,182 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +/** + * Class to help set up XProfile fields. + */ class BP_XProfile_Field { /** - * @since BuddyPress (1.0.0) + * Field ID. * - * @var int ID of field + * @since 1.0.0 + * @var int ID of field. */ public $id; /** - * @since BuddyPress (1.0.0) + * Field group ID. * - * @var int Field group ID for field + * @since 1.0.0 + * @var int Field group ID for field. */ public $group_id; /** - * @since BuddyPress (1.0.0) + * Field parent ID. * - * @var int Parent ID of field + * @since 1.0.0 + * @var int Parent ID of field. */ public $parent_id; /** - * @since BuddyPress (1.0.0) + * Field type. * - * @var string Field type + * @since 1.0.0 + * @var string Field type. */ public $type; /** - * @since BuddyPress (1.0.0) + * Field name. * - * @var string Field name + * @since 1.0.0 + * @var string Field name. */ public $name; /** - * @since BuddyPress (1.0.0) + * Field description. * - * @var string Field description + * @since 1.0.0 + * @var string Field description. */ public $description; /** - * @since BuddyPress (1.0.0) + * Required field? * + * @since 1.0.0 * @var bool Is field required to be filled out? */ public $is_required; /** - * @since BuddyPress (1.0.0) + * Deletable field? * + * @since 1.0.0 * @var int Can field be deleted? */ public $can_delete = '1'; /** - * @since BuddyPress (1.0.0) + * Field position. * - * @var int Field position + * @since 1.0.0 + * @var int Field position. */ public $field_order; /** - * @since BuddyPress (1.0.0) + * Option order. * - * @var int Option order + * @since 1.0.0 + * @var int Option order. */ public $option_order; /** - * @since BuddyPress (1.0.0) + * Order child fields. * - * @var string Order child fields by + * @since 1.0.0 + * @var string Order child fields by. */ public $order_by; /** - * @since BuddyPress (1.0.0) + * Is this the default option? * + * @since 1.0.0 * @var bool Is this the default option for this field? */ public $is_default_option; /** - * @since BuddyPress (1.9.0) + * Field data visibility. + * + * @since 1.9.0 + * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_default_visibility()`. + * @var string Default field data visibility. + */ + protected $default_visibility; + + /** + * Is the visibility able to be modified? * - * @var string Default field data visibility + * @since 2.3.0 + * @since 2.4.0 Property marked protected. Now accessible by magic method or by `get_allow_custom_visibility()`. + * @var string Members are allowed/disallowed to modify data visibility. */ - public $default_visibility = 'public'; + protected $allow_custom_visibility; /** - * @since BuddyPress (2.3.0) + * Whether values from this field are autolinked to directory searches. * - * @var string Members are allowed/disallowed to modify data visibility + * @since 2.5.0 + * + * @var bool */ - public $allow_custom_visibility = 'allowed'; + public $do_autolink; /** - * @since BuddyPress (2.0.0) + * Field type option. * - * @var BP_XProfile_Field_Type Field type object used for validation + * @since 2.0.0 + * @var BP_XProfile_Field_Type Field type object used for validation. */ public $type_obj = null; /** - * @since BuddyPress (2.0.0) + * Field data for user ID. * - * @var BP_XProfile_ProfileData Field data for user ID + * @since 2.0.0 + * @var BP_XProfile_ProfileData Field data for user ID. */ public $data; /** - * Initialize and/or populate profile field + * Member types to which the profile field should be applied. + * + * @since 2.4.0 + * @var array Array of member types. + */ + protected $member_types; + + /** + * Initialize and/or populate profile field. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * - * @param int $id - * @param int $user_id - * @param bool $get_data + * @param int|null $id Field ID. + * @param int|null $user_id User ID. + * @param bool $get_data 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 + // 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; @@ -145,16 +184,16 @@ class BP_XProfile_Field { } /** - * Populate a profile field object + * Populate a profile field object. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global object $wpdb * @global object $userdata * - * @param int $id - * @param int $user_id - * @param bool $get_data + * @param int $id Field ID. + * @param int|null $user_id User ID. + * @param bool $get_data Get data. */ public function populate( $id, $user_id = null, $get_data = true ) { global $wpdb, $userdata; @@ -166,57 +205,125 @@ class BP_XProfile_Field { $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; + $this->fill_data( $field ); + + if ( ! empty( $get_data ) && ! empty( $user_id ) ) { + $this->data = $this->get_field_data( $user_id ); + } + } + + /** + * Retrieve a `BP_XProfile_Field` instance. + * + * @static + * + * @param int $field_id ID of the field. + * @return BP_XProfile_Field|false Field object if found, otherwise false. + */ + public static function get_instance( $field_id ) { + global $wpdb; + + $field_id = (int) $field_id; + if ( ! $field_id ) { + return false; + } + + $field = wp_cache_get( $field_id, 'bp_xprofile_fields' ); + if ( false === $field ) { + $bp = buddypress(); + + $field = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ) ); + + wp_cache_add( $field->id, $field, 'bp_xprofile_fields' ); + + if ( ! $field ) { + return false; + } + } + + $_field = new BP_XProfile_Field(); + $_field->fill_data( $field ); - if ( ! empty( $get_data ) && ! empty( $user_id ) ) { - $this->data = $this->get_field_data( $user_id ); + return $_field; + } + + /** + * Fill object vars based on data passed to the method. + * + * @since 2.4.0 + * + * @param array|object $args Array or object representing the `BP_XProfile_Field` properties. + * Generally, this is a row from the fields database table. + */ + public function fill_data( $args ) { + if ( is_object( $args ) ) { + $args = (array) $args; + } + + foreach ( $args as $k => $v ) { + if ( 'name' === $k || 'description' === $k ) { + $v = stripslashes( $v ); } + $this->{$k} = $v; + } - // 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' ); + // Create the field type and store a reference back to this object. + $this->type_obj = bp_xprofile_create_field_type( $this->type ); + $this->type_obj->field_obj = $this; + } - // Setup default visibility - $this->default_visibility = ! empty( $default_visibility ) - ? $default_visibility - : 'public'; + /** + * Magic getter. + * + * @since 2.4.0 + * + * @param string $key Property name. + * @return mixed + */ + public function __get( $key ) { + switch ( $key ) { + case 'default_visibility' : + return $this->get_default_visibility(); + break; + + case 'allow_custom_visibility' : + return $this->get_allow_custom_visibility(); + break; + } + } - // Allow members to customize visibilty - $this->allow_custom_visibility = ( 'disabled' === $allow_custom_visibility ) - ? 'disabled' - : 'allowed'; + /** + * Magic issetter. + * + * @since 2.4.0 + * + * @param string $key Property name. + * @return bool + */ + public function __isset( $key ) { + switch ( $key ) { + // Backward compatibility for when these were public methods. + case 'allow_custom_visibility' : + case 'default_visibility' : + return true; + break; } } /** - * Delete a profile field + * Delete a profile field. + * + * @since 1.1.0 * - * @since BuddyPress (1.1.0) + * @global object $wpdb * - * @global object $wpdb - * @param boolean $delete_data + * @param boolean $delete_data Whether or not to delete data. * @return boolean */ public function delete( $delete_data = false ) { global $wpdb; - // Prevent deletion if no ID is present + // 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 ) ) { @@ -230,7 +337,7 @@ class BP_XProfile_Field { return false; } - // delete the data in the DB for this field + // Delete the data in the DB for this field. if ( true === $delete_data ) { BP_XProfile_ProfileData::delete_for_field( $this->id ); } @@ -239,9 +346,9 @@ class BP_XProfile_Field { } /** - * Save a profile field + * Save a profile field. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global object $wpdb * @@ -269,13 +376,15 @@ class BP_XProfile_Field { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_XProfile_Field Current instance of the field being saved. + * @param BP_XProfile_Field $this Current instance of the field being saved. */ do_action_ref_array( 'xprofile_field_before_save', array( $this ) ); - if ( $this->id != null ) { + $is_new_field = is_null( $this->id ); + + if ( ! $is_new_field ) { $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 ); @@ -287,14 +396,12 @@ class BP_XProfile_Field { */ if ( $wpdb->query( $sql ) !== null ) { - if ( !empty( $this->id ) ) { - $field_id = $this->id; - } else { - $field_id = $wpdb->insert_id; + if ( $is_new_field ) { + $this->id = $wpdb->insert_id; } - // Only do this if we are editing an existing field - if ( $this->id != null ) { + // Only do this if we are editing an existing field. + if ( ! $is_new_field ) { /** * Remove any radio or dropdown options for this @@ -311,11 +418,7 @@ class BP_XProfile_Field { */ if ( $this->type_obj->supports_options ) { - if ( !empty( $this->id ) ) { - $parent_id = $this->id; - } else { - $parent_id = $wpdb->insert_id; - } + $parent_id = $this->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"] : ''; @@ -324,7 +427,7 @@ class BP_XProfile_Field { /** * Filters the submitted field option value before saved. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $post_option Submitted option value. * @param BP_XProfile_Field $type Current field type being saved for. @@ -334,7 +437,7 @@ class BP_XProfile_Field { /** * Filters the default field option value before saved. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @param string $post_default Default option value. * @param BP_XProfile_Field $type Current field type being saved for. @@ -371,28 +474,28 @@ class BP_XProfile_Field { /** * Fires after the current field instance gets saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_XProfile_Field Current instance of the field being saved. + * @param BP_XProfile_Field $this 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; + // 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; + return $this->id; } else { return false; } } /** - * Get field data for a user ID + * Get field data for a user ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * - * @param int $user_id + * @param int $user_id ID of the user to get field data for. * @return object */ public function get_field_data( $user_id = 0 ) { @@ -400,19 +503,19 @@ class BP_XProfile_Field { } /** - * Get all child fields for this field ID + * Get all child fields for this field ID. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $wpdb * - * @param bool $for_editing + * @param bool $for_editing Whether or not the field is 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 + // 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 ) ) { @@ -422,7 +525,7 @@ class BP_XProfile_Field { } // This eliminates a problem with getting all fields when there is no - // id for the object + // id for the object. if ( empty( $this->id ) ) { $parent_id = -1; } else { @@ -437,7 +540,7 @@ class BP_XProfile_Field { /** * Filters the found children for a field. * - * @since BuddyPress (1.2.5) + * @since 1.2.5 * * @param object $children Found children for a field. * @param bool $for_editing Whether or not the field is for editing. @@ -446,9 +549,9 @@ class BP_XProfile_Field { } /** - * Delete all field children for this field + * Delete all field children for this field. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $wpdb */ @@ -461,12 +564,280 @@ class BP_XProfile_Field { $wpdb->query( $sql ); } - /** Static Methods ********************************************************/ + /** + * Gets the member types to which this field should be available. + * + * Will not return inactive member types, even if associated metadata is found. + * + * 'null' is a special pseudo-type, which represents users that do not have a member type. + * + * @since 2.4.0 + * + * @return array Array of member type names. + */ + public function get_member_types() { + if ( ! is_null( $this->member_types ) ) { + return $this->member_types; + } + + $raw_types = bp_xprofile_get_meta( $this->id, 'field', 'member_type', false ); + + // If `$raw_types` is not an array, it probably means this is a new field (id=0). + if ( ! is_array( $raw_types ) ) { + $raw_types = array(); + } + + // If '_none' is found in the array, it overrides all types. + $types = array(); + if ( ! in_array( '_none', $raw_types ) ) { + $registered_types = bp_get_member_types(); + + // Eliminate invalid member types saved in the database. + foreach ( $raw_types as $raw_type ) { + // 'null' is a special case - it represents users without a type. + if ( 'null' === $raw_type || isset( $registered_types[ $raw_type ] ) ) { + $types[] = $raw_type; + } + } + + // If no member types have been saved, intepret as *all* member types. + if ( empty( $types ) ) { + $types = array_values( $registered_types ); + + // + the "null" type, ie users without a type. + $types[] = 'null'; + } + } + + /** + * Filters the member types to which an XProfile object should be applied. + * + * @since 2.4.0 + * + * @param array $types Member types. + * @param BP_XProfile_Field $field Field object. + */ + $this->member_types = apply_filters( 'bp_xprofile_field_member_types', $types, $this ); + + return $this->member_types; + } + + /** + * Sets the member types for this field. + * + * @since 2.4.0 + * + * @param array $member_types Array of member types. Can include 'null' (users with no type) in addition to any + * registered types. + * @param bool $append Whether to append to existing member types. If false, all existing member type + * associations will be deleted before adding your `$member_types`. Default false. + * @return array Member types for the current field, after being saved. + */ + public function set_member_types( $member_types, $append = false ) { + // Unset invalid member types. + $types = array(); + foreach ( $member_types as $member_type ) { + // 'null' is a special case - it represents users without a type. + if ( 'null' === $member_type || bp_get_member_type_object( $member_type ) ) { + $types[] = $member_type; + } + } + + // When `$append` is false, delete all existing types before adding new ones. + if ( ! $append ) { + bp_xprofile_delete_meta( $this->id, 'field', 'member_type' ); + + /* + * We interpret an empty array as disassociating the field from all types. This is + * represented internally with the '_none' flag. + */ + if ( empty( $types ) ) { + bp_xprofile_add_meta( $this->id, 'field', 'member_type', '_none' ); + } + } + + /* + * Unrestricted fields are represented in the database as having no 'member_type'. + * We detect whether a field is being set to unrestricted by checking whether the + * list of types passed to the method is the same as the list of registered types, + * plus the 'null' pseudo-type. + */ + $_rtypes = bp_get_member_types(); + $rtypes = array_values( $_rtypes ); + $rtypes[] = 'null'; + + sort( $types ); + sort( $rtypes ); + + // Only save if this is a restricted field. + if ( $types !== $rtypes ) { + // Save new types. + foreach ( $types as $type ) { + bp_xprofile_add_meta( $this->id, 'field', 'member_type', $type ); + } + } + + // Reset internal cache of member types. + $this->member_types = null; + + /** + * Fires after a field's member types have been updated. + * + * @since 2.4.0 + * + * @param BP_XProfile_Field $this Field object. + */ + do_action( 'bp_xprofile_field_set_member_type', $this ); + + // Refetch fresh items from the database. + return $this->get_member_types(); + } + + /** + * Gets a label representing the field's member types. + * + * This label is displayed alongside the field's name on the Profile Fields Dashboard panel. + * + * @since 2.4.0 + * + * @return string + */ + public function get_member_type_label() { + // Field 1 is always displayed to everyone, so never gets a label. + if ( 1 == $this->id ) { + return ''; + } + + // Return an empty string if no member types are registered. + $all_types = bp_get_member_types(); + if ( empty( $all_types ) ) { + return ''; + } + + $member_types = $this->get_member_types(); + + // If the field applies to all member types, show no message. + $all_types[] = 'null'; + if ( array_values( $all_types ) == $member_types ) { + return ''; + } + + $label = ''; + if ( ! empty( $member_types ) ) { + $has_null = false; + $member_type_labels = array(); + foreach ( $member_types as $member_type ) { + if ( 'null' === $member_type ) { + $has_null = true; + continue; + } else { + $mt_obj = bp_get_member_type_object( $member_type ); + $member_type_labels[] = $mt_obj->labels['name']; + } + } + + // Alphabetical sort. + natcasesort( $member_type_labels ); + $member_type_labels = array_values( $member_type_labels ); + + // Add the 'null' option to the end of the list. + if ( $has_null ) { + $member_type_labels[] = __( 'Users with no member type', 'buddypress' ); + } + + $label = sprintf( __( '(Member types: %s)', 'buddypress' ), implode( ', ', array_map( 'esc_html', $member_type_labels ) ) ); + } else { + $label = '<span class="member-type-none-notice">' . __( '(Unavailable to all members)', 'buddypress' ) . '</span>'; + } + + return $label; + } + + /** + * Get the field's default visibility setting. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to 'public' if no visibility setting is found in the database. + * + * @since 2.4.0 + * + * @return string + */ + public function get_default_visibility() { + if ( ! isset( $this->default_visibility ) ) { + $this->default_visibility = bp_xprofile_get_meta( $this->id, 'field', 'default_visibility' ); + + if ( ! $this->default_visibility ) { + $this->default_visibility = 'public'; + } + } + + return $this->default_visibility; + } + + /** + * Get whether the field's default visibility can be overridden by users. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to 'allowed'. + * + * @since 4.4.0 + * + * @return string 'disabled' or 'allowed'. + */ + public function get_allow_custom_visibility() { + if ( ! isset( $this->allow_custom_visibility ) ) { + $allow_custom_visibility = bp_xprofile_get_meta( $this->id, 'field', 'allow_custom_visibility' ); + + if ( 'disabled' === $allow_custom_visibility ) { + $this->allow_custom_visibility = 'disabled'; + } else { + $this->allow_custom_visibility = 'allowed'; + } + } + + return $this->allow_custom_visibility; + } + + /** + * Get whether the field values should be auto-linked to a directory search. + * + * Lazy-loaded to reduce overhead. + * + * Defaults to true for multi and default fields, false for single fields. + * + * @since 2.5.0 + * + * @return bool + */ + public function get_do_autolink() { + if ( ! isset( $this->do_autolink ) ) { + $do_autolink = bp_xprofile_get_meta( $this->id, 'field', 'do_autolink' ); + + if ( '' === $do_autolink ) { + $this->do_autolink = $this->is_default_field() || $this->type_obj->supports_options; + } else { + $this->do_autolink = 'on' === $do_autolink; + } + } + + return $this->do_autolink; + } + + /* Static Methods ********************************************************/ + /** + * Get the type for provided field ID. + * + * @param int $field_id Field ID to get type of. + * @return bool|null|string + */ public static function get_type( $field_id = 0 ) { global $wpdb; - // Bail if no field ID + // Bail if no field ID. if ( empty( $field_id ) ) { return false; } @@ -475,7 +846,7 @@ class BP_XProfile_Field { $sql = $wpdb->prepare( "SELECT type FROM {$bp->profile->table_name_fields} WHERE id = %d", $field_id ); $type = $wpdb->get_var( $sql ); - // Return field type + // Return field type. if ( ! empty( $type ) ) { return $type; } @@ -484,20 +855,19 @@ class BP_XProfile_Field { } /** - * Delete all fields in a field group + * Delete all fields in a field group. * - * @since BuddyPress (1.2.0) + * @since 1.2.0 * * @global object $wpdb * - * @param int $group_id - * + * @param int $group_id ID of the field group to delete fields from. * @return boolean */ public static function delete_for_group( $group_id = 0 ) { global $wpdb; - // Bail if no group ID + // Bail if no group ID. if ( empty( $group_id ) ) { return false; } @@ -506,7 +876,7 @@ class BP_XProfile_Field { $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 + // Return true if fields were deleted. if ( false !== $deleted ) { return true; } @@ -515,13 +885,13 @@ class BP_XProfile_Field { } /** - * Get field ID from field name + * Get field ID from field name. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $wpdb - * @param string $field_name * + * @param string $field_name Name of the field to query the ID for. * @return boolean */ public static function get_id_from_name( $field_name = '' ) { @@ -539,35 +909,34 @@ class BP_XProfile_Field { } /** - * Update field position and/or field group when relocating + * Update field position and/or field group when relocating. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global object $wpdb * - * @param int $field_id - * @param int $position - * @param int $field_group_id - * + * @param int $field_id ID of the field to update. + * @param int|null $position Field position to update. + * @param int|null $field_group_id ID of the field group. * @return boolean */ public static function update_position( $field_id, $position = null, $field_group_id = null ) { global $wpdb; - // Bail if invalid position or field group + // Bail if invalid position or field group. if ( ! is_numeric( $position ) || ! is_numeric( $field_group_id ) ) { return false; } - // Get table name and field parent + // 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 + // Update $field_id with new $position and $field_group_id. if ( ! empty( $parent ) && ! is_wp_error( $parent ) ) { - // Update any children of this $field_id + // 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 ); @@ -578,67 +947,142 @@ class BP_XProfile_Field { } /** - * Validate form field data on sumbission + * Gets the IDs of fields applicable for a given member type or array of member types. + * + * @since 2.4.0 + * + * @param string|array $member_types Member type or array of member types. Use 'any' to return unrestricted + * fields (those available for anyone, regardless of member type). + * @return array Multi-dimensional array, with field IDs as top-level keys, and arrays of member types + * associated with each field as values. + */ + public static function get_fields_for_member_type( $member_types ) { + global $wpdb; + + $fields = array(); + + if ( empty( $member_types ) ) { + $member_types = array( 'any' ); + } elseif ( ! is_array( $member_types ) ) { + $member_types = array( $member_types ); + } + + $bp = buddypress(); + + // Pull up all recorded field member type data. + $mt_meta = wp_cache_get( 'field_member_types', 'bp_xprofile' ); + if ( false === $mt_meta ) { + $mt_meta = $wpdb->get_results( "SELECT object_id, meta_value FROM {$bp->profile->table_name_meta} WHERE meta_key = 'member_type' AND object_type = 'field'" ); + wp_cache_set( 'field_member_types', $mt_meta, 'bp_xprofile' ); + } + + // Keep track of all fields with recorded member_type metadata. + $all_recorded_field_ids = wp_list_pluck( $mt_meta, 'object_id' ); + + // Sort member_type matches in arrays, keyed by field_id. + foreach ( $mt_meta as $_mt_meta ) { + if ( ! isset( $fields[ $_mt_meta->object_id ] ) ) { + $fields[ $_mt_meta->object_id ] = array(); + } + + $fields[ $_mt_meta->object_id ][] = $_mt_meta->meta_value; + } + + /* + * Filter out fields that don't match any passed types, or those marked '_none'. + * The 'any' type is implicitly handled here: it will match no types. + */ + foreach ( $fields as $field_id => $field_types ) { + if ( ! array_intersect( $field_types, $member_types ) ) { + unset( $fields[ $field_id ] ); + } + } + + // Any fields with no member_type metadata are available to all member types. + if ( ! in_array( '_none', $member_types ) ) { + if ( ! empty( $all_recorded_field_ids ) ) { + $all_recorded_field_ids_sql = implode( ',', array_map( 'absint', $all_recorded_field_ids ) ); + $unrestricted_field_ids = $wpdb->get_col( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id NOT IN ({$all_recorded_field_ids_sql})" ); + } else { + $unrestricted_field_ids = $wpdb->get_col( "SELECT id FROM {$bp->profile->table_name_fields}" ); + } + + // Append the 'null' pseudo-type. + $all_member_types = bp_get_member_types(); + $all_member_types = array_values( $all_member_types ); + $all_member_types[] = 'null'; + + foreach ( $unrestricted_field_ids as $unrestricted_field_id ) { + $fields[ $unrestricted_field_id ] = $all_member_types; + } + } + + return $fields; + } + + /** + * Validate form field data on sumbission. + * + * @since 2.2.0 * - * @since BuddyPress (2.2.0) + * @global $message * - * @global type $message * @return boolean */ public static function admin_validate() { global $message; - // Check field name + // Check field name. if ( ! isset( $_POST['title'] ) || ( '' === $_POST['title'] ) ) { $message = esc_html__( 'Profile fields must have a name.', 'buddypress' ); return false; } - // Check field requirement + // Check field requirement. if ( ! isset( $_POST['required'] ) ) { $message = esc_html__( 'Profile field requirement is missing.', 'buddypress' ); return false; } - // Check field type + // 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 + // 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 + // 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 + // Field type requires options. if ( true === $field_type->supports_options ) { - // Build the field option key + // Build the field option key. $option_name = sanitize_key( $_POST['fieldtype'] ) . '_option'; - // Check for missing or malformed options + // 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 + // 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 + // 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 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; @@ -649,8 +1093,7 @@ class BP_XProfile_Field { } /** - * This function populates the items for radio buttons checkboxes and drop - * down boxes. + * Populates the items for radio buttons, checkboxes, and dropdown boxes. */ public function render_admin_form_children() { foreach ( array_keys( bp_xprofile_get_field_types() ) as $field_type ) { @@ -660,11 +1103,11 @@ class BP_XProfile_Field { } /** - * Oupput the admin form for this field + * Oupput the admin form for this field. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * - * @param type $message + * @param string $message Message to display. */ public function render_admin_form( $message = '' ) { if ( empty( $this->id ) ) { @@ -677,8 +1120,11 @@ class BP_XProfile_Field { $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']; + + if ( ! empty( $_POST["sort_order_{$this->type}"] ) ) { + $this->order_by = $_POST["sort_order_{$this->type}"]; + } } } else { $title = __( 'Edit Field', 'buddypress' ); @@ -688,9 +1134,7 @@ class BP_XProfile_Field { <div class="wrap"> - <?php screen_icon( 'users' ); ?> - - <h2><?php echo esc_html( $title ); ?></h2> + <h1><?php echo esc_html( $title ); ?></h1> <?php if ( !empty( $message ) ) : ?> @@ -707,7 +1151,7 @@ class BP_XProfile_Field { <?php - // Output the name & description fields + // Output the name & description fields. $this->name_and_description(); ?> </div><!-- #post-body-content --> @@ -716,19 +1160,26 @@ class BP_XProfile_Field { <?php - // Output the sumbit metabox + // Output the sumbit metabox. $this->submit_metabox( $button ); - // Output the required metabox + // Output the required metabox. $this->required_metabox(); - // Output the field visibility metaboxes + // Output the Member Types metabox. + $this->member_type_metabox(); + + // Output the field visibility metaboxes. $this->visibility_metabox(); + // Output the autolink metabox. + $this->autolink_metabox(); + + /** * Fires after XProfile Field sidebar metabox. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_XProfile_Field $this Current XProfile field. */ @@ -743,22 +1194,22 @@ class BP_XProfile_Field { /** * Fires before XProfile Field content metabox. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param BP_XProfile_Field $this Current XProfile field. */ do_action( 'xprofile_field_before_contentbox', $this ); - // Output the field attributes metabox + // Output the field attributes metabox. $this->type_metabox(); - // Output hidden inputs for default field + // Output hidden inputs for default field. $this->default_field_hidden_inputs(); /** * Fires after XProfile Field content metabox. * - * @since BuddyPress (2.2.0) + * @since 2.2.0 * * @param BP_XProfile_Field $this Current XProfile field. */ @@ -774,25 +1225,25 @@ class BP_XProfile_Field { } /** - * Private method used to display the submit metabox + * Private method used to display the submit metabox. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param string $button_text + * @param string $button_text Text to put on button. */ private function submit_metabox( $button_text = '' ) { /** * Fires before XProfile Field submit metabox. * - * @since BuddyPress (2.1.0) + * @since 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> + <h2><?php esc_html_e( 'Submit', 'buddypress' ); ?></h2> <div class="inside"> <div id="submitcomment" class="submitbox"> <div id="major-publishing-actions"> @@ -802,7 +1253,7 @@ class BP_XProfile_Field { /** * Fires at the beginning of the XProfile Field publishing actions section. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param BP_XProfile_Field $this Current XProfile field. */ @@ -835,7 +1286,7 @@ class BP_XProfile_Field { /** * Fires after XProfile Field submit metabox. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param BP_XProfile_Field $this Current XProfile field. */ @@ -843,9 +1294,9 @@ class BP_XProfile_Field { } /** - * Private method used to output field name and description fields + * Private method used to output field name and description fields. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ private function name_and_description() { ?> @@ -858,8 +1309,9 @@ class BP_XProfile_Field { </div> <div class="postbox"> - <h3><?php echo esc_html_x( 'Description', 'XProfile admin edit field', 'buddypress' ); ?></h3> + <h2><?php echo esc_html_x( 'Description', 'XProfile admin edit field', 'buddypress' ); ?></h2> <div class="inside"> + <label for="description" class="screen-reader-text"><?php esc_html_e( 'Add description', 'buddypress' ); ?></label> <textarea name="description" id="description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea> </div> </div> @@ -868,28 +1320,81 @@ class BP_XProfile_Field { } /** - * Private method used to output field visibility metaboxes + * Private method used to output field Member Type metabox. + * + * @since 2.4.0 + */ + private function member_type_metabox() { + + // The primary field is for all, so bail. + if ( 1 === (int) $this->id ) { + return; + } + + // Bail when no member types are registered. + if ( ! $member_types = bp_get_member_types( array(), 'objects' ) ) { + return; + } + + $field_member_types = $this->get_member_types(); + + ?> + + <div id="member-types-div" class="postbox"> + <h2><?php _e( 'Member Types', 'buddypress' ); ?></h2> + <div class="inside"> + <p class="description"><?php _e( 'This field should be available to:', 'buddypress' ); ?></p> + + <ul> + <?php foreach ( $member_types as $member_type ) : ?> + <li> + <label for="member-type-<?php echo $member_type->labels['name']; ?>"> + <input name="member-types[]" id="member-type-<?php echo $member_type->labels['name']; ?>" class="member-type-selector" type="checkbox" value="<?php echo $member_type->name; ?>" <?php checked( in_array( $member_type->name, $field_member_types ) ); ?>/> + <?php echo $member_type->labels['name']; ?> + </label> + </li> + <?php endforeach; ?> + + <li> + <label for="member-type-none"> + <input name="member-types[]" id="member-type-none" class="member-type-selector" type="checkbox" value="null" <?php checked( in_array( 'null', $field_member_types ) ); ?>/> + <?php _e( 'Users with no member type', 'buddypress' ); ?> + </label> + </li> + + </ul> + <p class="description member-type-none-notice<?php if ( ! empty( $field_member_types ) ) : ?> hide<?php endif; ?>"><?php _e( 'Unavailable to all members.', 'buddypress' ) ?></p> + </div> + + <input type="hidden" name="has-member-types" value="1" /> + </div> + + <?php + } + + /** + * Private method used to output field visibility metaboxes. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return if default field id 1 + * @return void If default field id 1. */ private function visibility_metabox() { - // Default field cannot have custom visibility + // 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> + <h2><label for="default-visibility"><?php esc_html_e( 'Visibility', 'buddypress' ); ?></label></h2> <div class="inside"> <div> - <select name="default-visibility" > + <select name="default-visibility" id="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'] ); ?>> + <option value="<?php echo esc_attr( $level['id'] ); ?>" <?php selected( $this->get_default_visibility(), $level['id'] ); ?>> <?php echo esc_html( $level['label'] ); ?> </option> @@ -901,11 +1406,11 @@ class BP_XProfile_Field { <div> <ul> <li> - <input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?> /> + <input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility" value="allowed" <?php checked( $this->get_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' ); ?> /> + <input type="radio" id="allow-custom-visibility-disabled" name="allow-custom-visibility" value="disabled" <?php checked( $this->get_allow_custom_visibility(), 'disabled' ); ?> /> <label for="allow-custom-visibility-disabled"><?php esc_html_e( 'Enforce field visibility', 'buddypress' ); ?></label> </li> </ul> @@ -917,21 +1422,21 @@ class BP_XProfile_Field { } /** - * Output the metabox for setting if field is required or not + * Output the metabox for setting if field is required or not. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return if default field + * @return void If default field. */ private function required_metabox() { - // Default field is always required + // 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> + <h2><label for="required"><?php esc_html_e( 'Requirement', 'buddypress' ); ?></label></h2> <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> @@ -944,21 +1449,55 @@ class BP_XProfile_Field { } /** - * Output the metabox for setting what type of field this is + * Private method used to output autolink metabox. + * + * @since 2.5.0 + * + * @return void If default field id 1. + */ + private function autolink_metabox() { + + // Default field cannot have custom visibility. + if ( true === $this->is_default_field() ) { + return; + } + + ?> + + <div class="postbox"> + <h2><?php esc_html_e( 'Autolink', 'buddypress' ); ?></h2> + <div class="inside"> + <p class="description"><?php esc_html_e( 'On user profiles, link this field to a search of the Members directory, using the field value as a search term.', 'buddypress' ); ?></p> + + <p> + <label for="do-autolink" class="screen-reader-text"><?php esc_html_e( 'Autolink status for this field', 'buddypress' ); ?></label> + <select name="do_autolink" id="do-autolink"> + <option value="on" <?php selected( $this->get_do_autolink() ); ?>><?php esc_html_e( 'Enabled', 'buddypress' ); ?></option> + <option value="" <?php selected( $this->get_do_autolink(), false ); ?>><?php esc_html_e( 'Disabled', 'buddypress' ); ?></option> + </select> + </p> + </div> + </div> + + <?php + } + + /** + * Output the metabox for setting what type of field this is. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return if default field + * @return void If default field. */ private function type_metabox() { - // Default field cannot change type + // 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> + <h2><label for="fieldtype"><?php esc_html_e( 'Type', 'buddypress'); ?></label></h2> <div class="inside"> <select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%"> @@ -980,15 +1519,15 @@ class BP_XProfile_Field { } /** - * Output hidden fields used by default field + * Output hidden fields used by default field. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @return if not default field + * @return void If not default field. */ private function default_field_hidden_inputs() { - // Field 1 is the fullname field, which cannot have custom visibility + // Field 1 is the fullname field, which cannot have custom visibility. if ( false === $this->is_default_field() ) { return; } ?> @@ -1000,21 +1539,21 @@ class BP_XProfile_Field { } /** - * Return if a field ID is the default field + * Return if a field ID is the default field. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * - * @param int $field_id ID of field to check + * @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 + // Fallback to current field ID if none passed. if ( empty( $field_id ) ) { $field_id = $this->id; } - // Compare & return + // 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 index d2215fbdf4ded7eff786c9838ceb48592f6341ff..481a18771317862ae6a9a4e55a51fe2e957f0b20 100644 --- 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 @@ -1,66 +1,74 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +/** + * Class to help set up XProfile Groups. + */ class BP_XProfile_Group { - + /** - * @since BuddyPress (1.1.0) + * Field group ID. * + * @since 1.1.0 * @var int ID of field group */ public $id = null; - + /** - * @since BuddyPress (1.1.0) + * Field group name. * + * @since 1.1.0 * @var string Name of field group */ public $name; - + /** - * @since BuddyPress (1.1.0) + * Field group Description. * + * @since 1.1.0 * @var string Description of field group */ public $description; - + /** - * @since BuddyPress (1.1.0) + * Group deletion boolean. * + * @since 1.1.0 * @var bool Can this group be deleted? */ public $can_delete; - + /** - * @since BuddyPress (1.1.0) + * Group order. * + * @since 1.1.0 * @var int Group order relative to other groups */ public $group_order; - + /** - * @since BuddyPress (1.1.0) + * Group fields. * + * @since 1.1.0 * @var array Fields of group */ public $fields; /** - * Initialize and/or populate profile field group + * Initialize and/or populate profile field group. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * - * @param int $id - * @param int $user_id - * @param bool $get_data + * @param int|null $id Field group ID. */ public function __construct( $id = null ) { if ( ! empty( $id ) ) { @@ -69,31 +77,32 @@ class BP_XProfile_Group { } /** - * Populate a profile field group + * Populate a profile field group. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global $wpdb $wpdb - * @param int $id + * + * @param int $id Field group ID. * * @return boolean */ public function populate( $id ) { - // Get this group + // Get this group. $group = self::get( array( 'profile_group_id' => $id ) ); - // Bail if group not found + // Bail if group not found. if ( empty( $group ) ) { return false; } - // Get the first array element + // Get the first array element. $group = reset( $group ); - // Set object properties + // Set object properties. $this->id = $group->id; $this->name = $group->name; $this->description = $group->description; @@ -102,9 +111,9 @@ class BP_XProfile_Group { } /** - * Save a profile field group + * Save a profile field group. * - * @since BuddyPress (1.1.0) + * @since 1.1.0 * * @global object $wpdb * @@ -113,7 +122,7 @@ class BP_XProfile_Group { public function save() { global $wpdb; - // Filter the field group attributes + // 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 ); @@ -122,30 +131,30 @@ class BP_XProfile_Group { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference. + * @param BP_XProfile_Group $this 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 + // 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 + // Attempt to insert or update. $query = $wpdb->query( $sql ); - // Bail if query fails - if ( empty( $query ) || is_wp_error( $query ) ) { + // Bail if query fails. If `$query` is 0, it means the save was successful, but no fields were updated. + if ( false === $query || is_wp_error( $query ) ) { return false; } - // If not set, update the ID in the group object + // If not set, update the ID in the group object. if ( empty( $this->id ) ) { $this->id = $wpdb->insert_id; } @@ -153,9 +162,9 @@ class BP_XProfile_Group { /** * Fires after the current group instance gets saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * - * @param BP_XProfile_Group Current instance of the group being saved. Passed by reference. + * @param BP_XProfile_Group $this Current instance of the group being saved. Passed by reference. */ do_action_ref_array( 'xprofile_group_after_save', array( &$this ) ); @@ -165,15 +174,16 @@ class BP_XProfile_Group { /** * Delete a profile field group * - * @since BuddyPress (1.1.0) + * @since 1.1.0 + * + * @global object $wpdb * - * @global object $wpdb * @return boolean */ public function delete() { global $wpdb; - // Bail if field group cannot be deleted + // Bail if field group cannot be deleted. if ( empty( $this->can_delete ) ) { return false; } @@ -181,9 +191,9 @@ class BP_XProfile_Group { /** * Fires before the current group instance gets deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference. + * @param BP_XProfile_Group $this Current instance of the group being deleted. Passed by reference. */ do_action_ref_array( 'xprofile_group_before_delete', array( &$this ) ); @@ -191,7 +201,7 @@ class BP_XProfile_Group { $sql = $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_groups} WHERE id = %d", $this->id ); $deleted = $wpdb->query( $sql ); - // Delete field group + // Delete field group. if ( empty( $deleted ) || is_wp_error( $deleted ) ) { return false; } @@ -199,7 +209,7 @@ class BP_XProfile_Group { // Remove the group's fields. if ( BP_XProfile_Field::delete_for_group( $this->id ) ) { - // Remove profile data for the groups fields + // 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 ); } @@ -208,9 +218,9 @@ class BP_XProfile_Group { /** * Fires after the current group instance gets deleted. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * - * @param BP_XProfile_Group Current instance of the group being deleted. Passed by reference. + * @param BP_XProfile_Group $this Current instance of the group being deleted. Passed by reference. */ do_action_ref_array( 'xprofile_group_after_delete', array( &$this ) ); @@ -223,40 +233,39 @@ class BP_XProfile_Group { * Populates the BP_XProfile_Group object with profile field groups, fields, * and field data * - * @package BuddyPress XProfile - * - * @global $wpdb WordPress DB access object. + * @global object $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. + * 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 array|string $member_type Limit fields by those restricted to a given member type, or array of + * member types. If `$user_id` is provided, the value of `$member_type` + * will be overridden by the member types of the provided user. The + * special value of 'any' will return only those fields that are + * unrestricted by member type - i.e., those applicable to any type. + * @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 + // Parse arguments. $r = wp_parse_args( $args, array( 'profile_group_id' => false, 'user_id' => bp_displayed_user_id(), + 'member_type' => false, 'hide_empty_groups' => false, 'hide_empty_fields' => false, 'fetch_fields' => false, @@ -267,14 +276,14 @@ class BP_XProfile_Group { 'update_meta_cache' => true, ) ); - // Keep track of object IDs for cache-priming + // Keep track of object IDs for cache-priming. $object_ids = array( 'group' => array(), 'field' => array(), 'data' => array(), ); - // WHERE + // WHERE. if ( ! empty( $r['profile_group_id'] ) ) { $where_sql = $wpdb->prepare( 'WHERE g.id = %d', $r['profile_group_id'] ); } elseif ( $r['exclude_groups'] ) { @@ -286,84 +295,127 @@ class BP_XProfile_Group { $bp = buddypress(); - // Include or exclude empty groups + // 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 + // Get all group data. $groups = self::get_group_data( $group_ids ); - // Bail if not also getting fields + // Bail if not also getting fields. if ( empty( $r['fetch_fields'] ) ) { return $groups; } - // Get the group ids from the groups we found + // Get the group ids from the groups we found. $group_ids = wp_list_pluck( $groups, 'id' ); - // Store for meta cache priming + // Store for meta cache priming. $object_ids['group'] = $group_ids; - // Bail if no groups foundS + // Bail if no groups found. if ( empty( $group_ids ) ) { return $groups; } - // Setup IN query from group IDs + // Setup IN query from group IDs. $group_ids_in = implode( ',', (array) $group_ids ); - // Support arrays and comma-separated strings + // 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() + // 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 + // Set up NOT IN query for excluded 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' ); + // Set up IN query for included field IDs. + $include_field_ids = array(); + + // Member-type restrictions. + if ( bp_get_member_types() ) { + if ( $r['user_id'] || false !== $r['member_type'] ) { + $member_types = $r['member_type']; + if ( $r['user_id'] ) { + $member_types = bp_get_member_type( $r['user_id'], false ); + if ( empty( $member_types ) ) { + $member_types = array( 'null' ); + } + } - // Store field IDs for meta cache priming - $object_ids['field'] = $field_ids; + $member_types_fields = BP_XProfile_Field::get_fields_for_member_type( $member_types ); + $include_field_ids += array_keys( $member_types_fields ); + } + } + + $in_sql = ''; + if ( ! empty( $include_field_ids ) ) { + $include_field_ids_cs = implode( ',', array_map( 'intval', $include_field_ids ) ); + $in_sql = " AND id IN ({$include_field_ids_cs}) "; + } - // Bail if no fields - if ( empty( $fields ) ) { + // Fetch the fields. + $field_ids = $wpdb->get_col( "SELECT id FROM {$bp->profile->table_name_fields} WHERE group_id IN ( {$group_ids_in} ) AND parent_id = 0 {$exclude_fields_sql} {$in_sql} ORDER BY field_order" ); + + // Bail if no fields. + if ( empty( $field_ids ) ) { return $groups; } - // Maybe fetch field data + $field_ids = array_map( 'intval', $field_ids ); + + // Prime the field cache. + $uncached_field_ids = bp_get_non_cached_ids( $field_ids, 'bp_xprofile_fields' ); + if ( ! empty( $uncached_field_ids ) ) { + $_uncached_field_ids = implode( ',', array_map( 'intval', $uncached_field_ids ) ); + $uncached_fields = $wpdb->get_results( "SELECT * FROM {$bp->profile->table_name_fields} WHERE id IN ({$_uncached_field_ids})" ); + foreach ( $uncached_fields as $uncached_field ) { + $fid = intval( $uncached_field->id ); + wp_cache_set( $fid, $uncached_field, 'bp_xprofile_fields' ); + } + } + + // Pull field objects from the cache. + $fields = array(); + foreach ( $field_ids as $field_id ) { + $fields[] = xprofile_get_field( $field_id ); + } + + // Store field IDs for meta cache priming. + $object_ids['field'] = $field_ids; + + // Maybe fetch field data. if ( ! empty( $r['fetch_field_data'] ) ) { - // Get field data for user ID + // 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 + // 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 + // 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 + // 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 + // Fields that have data get removed from the list. unset( $field_ids[ $key ] ); } } @@ -375,48 +427,48 @@ class BP_XProfile_Group { } } - // Reset indexes + // Reset indexes. $fields = array_values( $fields ); } - // Field data was found + // Field data was found. if ( ! empty( $fields ) && ! empty( $field_data ) && ! is_wp_error( $field_data ) ) { - // Loop through fields + // Loop through fields. foreach( (array) $fields as $field_key => $field ) { - // Loop through the data in each field + // Loop through the data in each field. foreach( (array) $field_data as $data ) { - // Assign correct data value to the field + // 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 + // Store for meta cache priming. $object_ids['data'][] = $data->id; } } } } - // Prime the meta cache, if necessary + // Prime the meta cache, if necessary. if ( ! empty( $r['update_meta_cache'] ) ) { bp_xprofile_update_meta_cache( $object_ids ); } - // Maybe fetch visibility levels + // 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 + // 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 + // fresh one each time through the loop. $index = array_search( $group, $groups ); foreach( (array) $fields as $field ) { @@ -431,7 +483,7 @@ class BP_XProfile_Group { unset( $groups[ $index ] ); } - // Reset indexes + // Reset indexes. $groups = array_values( $groups ); } @@ -441,7 +493,7 @@ class BP_XProfile_Group { /** * Get data about a set of groups, based on IDs. * - * @since BuddyPress (2.0.0) + * @since 2.0.0 * * @param array $group_ids Array of IDs. * @return array @@ -449,68 +501,68 @@ class BP_XProfile_Group { protected static function get_group_data( $group_ids ) { global $wpdb; - // Bail if no group IDs are passed + // Bail if no group IDs are passed. if ( empty( $group_ids ) ) { return array(); } - // Setup empty arrays + // Setup empty arrays. $groups = array(); $uncached_gids = array(); - // Loop through groups and look for cached & uncached data + // Loop through groups and look for cached & uncached data. foreach ( $group_ids as $group_id ) { - // If cached data is found, use it + // 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 + // Otherwise leave a placeholder so we don't lose the order. } else { $groups[ $group_id ] = ''; - // Add to the list of items to be queried + // Add to the list of items to be queried. $uncached_gids[] = $group_id; } } - // Fetch uncached data from the DB if necessary + // Fetch uncached data from the DB if necessary. if ( ! empty( $uncached_gids ) ) { - // Setup IN query for uncached group data + // Setup IN query for uncached group data. $uncached_gids_sql = implode( ',', wp_parse_id_list( $uncached_gids ) ); - // Get table name to query + // Get table name to query. $table_name = buddypress()->profile->table_name_groups; - // Fetch data, preserving order + // 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 + // 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 + // and add it to the cache. foreach ( (array) $queried_gdata as $gdata ) { - // Add group to groups array + // Add group to groups array. $groups[ $gdata->id ] = $gdata; - // Cache previously uncached group data + // Cache previously uncached group data. wp_cache_set( $gdata->id, $gdata, 'bp_xprofile_groups' ); } } } - // Reset indexes & return + // Reset indexes & return. return array_values( $groups ); } /** - * Validate field group when form submitted + * Validate field group when form submitted. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global string $message * @@ -519,7 +571,7 @@ class BP_XProfile_Group { public static function admin_validate() { global $message; - // Validate Form + // Validate Form. if ( empty( $_POST['group_name'] ) ) { $message = __( 'Please make sure you give the group a name.', 'buddypress' ); return false; @@ -529,14 +581,14 @@ class BP_XProfile_Group { } /** - * Update field group position + * Update field group position. * - * @since BuddyPress (1.5.0) + * @since 1.5.0 * * @global $wpdb $wpdb - * @param int $field_group_id - * @param int $position * + * @param int $field_group_id ID of the group the field belongs to. + * @param int $position Field group position. * @return boolean */ public static function update_position( $field_group_id, $position ) { @@ -546,7 +598,7 @@ class BP_XProfile_Group { return false; } - // Purge profile field group cache + // Purge profile field group cache. wp_cache_delete( 'all', 'bp_xprofile_groups' ); $bp = buddypress(); @@ -555,17 +607,17 @@ class BP_XProfile_Group { } /** - * Fetch the field visibility level for the fields returned by the query + * Fetch the field visibility level for the fields returned by the query. * - * @since BuddyPress (1.6.0) + * @since 1.6.0 * - * @param int $user_id The profile owner's user_id - * @param array $fields The database results returned by the get() query + * @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 + // 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 ) { @@ -574,18 +626,18 @@ class BP_XProfile_Group { $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 + // 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 + // 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) + * @since 1.6.0 * * @param string $value Default visibility value. */ @@ -603,11 +655,12 @@ class BP_XProfile_Group { /** * Fetch the admin-set preferences for all fields. * - * @since BuddyPress (1.6.0) + * @since 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) + * @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; @@ -619,7 +672,7 @@ class BP_XProfile_Group { $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 + // 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 ) { @@ -641,22 +694,22 @@ class BP_XProfile_Group { /** Admin Output **********************************************************/ /** - * Output the admin area field group form + * Output the admin area field group form. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @global string $message */ public function render_admin_form() { global $message; - // New field group + // 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 + // 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' ); @@ -665,9 +718,7 @@ class BP_XProfile_Group { <div class="wrap"> - <?php screen_icon( 'users' ); ?> - - <h2><?php echo esc_html( $title ); ?></h2> + <h1><?php echo esc_html( $title ); ?></h1> <?php if ( ! empty( $message ) ) : ?> @@ -688,8 +739,9 @@ class BP_XProfile_Group { </div> </div> <div class="postbox"> - <h3><?php _e( 'Field Group Description', 'buddypress' ); ?></h3> + <h2><?php esc_html_e( 'Field Group Description', 'buddypress' ); ?></h2> <div class="inside"> + <label for="group_description" class="screen-reader-text"><?php esc_html_e( 'Add description', 'buddypress' ); ?></label> <textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea> </div> </div> @@ -702,14 +754,14 @@ class BP_XProfile_Group { /** * Fires before XProfile Group submit metabox. * - * @since BuddyPress (2.1.0) + * @since 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> + <h2><?php _e( 'Submit', 'buddypress' ); ?></h2> <div class="inside"> <div id="submitcomment" class="submitbox"> <div id="major-publishing-actions"> @@ -719,7 +771,7 @@ class BP_XProfile_Group { /** * Fires at the beginning of the XProfile Group publishing actions section. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param BP_XProfile_Group $this Current XProfile group. */ @@ -743,7 +795,7 @@ class BP_XProfile_Group { /** * Fires after XProfile Group submit metabox. * - * @since BuddyPress (2.1.0) + * @since 2.1.0 * * @param BP_XProfile_Group $this Current XProfile group. */ 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 index 0bfa17e760a349c4282d51ae85614b42d64f55cf..a802932f96d04db6071ab34440a8ab5eb9690b3f 100644 --- 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 @@ -1,13 +1,13 @@ <?php - /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.3.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; /** @@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit; * metadata, by generating `JOIN` and `WHERE` subclauses to be attached * to the primary SQL query string. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 */ class BP_XProfile_Meta_Query extends WP_Meta_Query { @@ -29,10 +29,10 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { * 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 + * @since 2.3.0 * * @param array $query Meta query arguments. + * * @return bool Whether the query clause is a first-order clause. */ protected function is_first_order_clause( $query ) { @@ -42,10 +42,9 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { /** * Constructs a meta query based on 'meta_*' query vars * - * @since BuddyPress (2.3.0) - * @access public + * @since 2.3.0 * - * @param array $qv The query variables + * @param array $qv The query variables. */ public function parse_query_vars( $qv ) { $meta_query = array(); @@ -68,7 +67,7 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { $primary_meta_query['value'] = $qv['meta_value']; } - // BP_XProfile_Query sets 'object_type' = '' by default + // 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' ]; } @@ -95,13 +94,13 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { /** * Generates SQL clauses to be appended to a main query. * - * @since BuddyPress (2.3.0) - * @access public + * @since 2.3.0 + * + * @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|null $context Optional. The main query object. * - * @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. * @@ -133,7 +132,7 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { /** * Filter the meta query's generated SQL. * - * @since BuddyPress (2.3.0) + * @since 2.3.0 * * @param array $args { * An array of meta query SQL arguments. @@ -154,13 +153,13 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { * * "First-order" means that it's an array with a 'key' or 'value'. * - * @since BuddyPress (2.3.0) - * @access public + * @since 2.3.0 * * @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. * @@ -246,8 +245,7 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { $this->clauses[ $clause_key ] =& $clause; // Next, build the WHERE clause. - - // meta_key. + // Meta_key. if ( array_key_exists( 'key', $clause ) ) { if ( 'NOT EXISTS' === $meta_compare ) { $sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL'; @@ -256,7 +254,7 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { } } - // meta_value. + // Meta_value. if ( array_key_exists( 'value', $clause ) ) { $meta_value = $clause['value']; @@ -309,7 +307,7 @@ class BP_XProfile_Meta_Query extends WP_Meta_Query { } } - // object_type. + // Object_type. if ( array_key_exists( 'object', $clause ) ) { $object_type = $clause['object']; 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 index 7f335ab2dbfe65af1d3d58b249f7ac2aa53c23af..7f46cd411cb079920aab3d9cd550b52e0081c31c 100644 --- 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 @@ -1,28 +1,76 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 1.0.0 */ -// Exit if accessed directly +// Exit if accessed directly. defined( 'ABSPATH' ) || exit; +/** + * Class for XProfile Profile Data setup. + * + * @since 1.6.0 + */ class BP_XProfile_ProfileData { + + /** + * XProfile ID. + * + * @var int $id + */ public $id; + + /** + * User ID. + * + * @var int $user_id + */ public $user_id; + + /** + * XProfile field ID. + * + * @var int $field_id + */ public $field_id; + + /** + * XProfile field value. + * + * @var string $value + */ public $value; + + /** + * XProfile field last updated time. + * + * @var string $last_updated + */ public $last_updated; + /** + * BP_XProfile_ProfileData constructor. + * + * @param null $field_id Field ID to instantiate. + * @param null $user_id User ID to instantiate for. + */ 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 ) { + /** + * Populates the XProfile profile data. + * + * @param int $field_id Field ID to populate. + * @param int $user_id User ID to populate for. + */ + public function populate( $field_id, $user_id ) { global $wpdb; $cache_key = "{$user_id}:{$field_id}"; @@ -47,7 +95,7 @@ class BP_XProfile_ProfileData { $this->last_updated = $profiledata->last_updated; } else { - // When no row is found, we'll need to set these properties manually + // When no row is found, we'll need to set these properties manually. $this->field_id = $field_id; $this->user_id = $user_id; } @@ -63,7 +111,7 @@ class BP_XProfile_ProfileData { public function exists() { global $wpdb; - // Check cache first + // Check cache first. $cache_key = "{$this->user_id}:{$this->field_id}"; $cached = wp_cache_get( $cache_key, 'bp_xprofile_data' ); @@ -77,7 +125,7 @@ class BP_XProfile_ProfileData { /** * Filters whether or not data already exists for the user. * - * @since BuddyPress (1.2.7) + * @since 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. @@ -99,9 +147,9 @@ class BP_XProfile_ProfileData { $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 + * Filters whether or not data is for a valid field. * - * @since BuddyPress (1.2.7) + * @since 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. @@ -109,6 +157,11 @@ class BP_XProfile_ProfileData { return apply_filters_ref_array( 'xprofile_data_is_valid_field', array( (bool)$retval, $this ) ); } + /** + * Save the data for the XProfile field. + * + * @return bool + */ public function save() { global $wpdb; @@ -124,7 +177,7 @@ class BP_XProfile_ProfileData { * * Please use this hook to filter the properties above. Each part will be passed in. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved. */ @@ -150,7 +203,7 @@ class BP_XProfile_ProfileData { /** * Fires after the current profile data instance gets saved. * - * @since BuddyPress (1.0.0) + * @since 1.0.0 * * @param BP_XProfile_ProfileData $this Current instance of the profile data being saved. */ @@ -163,7 +216,7 @@ class BP_XProfile_ProfileData { } /** - * Delete specific XProfile field data + * Delete specific XProfile field data. * * @global object $wpdb * @return boolean @@ -176,7 +229,7 @@ class BP_XProfile_ProfileData { /** * Fires before the current profile data instance gets deleted. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted. */ @@ -190,7 +243,7 @@ class BP_XProfile_ProfileData { /** * Fires after the current profile data instance gets deleted. * - * @since BuddyPress (1.9.0) + * @since 1.9.0 * * @param BP_XProfile_ProfileData $this Current instance of the profile data being deleted. */ @@ -204,8 +257,8 @@ class BP_XProfile_ProfileData { /** * Get a user's profile data for a set of fields. * - * @param int $user_id - * @param array $field_ids + * @param int $user_id ID of user whose data is being queried. + * @param array $field_ids Array of field IDs to query for. * @return array */ public static function get_data_for_user( $user_id, $field_ids ) { @@ -215,13 +268,13 @@ class BP_XProfile_ProfileData { $uncached_field_ids = bp_xprofile_get_non_cached_field_ids( $user_id, $field_ids ); - // Prime the cache + // 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 + // Rekey. $queried_data = array(); foreach ( $uncached_data as $ud ) { $d = new stdClass; @@ -234,17 +287,17 @@ class BP_XProfile_ProfileData { $queried_data[ $ud->field_id ] = $d; } - // Set caches + // Set caches. foreach ( $uncached_field_ids as $field_id ) { $cache_key = "{$user_id}:{$field_id}"; - // If a value was found, cache it + // 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 + // to avoid future cache misses. } else { $d = new stdClass; $d->id = ''; @@ -258,7 +311,7 @@ class BP_XProfile_ProfileData { } } - // Now that all items are cached, fetch them + // 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' ); @@ -315,8 +368,8 @@ class BP_XProfile_ProfileData { /** * Get the user's field data id by the id of the xprofile field. * - * @param int $field_id - * @param int $user_id + * @param int $field_id Field ID being queried for. + * @param int $user_id User ID associated with field. * @return int $fielddata_id */ public static function get_fielddataid_byid( $field_id, $user_id ) { @@ -327,7 +380,7 @@ class BP_XProfile_ProfileData { } else { $bp = buddypress(); - // Check cache first + // Check cache first. $cache_key = "{$user_id}:{$field_id}"; $fielddata = wp_cache_get( $cache_key, 'bp_xprofile_data' ); if ( false === $fielddata || empty( $fielddata->id ) ) { @@ -345,10 +398,10 @@ class BP_XProfile_ProfileData { * * Supports multiple user IDs. * - * @param int $field_id ID of the field. - * @param int|array $user_ids ID or IDs of user(s). + * @param int $field_id ID of the field. + * @param int|array|null $user_ids ID or IDs of user(s). * @return string|array Single value if a single user is queried, - * otherwise an array of results. + * otherwise an array of results. */ public static function get_value_byid( $field_id, $user_ids = null ) { global $wpdb; @@ -363,7 +416,7 @@ class BP_XProfile_ProfileData { $is_single = true; } - // Assemble uncached IDs + // Assemble uncached IDs. $uncached_ids = array(); foreach ( $user_ids as $user_id ) { $cache_key = "{$user_id}:{$field_id}"; @@ -372,25 +425,25 @@ class BP_XProfile_ProfileData { } } - // Prime caches + // 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 + // Rekey. $qd = array(); foreach ( $queried_data as $data ) { $qd[ $data->user_id ] = $data; } foreach ( $uncached_ids as $id ) { - // The value was successfully fetched + // 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 + // avoid cache misses and PHP notices. } else { $d = new stdClass; $d->id = ''; @@ -405,23 +458,30 @@ class BP_XProfile_ProfileData { } } - // Now that the cache is primed with all data, fetch it + // 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 a single ID was passed, just return the value. if ( $is_single ) { return $data[0]->value; - // Otherwise return the whole array + // Otherwise return the whole array. } else { return $data; } } + /** + * Get profile field values by field name and user ID. + * + * @param array|string $fields Field(s) to get. + * @param int|null $user_id User ID to get field data for. + * @return array|bool + */ public static function get_value_byfieldname( $fields, $user_id = null ) { global $wpdb; @@ -477,6 +537,12 @@ class BP_XProfile_ProfileData { return $new_values; } + /** + * Delete field. + * + * @param int $field_id ID of the field to delete. + * @return bool + */ public static function delete_for_field( $field_id ) { global $wpdb; @@ -489,6 +555,12 @@ class BP_XProfile_ProfileData { return true; } + /** + * Get time for last XProfile field data update by user. + * + * @param int $user_id User ID to get time for. + * @return null|string + */ public static function get_last_updated( $user_id ) { global $wpdb; @@ -499,6 +571,12 @@ class BP_XProfile_ProfileData { return $last_updated; } + /** + * Delete all data for provided user ID. + * + * @param int $user_id User ID to remove data for. + * @return false|int + */ public static function delete_data_for_user( $user_id ) { global $wpdb; @@ -507,6 +585,13 @@ class BP_XProfile_ProfileData { return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_data} WHERE user_id = %d", $user_id ) ); } + /** + * Get random field type by user ID. + * + * @param int $user_id User ID to query for. + * @param string $exclude_fullname SQL portion used to exclude by field ID. + * @return array|null|object + */ public static function get_random( $user_id, $exclude_fullname ) { global $wpdb; @@ -517,6 +602,12 @@ class BP_XProfile_ProfileData { 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 ) ); } + /** + * Get fullname for provided user ID. + * + * @param int $user_id ID of the user to query. + * @return mixed + */ public static function get_fullname( $user_id = 0 ) { if ( empty( $user_id ) ) { @@ -525,4 +616,4 @@ class BP_XProfile_ProfileData { 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 index 0e72668e95beb0d11d0fbaf5e09e16fdbffe3aed..1807d15bc1985d1952bde8bd4fba434160fbc4c8 100644 --- 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 @@ -1,63 +1,60 @@ <?php /** - * BuddyPress XProfile Classes + * BuddyPress XProfile Classes. * * @package BuddyPress * @subpackage XProfileClasses + * @since 2.2.0 */ -// Exit if accessed directly +// 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) + * @since 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 + * @since 2.2.0 + * @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 + * @since 2.2.0 + * @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 + * @since 2.2.0 + * @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 + * @since 2.2.0 + * @var array */ protected $table_aliases = array(); /** * Constructor. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * * @param array $xprofile_query { * Array of xprofile query clauses. @@ -92,10 +89,9 @@ class BP_XProfile_Query { * * Eliminates empty items and ensures that a 'relation' is set. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * - * @param array $queries Array of query clauses. + * @param array $queries Array of query clauses. * @return array Sanitized array of query clauses. */ public function sanitize_query( $queries ) { @@ -159,8 +155,7 @@ class BP_XProfile_Query { * * A first-order query clause is one that has either a 'key' or a 'value' array key. * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 * * @param array $query XProfile query arguments. * @return bool Whether the query clause is a first-order clause. @@ -172,10 +167,9 @@ class BP_XProfile_Query { /** * Return the appropriate alias for the given field type if applicable. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * - * @param string $type MySQL type to cast `value`. + * @param string $type MySQL type to cast `value`. * @return string MySQL type. */ public function get_cast_for_type( $type = '' ) { @@ -202,8 +196,7 @@ class BP_XProfile_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 + * @since 2.2.0 * * @return array { * Array containing JOIN and WHERE SQL clauses to append to the main query. @@ -232,10 +225,9 @@ class BP_XProfile_Query { * * If nested subqueries are found, this method recurses the tree to produce the properly nested SQL. * - * @since BuddyPress (2.2.0) - * @access protected + * @since 2.2.0 * - * @param array $query Query to parse. + * @param array $query Query to parse. Passed by reference. * @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. @@ -313,8 +305,7 @@ class BP_XProfile_Query { /** * Generates SQL clauses to be appended to a main query. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * * @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. @@ -348,8 +339,7 @@ class BP_XProfile_Query { * * "First-order" means that it's an array with a 'field' or 'value'. * - * @since BuddyPress (2.2.0) - * @access public + * @since 2.2.0 * * @param array $clause Query clause. * @param array $parent_query Parent query array. @@ -421,7 +411,7 @@ class BP_XProfile_Query { // Next, build the WHERE clause. $where = ''; - // field_id. + // Field_id. if ( array_key_exists( 'field', $clause ) ) { // Convert field name to ID if necessary. if ( ! is_numeric( $clause['field'] ) ) { @@ -436,7 +426,7 @@ class BP_XProfile_Query { } } - // value. + // Value. if ( array_key_exists( 'value', $clause ) ) { $field_value = $clause['value']; $field_type = $this->get_cast_for_type( isset( $clause['type'] ) ? $clause['type'] : '' ); @@ -498,11 +488,10 @@ class BP_XProfile_Query { * 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 + * @since 2.2.0 * - * @param array $clause Query clause. - * @param array $parent_query Parent query of $clause. + * @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 ) { diff --git a/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-user-admin.php b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-user-admin.php new file mode 100644 index 0000000000000000000000000000000000000000..18269bb53084ae549a3efe98a11c34efc3108bb0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-user-admin.php @@ -0,0 +1,479 @@ +<?php +/** + * BuddyPress XProfile Admin Class. + * + * @package BuddyPress + * @since 2.0.0 + */ + +// Exit if accessed directly. +defined( 'ABSPATH' ) || exit; + +if ( ! class_exists( 'BP_XProfile_User_Admin' ) ) : + +/** + * Load xProfile Profile admin area. + * + * @since 2.0.0 + */ +class BP_XProfile_User_Admin { + + /** + * Setup xProfile User Admin. + * + * @since 2.0.0 + * + * @uses buddypress() to get BuddyPress main instance. + */ + public static function register_xprofile_user_admin() { + + // Bail if not in admin. + if ( ! is_admin() ) { + return; + } + + $bp = buddypress(); + + if ( empty( $bp->profile->admin ) ) { + $bp->profile->admin = new self; + } + + return $bp->profile->admin; + } + + /** + * Constructor method. + * + * @since 2.0.0 + */ + public function __construct() { + $this->setup_actions(); + } + + /** + * Set admin-related actions and filters. + * + * @since 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 ); + + // Saves the profile actions for user ( avatar, profile fields ). + add_action( 'bp_members_admin_update_user', array( $this, 'user_admin_load' ), 10, 4 ); + } + + /** + * Enqueue needed scripts. + * + * @since 2.3.0 + * + * @param int $screen_id Screen ID being displayed. + */ + 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. + * + * @since 2.0.0 + * + * @param int $user_id ID of the user being edited. + * @param string $screen_id Screen ID to load the metabox in. + * @param object|null $stats_metabox Context and priority for the stats metabox. + */ + public function register_metaboxes( $user_id = 0, $screen_id = '', $stats_metabox = null ) { + + // Set the screen ID if none was passed. + if ( empty( $screen_id ) ) { + $screen_id = buddypress()->members->admin->user_page; + } + + // Setup a new metabox class if none was passed. + if ( empty( $stats_metabox ) ) { + $stats_metabox = new StdClass(); + } + + // Moving the Stats Metabox. + $stats_metabox->context = 'side'; + $stats_metabox->priority = 'low'; + + // Each Group of fields will have his own metabox. + $profile_args = array( + 'fetch_fields' => false, + 'user_id' => $user_id, + ); + + if ( ! bp_is_user_spammer( $user_id ) && bp_has_profile( $profile_args ) ) { + + // Loop through field groups and add a metabox for each one. + while ( bp_profile_groups() ) : bp_the_profile_group(); + add_meta_box( + 'bp_xprofile_user_admin_fields_' . sanitize_key( bp_get_the_profile_group_slug() ), + esc_html( bp_get_the_profile_group_name() ), + array( $this, 'user_admin_profile_metaboxes' ), + $screen_id, + 'normal', + 'core', + array( 'profile_group_id' => absint( bp_get_the_profile_group_id() ) ) + ); + endwhile; + + // If member is already a spammer, show a generic metabox. + } else { + add_meta_box( + 'bp_xprofile_user_admin_empty_profile', + _x( 'User marked as a spammer', 'xprofile user-admin edit screen', 'buddypress' ), + array( $this, 'user_admin_spammer_metabox' ), + $screen_id, + 'normal', + 'core' + ); + } + + 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' + ); + } + } + + /** + * Save the profile fields in Members community profile page. + * + * Loaded before the page is rendered, this function is processing form + * requests. + * + * @since 2.0.0 + * + * @param string $doaction Action being run. + * @param int $user_id ID for the user whose profile is being saved. + * @param array $request Request being made. + * @param string $redirect_to Where to redirect user to. + */ + public function user_admin_load( $doaction = '', $user_id = 0, $request = array(), $redirect_to = '' ) { + + // Eventually delete avatar. + if ( 'delete_avatar' === $doaction ) { + + check_admin_referer( 'delete_avatar' ); + + $redirect_to = remove_query_arg( '_wpnonce', $redirect_to ); + + if ( bp_core_delete_existing_avatar( array( 'item_id' => $user_id ) ) ) { + $redirect_to = add_query_arg( 'updated', 'avatar', $redirect_to ); + } else { + $redirect_to = add_query_arg( 'error', 'avatar', $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + + // Update profile fields. + } elseif ( isset( $_POST['field_ids'] ) ) { + + // Check the nonce. + check_admin_referer( 'edit-bp-profile_' . $user_id ); + + // Check we have field ID's. + if ( empty( $_POST['field_ids'] ) ) { + $redirect_to = add_query_arg( 'error', '1', $redirect_to ); + bp_core_redirect( $redirect_to ); + } + + /** + * Unlike front-end edit-fields screens, the wp-admin/profile + * displays all groups of fields on a single page, so the list of + * field ids is an array gathering for each group of fields a + * distinct comma separated list of ids. + * + * As a result, before using the wp_parse_id_list() function, we + * must ensure that these ids are "merged" into a single comma + * separated list. + */ + $merge_ids = join( ',', $_POST['field_ids'] ); + + // Explode the posted field IDs into an array so we know which fields have been submitted. + $posted_field_ids = wp_parse_id_list( $merge_ids ); + $is_required = array(); + + // Loop through the posted fields formatting any datebox values then validate the field. + foreach ( (array) $posted_field_ids as $field_id ) { + if ( ! isset( $_POST['field_' . $field_id ] ) ) { + if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { + + // Concatenate the values. + $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; + + // Turn the concatenated value into a timestamp. + $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); + } + } + + $is_required[ $field_id ] = xprofile_check_is_required_field( $field_id ) && ! bp_current_user_can( 'bp_moderate' ); + if ( $is_required[ $field_id ] && empty( $_POST['field_' . $field_id ] ) ) { + $redirect_to = add_query_arg( 'error', '2', $redirect_to ); + bp_core_redirect( $redirect_to ); + } + } + + // Set the errors var. + $errors = false; + + // 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. + $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 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 ); + } + + // Save the visibility level. + $visibility_level = ! empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public'; + xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); + } + + /** + * Fires after all of the profile fields have been saved. + * + * @since 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. + if ( ! empty( $errors ) ) { + $redirect_to = add_query_arg( 'error', '3', $redirect_to ); + } else { + $redirect_to = add_query_arg( 'updated', '1', $redirect_to ); + } + + bp_core_redirect( $redirect_to ); + } + } + + /** + * Render the xprofile metabox for Community Profile screen. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + * @param array $args Aray of arguments for metaboxes. + */ + public function user_admin_profile_metaboxes( $user = null, $args = array() ) { + + // Bail if no user ID. + if ( empty( $user->ID ) ) { + return; + } + + $r = bp_parse_args( $args['args'], array( + 'profile_group_id' => 0, + 'user_id' => $user->ID + ), 'bp_xprofile_user_admin_profile_loop_args' ); + + // We really need these args. + if ( empty( $r['profile_group_id'] ) || empty( $r['user_id'] ) ) { + return; + } + + // Bail if no profile fields are available. + if ( ! bp_has_profile( $r ) ) { + return; + } + + // Loop through profile groups & fields. + while ( bp_profile_groups() ) : bp_the_profile_group(); ?> + + <input type="hidden" name="field_ids[]" id="<?php echo esc_attr( 'field_ids_' . bp_get_the_profile_group_slug() ); ?>" value="<?php echo esc_attr( bp_get_the_profile_group_field_ids() ); ?>" /> + + <?php if ( bp_get_the_profile_group_description() ) : ?> + + <p class="description"><?php bp_the_profile_group_description(); ?></p> + + <?php endif; ?> + + <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> + + <div<?php bp_field_css_class( 'bp-profile-field' ); ?>> + + <?php + + $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); + $field_type->edit_field_html( array( 'user_id' => $r['user_id'] ) ); + + if ( bp_get_the_profile_field_description() ) : ?> + + <p class="description"><?php bp_the_profile_field_description(); ?></p> + + <?php endif; + + /** + * Fires before display of visibility form elements for profile metaboxes. + * + * @since 1.7.0 + */ + do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); + + $can_change_visibility = bp_current_user_can( 'bp_xprofile_change_field_visibility' ); ?> + + <p class="field-visibility-settings-<?php echo $can_change_visibility ? 'toggle' : 'notoggle'; ?>" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id(); ?>"> + + <?php + printf( + __( 'This field can be seen by: %s', 'buddypress' ), + '<span class="current-visibility-level">' . bp_get_the_profile_field_visibility_level_label() . '</span>' + ); + ?> + + <?php if ( $can_change_visibility ) : ?> + + <a href="#" class="button visibility-toggle-link"><?php esc_html_e( 'Change', 'buddypress' ); ?></a> + + <?php endif; ?> + </p> + + <?php if ( $can_change_visibility ) : ?> + + <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> + <fieldset> + <legend><?php _e( 'Who can see this field?', 'buddypress' ); ?></legend> + + <?php bp_profile_visibility_radio_buttons(); ?> + + </fieldset> + <a class="button field-visibility-settings-close" href="#"><?php esc_html_e( 'Close', 'buddypress' ); ?></a> + </div> + + <?php endif; ?> + + <?php + + /** + * Fires at end of custom profile field items on your xprofile screen tab. + * + * @since 1.1.0 + */ + do_action( 'bp_custom_profile_edit_fields' ); ?> + + </div> + + <?php endwhile; // End bp_profile_fields(). ?> + + <?php endwhile; // End bp_profile_groups. + } + + /** + * Render the fallback metabox in case a user has been marked as a spammer. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + */ + public function user_admin_spammer_metabox( $user = null ) { + ?> + <p><?php printf( __( '%s has been marked as a spammer. All BuddyPress data associated with the user has been removed', 'buddypress' ), esc_html( bp_core_get_user_displayname( $user->ID ) ) ) ;?></p> + <?php + } + + /** + * Render the Avatar metabox to moderate inappropriate images. + * + * @since 2.0.0 + * + * @param WP_User|null $user The WP_User object for the user being edited. + */ + public function user_admin_avatar_metabox( $user = null ) { + + if ( empty( $user->ID ) ) { + return; + } ?> + + <div class="avatar"> + + <?php echo bp_core_fetch_avatar( array( + 'item_id' => $user->ID, + 'object' => 'user', + 'type' => 'full', + 'title' => $user->display_name + ) ); ?> + + <?php if ( bp_get_user_has_avatar( $user->ID ) ) : + + $query_args = array( + 'user_id' => $user->ID, + 'action' => 'delete_avatar' + ); + + if ( ! empty( $_REQUEST['wp_http_referer'] ) ) { + $query_args['wp_http_referer'] = urlencode( wp_unslash( $_REQUEST['wp_http_referer'] ) ); + } + + $community_url = add_query_arg( $query_args, buddypress()->members->admin->edit_profile_url ); + $delete_link = wp_nonce_url( $community_url, 'delete_avatar' ); ?> + + <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> + + <?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> + <?php + } + +} +endif; // End class_exists check. diff --git a/wp-content/plugins/buddypress/buddypress.pot b/wp-content/plugins/buddypress/buddypress.pot index 6c29d503674dc6c671e747481a62d01d4b68bbbf..ddb00867063c77658a7203deca39cc8ce632a0ba 100644 --- a/wp-content/plugins/buddypress/buddypress.pot +++ b/wp-content/plugins/buddypress/buddypress.pot @@ -1,83 +1,83 @@ -# Copyright (C) 2015 The BuddyPress Community +# Copyright (C) 2016 The BuddyPress Community # This file is distributed under the GPLv2 or later (license.txt). msgid "" msgstr "" -"Project-Id-Version: BuddyPress 2.3.5\n" +"Project-Id-Version: BuddyPress 2.5.3\n" "Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org\n" -"POT-Creation-Date: 2015-11-11 05:23:04+00:00\n" +"POT-Creation-Date: 2016-05-24 17:17:48+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2016-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.5.3\n" +"X-Generator: grunt-wp-i18n 0.5.4\n" -#: bp-activity/bp-activity-actions.php:175 +#: bp-activity/bp-activity-actions.php:174 msgid "Activity deleted successfully" msgstr "" -#: bp-activity/bp-activity-actions.php:177 +#: bp-activity/bp-activity-actions.php:176 msgid "There was an error when deleting that activity" msgstr "" -#: bp-activity/bp-activity-actions.php:247 +#: bp-activity/bp-activity-actions.php:245 msgid "The activity item has been marked as spam and is no longer visible." msgstr "" -#: bp-activity/bp-activity-actions.php:332 +#: bp-activity/bp-activity-actions.php:330 #: bp-templates/bp-legacy/buddypress-functions.php:925 msgid "Please enter some content to post." msgstr "" -#: bp-activity/bp-activity-actions.php:362 +#: bp-activity/bp-activity-actions.php:360 msgid "Update Posted!" msgstr "" -#: bp-activity/bp-activity-actions.php:364 +#: bp-activity/bp-activity-actions.php:362 msgid "There was an error when posting your update. Please try again." msgstr "" -#: bp-activity/bp-activity-actions.php:416 -#: bp-templates/bp-legacy/buddypress-functions.php:994 +#: bp-activity/bp-activity-actions.php:414 +#: bp-templates/bp-legacy/buddypress-functions.php:1015 msgid "Please do not leave the comment area blank." msgstr "" -#: bp-activity/bp-activity-actions.php:427 +#: bp-activity/bp-activity-actions.php:425 msgid "Reply Posted!" msgstr "" -#: bp-activity/bp-activity-actions.php:429 +#: bp-activity/bp-activity-actions.php:427 msgid "There was an error posting that reply. Please try again." msgstr "" -#: bp-activity/bp-activity-actions.php:461 +#: bp-activity/bp-activity-actions.php:459 msgid "Activity marked as favorite." msgstr "" -#: bp-activity/bp-activity-actions.php:463 +#: bp-activity/bp-activity-actions.php:461 msgid "There was an error marking that activity as a favorite. Please try again." msgstr "" -#: bp-activity/bp-activity-actions.php:495 +#: bp-activity/bp-activity-actions.php:493 msgid "Activity removed as favorite." msgstr "" -#: bp-activity/bp-activity-actions.php:497 +#: bp-activity/bp-activity-actions.php:495 msgid "There was an error removing that activity as a favorite. Please try again." msgstr "" -#: bp-activity/bp-activity-actions.php:526 +#: bp-activity/bp-activity-actions.php:524 #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide #. Activity" msgid "%s | Site-Wide Activity" msgstr "" -#: bp-activity/bp-activity-actions.php:529 +#: bp-activity/bp-activity-actions.php:527 msgid "Activity feed for the entire site." msgstr "" -#: bp-activity/bp-activity-actions.php:556 bp-groups/bp-groups-actions.php:531 +#: bp-activity/bp-activity-actions.php:554 bp-groups/bp-groups-actions.php:542 #. translators: Personal activity RSS title - "[Site Name] | [User Display #. Name] | Activity" #. translators: Group activity RSS title - "[Site Name] | [Group Name] | @@ -85,78 +85,79 @@ msgstr "" msgid "%1$s | %2$s | Activity" msgstr "" -#: bp-activity/bp-activity-actions.php:559 +#: bp-activity/bp-activity-actions.php:557 msgid "Activity feed for %s." msgstr "" -#: bp-activity/bp-activity-actions.php:589 +#: bp-activity/bp-activity-actions.php:587 #. 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:592 +#: bp-activity/bp-activity-actions.php:590 msgid "Activity feed for %s's friends." msgstr "" -#: bp-activity/bp-activity-actions.php:626 +#: bp-activity/bp-activity-actions.php:624 #. 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:629 +#: bp-activity/bp-activity-actions.php:627 msgid "Public group activity feed of which %s is a member." msgstr "" -#: bp-activity/bp-activity-actions.php:665 +#: bp-activity/bp-activity-actions.php:663 #. 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:668 +#: bp-activity/bp-activity-actions.php:666 msgid "Activity feed mentioning %s." msgstr "" -#: bp-activity/bp-activity-actions.php:702 +#: bp-activity/bp-activity-actions.php:700 #. 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:705 +#: bp-activity/bp-activity-actions.php:703 msgid "Activity feed of %s's favorites." msgstr "" -#: bp-activity/bp-activity-admin.php:89 +#: bp-activity/bp-activity-admin.php:90 msgid "ERROR: Please type a reply." msgstr "" -#: bp-activity/bp-activity-admin.php:94 +#: bp-activity/bp-activity-admin.php:95 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: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 +#: bp-activity/bp-activity-admin.php:224 bp-activity/bp-activity-admin.php:278 +#: bp-core/admin/bp-core-admin-functions.php:481 +#: bp-core/admin/bp-core-admin-functions.php:499 +#: bp-core/admin/bp-core-admin-functions.php:518 +#: bp-core/admin/bp-core-admin-functions.php:537 +#: bp-groups/bp-groups-admin.php:117 bp-groups/bp-groups-admin.php:157 +#: bp-members/classes/class-bp-members-admin.php:718 +#: bp-members/classes/class-bp-members-admin.php:1426 msgid "Overview" msgstr "" -#: bp-activity/bp-activity-admin.php:230 +#: bp-activity/bp-activity-admin.php:226 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:231 +#: bp-activity/bp-activity-admin.php:227 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 " @@ -165,17 +166,17 @@ msgid "" "Type, Author ID) or to choose a 1- or 2-column layout for this screen." msgstr "" -#: bp-activity/bp-activity-admin.php:232 +#: bp-activity/bp-activity-admin.php:228 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:237 +#: bp-activity/bp-activity-admin.php:233 msgid "Item, Link, Type" msgstr "" -#: bp-activity/bp-activity-admin.php:239 +#: bp-activity/bp-activity-admin.php:235 msgid "" "<strong>Primary Item/Secondary Item</strong> - These identify the object " "that created the activity. For example, the fields could reference a " @@ -183,54 +184,56 @@ msgid "" "or none, of these fields." msgstr "" -#: bp-activity/bp-activity-admin.php:240 +#: bp-activity/bp-activity-admin.php:236 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:241 +#: bp-activity/bp-activity-admin.php:237 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:242 +#: bp-activity/bp-activity-admin.php:238 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: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 +#: bp-activity/bp-activity-admin.php:243 bp-activity/bp-activity-admin.php:295 +#: bp-core/admin/bp-core-admin-functions.php:487 +#: bp-core/admin/bp-core-admin-functions.php:505 +#: bp-core/admin/bp-core-admin-functions.php:524 +#: bp-core/admin/bp-core-admin-functions.php:543 +#: bp-groups/bp-groups-admin.php:125 bp-groups/bp-groups-admin.php:173 +#: bp-members/classes/class-bp-members-admin.php:727 +#: bp-members/classes/class-bp-members-admin.php:1447 msgid "For more information:" msgstr "" -#: bp-activity/bp-activity-admin.php:248 +#: bp-activity/bp-activity-admin.php:244 msgid "" "<a " "href=\"https://codex.buddypress.org/administrator-guide/activity-stream-" "management-panels/\">Managing Activity</a>" msgstr "" -#: 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 +#: bp-activity/bp-activity-admin.php:245 bp-activity/bp-activity-admin.php:296 +#: bp-core/admin/bp-core-admin-functions.php:489 +#: bp-core/admin/bp-core-admin-functions.php:507 +#: bp-core/admin/bp-core-admin-functions.php:526 +#: bp-core/admin/bp-core-admin-functions.php:545 +#: bp-groups/bp-groups-admin.php:174 +#: bp-members/classes/class-bp-members-admin.php:729 +#: bp-members/classes/class-bp-members-admin.php:1448 msgid "<a href=\"https://buddypress.org/support/\">Support Forums</a>" msgstr "" -#: bp-activity/bp-activity-admin.php:277 +#: bp-activity/bp-activity-admin.php:280 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 " @@ -238,7 +241,7 @@ msgid "" "action links or the Bulk Actions." msgstr "" -#: bp-activity/bp-activity-admin.php:278 +#: bp-activity/bp-activity-admin.php:281 msgid "" "There are many different types of activities. Some are generated " "automatically by BuddyPress and other plugins, and some are entered " @@ -247,11 +250,11 @@ msgid "" "them." msgstr "" -#: bp-activity/bp-activity-admin.php:284 +#: bp-activity/bp-activity-admin.php:287 msgid "Moderating Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:286 +#: bp-activity/bp-activity-admin.php:289 msgid "" "In the <strong>Activity</strong> column, above each activity it says " "“Submitted on,” followed by the date and time the activity item " @@ -260,7 +263,7 @@ msgid "" "options to reply, edit, spam mark, or delete that activity." msgstr "" -#: bp-activity/bp-activity-admin.php:287 +#: bp-activity/bp-activity-admin.php:290 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, " @@ -270,1085 +273,1113 @@ msgid "" "screen to show only related activity items." msgstr "" -#: bp-activity/bp-activity-admin.php:651 +#: bp-activity/bp-activity-admin.php:302 +msgid "Activity list navigation" +msgstr "" + +#: bp-activity/bp-activity-admin.php:664 msgid "Editing Activity (ID #%s)" msgstr "" -#: bp-activity/bp-activity-admin.php:662 +#: bp-activity/bp-activity-admin.php:675 msgid "Action" msgstr "" -#: bp-activity/bp-activity-admin.php:669 +#: bp-activity/bp-activity-admin.php:682 msgid "Content" msgstr "" -#: bp-activity/bp-activity-admin.php:694 -msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>." +#: bp-activity/bp-activity-admin.php:708 +msgid "No activity found with this ID." +msgstr "" + +#: bp-activity/bp-activity-admin.php:709 +msgid "Go back and try again." msgstr "" -#: bp-activity/bp-activity-admin.php:717 +#: bp-activity/bp-activity-admin.php:733 +#: bp-activity/classes/class-bp-activity-list-table.php:667 msgid "View Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:725 +#: bp-activity/bp-activity-admin.php:741 msgid "Approved" msgstr "" -#: bp-activity/bp-activity-admin.php:726 bp-activity/bp-activity-admin.php:1544 -#: bp-activity/bp-activity-akismet.php:206 -#: bp-activity/bp-activity-akismet.php:235 -#: bp-core/admin/bp-core-admin-functions.php:863 +#: bp-activity/bp-activity-admin.php:742 +#: bp-activity/classes/class-bp-activity-list-table.php:578 +#: bp-activity/classes/class-bp-akismet.php:205 +#: bp-activity/classes/class-bp-akismet.php:234 +#: bp-core/admin/bp-core-admin-functions.php:1003 msgid "Spam" msgstr "" -#: 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 +#: bp-activity/bp-activity-admin.php:748 +#: bp-members/classes/class-bp-members-admin.php:1001 +#: bp-members/classes/class-bp-members-admin.php:1061 +#. Translators: Publish box date format, see http:php.net/date. msgid "M j, Y @ G:i" msgstr "" -#: bp-activity/bp-activity-admin.php:735 -msgid "Submitted on: <strong>%1$s</strong>" +#: bp-activity/bp-activity-admin.php:751 +msgid "Submitted on: %s" msgstr "" -#: bp-activity/bp-activity-admin.php:735 bp-activity/bp-activity-admin.php:1537 -#: bp-forums/bp-forums-template.php:2554 bp-groups/bp-groups-admin.php:1579 -#: bp-xprofile/bp-xprofile-admin.php:544 +#: bp-activity/bp-activity-admin.php:751 +#: bp-activity/classes/class-bp-activity-list-table.php:571 +#: bp-forums/bp-forums-template.php:2531 +#: bp-groups/classes/class-bp-groups-list-table.php:482 +#: bp-xprofile/bp-xprofile-admin.php:602 msgid "Edit" msgstr "" -#: 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 +#: bp-activity/bp-activity-admin.php:764 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1132 +#: bp-xprofile/classes/class-bp-xprofile-group.php:716 msgid "Update" msgstr "" -#: bp-activity/bp-activity-admin.php:768 +#: bp-activity/bp-activity-admin.php:784 msgid "Link" msgstr "" -#: bp-activity/bp-activity-admin.php:770 +#: bp-activity/bp-activity-admin.php:786 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:785 +#: bp-activity/bp-activity-admin.php:801 msgid "Author ID" msgstr "" -#: bp-activity/bp-activity-admin.php:852 +#: bp-activity/bp-activity-admin.php:870 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:877 +#: bp-activity/bp-activity-admin.php:876 +msgid "Select activity type" +msgstr "" + +#: bp-activity/bp-activity-admin.php:896 msgid "Primary Item ID" msgstr "" -#: bp-activity/bp-activity-admin.php:881 +#: bp-activity/bp-activity-admin.php:900 msgid "Secondary Item ID" msgstr "" -#: bp-activity/bp-activity-admin.php:884 +#: bp-activity/bp-activity-admin.php:903 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:923 +#: bp-activity/bp-activity-admin.php:942 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:927 +#: bp-activity/bp-activity-admin.php:946 msgid "An error occurred when trying to update activity ID #%s." msgstr "" -#: bp-activity/bp-activity-admin.php:930 +#: bp-activity/bp-activity-admin.php:949 msgid "Errors occurred when trying to update these activity items:" msgstr "" -#: bp-activity/bp-activity-admin.php:936 -#. Translators: This is a bulleted list of item IDs +#: bp-activity/bp-activity-admin.php:955 +#. Translators: This is a bulleted list of item IDs. msgid "#%s" msgstr "" -#: bp-activity/bp-activity-admin.php:945 +#: bp-activity/bp-activity-admin.php:964 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:948 +#: bp-activity/bp-activity-admin.php:967 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:951 +#: bp-activity/bp-activity-admin.php:970 msgid "The activity item has been updated successfully." msgstr "" -#: bp-activity/bp-activity-admin.php:970 +#: bp-activity/bp-activity-admin.php:988 msgid "Activity related to ID #%s" msgstr "" -#: bp-activity/bp-activity-admin.php:976 bp-groups/bp-groups-admin.php:732 -#: bp-members/bp-members-admin.php:1857 +#: bp-activity/bp-activity-admin.php:994 bp-groups/bp-groups-admin.php:735 +#: bp-members/classes/class-bp-members-admin.php:1866 msgid "Search results for “%s”" msgstr "" -#: bp-activity/bp-activity-admin.php:989 +#: bp-activity/bp-activity-admin.php:1007 msgid "Search all Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:1000 +#: bp-activity/bp-activity-admin.php:1018 msgid "Reply to Activity" msgstr "" -#: 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 +#: bp-activity/bp-activity-admin.php:1022 bp-groups/bp-groups-admin.php:682 +#: bp-members/classes/class-bp-members-admin.php:2015 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:126 +#: bp-templates/bp-legacy/buddypress/forums/index.php:205 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1273 +#: bp-xprofile/classes/class-bp-xprofile-group.php:785 msgid "Cancel" msgstr "" -#: bp-activity/bp-activity-admin.php:1005 -#: bp-activity/bp-activity-admin.php:1531 -#: bp-templates/bp-legacy/buddypress/activity/comment.php:44 -#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:17 +#: bp-activity/bp-activity-admin.php:1023 +#: bp-activity/classes/class-bp-activity-list-table.php:565 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:39 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:23 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:189 msgid "Reply" msgstr "" -#: bp-activity/bp-activity-admin.php:1212 -msgid "No activities found." +#: bp-activity/bp-activity-filters.php:437 +msgid "[Read more]" msgstr "" -#: bp-activity/bp-activity-admin.php:1283 bp-groups/bp-groups-admin.php:1386 -msgid "All" +#: bp-activity/bp-activity-filters.php:449 +msgid "…" msgstr "" -#: bp-activity/bp-activity-admin.php:1284 -msgid "Spam <span class=\"count\">(%s)</span>" +#: bp-activity/bp-activity-filters.php:656 +msgid "Load Newest" msgstr "" -#: bp-activity/bp-activity-admin.php:1310 -msgid "Mark as Spam" +#: bp-activity/bp-activity-functions.php:1430 +msgid "Posted a status update" msgstr "" -#: bp-activity/bp-activity-admin.php:1311 -#: bp-activity/bp-activity-admin.php:1542 -#: bp-core/admin/bp-core-admin-functions.php:857 -msgid "Not Spam" +#: bp-activity/bp-activity-functions.php:1432 +msgid "Updates" msgstr "" -#: bp-activity/bp-activity-admin.php:1312 -#: bp-activity/bp-activity-admin.php:1547 bp-groups/bp-groups-admin.php:677 -msgid "Delete Permanently" +#: bp-activity/bp-activity-functions.php:1439 +msgid "Replied to a status update" msgstr "" -#: bp-activity/bp-activity-admin.php:1384 -msgid "View all actions" +#: bp-activity/bp-activity-functions.php:1441 +msgid "Activity Comments" msgstr "" -#: bp-activity/bp-activity-admin.php:1409 -msgid "Filter" +#: bp-activity/bp-activity-functions.php:1509 +msgid "%s posted an update" msgstr "" -#: bp-activity/bp-activity-admin.php:1456 -msgid "Select activity item %1$d" +#: bp-activity/bp-activity-functions.php:1532 +msgid "%s posted a new activity comment" msgstr "" -#: bp-activity/bp-activity-admin.php:1487 -msgid "Unregistered action - %s" +#: bp-activity/bp-activity-functions.php:2595 +#: bp-templates/bp-legacy/buddypress-functions.php:1012 +msgid "There was an error posting your reply. Please try again." msgstr "" -#: bp-activity/bp-activity-admin.php:1533 -msgid "Replies are disabled for this activity item" +#: bp-activity/bp-activity-functions.php:2631 +msgid "Sorry, the item you are replying to no longer exists." msgstr "" -#: bp-activity/bp-activity-admin.php:1533 -msgid "Replies disabled" +#: bp-activity/bp-activity-functions.php:3183 +msgid "Thumbnail" msgstr "" -#: bp-activity/bp-activity-admin.php:1547 bp-core/bp-core-cssjs.php:115 -msgid "Are you sure?" +#: bp-activity/bp-activity-notifications.php:234 +msgid "@%s Mentions" msgstr "" -#: bp-activity/bp-activity-admin.php:1563 -#. translators: 2: activity admin ui date/time -msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>" +#: bp-activity/bp-activity-notifications.php:238 +msgid "You have %1$d new mentions" msgstr "" -#: bp-activity/bp-activity-admin.php:1612 -msgid "<a href=\"%1$s\" class=\"comments-view-item-link\">View Activity</a>" +#: bp-activity/bp-activity-notifications.php:242 +msgid "%1$s mentioned you" msgstr "" -#: bp-activity/bp-activity-admin.php:1631 -msgid "%s related activity" -msgid_plural "%s related activities" -msgstr[0] "" -msgstr[1] "" +#: bp-activity/bp-activity-screens.php:327 +msgid "You do not have access to this activity." +msgstr "" -#: bp-activity/bp-activity-akismet.php:88 -msgid "Flagged as spam by Akismet" +#: bp-activity/bp-activity-screens.php:381 +#: bp-activity/classes/class-bp-activity-theme-compat.php:161 +msgid "Activity" msgstr "" -#: bp-activity/bp-activity-akismet.php:91 -msgid "Cleared by Akismet" +#: bp-activity/bp-activity-screens.php:382 bp-blogs/bp-blogs-template.php:1043 +#: bp-friends/bp-friends-screens.php:116 bp-groups/bp-groups-screens.php:1431 +#: bp-messages/bp-messages-screens.php:207 +#: bp-templates/bp-legacy/buddypress/members/register.php:307 +msgid "Yes" msgstr "" -#: bp-activity/bp-activity-akismet.php:97 -msgid "Flagged as spam by %s" +#: bp-activity/bp-activity-screens.php:383 bp-blogs/bp-blogs-template.php:1047 +#: bp-friends/bp-friends-screens.php:117 bp-groups/bp-groups-screens.php:1432 +#: bp-messages/bp-messages-screens.php:208 +#: bp-templates/bp-legacy/buddypress/members/register.php:308 +msgid "No" msgstr "" -#: bp-activity/bp-activity-akismet.php:99 -msgid "Un-spammed by %s" +#: bp-activity/bp-activity-screens.php:391 +msgid "A member mentions you in an update using \"@%s\"" msgstr "" -#: bp-activity/bp-activity-akismet.php:108 -msgid "History" +#: bp-activity/bp-activity-screens.php:392 +#: bp-activity/bp-activity-screens.php:400 +#: bp-friends/bp-friends-screens.php:125 bp-friends/bp-friends-screens.php:131 +#: bp-groups/bp-groups-screens.php:1440 bp-groups/bp-groups-screens.php:1446 +#: bp-groups/bp-groups-screens.php:1452 bp-groups/bp-groups-screens.php:1458 +#: bp-messages/bp-messages-screens.php:216 +msgid "Yes, send email" msgstr "" -#: bp-activity/bp-activity-akismet.php:434 -msgid "%s reported this activity as spam" +#: bp-activity/bp-activity-screens.php:393 +#: bp-activity/bp-activity-screens.php:401 +#: bp-friends/bp-friends-screens.php:126 bp-friends/bp-friends-screens.php:132 +#: bp-groups/bp-groups-screens.php:1441 bp-groups/bp-groups-screens.php:1447 +#: bp-groups/bp-groups-screens.php:1453 bp-groups/bp-groups-screens.php:1459 +#: bp-messages/bp-messages-screens.php:217 +msgid "No, do not send email" msgstr "" -#: bp-activity/bp-activity-akismet.php:451 -msgid "%s reported this activity as not spam" +#: bp-activity/bp-activity-screens.php:399 +msgid "A member replies to an update or comment you've posted" msgstr "" -#: bp-activity/bp-activity-akismet.php:475 -msgid "Akismet caught this item as spam" +#: bp-activity/bp-activity-template.php:479 +msgid "Viewing 1 item" msgstr "" -#: bp-activity/bp-activity-akismet.php:480 -msgid "Akismet cleared this item" +#: bp-activity/bp-activity-template.php:481 +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:1102 +#: bp-activity/bp-activity-template.php:1282 +#: bp-activity/bp-activity-template.php:1293 +#: bp-activity/classes/class-bp-activity-component.php:355 +#: bp-blogs/classes/class-bp-blogs-component.php:282 +#: bp-core/deprecated/2.1.php:459 bp-forums/bp-forums-loader.php:254 +#: bp-forums/bp-forums-template.php:844 bp-forums/bp-forums-template.php:1143 +#: bp-forums/bp-forums-template.php:2381 +#: bp-friends/classes/class-bp-friends-component.php:247 +#: bp-groups/bp-groups-template.php:1363 bp-groups/bp-groups-template.php:1408 +#: bp-groups/bp-groups-template.php:2175 bp-groups/bp-groups-template.php:2191 +#: bp-groups/bp-groups-template.php:2251 bp-groups/bp-groups-template.php:2267 +#: bp-groups/bp-groups-template.php:3708 bp-groups/bp-groups-template.php:3747 +#: bp-groups/bp-groups-template.php:3788 bp-groups/bp-groups-template.php:5291 +#: bp-groups/classes/class-bp-groups-component.php:772 +#: bp-members/bp-members-template.php:769 +#: bp-members/bp-members-template.php:1332 +#: bp-members/bp-members-template.php:1381 +#: bp-members/classes/class-bp-members-component.php:293 +#: bp-messages/bp-messages-template.php:664 +#: bp-messages/classes/class-bp-messages-component.php:321 +#: bp-notifications/classes/class-bp-notifications-component.php:242 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:297 +msgid "Profile picture of %s" msgstr "" -#: bp-activity/bp-activity-akismet.php:485 -msgid "" -"Akismet was unable to check this item (response: %s), will automatically " -"retry again later." +#: bp-activity/bp-activity-template.php:1102 +msgid "Profile picture" msgstr "" -#: bp-activity/bp-activity-akismet.php:592 -msgid "Activity History" +#: bp-activity/bp-activity-template.php:1258 +msgid "Group logo" msgstr "" -#: bp-activity/bp-activity-filters.php:435 -msgid "[Read more]" +#: bp-activity/bp-activity-template.php:1261 +#: bp-groups/bp-groups-template.php:586 +#: bp-groups/classes/class-bp-groups-list-table.php:509 +msgid "Group logo of %s" msgstr "" -#: bp-activity/bp-activity-filters.php:448 -msgid "…" +#: bp-activity/bp-activity-template.php:1272 +msgid "Profile picture of the author of the site %s" msgstr "" -#: bp-activity/bp-activity-filters.php:658 -msgid "Load Newest" +#: bp-activity/bp-activity-template.php:1585 +msgid "View Discussion" msgstr "" -#: bp-activity/bp-activity-functions.php:1247 -msgid "Posted a status update" +#: bp-activity/bp-activity-template.php:2293 +msgid "" +"%1$s no longer accepts arguments. See the inline documentation at %2$s for " +"more details." msgstr "" -#: bp-activity/bp-activity-functions.php:1249 -msgid "Updates" +#: bp-activity/bp-activity-template.php:2768 +#: bp-core/bp-core-attachments.php:719 bp-forums/bp-forums-template.php:2532 +#: bp-groups/classes/class-bp-groups-component.php:660 +#: bp-groups/classes/class-bp-groups-list-table.php:327 +#: bp-groups/classes/class-bp-groups-list-table.php:485 +#: bp-members/classes/class-bp-members-list-table.php:171 +#: bp-members/classes/class-bp-members-list-table.php:316 +#: bp-members/classes/class-bp-members-ms-list-table.php:158 +#: bp-members/classes/class-bp-members-ms-list-table.php:309 +#: bp-messages/bp-messages-template.php:957 +#: bp-notifications/bp-notifications-template.php:702 +#: bp-notifications/bp-notifications-template.php:936 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:45 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:133 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:44 +#: bp-xprofile/bp-xprofile-admin.php:607 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:377 +msgid "Delete" msgstr "" -#: bp-activity/bp-activity-functions.php:1256 -msgid "Replied to a status update" +#: bp-activity/bp-activity-template.php:2889 +#: bp-core/admin/bp-core-admin-functions.php:1009 +#: bp-core/admin/bp-core-admin-slugs.php:150 +#: bp-core/admin/bp-core-admin-slugs.php:213 +#: bp-groups/classes/class-bp-groups-list-table.php:488 +#: bp-members/bp-members-template.php:982 +#: bp-templates/bp-legacy/buddypress-functions.php:309 +msgid "View" msgstr "" -#: bp-activity/bp-activity-functions.php:1258 -msgid "Activity Comments" +#: bp-activity/bp-activity-template.php:3004 +msgid "Clear Filter" msgstr "" -#: bp-activity/bp-activity-functions.php:1326 -msgid "%s posted an update" +#: bp-activity/bp-activity-template.php:3328 +msgid "a user" msgstr "" -#: bp-activity/bp-activity-functions.php:1350 -msgid "%s posted a new activity comment" +#: bp-activity/bp-activity-template.php:3392 +msgid "Send a public message on your activity stream." msgstr "" -#: 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." +#: bp-activity/bp-activity-template.php:3393 +msgid "Public Message" msgstr "" -#: bp-activity/bp-activity-functions.php:2130 -msgid "Sorry, the item you are replying to no longer exists." +#: bp-activity/bp-activity-template.php:4021 +msgid "Site Wide Activity RSS Feed" msgstr "" -#: bp-activity/bp-activity-functions.php:2668 -msgid "Thumbnail" +#: bp-activity/classes/class-bp-activity-activity.php:325 +#: bp-activity/classes/class-bp-activity-template.php:144 +#: bp-groups/bp-groups-functions.php:596 +#: bp-groups/classes/class-bp-groups-group-members-template.php:99 +#: bp-groups/classes/class-bp-groups-group.php:732 +#: bp-groups/classes/class-bp-groups-invite-template.php:84 +#: bp-groups/classes/class-bp-groups-membership-requests-template.php:91 +#: bp-groups/classes/class-bp-groups-template.php:134 +#: bp-messages/classes/class-bp-messages-box-template.php:113 +#: bp-messages/classes/class-bp-messages-thread.php:422 +#: bp-xprofile/classes/class-bp-xprofile-data-template.php:128 +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-loader.php:30 -#: bp-core/admin/bp-core-admin-components.php:390 +#: bp-activity/classes/class-bp-activity-component.php:30 +#: bp-core/admin/bp-core-admin-components.php:394 msgid "Activity Streams" msgstr "" -#: bp-activity/bp-activity-loader.php:114 +#: bp-activity/classes/class-bp-activity-component.php:117 msgid "Search Activity..." msgstr "" -#: 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" +#: bp-activity/classes/class-bp-activity-feed.php:157 +msgid "RSS feed 'id' must be defined" msgstr "" -#: bp-activity/bp-activity-notifications.php:73 -msgid "%s mentioned you in an update" +#: bp-activity/classes/class-bp-activity-feed.php:305 +msgid "In reply to" msgstr "" -#: bp-activity/bp-activity-notifications.php:76 bp-core/deprecated/1.5.php:354 -msgid "" -"%1$s mentioned you in the group \"%2$s\":\n" -"\n" -"\"%3$s\"\n" -"\n" -"To view and respond to the message, log in and visit: %4$s\n" -"\n" -"---------------------\n" +#: bp-activity/classes/class-bp-activity-list-table.php:235 +msgid "No activities found." msgstr "" -#: bp-activity/bp-activity-notifications.php:86 -msgid "" -"%1$s mentioned you in an update:\n" -"\n" -"\"%2$s\"\n" -"\n" -"To view and respond to the message, log in and visit: %3$s\n" -"\n" -"---------------------\n" +#: bp-activity/classes/class-bp-activity-list-table.php:246 +msgid "Activities list" msgstr "" -#: bp-activity/bp-activity-notifications.php:99 -#: 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: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" +#: bp-activity/classes/class-bp-activity-list-table.php:307 +msgid "Filter activities list" msgstr "" -#: bp-activity/bp-activity-notifications.php:204 -msgid "%s replied to one of your updates" +#: bp-activity/classes/class-bp-activity-list-table.php:310 +#: bp-groups/classes/class-bp-groups-list-table.php:290 +msgid "All" msgstr "" -#: bp-activity/bp-activity-notifications.php:205 -msgid "" -"%1$s replied to one of your updates:\n" -"\n" -"\"%2$s\"\n" -"\n" -"To view your original update and all comments, log in and visit: %3$s\n" -"\n" -"---------------------\n" +#: bp-activity/classes/class-bp-activity-list-table.php:311 +msgid "Spam <span class=\"count\">(%s)</span>" msgstr "" -#: bp-activity/bp-activity-notifications.php:288 -msgid "%s replied to one of your comments" +#: bp-activity/classes/class-bp-activity-list-table.php:337 +msgid "Mark as Spam" msgstr "" -#: bp-activity/bp-activity-notifications.php:293 -msgid "" -"%1$s replied to one of your comments:\n" -"\n" -"\"%2$s\"\n" -"\n" -"To view the original activity, your comment and all replies, log in and " -"visit: %3$s\n" -"\n" -"---------------------\n" +#: bp-activity/classes/class-bp-activity-list-table.php:338 +#: bp-activity/classes/class-bp-activity-list-table.php:576 +#: bp-core/admin/bp-core-admin-functions.php:997 +msgid "Not Spam" msgstr "" -#: bp-activity/bp-activity-notifications.php:400 -msgid "@%s Mentions" +#: bp-activity/classes/class-bp-activity-list-table.php:339 +#: bp-activity/classes/class-bp-activity-list-table.php:581 +#: bp-groups/bp-groups-admin.php:681 +msgid "Delete Permanently" msgstr "" -#: bp-activity/bp-activity-notifications.php:404 -msgid "You have %1$d new mentions" +#: bp-activity/classes/class-bp-activity-list-table.php:417 +msgid "Filter by activity type" msgstr "" -#: bp-activity/bp-activity-notifications.php:408 -msgid "%1$s mentioned you" +#: bp-activity/classes/class-bp-activity-list-table.php:419 +msgid "View all actions" msgstr "" -#: bp-activity/bp-activity-screens.php:325 -msgid "You do not have access to this activity." +#: bp-activity/classes/class-bp-activity-list-table.php:444 +msgid "Filter" msgstr "" -#: bp-activity/bp-activity-screens.php:379 -#: bp-activity/bp-activity-screens.php:570 -msgid "Activity" +#: bp-activity/classes/class-bp-activity-list-table.php:491 +msgid "Select activity item %1$d" msgstr "" -#: 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" +#: bp-activity/classes/class-bp-activity-list-table.php:522 +msgid "Unregistered action - %s" msgstr "" -#: 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" +#: bp-activity/classes/class-bp-activity-list-table.php:567 +msgid "Replies are disabled for this activity item" msgstr "" -#: bp-activity/bp-activity-screens.php:389 -msgid "A member mentions you in an update using \"@%s\"" +#: bp-activity/classes/class-bp-activity-list-table.php:567 +msgid "Replies disabled" msgstr "" -#: bp-activity/bp-activity-screens.php:397 -msgid "A member replies to an update or comment you've posted" +#: bp-activity/classes/class-bp-activity-list-table.php:581 +#: bp-core/bp-core-cssjs.php:121 +msgid "Are you sure?" msgstr "" -#: 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." +#: bp-activity/classes/class-bp-activity-list-table.php:598 +#. translators: %s: activity date and time +msgid "Submitted on %s" msgstr "" -#: bp-activity/bp-activity-template.php:851 -msgid "Viewing 1 item" +#: bp-activity/classes/class-bp-activity-list-table.php:604 +#: bp-core/bp-core-template.php:412 +#. translators: 1: activity date, 2: activity time +msgid "%1$s at %2$s" 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" +#: bp-activity/classes/class-bp-activity-list-table.php:686 +msgid "%s related activity" +msgid_plural "%s related activities" msgstr[0] "" msgstr[1] "" -#: bp-activity/bp-activity-template.php:1474 -msgid "Profile picture" -msgstr "" - -#: bp-activity/bp-activity-template.php:1630 -msgid "Group logo" -msgstr "" - -#: bp-activity/bp-activity-template.php:1633 bp-groups/bp-groups-admin.php:1606 -#: bp-groups/bp-groups-template.php:897 -msgid "Group logo of %s" +#: bp-activity/classes/class-bp-akismet.php:87 +msgid "Flagged as spam by Akismet" msgstr "" -#: bp-activity/bp-activity-template.php:1644 -msgid "Profile picture of the author of the site %s" +#: bp-activity/classes/class-bp-akismet.php:90 +msgid "Cleared by Akismet" msgstr "" -#: bp-activity/bp-activity-template.php:1959 -msgid "View Discussion" +#: bp-activity/classes/class-bp-akismet.php:96 +msgid "Flagged as spam by %s" msgstr "" -#: bp-activity/bp-activity-template.php:2672 -msgid "" -"%1$s no longer accepts arguments. See the inline documentation at %2$s for " -"more details." +#: bp-activity/classes/class-bp-akismet.php:98 +msgid "Un-spammed by %s" msgstr "" -#: 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:1423 bp-groups/bp-groups-admin.php:1582 -#: bp-groups/bp-groups-loader.php:598 -#: bp-members/admin/bp-members-admin-classes.php:156 -#: bp-members/admin/bp-members-admin-classes.php:302 -#: bp-members/admin/bp-members-admin-classes.php:530 -#: bp-members/admin/bp-members-admin-classes.php:681 -#: bp-messages/bp-messages-template.php:1297 -#: 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" +#: bp-activity/classes/class-bp-akismet.php:107 +msgid "History" msgstr "" -#: 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:1585 -#: bp-members/bp-members-template.php:1141 -#: bp-templates/bp-legacy/buddypress-functions.php:311 -msgid "View" +#: bp-activity/classes/class-bp-akismet.php:432 +msgid "%s reported this activity as spam" msgstr "" -#: bp-activity/bp-activity-template.php:3385 -msgid "Clear Filter" +#: bp-activity/classes/class-bp-akismet.php:449 +msgid "%s reported this activity as not spam" msgstr "" -#: bp-activity/bp-activity-template.php:3734 -msgid "a user" +#: bp-activity/classes/class-bp-akismet.php:473 +msgid "Akismet caught this item as spam" msgstr "" -#: bp-activity/bp-activity-template.php:3798 -msgid "Send a public message on your activity stream." +#: bp-activity/classes/class-bp-akismet.php:478 +msgid "Akismet cleared this item" msgstr "" -#: bp-activity/bp-activity-template.php:3799 -msgid "Public Message" +#: bp-activity/classes/class-bp-akismet.php:483 +msgid "" +"Akismet was unable to check this item (response: %s), will automatically " +"retry again later." msgstr "" -#: bp-activity/bp-activity-template.php:4428 -msgid "Site Wide Activity RSS Feed" +#: bp-activity/classes/class-bp-akismet.php:588 +msgid "Activity History" msgstr "" -#: bp-activity/classes/class-bp-activity-feed.php:139 -msgid "RSS feed 'id' must be defined" +#: bp-blogs/bp-blogs-activity.php:25 +msgid "New site created" msgstr "" -#: bp-activity/classes/class-bp-activity-feed.php:281 -msgid "In reply to" +#: bp-blogs/bp-blogs-activity.php:27 +msgid "New Sites" msgstr "" -#: bp-blogs/bp-blogs-activity.php:32 -msgid "New site created" +#: bp-blogs/bp-blogs-activity.php:77 +msgid "New post published" msgstr "" -#: bp-blogs/bp-blogs-activity.php:34 -msgid "New Sites" +#: bp-blogs/bp-blogs-activity.php:79 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:53 +msgid "Posts" msgstr "" -#: bp-blogs/bp-blogs-activity.php:45 +#: bp-blogs/bp-blogs-activity.php:105 msgid "New post comment posted" msgstr "" -#: bp-blogs/bp-blogs-activity.php:47 +#: bp-blogs/bp-blogs-activity.php:107 msgid "Comments" msgstr "" -#: bp-blogs/bp-blogs-activity.php:74 +#: bp-blogs/bp-blogs-activity.php:130 msgid "%s created the site %s" msgstr "" -#: bp-blogs/bp-blogs-activity.php:155 +#: bp-blogs/bp-blogs-activity.php:212 msgid "(no title)" msgstr "" -#: bp-blogs/bp-blogs-activity.php:182 +#: bp-blogs/bp-blogs-activity.php:239 msgid "%1$s wrote a new post, %2$s, on the site %3$s" msgstr "" -#: bp-blogs/bp-blogs-activity.php:184 +#: bp-blogs/bp-blogs-activity.php:241 msgid "%1$s wrote a new post, %2$s" msgstr "" -#: bp-blogs/bp-blogs-activity.php:257 +#: bp-blogs/bp-blogs-activity.php:365 msgid "%1$s commented on the post, %2$s, on the site %3$s" msgstr "" -#: bp-blogs/bp-blogs-activity.php:259 +#: bp-blogs/bp-blogs-activity.php:367 msgid "%1$s commented on the post, %2$s" msgstr "" -#: bp-blogs/bp-blogs-loader.php:27 -msgid "Site Directory" -msgstr "" - -#: bp-blogs/bp-blogs-loader.php:71 -msgid "Search sites..." -msgstr "" - -#: bp-blogs/bp-blogs-loader.php:160 -msgid "Sites <span class=\"%s\">%s</span>" -msgstr "" - -#: 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:225 bp-blogs/bp-blogs-screens.php:174 -#: bp-blogs/bp-blogs-screens.php:239 -msgid "Sites" -msgstr "" - -#: 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-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 +#: bp-blogs/bp-blogs-template.php:239 msgid "Viewing 1 site" msgstr "" -#: bp-blogs/bp-blogs-template.php:478 +#: bp-blogs/bp-blogs-template.php:241 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:560 +#: bp-blogs/bp-blogs-template.php:326 bp-blogs/bp-blogs-template.php:328 msgid "Profile picture of site author %s" msgstr "" -#: 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 +#: bp-blogs/bp-blogs-template.php:555 +#: bp-core/classes/class-bp-core-user.php:189 +#: bp-groups/bp-groups-widgets.php:71 +#: bp-groups/classes/class-bp-groups-invite-template.php:240 +#: bp-groups/classes/class-bp-groups-widget.php:133 +#: bp-members/bp-members-template.php:908 +#: bp-members/bp-members-template.php:1453 +#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:62 +#: bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php:62 +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:71 msgid "active %s" msgstr "" -#: bp-blogs/bp-blogs-template.php:799 bp-members/bp-members-template.php:1080 +#: bp-blogs/bp-blogs-template.php:568 bp-members/bp-members-template.php:921 msgid "Never active" msgstr "" -#: bp-blogs/bp-blogs-template.php:851 +#: bp-blogs/bp-blogs-template.php:620 msgid "Latest Post: %s" msgstr "" -#: bp-blogs/bp-blogs-template.php:1183 +#: bp-blogs/bp-blogs-template.php:954 msgid "There was a problem; please correct the form below and try again." msgstr "" -#: bp-blogs/bp-blogs-template.php:1186 +#: bp-blogs/bp-blogs-template.php:957 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:1188 +#: bp-blogs/bp-blogs-template.php:959 msgid "" "If you’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:1204 +#: bp-blogs/bp-blogs-template.php:975 msgid "Create Site" msgstr "" -#: bp-blogs/bp-blogs-template.php:1226 +#: bp-blogs/bp-blogs-template.php:997 msgid "Site Name:" msgstr "" -#: bp-blogs/bp-blogs-template.php:1228 +#: bp-blogs/bp-blogs-template.php:999 msgid "Site Domain:" msgstr "" -#: bp-blogs/bp-blogs-template.php:1242 +#: bp-blogs/bp-blogs-template.php:1013 msgid "Your address will be " msgstr "" -#: bp-blogs/bp-blogs-template.php:1245 +#: bp-blogs/bp-blogs-template.php:1016 msgid "blogname" msgstr "" -#: bp-blogs/bp-blogs-template.php:1247 +#: bp-blogs/bp-blogs-template.php:1018 msgid "domain." msgstr "" -#: bp-blogs/bp-blogs-template.php:1250 +#: bp-blogs/bp-blogs-template.php:1021 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:1256 +#: bp-blogs/bp-blogs-template.php:1027 msgid "Site Title:" msgstr "" -#: bp-blogs/bp-blogs-template.php:1267 +#: bp-blogs/bp-blogs-template.php:1038 msgid "Privacy:" msgstr "" -#: bp-blogs/bp-blogs-template.php:1268 -#: bp-templates/bp-legacy/buddypress/members/register.php:276 +#: bp-blogs/bp-blogs-template.php:1039 +#: bp-templates/bp-legacy/buddypress/members/register.php:297 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:1373 +#: bp-blogs/bp-blogs-template.php:1145 msgid "Congratulations! You have successfully registered a new site." msgstr "" -#: bp-blogs/bp-blogs-template.php:1375 +#: bp-blogs/bp-blogs-template.php:1147 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:1424 +#: bp-blogs/bp-blogs-template.php:1180 bp-blogs/bp-blogs-template.php:1266 +#: bp-blogs/bp-blogs-template.php:1267 +#: bp-blogs/classes/class-bp-blogs-component.php:252 +#: bp-blogs/classes/class-bp-blogs-theme-compat.php:175 +#: bp-core/bp-core-template.php:3082 +msgid "Create a Site" +msgstr "" + +#: bp-blogs/bp-blogs-template.php:1196 msgid "%s's Sites" msgstr "" -#: bp-blogs/bp-blogs-template.php:1425 +#: bp-blogs/bp-blogs-template.php:1197 msgid "%s's Recent Posts" msgstr "" -#: bp-blogs/bp-blogs-template.php:1426 +#: bp-blogs/bp-blogs-template.php:1198 msgid "%s's Recent Comments" msgstr "" -#: 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 +#: bp-blogs/bp-blogs-template.php:1226 bp-core/deprecated/1.5.php:426 +#: bp-forums/bp-forums-template.php:2659 bp-groups/bp-groups-template.php:4978 +#: bp-members/bp-members-template.php:1152 +#: bp-messages/bp-messages-template.php:782 msgid "Search" msgstr "" -#: bp-blogs/bp-blogs-template.php:1600 bp-blogs/bp-blogs-template.php:1601 +#: bp-blogs/bp-blogs-template.php:1379 bp-blogs/bp-blogs-template.php:1380 msgid "Visit Site" msgstr "" -#: bp-blogs/bp-blogs-template.php:1662 +#: bp-blogs/bp-blogs-template.php:1442 msgid "%s site" msgid_plural "%s sites" msgstr[0] "" msgstr[1] "" -#: bp-blogs/bp-blogs-widgets.php:35 -msgid "A list of recently published posts from across your network." +#: bp-blogs/classes/class-bp-blogs-component.php:30 +msgid "Site Directory" msgstr "" -#: bp-blogs/bp-blogs-widgets.php:53 bp-blogs/bp-blogs-widgets.php:147 -msgid "Recent Networkwide Posts" +#: bp-blogs/classes/class-bp-blogs-component.php:75 +msgid "Search sites..." msgstr "" -#: bp-blogs/bp-blogs-widgets.php:115 -msgid "Sorry, there were no posts found. Why not write one?" +#: bp-blogs/classes/class-bp-blogs-component.php:179 +msgid "Sites <span class=\"%s\">%s</span>" msgstr "" -#: bp-blogs/bp-blogs-widgets.php:159 -msgid "Link widget title to Blogs directory" +#: bp-blogs/classes/class-bp-blogs-component.php:190 +#: bp-blogs/classes/class-bp-blogs-component.php:242 +#: bp-blogs/classes/class-bp-blogs-component.php:273 +#: bp-core/deprecated/2.1.php:62 +msgid "My Sites" msgstr "" -#: bp-blogs/bp-blogs-widgets.php:160 -msgid "Max posts to show:" +#: bp-blogs/classes/class-bp-blogs-component.php:234 +#: bp-blogs/classes/class-bp-blogs-theme-compat.php:113 +#: bp-blogs/classes/class-bp-blogs-theme-compat.php:177 +msgid "Sites" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:26 -#: bp-core/admin/bp-core-admin-functions.php:417 +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:23 +msgid "A list of recently published posts from across your network." +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:42 +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:147 +msgid "Recent Networkwide Posts" +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:111 +msgid "Sorry, there were no posts found. Why not write one?" +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:159 +msgid "Link widget title to Blogs directory" +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:160 +msgid "Max posts to show:" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:25 +#: bp-core/admin/bp-core-admin-settings.php:280 +#: bp-core/admin/bp-core-admin-slugs.php:25 +msgid "BuddyPress Settings" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:27 +#: bp-core/admin/bp-core-admin-functions.php:424 msgid "Components" msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-components.php:33 +#: bp-core/admin/bp-core-admin-settings.php:291 +#: bp-core/admin/bp-core-admin-slugs.php:33 +#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:62 msgid "Save Settings" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:67 -#: bp-core/admin/bp-core-admin-components.php:374 +#: bp-core/admin/bp-core-admin-components.php:68 +#: bp-core/admin/bp-core-admin-components.php:378 msgid "Extended Profiles" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:68 -#: bp-core/admin/bp-core-admin-components.php:375 +#: bp-core/admin/bp-core-admin-components.php:69 +#: bp-core/admin/bp-core-admin-components.php:379 msgid "" "Customize your community with fully editable profile fields that allow your " "users to describe themselves." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:71 -#: bp-core/admin/bp-core-admin-components.php:378 +#: bp-core/admin/bp-core-admin-components.php:72 +#: bp-core/admin/bp-core-admin-components.php:382 msgid "Account Settings" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:72 -#: bp-core/admin/bp-core-admin-components.php:379 +#: bp-core/admin/bp-core-admin-components.php:73 +#: bp-core/admin/bp-core-admin-components.php:383 msgid "" "Allow your users to modify their account and notification settings directly " "from within their profiles." msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-components.php:76 +#: bp-core/admin/bp-core-admin-components.php:398 +#: bp-core/deprecated/2.1.php:530 +#: bp-notifications/classes/class-bp-notifications-component.php:237 msgid "Notifications" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:76 -#: bp-core/admin/bp-core-admin-components.php:395 +#: bp-core/admin/bp-core-admin-components.php:77 +#: bp-core/admin/bp-core-admin-components.php:399 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-admin-components.php:153 +msgid "Filter components list" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:157 msgid "Active <span class=\"count\">(%s)</span>" msgid_plural "Active <span class=\"count\">(%s)</span>" msgstr[0] "" msgstr[1] "" -#: bp-core/admin/bp-core-admin-components.php:154 +#: bp-core/admin/bp-core-admin-components.php:158 msgid "Inactive <span class=\"count\">(%s)</span>" msgid_plural "Inactive <span class=\"count\">(%s)</span>" msgstr[0] "" msgstr[1] "" -#: bp-core/admin/bp-core-admin-components.php:155 +#: bp-core/admin/bp-core-admin-components.php:159 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-admin-components.php:156 +#: bp-core/admin/bp-core-admin-components.php:160 msgid "Retired <span class=\"count\">(%s)</span>" msgid_plural "Retired <span class=\"count\">(%s)</span>" msgstr[0] "" msgstr[1] "" #: bp-core/admin/bp-core-admin-components.php:163 -#: bp-core/admin/bp-core-admin-components.php:171 +msgid "Components list" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:168 +#: bp-core/admin/bp-core-admin-components.php:227 +msgid "Bulk selection is disabled" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:169 +#: bp-core/admin/bp-core-admin-components.php:228 msgid "Component" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:164 -#: bp-core/admin/bp-core-admin-components.php:172 +#: bp-core/admin/bp-core-admin-components.php:170 +#: bp-core/admin/bp-core-admin-components.php:229 msgid "Description" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:224 +#: bp-core/admin/bp-core-admin-components.php:191 +msgid "Select %s" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:195 +msgid "%s is a required component" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:218 msgid "No components found." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:354 bp-core/bp-core-loader.php:27 +#: bp-core/admin/bp-core-admin-components.php:358 +#: bp-core/classes/class-bp-core.php:32 msgid "BuddyPress Core" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:355 +#: bp-core/admin/bp-core-admin-components.php:359 msgid "It‘s what makes <del>time travel</del> BuddyPress possible!" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:358 +#: bp-core/admin/bp-core-admin-components.php:362 msgid "Community Members" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:359 +#: bp-core/admin/bp-core-admin-components.php:363 msgid "Everything in a BuddyPress community revolves around its members." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:366 -#: bp-templates/bp-legacy/buddypress/groups/create.php:152 +#: bp-core/admin/bp-core-admin-components.php:370 +#: bp-templates/bp-legacy/buddypress/groups/create.php:149 msgid "Group Forums" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:367 +#: bp-core/admin/bp-core-admin-components.php:371 msgid "BuddyPress Forums are retired. Use %s." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:382 +#: bp-core/admin/bp-core-admin-components.php:386 msgid "Friend Connections" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:383 +#: bp-core/admin/bp-core-admin-components.php:387 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-admin-components.php:386 +#: bp-core/admin/bp-core-admin-components.php:390 msgid "Private Messaging" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:387 +#: bp-core/admin/bp-core-admin-components.php:391 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-admin-components.php:391 +#: bp-core/admin/bp-core-admin-components.php:395 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-admin-components.php:398 +#: bp-core/admin/bp-core-admin-components.php:402 msgid "User Groups" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:399 +#: bp-core/admin/bp-core-admin-components.php:403 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-admin-components.php:402 +#: bp-core/admin/bp-core-admin-components.php:406 msgid "Group Forums (Legacy)" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:403 +#: bp-core/admin/bp-core-admin-components.php:407 msgid "Group forums allow for focused, bulletin-board style conversations." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:406 +#: bp-core/admin/bp-core-admin-components.php:410 msgid "Site Tracking" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:407 +#: bp-core/admin/bp-core-admin-components.php:411 msgid "Record activity for new posts and comments from your site." msgstr "" -#: bp-core/admin/bp-core-admin-components.php:414 +#: bp-core/admin/bp-core-admin-components.php:418 msgid "Record activity for new sites, posts, and comments across your network." msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:105 +#: bp-core/admin/bp-core-admin-functions.php:107 msgid "Why have all my BuddyPress menus disappeared?" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:107 +#: bp-core/admin/bp-core-admin-functions.php:109 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-admin-functions.php:108 +#: bp-core/admin/bp-core-admin-functions.php:110 msgid "" "Components, Pages, Settings, and Forums, have been moved to <a " "href=\"%s\">Settings > BuddyPress</a>. Profile Fields has been moved " "into the <a href=\"%s\">Users</a> menu." msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:243 +#: bp-core/admin/bp-core-admin-functions.php:246 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-admin-functions.php:270 -#: bp-core/admin/bp-core-admin-slugs.php:148 -#: bp-members/admin/bp-members-admin-classes.php:294 -#: bp-members/admin/bp-members-admin-classes.php:298 -#: bp-members/admin/bp-members-admin-classes.php:673 -#: bp-members/admin/bp-members-admin-classes.php:677 -#: bp-messages/bp-messages-template.php:1532 -#: bp-templates/bp-legacy/buddypress/members/activate.php:46 +#: bp-core/admin/bp-core-admin-functions.php:273 +#: bp-core/admin/bp-core-admin-slugs.php:92 +#: bp-members/classes/class-bp-members-list-table.php:308 +#: bp-members/classes/class-bp-members-list-table.php:312 +#: bp-members/classes/class-bp-members-ms-list-table.php:301 +#: bp-members/classes/class-bp-members-ms-list-table.php:305 +#: bp-messages/bp-messages-template.php:1195 +#: bp-templates/bp-legacy/buddypress/members/activate.php:56 msgid "Activate" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:275 -#: bp-core/admin/bp-core-admin-slugs.php:147 +#: bp-core/admin/bp-core-admin-functions.php:278 +#: bp-core/admin/bp-core-admin-slugs.php:91 +#: bp-core/classes/class-bp-core-login-widget.php:119 #: bp-members/bp-members-adminbar.php:63 msgid "Register" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:301 +#: bp-core/admin/bp-core-admin-functions.php:305 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-admin-functions.php:323 +#: bp-core/admin/bp-core-admin-functions.php:327 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-admin-functions.php:421 -#: bp-core/admin/bp-core-admin-slugs.php:26 +#: bp-core/admin/bp-core-admin-functions.php:428 +#: bp-core/admin/bp-core-admin-slugs.php:27 msgid "Pages" msgstr "" -#: 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" +#: bp-core/admin/bp-core-admin-functions.php:432 +#: bp-core/admin/bp-core-admin-settings.php:282 +#: bp-core/bp-core-template.php:106 +msgid "Options" msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-functions.php:445 +#: bp-forums/bp-forums-loader.php:152 bp-forums/bp-forums-loader.php:207 +#: bp-forums/bp-forums-loader.php:249 bp-forums/bp-forums-screens.php:289 +#: bp-forums/bp-forums-screens.php:291 bp-forums/deprecated/1.6.php:39 +#: bp-forums/deprecated/1.7.php:24 bp-forums/deprecated/1.7.php:101 msgid "Forums" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:479 +#: bp-core/admin/bp-core-admin-functions.php:488 msgid "" "<a " "href=\"https://codex.buddypress.org/getting-started/configure-components/\">" "Managing Components</a>" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:497 +#: bp-core/admin/bp-core-admin-functions.php:506 msgid "" "<a " "href=\"https://codex.buddypress.org/getting-started/configure-components/#" "settings-buddypress-pages\">Managing Pages</a>" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:516 +#: bp-core/admin/bp-core-admin-functions.php:525 msgid "" "<a " "href=\"https://codex.buddypress.org/getting-started/configure-components/#" "settings-buddypress-settings\">Managing Settings</a>" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:535 +#: bp-core/admin/bp-core-admin-functions.php:544 msgid "" "<a " "href=\"https://codex.buddypress.org/administrator-guide/extended-profiles/\"" ">Managing Profile Fields</a>" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:553 +#: bp-core/admin/bp-core-admin-functions.php:565 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 " @@ -1357,60 +1388,92 @@ msgid "" "using the site." msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:557 +#: bp-core/admin/bp-core-admin-functions.php:569 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-admin-functions.php:561 +#: bp-core/admin/bp-core-admin-functions.php:573 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-admin-functions.php:565 +#: bp-core/admin/bp-core-admin-functions.php:577 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." +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:577 +msgid "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-admin-functions.php:760 -#: bp-core/admin/bp-core-admin-functions.php:769 +#: bp-core/admin/bp-core-admin-functions.php:775 +#: bp-core/admin/bp-core-admin-functions.php:784 msgid "Logged-In" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:763 #: bp-core/admin/bp-core-admin-functions.php:778 +#: bp-core/admin/bp-core-admin-functions.php:793 msgid "Logged-Out" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:770 +#: bp-core/admin/bp-core-admin-functions.php:785 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-admin-functions.php:779 +#: bp-core/admin/bp-core-admin-functions.php:794 msgid "<em>Logged-Out</em> links are not visible to users who are logged in." msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:789 +#: bp-core/admin/bp-core-admin-functions.php:804 msgid "Add to Menu" msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:921 -#: bp-members/bp-members-actions.php:53 bp-members/bp-members-admin.php:298 +#: bp-core/admin/bp-core-admin-functions.php:839 +msgid "" +"Are your emails in the wrong language? Go to <a href=\"%s\">BuddyPress " +"Tools and run the \"reinstall emails\"</a> tool." +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:859 +msgid "" +"Phrases wrapped in braces <code>{{ }}</code> are email tokens. <a " +"href=\"%s\">Learn about tokens on the BuddyPress Codex</a>." +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:902 +msgid "Choose when this email will be sent." +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:915 +#: bp-core/admin/bp-core-admin-functions.php:931 +msgid "Plain text email content" +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:933 +msgid "" +"Most email clients support HTML email. However, some people prefer to " +"receive plain text email. Enter a plain text alternative version of your " +"email here." +msgstr "" + +#: bp-core/admin/bp-core-admin-functions.php:1061 +#: bp-members/bp-members-actions.php:53 +#: bp-members/classes/class-bp-members-admin.php:309 msgid "User marked as spammer. Spam users are visible only to site admins." msgstr "" -#: bp-core/admin/bp-core-admin-functions.php:923 +#: bp-core/admin/bp-core-admin-functions.php:1063 msgid "User removed from spam." msgstr "" @@ -1434,1201 +1497,1793 @@ msgstr "" msgid "Automatically check for new items while viewing the activity stream" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:138 +#: bp-core/admin/bp-core-admin-settings.php:141 msgid "Enable BuddyPress to WordPress profile syncing" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:154 +#: bp-core/admin/bp-core-admin-settings.php:157 msgid "Allow registered members to upload avatars" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:179 +#: bp-core/admin/bp-core-admin-settings.php:170 +msgid "Allow registered members to upload cover images" +msgstr "" + +#: bp-core/admin/bp-core-admin-settings.php:194 msgid "Enable group creation for all users" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:180 +#: bp-core/admin/bp-core-admin-settings.php:195 msgid "Administrators can always create groups, regardless of this setting." msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:193 +#: bp-core/admin/bp-core-admin-settings.php:208 msgid "Allow customizable avatars for groups" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:223 +#: bp-core/admin/bp-core-admin-settings.php:220 +msgid "Allow customizable cover images for groups" +msgstr "" + +#: bp-core/admin/bp-core-admin-settings.php:251 msgid "Attempt to save a new config file." msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:223 -#: bp-core/admin/bp-core-admin-tools.php:34 +#: bp-core/admin/bp-core-admin-settings.php:251 +#: bp-core/admin/bp-core-admin-tools.php:37 msgid "Repair" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:224 +#: bp-core/admin/bp-core-admin-settings.php:252 msgid "File does not exist" msgstr "" -#: bp-core/admin/bp-core-admin-settings.php:228 +#: bp-core/admin/bp-core-admin-settings.php:256 msgid "Absolute path to your bbPress configuration file." msgstr "" -#: bp-core/admin/bp-core-admin-slugs.php:86 +#: bp-core/admin/bp-core-admin-slugs.php:123 msgid "Directories" msgstr "" -#: bp-core/admin/bp-core-admin-slugs.php:88 +#: bp-core/admin/bp-core-admin-slugs.php:125 msgid "Associate a WordPress Page with each BuddyPress component directory." msgstr "" -#: bp-core/admin/bp-core-admin-slugs.php:107 -#: bp-core/admin/bp-core-admin-slugs.php:183 +#: bp-core/admin/bp-core-admin-slugs.php:144 +#: bp-core/admin/bp-core-admin-slugs.php:207 msgid "- None -" msgstr "" -#: bp-core/admin/bp-core-admin-slugs.php:162 +#: bp-core/admin/bp-core-admin-slugs.php:186 msgid "Registration" msgstr "" -#: bp-core/admin/bp-core-admin-slugs.php:164 +#: bp-core/admin/bp-core-admin-slugs.php:188 msgid "Associate WordPress Pages with the following BuddyPress Registration pages." msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-tools.php:22 +#: bp-core/admin/bp-core-admin-tools.php:413 +#: bp-core/admin/bp-core-admin-tools.php:416 +#: bp-core/classes/class-bp-admin.php:302 msgid "BuddyPress Tools" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:22 -#: bp-core/admin/bp-core-admin-tools.php:403 +#: bp-core/admin/bp-core-admin-tools.php:25 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." +"BuddyPress keeps track of various relationships between members, 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-admin-tools.php:23 +#: bp-core/admin/bp-core-admin-tools.php:26 msgid "Use the tools below to manually recalculate these relationships." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:25 +#: bp-core/admin/bp-core-admin-tools.php:28 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-admin-tools.php:31 -msgid "Data to Repair:" +#: bp-core/admin/bp-core-admin-tools.php:34 +msgid "Repair tools" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:49 +#: bp-core/admin/bp-core-admin-tools.php:52 msgid "Repair Items" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:105 -msgid "Count total members" +#: bp-core/admin/bp-core-admin-tools.php:108 +msgid "Repair total members count." +msgstr "" + +#: bp-core/admin/bp-core-admin-tools.php:114 +msgid "Repair member \"last activity\" data." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:111 -msgid "Repair user \"last activity\" data" +#: bp-core/admin/bp-core-admin-tools.php:123 +msgid "Repair total friends count for each member." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:120 -msgid "Count friends for each user" +#: bp-core/admin/bp-core-admin-tools.php:133 +msgid "Repair total groups count for each member." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:130 -msgid "Count groups for each user" +#: bp-core/admin/bp-core-admin-tools.php:143 +msgid "Repopulate site tracking records." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:140 -msgid "Repopulate blogs records" +#: bp-core/admin/bp-core-admin-tools.php:152 +msgid "Reinstall emails (delete and restore from defaults)." msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:171 +#: bp-core/admin/bp-core-admin-tools.php:182 msgid "Counting the number of friends for each user… %s" msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-tools.php:183 +#: bp-core/admin/bp-core-admin-tools.php:241 +#: bp-core/admin/bp-core-admin-tools.php:286 msgid "Failed!" msgstr "" -#: 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 +#: bp-core/admin/bp-core-admin-tools.php:223 +#: bp-core/admin/bp-core-admin-tools.php:270 +#: bp-core/admin/bp-core-admin-tools.php:298 +#: bp-core/admin/bp-core-admin-tools.php:314 +#: bp-core/admin/bp-core-admin-tools.php:327 msgid "Complete!" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:229 +#: bp-core/admin/bp-core-admin-tools.php:240 msgid "Counting the number of groups for each user… %s" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:272 +#: bp-core/admin/bp-core-admin-tools.php:283 msgid "Repopulating Blogs records… %s" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:300 +#: bp-core/admin/bp-core-admin-tools.php:311 msgid "Counting the number of active members on the site… %s" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:314 +#: bp-core/admin/bp-core-admin-tools.php:325 msgid "Determining last activity dates for each user… %s" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:372 bp-core/bp-core-admin.php:268 -#: bp-core/bp-core-admin.php:269 +#: bp-core/admin/bp-core-admin-tools.php:384 +#: bp-core/classes/class-bp-admin.php:279 +#: bp-core/classes/class-bp-admin.php:280 msgid "Tools" msgstr "" -#: 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" +#: bp-core/admin/bp-core-admin-tools.php:415 +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/bp-core-admin.php:227 -msgid "BuddyPress Help" +#: bp-core/admin/bp-core-admin-tools.php:474 +msgid "Emails have been successfully reinstalled." msgstr "" -#: bp-core/bp-core-admin.php:228 -msgid "Help" -msgstr "" +#: bp-core/bp-core-admin.php:28 +msgid "Maintenance Release" +msgid_plural "Maintenance Releases" +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:237 -msgid "BuddyPress Components" -msgstr "" +#: bp-core/bp-core-admin.php:29 +msgid "Security Release" +msgid_plural "Security Releases" +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:246 bp-core/bp-core-admin.php:247 -msgid "BuddyPress Pages" -msgstr "" +#: bp-core/bp-core-admin.php:30 +msgid "Maintenance and Security Release" +msgid_plural "Maintenance and Security Releases" +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:255 bp-core/bp-core-admin.php:256 -msgid "BuddyPress Settings" -msgstr "" +#: bp-core/bp-core-admin.php:33 +#. 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:279 bp-core/bp-core-admin.php:280 -msgid "Available Tools" -msgstr "" +#: bp-core/bp-core-admin.php:38 +#. 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:318 -msgid "Main Settings" -msgstr "" +#: bp-core/bp-core-admin.php:43 +#. 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." +msgid_plural "" +"<strong>Version %1$s</strong> addressed a security issue and fixed %2$s " +"bugs." +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:321 bp-core/bp-core-admin.php:326 -msgid "Toolbar" -msgstr "" +#: bp-core/bp-core-admin.php:48 +#. translators: 1: WordPress version number, 2: plural number of bugs. More +#. than one security issue. +msgid "" +"<strong>Version %1$s</strong> addressed some security issues and fixed %2$s " +"bug." +msgid_plural "" +"<strong>Version %1$s</strong> addressed some security issues and fixed %2$s " +"bugs." +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:331 -msgid "Account Deletion" +#: bp-core/bp-core-admin.php:52 +msgid "For more information, see <a href=\"%s\">the release notes</a>." msgstr "" -#: bp-core/bp-core-admin.php:341 -msgid "Profile Photo Uploads" +#: bp-core/bp-core-adminbar.php:36 bp-core/deprecated/2.1.php:213 +msgid "My Account" msgstr "" -#: bp-core/bp-core-admin.php:345 -msgid "Profile Syncing" +#: bp-core/bp-core-adminbar.php:79 +msgid "" +"The BuddyBar is no longer supported. Please migrate to the WordPress " +"toolbar as soon as possible." msgstr "" -#: bp-core/bp-core-admin.php:354 -msgid "Groups Settings" +#: bp-core/bp-core-attachments.php:592 +msgid "You have attempted to queue too many files." msgstr "" -#: bp-core/bp-core-admin.php:357 -msgid "Group Creation" +#: bp-core/bp-core-attachments.php:593 +msgid "%s exceeds the maximum upload size for this site." msgstr "" -#: bp-core/bp-core-admin.php:361 -msgid "Group Photo Uploads" +#: bp-core/bp-core-attachments.php:594 +msgid "This file is empty. Please try another." msgstr "" -#: bp-core/bp-core-admin.php:370 -msgid "Legacy Group Forums" +#: bp-core/bp-core-attachments.php:595 +msgid "This file type is not allowed. Please try another." msgstr "" -#: bp-core/bp-core-admin.php:373 -msgid "bbPress Configuration" +#: bp-core/bp-core-attachments.php:596 +msgid "This file is not an image. Please try another." msgstr "" -#: bp-core/bp-core-admin.php:382 -msgid "Activity Settings" +#: bp-core/bp-core-attachments.php:597 +msgid "Memory exceeded. Please try another smaller file." msgstr "" -#: bp-core/bp-core-admin.php:385 -msgid "Blog & Forum Comments" +#: bp-core/bp-core-attachments.php:598 +msgid "This is larger than the maximum size. Please try another." msgstr "" -#: bp-core/bp-core-admin.php:389 -msgid "Activity auto-refresh" +#: bp-core/bp-core-attachments.php:599 +msgid "An error occurred. Please try again later." msgstr "" -#: bp-core/bp-core-admin.php:394 -msgid "Akismet" +#: bp-core/bp-core-attachments.php:600 +msgid "There was a configuration error. Please contact the server administrator." msgstr "" -#: bp-core/bp-core-admin.php:412 -msgid "About BuddyPress" +#: bp-core/bp-core-attachments.php:601 +msgid "You may only upload 1 file." msgstr "" -#: bp-core/bp-core-admin.php:437 -msgid "About" +#: bp-core/bp-core-attachments.php:602 +msgid "HTTP error." msgstr "" -#: bp-core/bp-core-admin.php:506 -msgid "Getting Started with BuddyPress" +#: bp-core/bp-core-attachments.php:603 bp-core/bp-core-avatars.php:1047 +msgid "Upload failed." msgstr "" -#: bp-core/bp-core-admin.php:509 -msgid "Configure BuddyPress" +#: bp-core/bp-core-attachments.php:604 +msgid "Please try uploading this file with the %1$sbrowser uploader%2$s." msgstr "" -#: bp-core/bp-core-admin.php:512 -msgid "Set Up Components" +#: bp-core/bp-core-attachments.php:605 +msgid "" +"%s exceeds the maximum upload size for the multi-file uploader when used in " +"your browser." msgstr "" -#: bp-core/bp-core-admin.php:515 -msgid "Assign Components to Pages" +#: bp-core/bp-core-attachments.php:606 +msgid "IO error." msgstr "" -#: bp-core/bp-core-admin.php:518 -msgid "Customize Settings" +#: bp-core/bp-core-attachments.php:607 +msgid "Security error." msgstr "" -#: bp-core/bp-core-admin.php:521 -msgid "Get Started" +#: bp-core/bp-core-attachments.php:608 +msgid "File canceled." msgstr "" -#: bp-core/bp-core-admin.php:524 -msgid "Administration Tools" +#: bp-core/bp-core-attachments.php:609 +msgid "Upload stopped." msgstr "" -#: bp-core/bp-core-admin.php:527 -msgid "Add User Profile Fields" +#: bp-core/bp-core-attachments.php:610 +msgid "Dismiss" msgstr "" -#: bp-core/bp-core-admin.php:529 -msgid "Manage User Signups" +#: bp-core/bp-core-attachments.php:611 +msgid "Crunching…" msgstr "" -#: bp-core/bp-core-admin.php:531 -msgid "Moderate Activity Streams" +#: bp-core/bp-core-attachments.php:612 +msgid "Make sure to upload a unique file" msgstr "" -#: bp-core/bp-core-admin.php:534 -msgid "Manage Groups" +#: bp-core/bp-core-attachments.php:613 +msgid "“%s” has failed to upload." msgstr "" -#: bp-core/bp-core-admin.php:536 -msgid "Repair Data" +#: bp-core/bp-core-attachments.php:614 +msgid "" +"If you'd like to delete the existing profile photo but not upload a new " +"one, please use the delete tab." msgstr "" -#: bp-core/bp-core-admin.php:541 -msgid "Community and Support" +#: bp-core/bp-core-attachments.php:716 +msgid "Upload" msgstr "" -#: bp-core/bp-core-admin.php:542 -msgid "" -"Looking for help? The <a href=\"https://codex.buddypress.org/\">BuddyPress " -"Codex</a> has you covered." +#: bp-core/bp-core-attachments.php:724 +msgid "Take Photo" msgstr "" -#: bp-core/bp-core-admin.php:543 -msgid "" -"Can’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." +#: bp-core/bp-core-attachments.php:728 +msgid "Please allow us to access to your camera." msgstr "" -#: bp-core/bp-core-admin.php:552 -msgid "Upload Profile Pictures with Drag and Drop" +#: bp-core/bp-core-attachments.php:729 +msgid "Please wait as we access your camera." msgstr "" -#: bp-core/bp-core-admin.php:555 -msgid "Revamped Profile Picture Upload UI" +#: bp-core/bp-core-attachments.php:730 +msgid "Camera loaded. Click on the \"Capture\" button to take your photo." msgstr "" -#: bp-core/bp-core-admin.php:559 +#: bp-core/bp-core-attachments.php:731 msgid "" -"Built with the Attachments API, the new foundation for BuddyPress media " -"management." +"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-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." +#: bp-core/bp-core-attachments.php:732 +msgid "Your browser is not supported. Please upload a photo instead." msgstr "" -#: bp-core/bp-core-admin.php:560 -msgid "Learn more →" +#: bp-core/bp-core-attachments.php:733 +msgid "Video error. Please upload a photo instead." msgstr "" -#: bp-core/bp-core-admin.php:567 -msgid "The Finer Points" +#: bp-core/bp-core-attachments.php:734 +msgid "Your profile photo is ready. Click on the \"Save\" button to use this photo." msgstr "" -#: bp-core/bp-core-admin.php:572 -msgid "Member Type Directories" +#: bp-core/bp-core-attachments.php:735 +msgid "No photo was captured. Click on the \"Capture\" button to take your photo." msgstr "" -#: bp-core/bp-core-admin.php:573 -msgid "Create directories of member types in your site using the Member Type API." +#: bp-core/bp-core-attachments.php:782 +msgid "" +"For better results, make sure to upload an image that is larger than %1$spx " +"wide, and %2$spx tall." msgstr "" -#: bp-core/bp-core-admin.php:578 -msgid "Companion Stylesheets For Themes" +#: bp-core/bp-core-attachments.php:1294 bp-core/bp-core-avatars.php:887 +msgid "Upload Failed! Error was: %s" msgstr "" -#: bp-core/bp-core-admin.php:579 -msgid "" -"Improved styling and integration of BuddyPress components with bundled " -"WordPress themes, Twenty Fifteen and Twenty Fourteen." +#: bp-core/bp-core-attachments.php:1299 +msgid "There was a problem uploading the cover image." msgstr "" -#: bp-core/bp-core-admin.php:584 -msgid "Blog Post Activity" +#: bp-core/bp-core-avatars.php:343 +msgid "Profile Photo" msgstr "" -#: bp-core/bp-core-admin.php:585 -msgid "" -"BuddyPress now generates better excerpts in the activity streams for posts " -"containing images or other embedded media content." +#: bp-core/bp-core-avatars.php:915 +msgid "Upload failed! Error was: %s" msgstr "" -#: bp-core/bp-core-admin.php:590 -msgid "Star Private Messages " +#: bp-core/bp-core-avatars.php:921 +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-admin.php:591 -msgid "Mark important messages in your inbox from your friends with a star." -msgstr "" - -#: bp-core/bp-core-admin.php:597 -msgid "Under the Hood" -msgstr "" - -#: bp-core/bp-core-admin.php:601 -msgid "Components can register new features" -msgstr "" - -#: bp-core/bp-core-admin.php:602 -msgid "" -"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:604 -msgid "Cache Improvements" +#: bp-core/bp-core-avatars.php:1411 bp-core/bp-core-template.php:185 +#: bp-core/bp-core-template.php:204 bp-core/classes/class-bp-core-user.php:186 +#: bp-core/classes/class-bp-core-user.php:187 +#: bp-core/classes/class-bp-core-user.php:188 +#: bp-groups/classes/class-bp-groups-invite-template.php:234 +#: bp-groups/classes/class-bp-groups-invite-template.php:235 +#: bp-groups/classes/class-bp-groups-invite-template.php:236 +msgid "Profile photo of %s" msgstr "" -#: bp-core/bp-core-admin.php:605 -msgid "" -"Improved caching for the following components: Messages, Profiles, Members " -"& Member Types, and Friends." +#: bp-core/bp-core-buddybar.php:641 bp-core/bp-core-buddybar.php:652 +#: bp-core/bp-core-buddybar.php:672 +msgid "You do not have access to this page." msgstr "" -#: bp-core/bp-core-admin.php:608 -msgid "Developer Reference" +#: bp-core/bp-core-caps.php:382 bp-core/bp-core-caps.php:394 +#: bp-core/bp-core-caps.php:408 bp-core/bp-core-caps.php:418 +msgid "Special community roles no longer exist. Use mapped capabilities instead" msgstr "" -#: bp-core/bp-core-admin.php:609 +#: bp-core/bp-core-catchuri.php:312 msgid "" -"Continued improvements to inline code documentation make it easier for " -"developers to understand how BuddyPress works." +"This user has been marked as a spammer. Only site admins can view this " +"profile." msgstr "" -#: bp-core/bp-core-admin.php:611 -msgid "User Documentation" +#: bp-core/bp-core-catchuri.php:572 bp-core/bp-core-catchuri.php:649 +msgid "You must log in to access the page you requested." msgstr "" -#: bp-core/bp-core-admin.php:612 -msgid "" -"The BuddyPress Codex is maintained and updated regularly with new articles " -"and tutorials." +#: bp-core/bp-core-customizer-email.php:33 +msgid "Customize the appearance of emails sent by BuddyPress." msgstr "" -#: bp-core/bp-core-admin.php:640 -msgid "BuddyPress is created by a worldwide network of friendly folks like these." +#: bp-core/bp-core-customizer-email.php:284 +msgid "Email background color" msgstr "" -#: bp-core/bp-core-admin.php:642 -msgid "Project Leaders" +#: bp-core/bp-core-customizer-email.php:291 +msgid "Header background color" msgstr "" -#: bp-core/bp-core-admin.php:647 -msgid "Project Lead" +#: bp-core/bp-core-customizer-email.php:298 +msgid "Applied to links and other decorative areas." msgstr "" -#: bp-core/bp-core-admin.php:652 bp-core/bp-core-admin.php:657 -msgid "Lead Developer" +#: bp-core/bp-core-customizer-email.php:299 +msgid "Highlight color" msgstr "" -#: bp-core/bp-core-admin.php:661 -msgid "Core Team" +#: bp-core/bp-core-customizer-email.php:306 +#: bp-core/bp-core-customizer-email.php:335 +#: bp-core/bp-core-customizer-email.php:372 +msgid "Text color" msgstr "" -#: 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" +#: bp-core/bp-core-customizer-email.php:313 +#: bp-core/bp-core-customizer-email.php:342 +#: bp-core/bp-core-customizer-email.php:379 +msgid "Text size" msgstr "" -#: bp-core/bp-core-admin.php:676 -msgid "Navigator" +#: bp-core/bp-core-customizer-email.php:327 +#: bp-core/bp-core-customizer-email.php:365 +msgid "Background color" msgstr "" -#: bp-core/bp-core-admin.php:695 -msgid "Recent Rockstars" +#: bp-core/bp-core-customizer-email.php:356 +msgid "Change the email footer here" msgstr "" -#: bp-core/bp-core-admin.php:720 -msgid "Contributors to BuddyPress %s" +#: bp-core/bp-core-customizer-email.php:357 +msgid "Footer text" msgstr "" -#: bp-core/bp-core-admin.php:764 -msgid "External Libraries" +#: bp-core/bp-core-dependency.php:225 +msgid "The current user is being initialized without using $wp->init()." msgstr "" -#: 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." +#: bp-core/bp-core-filters.php:410 bp-core/bp-core-filters.php:443 +msgid "[User Set]" msgstr "" -#: bp-core/bp-core-admin.php:786 -msgid "" -"BuddyPress %s comes with a bunch of great improvements we think " -"you’re really going to like." +#: bp-core/bp-core-filters.php:586 +msgid "Page %s" msgstr "" -#: bp-core/bp-core-admin.php:790 -msgid "Welcome to BuddyPress %s" +#: bp-core/bp-core-functions.php:1091 +msgid "sometime" msgstr "" -#: bp-core/bp-core-admin.php:811 -msgid "What’s New" +#: bp-core/bp-core-functions.php:1100 +msgid "right now" msgstr "" -#: bp-core/bp-core-admin.php:813 -msgid "Credits" +#: bp-core/bp-core-functions.php:1109 +msgid "%s ago" msgstr "" -#: bp-core/bp-core-admin.php:880 -msgid "Maintenance Release" -msgid_plural "Maintenance Releases" +#: bp-core/bp-core-functions.php:1170 +msgid "%s year" +msgid_plural "%s years" msgstr[0] "" msgstr[1] "" -#: bp-core/bp-core-admin.php:881 -msgid "Security Release" -msgid_plural "Security Releases" +#: bp-core/bp-core-functions.php:1173 bp-core/bp-core-functions.php:1207 +msgid "%s month" +msgid_plural "%s months" msgstr[0] "" msgstr[1] "" -#: bp-core/bp-core-admin.php:882 -msgid "Maintenance and Security Release" -msgid_plural "Maintenance and Security Releases" +#: bp-core/bp-core-functions.php:1176 bp-core/bp-core-functions.php:1210 +msgid "%s week" +msgid_plural "%s weeks" msgstr[0] "" msgstr[1] "" -#: 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." +#: bp-core/bp-core-functions.php:1179 bp-core/bp-core-functions.php:1213 +msgid "%s day" +msgid_plural "%s days" msgstr[0] "" msgstr[1] "" -#: 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." +#: bp-core/bp-core-functions.php:1182 bp-core/bp-core-functions.php:1216 +msgid "%s hour" +msgid_plural "%s hours" msgstr[0] "" msgstr[1] "" -#: 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." -msgid_plural "" -"<strong>Version %1$s</strong> addressed a security issue and fixed %2$s " -"bugs." +#: bp-core/bp-core-functions.php:1185 bp-core/bp-core-functions.php:1219 +msgid "%s minute" +msgid_plural "%s minutes" msgstr[0] "" msgstr[1] "" -#: bp-core/bp-core-admin.php:900 -#. translators: 1: WordPress version number, 2: plural number of bugs. More -#. than one security issue. -msgid "" -"<strong>Version %1$s</strong> addressed some security issues and fixed %2$s " -"bug." -msgid_plural "" -"<strong>Version %1$s</strong> addressed some security issues and fixed %2$s " -"bugs." +#: bp-core/bp-core-functions.php:1188 bp-core/bp-core-functions.php:1222 +msgid "%s second" +msgid_plural "%s seconds" msgstr[0] "" msgstr[1] "" -#: bp-core/bp-core-admin.php:904 -msgid "For more information, see <a href=\"%s\">the release notes</a>." +#: bp-core/bp-core-functions.php:1454 +msgid "Not recently active" msgstr "" -#: bp-core/bp-core-adminbar.php:36 bp-core/deprecated/2.1.php:262 -msgid "My Account" +#: bp-core/bp-core-functions.php:2370 +#: bp-core/classes/class-bp-core-login-widget.php:83 +#: bp-core/deprecated/1.5.php:313 bp-core/deprecated/2.1.php:258 +#: bp-members/bp-members-template.php:1239 +msgid "Log Out" msgstr "" -#: bp-core/bp-core-adminbar.php:79 -msgid "" -"The BuddyBar is no longer supported. Please migrate to the WordPress " -"toolbar as soon as possible." +#: bp-core/bp-core-functions.php:2435 +#: bp-core/classes/class-bp-core-login-widget.php:115 +#: bp-core/deprecated/2.1.php:190 +msgid "Log In" msgstr "" -#: bp-core/bp-core-attachments.php:95 -msgid "You have attempted to queue too many files." +#: bp-core/bp-core-functions.php:3139 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] {{poster.name}} replied to one of your updates" msgstr "" -#: bp-core/bp-core-attachments.php:96 -msgid "%s exceeds the maximum upload size for this site." +#: bp-core/bp-core-functions.php:3141 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} replied to one of your updates:\n" +"\n" +"<blockquote>"{{usermessage}}"</blockquote>\n" +"\n" +"<a href=\"{{{thread.url}}}\">Go to the discussion</a> to reply or catch up " +"on the conversation." msgstr "" -#: bp-core/bp-core-attachments.php:97 -msgid "This file is empty. Please try another." +#: bp-core/bp-core-functions.php:3143 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} replied to one of your updates:\n" +"\n" +"\"{{usermessage}}\"\n" +"\n" +"Go to the discussion to reply or catch up on the conversation: " +"{{{thread.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:98 -msgid "This file type is not allowed. Please try another." +#: bp-core/bp-core-functions.php:3147 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] {{poster.name}} replied to one of your comments" msgstr "" -#: bp-core/bp-core-attachments.php:99 -msgid "This file is not an image. Please try another." +#: bp-core/bp-core-functions.php:3149 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} replied to one of your comments:\n" +"\n" +"<blockquote>"{{usermessage}}"</blockquote>\n" +"\n" +"<a href=\"{{{thread.url}}}\">Go to the discussion</a> to reply or catch up " +"on the conversation." msgstr "" -#: bp-core/bp-core-attachments.php:100 -msgid "Memory exceeded. Please try another smaller file." +#: bp-core/bp-core-functions.php:3151 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} replied to one of your comments:\n" +"\n" +"\"{{usermessage}}\"\n" +"\n" +"Go to the discussion to reply or catch up on the conversation: " +"{{{thread.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:101 -msgid "This is larger than the maximum size. Please try another." +#: bp-core/bp-core-functions.php:3155 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] {{poster.name}} mentioned you in a status update" msgstr "" -#: bp-core/bp-core-attachments.php:102 -msgid "An error occurred. Please try again later." +#: bp-core/bp-core-functions.php:3157 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} mentioned you in a status update:\n" +"\n" +"<blockquote>"{{usermessage}}"</blockquote>\n" +"\n" +"<a href=\"{{{mentioned.url}}}\">Go to the discussion</a> to reply or catch " +"up on the conversation." msgstr "" -#: bp-core/bp-core-attachments.php:103 -msgid "There was a configuration error. Please contact the server administrator." +#: bp-core/bp-core-functions.php:3159 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} mentioned you in a status update:\n" +"\n" +"\"{{usermessage}}\"\n" +"\n" +"Go to the discussion to reply or catch up on the conversation: " +"{{{mentioned.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:104 -msgid "You may only upload 1 file." +#: bp-core/bp-core-functions.php:3163 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] {{poster.name}} mentioned you in an update" msgstr "" -#: bp-core/bp-core-attachments.php:105 -msgid "HTTP error." +#: bp-core/bp-core-functions.php:3165 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} mentioned you in the group \"{{group.name}}\":\n" +"\n" +"<blockquote>"{{usermessage}}"</blockquote>\n" +"\n" +"<a href=\"{{{mentioned.url}}}\">Go to the discussion</a> to reply or catch " +"up on the conversation." msgstr "" -#: bp-core/bp-core-attachments.php:106 bp-core/bp-core-avatars.php:965 -msgid "Upload failed." +#: bp-core/bp-core-functions.php:3167 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{poster.name}} mentioned you in the group \"{{group.name}}\":\n" +"\n" +"\"{{usermessage}}\"\n" +"\n" +"Go to the discussion to reply or catch up on the conversation: " +"{{{mentioned.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:107 -msgid "Please try uploading this file with the %1$sbrowser uploader%2$s." +#: bp-core/bp-core-functions.php:3171 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Activate your account" msgstr "" -#: bp-core/bp-core-attachments.php:108 +#: bp-core/bp-core-functions.php:3173 +#. translators: do not remove {} brackets or translate its contents. msgid "" -"%s exceeds the maximum upload size for the multi-file uploader when used in " -"your browser." +"Thanks for registering!\n" +"\n" +"To complete the activation of your account, go to the following link: <a " +"href=\"{{{activate.url}}}\">{{{activate.url}}}</a>" msgstr "" -#: bp-core/bp-core-attachments.php:109 -msgid "IO error." +#: bp-core/bp-core-functions.php:3175 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Thanks for registering!\n" +"\n" +"To complete the activation of your account, go to the following link: " +"{{{activate.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:110 -msgid "Security error." +#: bp-core/bp-core-functions.php:3179 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Activate {{{user-site.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:111 -msgid "File canceled." +#: bp-core/bp-core-functions.php:3181 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Thanks for registering!\n" +"\n" +"To complete the activation of your account and site, go to the following " +"link: <a href=\"{{{activate-site.url}}}\">{{{activate-site.url}}}</a>.\n" +"\n" +"After you activate, you can visit your site at <a " +"href=\"{{{user-site.url}}}\">{{{user-site.url}}}</a>." msgstr "" -#: bp-core/bp-core-attachments.php:112 -msgid "Upload stopped." +#: bp-core/bp-core-functions.php:3183 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Thanks for registering!\n" +"\n" +"To complete the activation of your account and site, go to the following " +"link: {{{activate-site.url}}}\n" +"\n" +"After you activate, you can visit your site at {{{user-site.url}}}." msgstr "" -#: bp-core/bp-core-attachments.php:113 -msgid "Dismiss" +#: bp-core/bp-core-functions.php:3187 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] New friendship request from {{initiator.name}}" msgstr "" -#: bp-core/bp-core-attachments.php:114 -msgid "Crunching…" +#: bp-core/bp-core-functions.php:3189 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"<a href=\"{{{initiator.url}}}\">{{initiator.name}}</a> wants to add you as " +"a friend.\n" +"\n" +"To accept this request and manage all of your pending requests, visit: <a " +"href=\"{{{friend-requests.url}}}\">{{{friend-requests.url}}}</a>" msgstr "" -#: bp-core/bp-core-attachments.php:115 -msgid "Make sure to upload a unique file" +#: bp-core/bp-core-functions.php:3191 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{initiator.name}} wants to add you as a friend.\n" +"\n" +"To accept this request and manage all of your pending requests, visit: " +"{{{friend-requests.url}}}\n" +"\n" +"To view {{initiator.name}}'s profile, visit: {{{initiator.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:116 -msgid "“%s” has failed to upload." +#: bp-core/bp-core-functions.php:3195 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] {{friend.name}} accepted your friendship request" msgstr "" -#: bp-core/bp-core-attachments.php:117 +#: bp-core/bp-core-functions.php:3197 +#. translators: do not remove {} brackets or translate its contents. msgid "" -"If you'd like to delete the existing profile photo but not upload a new " -"one, please use the delete tab." +"<a href=\"{{{friendship.url}}}\">{{friend.name}}</a> accepted your friend " +"request." msgstr "" -#: bp-core/bp-core-attachments.php:218 -msgid "Upload" +#: bp-core/bp-core-functions.php:3199 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{friend.name}} accepted your friend request.\n" +"\n" +"To learn more about them, visit their profile: {{{friendship.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:226 -msgid "Take Photo" +#: bp-core/bp-core-functions.php:3203 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Group details updated" msgstr "" -#: bp-core/bp-core-attachments.php:230 -msgid "Please allow us to access to your camera." +#: bp-core/bp-core-functions.php:3205 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Group details for the group "<a " +"href=\"{{{group.url}}}\">{{group.name}}</a>" were updated:\n" +"<blockquote>{{changed_text}}</blockquote>" msgstr "" -#: bp-core/bp-core-attachments.php:231 -msgid "Please wait as we access your camera." +#: bp-core/bp-core-functions.php:3207 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Group details for the group "{{group.name}}" were updated:\n" +"\n" +"{{changed_text}}\n" +"\n" +"To view the group, visit: {{{group.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:232 -msgid "Camera loaded. Click on the \"Capture\" button to take your photo." +#: bp-core/bp-core-functions.php:3211 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] You have an invitation to the group: \"{{group.name}}\"" msgstr "" -#: bp-core/bp-core-attachments.php:233 +#: bp-core/bp-core-functions.php:3213 +#. translators: do not remove {} brackets or translate its contents. 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." +"<a href=\"{{{inviter.url}}}\">{{inviter.name}}</a> has invited you to join " +"the group: "{{group.name}}".\n" +"<a href=\"{{{invites.url}}}\">Go here to accept your invitation</a> or <a " +"href=\"{{{group.url}}}\">visit the group</a> to learn more." msgstr "" -#: bp-core/bp-core-attachments.php:234 -msgid "Your browser is not supported. Please upload a photo instead." +#: bp-core/bp-core-functions.php:3215 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{inviter.name}} has invited you to join the group: " +""{{group.name}}".\n" +"\n" +"To accept your invitation, visit: {{{invites.url}}}\n" +"\n" +"To learn more about the group, visit {{{group.url}}}.\n" +"To view {{inviter.name}}'s profile, visit: {{{inviter.url}}}" msgstr "" -#: bp-core/bp-core-attachments.php:235 -msgid "Video error. Please upload a photo instead." +#: bp-core/bp-core-functions.php:3219 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] You have been promoted in the group: \"{{group.name}}\"" msgstr "" -#: bp-core/bp-core-attachments.php:236 -msgid "Your profile photo is ready. Click on the \"Save\" button to use this photo." +#: bp-core/bp-core-functions.php:3221 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"You have been promoted to <b>{{promoted_to}}</b> in the group "<a " +"href=\"{{{group.url}}}\">{{group.name}}</a>"." msgstr "" -#: bp-core/bp-core-attachments.php:237 -msgid "No photo was captured. Click on the \"Capture\" button to take your photo." +#: bp-core/bp-core-functions.php:3223 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"You have been promoted to {{promoted_to}} in the group: " +""{{group.name}}".\n" +"\n" +"To visit the group, go to: {{{group.url}}}" msgstr "" -#: bp-core/bp-core-avatars.php:329 -msgid "Profile Photo" +#: bp-core/bp-core-functions.php:3227 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Membership request for group: {{group.name}}" msgstr "" -#: bp-core/bp-core-avatars.php:821 -msgid "Upload Failed! Error was: %s" +#: bp-core/bp-core-functions.php:3229 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"<a href=\"{{{profile.url}}}\">{{requesting-user.name}}</a> wants to join " +"the group "{{group.name}}". As you are an administrator of this " +"group, you must either accept or reject the membership request.\n" +"\n" +"<a href=\"{{{group-requests.url}}}\">Go here to manage this</a> and all " +"other pending requests." msgstr "" -#: bp-core/bp-core-avatars.php:841 -msgid "Upload failed! Error was: %s" +#: bp-core/bp-core-functions.php:3231 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{requesting-user.name}} wants to join the group " +""{{group.name}}". As you are the administrator of this group, you " +"must either accept or reject the membership request.\n" +"\n" +"To manage this and all other pending requests, visit: " +"{{{group-requests.url}}}\n" +"\n" +"To view {{requesting-user.name}}'s profile, visit: {{{profile.url}}}" msgstr "" -#: 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." +#: bp-core/bp-core-functions.php:3235 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] New message from {{sender.name}}" msgstr "" -#: bp-core/bp-core-avatars.php:1297 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" +#: bp-core/bp-core-functions.php:3237 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{sender.name}} sent you a new message: "{{usersubject}}"\n" +"\n" +"<blockquote>"{{usermessage}}"</blockquote>\n" +"\n" +"<a href=\"{{{message.url}}}\">Go to the discussion</a> to reply or catch up " +"on the conversation." msgstr "" -#: 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." +#: bp-core/bp-core-functions.php:3239 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"{{sender.name}} sent you a new message: "{{usersubject}}"\n" +"\n" +""{{usermessage}}"\n" +"\n" +"Go to the discussion to reply or catch up on the conversation: " +"{{{message.url}}}" msgstr "" -#: 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" +#: bp-core/bp-core-functions.php:3243 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Verify your new email address" msgstr "" -#: bp-core/bp-core-catchuri.php:300 +#: bp-core/bp-core-functions.php:3245 +#. translators: do not remove {} brackets or translate its contents. msgid "" -"This user has been marked as a spammer. Only site admins can view this " -"profile." +"You recently changed the email address associated with your account on " +"{{site.name}}. If this is correct, <a href=\"{{{verify.url}}}\">go here to " +"confirm the change</a>.\n" +"\n" +"Otherwise, you can safely ignore and delete this email if you have changed " +"your mind, or if you think you have received this email in error." msgstr "" -#: 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." +#: bp-core/bp-core-functions.php:3247 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"You recently changed the email address associated with your account on " +"{{site.name}}. If this is correct, go to the following link to confirm the " +"change: {{{verify.url}}}\n" +"\n" +"Otherwise, you can safely ignore and delete this email if you have changed " +"your mind, or if you think you have received this email in error." msgstr "" -#: bp-core/bp-core-dependency.php:189 -msgid "The current user is being initialized without using $wp->init()." +#: bp-core/bp-core-functions.php:3251 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Membership request for group \"{{group.name}}\" accepted" msgstr "" -#: bp-core/bp-core-filters.php:388 bp-core/bp-core-filters.php:419 -msgid "[User Set]" +#: bp-core/bp-core-functions.php:3253 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Your membership request for the group "<a " +"href=\"{{{group.url}}}\">{{group.name}}</a>" has been accepted." msgstr "" -#: bp-core/bp-core-filters.php:448 +#: bp-core/bp-core-functions.php:3255 +#. translators: do not remove {} brackets or translate its contents. msgid "" -"%1$s,\n" -"\n" -"\n" +"Your membership request for the group "{{group.name}}" has been " +"accepted.\n" "\n" -"Thanks for registering! To complete the activation of your account and " -"blog, please click the following link:\n" -"\n" -"%2$s\n" -"\n" -"\n" -"\n" -"After you activate, you can visit your blog here:\n" -"\n" -"%3$s" +"To view the group, visit: {{{group.url}}}" msgstr "" -#: bp-core/bp-core-filters.php:449 -msgid "Activate %s" +#: bp-core/bp-core-functions.php:3259 +#. translators: do not remove {} brackets or translate its contents. +msgid "[{{{site.name}}}] Membership request for group \"{{group.name}}\" rejected" msgstr "" -#: bp-core/bp-core-filters.php:572 bp-members/bp-members-functions.php:2236 +#: bp-core/bp-core-functions.php:3261 +#. translators: do not remove {} brackets or translate its contents. msgid "" -"Thanks for registering! To complete the activation of your account please " -"click the following link:\n" -"\n" -"%1$s\n" +"Your membership request for the group "<a " +"href=\"{{{group.url}}}\">{{group.name}}</a>" has been rejected." +msgstr "" + +#: bp-core/bp-core-functions.php:3263 +#. translators: do not remove {} brackets or translate its contents. +msgid "" +"Your membership request for the group "{{group.name}}" has been " +"rejected.\n" "\n" +"To request membership again, visit: {{{group.url}}}" msgstr "" -#: bp-core/bp-core-filters.php:573 bp-members/bp-members-functions.php:2237 -msgid "Activate Your Account" +#: bp-core/bp-core-functions.php:3277 +msgid "A member has replied to an activity update that the recipient posted." +msgstr "" + +#: bp-core/bp-core-functions.php:3278 +msgid "" +"A member has replied to a comment on an activity update that the recipient " +"posted." +msgstr "" + +#: bp-core/bp-core-functions.php:3279 +msgid "Recipient was mentioned in an activity update." +msgstr "" + +#: bp-core/bp-core-functions.php:3280 +msgid "Recipient was mentioned in a group activity update." +msgstr "" + +#: bp-core/bp-core-functions.php:3281 +msgid "Recipient has registered for an account." +msgstr "" + +#: bp-core/bp-core-functions.php:3282 +msgid "Recipient has registered for an account and site." +msgstr "" + +#: bp-core/bp-core-functions.php:3283 +msgid "A member has sent a friend request to the recipient." +msgstr "" + +#: bp-core/bp-core-functions.php:3284 +msgid "Recipient has had a friend request accepted by a member." +msgstr "" + +#: bp-core/bp-core-functions.php:3285 +msgid "A group's details were updated." +msgstr "" + +#: bp-core/bp-core-functions.php:3286 +msgid "A member has sent a group invitation to the recipient." msgstr "" -#: bp-core/bp-core-filters.php:749 bp-members/bp-members-screens.php:670 +#: bp-core/bp-core-functions.php:3287 +msgid "Recipient's status within a group has changed." +msgstr "" + +#: bp-core/bp-core-functions.php:3288 +msgid "A member has requested permission to join a group." +msgstr "" + +#: bp-core/bp-core-functions.php:3289 +msgid "Recipient has received a private message." +msgstr "" + +#: bp-core/bp-core-functions.php:3290 +msgid "Recipient has changed their email address." +msgstr "" + +#: bp-core/bp-core-functions.php:3291 +msgid "Recipient had requested to join a group, which was accepted." +msgstr "" + +#: bp-core/bp-core-functions.php:3292 +msgid "Recipient had requested to join a group, which was rejected." +msgstr "" + +#: bp-core/bp-core-template.php:132 +msgid "%s Directory" +msgstr "" + +#: bp-core/bp-core-template.php:601 +msgid "Search anything..." +msgstr "" + +#: bp-core/bp-core-template.php:803 +msgid " […]" +msgstr "" + +#: bp-core/bp-core-template.php:1127 +msgid "Community" +msgstr "" + +#: bp-core/bp-core-template.php:3070 +#: bp-members/classes/class-bp-registration-theme-compat.php:100 msgid "Create an Account" msgstr "" -#: bp-core/bp-core-filters.php:753 bp-members/bp-members-screens.php:678 -msgid "Activate your Account" +#: bp-core/bp-core-template.php:3074 +#: bp-members/classes/class-bp-registration-theme-compat.php:108 +msgid "Activate Your Account" msgstr "" -#: bp-core/bp-core-filters.php:757 bp-groups/bp-groups-template.php:3390 -#: bp-groups/bp-groups-template.php:3391 +#: bp-core/bp-core-template.php:3078 bp-groups/bp-groups-template.php:3362 +#: bp-groups/bp-groups-template.php:3363 msgid "Create a Group" msgstr "" -#: bp-core/bp-core-filters.php:788 -msgid "Page %s" +#: bp-core/classes/class-bp-admin.php:208 +#: bp-core/classes/class-bp-admin.php:209 +#: bp-core/classes/class-bp-admin.php:217 +#: bp-core/classes/class-bp-admin.php:218 +msgid "Welcome to BuddyPress" msgstr "" -#: bp-core/bp-core-functions.php:1074 -msgid "sometime" +#: bp-core/classes/class-bp-admin.php:238 +msgid "BuddyPress Help" msgstr "" -#: bp-core/bp-core-functions.php:1083 -msgid "right now" +#: bp-core/classes/class-bp-admin.php:239 +msgid "Help" msgstr "" -#: bp-core/bp-core-functions.php:1092 -msgid "%s ago" +#: bp-core/classes/class-bp-admin.php:248 +msgid "BuddyPress Components" msgstr "" -#: bp-core/bp-core-functions.php:1153 -msgid "%s year" -msgid_plural "%s years" -msgstr[0] "" -msgstr[1] "" +#: bp-core/classes/class-bp-admin.php:257 +#: bp-core/classes/class-bp-admin.php:258 +msgid "BuddyPress Pages" +msgstr "" -#: 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/classes/class-bp-admin.php:266 +#: bp-core/classes/class-bp-admin.php:267 +msgid "BuddyPress Options" +msgstr "" -#: 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/classes/class-bp-admin.php:290 +#: bp-core/classes/class-bp-admin.php:291 +msgid "Available Tools" +msgstr "" -#: 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/classes/class-bp-admin.php:386 +msgid "Main Settings" +msgstr "" -#: 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/classes/class-bp-admin.php:389 +#: bp-core/classes/class-bp-admin.php:394 +msgid "Toolbar" +msgstr "" -#: 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/classes/class-bp-admin.php:399 +msgid "Account Deletion" +msgstr "" -#: 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/classes/class-bp-admin.php:410 +msgid "Profile Photo Uploads" +msgstr "" -#: bp-core/bp-core-functions.php:1427 -msgid "Not recently active" +#: bp-core/classes/class-bp-admin.php:415 +msgid "Cover Image Uploads" msgstr "" -#: 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" +#: bp-core/classes/class-bp-admin.php:420 +msgid "Profile Syncing" msgstr "" -#: bp-core/bp-core-functions.php:2358 bp-core/bp-core-widgets.php:121 -#: bp-core/deprecated/2.1.php:239 -msgid "Log In" +#: bp-core/classes/class-bp-admin.php:429 +msgid "Groups Settings" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:432 +msgid "Group Creation" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:436 +msgid "Group Photo Uploads" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:441 +msgid "Group Cover Image Uploads" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:451 +msgid "Legacy Group Forums" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:454 +msgid "bbPress Configuration" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:463 +msgid "Activity Settings" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:466 +msgid "Blog & Forum Comments" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:470 +msgid "Activity auto-refresh" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:475 +msgid "Akismet" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:493 +msgid "About BuddyPress" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:517 +#: bp-groups/classes/class-bp-groups-component.php:624 +#: bp-settings/classes/class-bp-settings-component.php:28 +#: bp-settings/classes/class-bp-settings-component.php:101 +#: bp-settings/classes/class-bp-settings-component.php:180 +msgid "Settings" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:518 +msgid "About" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:570 +msgid "Getting Started with BuddyPress" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:573 +msgid "Configure BuddyPress" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:576 +msgid "Set Up Components" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:579 +msgid "Assign Components to Pages" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:582 +msgid "Customize Settings" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:585 +msgid "Get Started" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:588 +msgid "Administration Tools" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:591 +msgid "Add User Profile Fields" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:593 +msgid "Manage User Signups" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:595 +msgid "Moderate Activity Streams" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:598 +msgid "Manage Groups" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:600 +msgid "Repair Data" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:605 +msgid "Community and Support" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:606 +msgid "" +"Looking for help? The <a href=\"https://codex.buddypress.org/\">BuddyPress " +"Codex</a> has you covered." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:607 +msgid "" +"Can’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." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:616 +msgid "Customizable BuddyPress Emails" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:619 +msgid "Change colors of the email template using the Customizer." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:622 +msgid "Keep your users coming back with beautiful and flexible email notifications." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:623 +msgid "" +"Edit the content of your emails, create new email templates, or change the " +"design of the template in the Customizer. These are just a few of the " +"customizations you can make to engage your users and increase their " +"participation in your community with the new email features." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:623 +msgid "Learn more →" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:634 +msgid "Post Type Comments Tracking" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:635 +msgid "Registered post types" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:636 +msgid "" +"New Activity functions help you track post type comments in sync with the " +"Blogs component when activated." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:639 +msgid "Twenty Twelve Companion Stylesheet" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:640 +msgid "BuddyPress styles Twenty Twelve" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:641 +msgid "" +"BuddyPress components never looked so fine as they do now in the Twenty " +"Twelve theme." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:647 +msgid "Support for Emojis" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:648 +msgid "Fun with Emojies" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:649 +msgid "" +"Have fun and be merry! You can now use Emojis in activity updates, " +"messages, and group descriptions." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:653 +msgid "Autolink Settings for Profile Fields" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:654 +msgid "Autolink settings in the profile fields panel" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:655 +msgid "" +"Administrators can enable or disable autolink settings for each new profile " +"field type." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:662 +msgid "Under The Hood" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:666 +msgid "Localization Improvements" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:667 +msgid "" +"We continue to improve on localization for translation editors so that " +"BuddyPress will be available for everyone in their own language." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:668 +msgid "Accessibility Upgrades" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:669 +msgid "" +"Continued improvements in the frontend and backend to make BuddyPress " +"usable for everyone." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:673 +msgid "Enhanced Multisite Support" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:674 +msgid "" +"BuddyPress is already primed for all multisite configurations available. We " +"just made it better." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:675 +msgid "Developer Reference" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:676 +msgid "" +"Regular updates to inline code documentation make it easier for developers " +"to understand how BuddyPress works." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:708 +msgid "BuddyPress is created by a worldwide network of friendly folks like these." +msgstr "" + +#: bp-core/classes/class-bp-admin.php:710 +msgid "Project Leaders" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:715 +msgid "Project Lead" msgstr "" -#: bp-core/bp-core-template.php:99 -msgid "Options" +#: bp-core/classes/class-bp-admin.php:720 +#: bp-core/classes/class-bp-admin.php:725 +msgid "Lead Developer" msgstr "" -#: bp-core/bp-core-template.php:124 -msgid "%s Directory" +#: bp-core/classes/class-bp-admin.php:729 +msgid "Core Team" msgstr "" -#: bp-core/bp-core-template.php:389 -msgid "%1$s at %2$s" +#: bp-core/classes/class-bp-admin.php:734 +#: bp-core/classes/class-bp-admin.php:739 +#: bp-core/classes/class-bp-admin.php:749 +#: bp-core/classes/class-bp-admin.php:754 +#: bp-core/classes/class-bp-admin.php:759 +msgid "Core Developer" msgstr "" -#: bp-core/bp-core-template.php:574 -msgid "Search anything..." +#: bp-core/classes/class-bp-admin.php:744 +msgid "Navigator" msgstr "" -#: bp-core/bp-core-template.php:770 -msgid " […]" +#: bp-core/classes/class-bp-admin.php:763 +msgid "🌟Recent Rockstars🌟" msgstr "" -#: bp-core/bp-core-template.php:1083 -msgid "Community" +#: bp-core/classes/class-bp-admin.php:788 +msgid "Contributors to BuddyPress %s" msgstr "" -#: 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." +#: bp-core/classes/class-bp-admin.php:826 +msgid "💖With our thanks to these Open Source projects💖" msgstr "" -#: bp-core/bp-core-widgets.php:113 -#: bp-members/admin/bp-members-admin-classes.php:135 -#: bp-members/admin/bp-members-admin-classes.php:509 -#: bp-templates/bp-legacy/buddypress/members/register.php:66 -msgid "Username" +#: bp-core/classes/class-bp-admin.php:851 +msgid "" +"Thank you for installing BuddyPress! BuddyPress helps you build any type of " +"community website using WordPress, with member profiles, activity streams, " +"user groups, messaging, and more." msgstr "" -#: bp-core/bp-core-widgets.php:116 -msgid "Password" +#: bp-core/classes/class-bp-admin.php:852 +msgid "" +"Thank you for updating! BuddyPress %s has many new features that you will " +"enjoy." msgstr "" -#: bp-core/bp-core-widgets.php:119 -msgid "Remember Me" +#: bp-core/classes/class-bp-admin.php:856 +msgid "Welcome to BuddyPress %s" msgstr "" -#: bp-core/bp-core-widgets.php:125 -msgid "<a href=\"%s\" title=\"Register for a new account\">Register</a>" +#: bp-core/classes/class-bp-admin.php:885 +msgid "What’s New" msgstr "" -#: 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:" +#: bp-core/classes/class-bp-admin.php:887 +msgid "Credits" msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:41 +#: bp-core/classes/class-bp-attachment-avatar.php:42 msgid "That photo is too big. Please upload one smaller than %s" msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:42 +#: bp-core/classes/class-bp-attachment-avatar.php:43 +#: bp-core/classes/class-bp-attachment-cover-image.php:41 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:359 +#: bp-core/classes/class-bp-attachment-avatar.php:386 #: bp-xprofile/bp-xprofile-screens.php:260 msgid "There was a problem cropping your profile photo." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:360 +#: bp-core/classes/class-bp-attachment-avatar.php:387 #: bp-xprofile/bp-xprofile-screens.php:274 msgid "Your new profile photo was uploaded successfully." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:361 -#: bp-xprofile/bp-xprofile-actions.php:41 +#: bp-core/classes/class-bp-attachment-avatar.php:388 +#: bp-xprofile/bp-xprofile-actions.php:42 msgid "There was a problem deleting your profile photo. Please try again." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:362 -#: bp-xprofile/bp-xprofile-actions.php:39 +#: bp-core/classes/class-bp-attachment-avatar.php:389 +#: bp-xprofile/bp-xprofile-actions.php:40 msgid "Your profile photo was deleted successfully!" msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:377 -#: bp-groups/bp-groups-screens.php:966 +#: bp-core/classes/class-bp-attachment-avatar.php:404 +#: bp-groups/bp-groups-screens.php:1022 msgid "There was a problem cropping the group profile photo." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:378 +#: bp-core/classes/class-bp-attachment-avatar.php:405 +#: bp-groups/bp-groups-actions.php:346 msgid "The group profile photo was uploaded successfully." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:379 -#: bp-groups/bp-groups-screens.php:923 +#: bp-core/classes/class-bp-attachment-avatar.php:406 +#: bp-groups/bp-groups-screens.php:979 msgid "There was a problem deleting the group profile photo. Please try again." msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:380 -#: bp-groups/bp-groups-screens.php:921 +#: bp-core/classes/class-bp-attachment-avatar.php:407 +#: bp-groups/bp-groups-screens.php:977 msgid "The group profile photo was deleted successfully!" msgstr "" -#: bp-core/classes/class-bp-attachment.php:157 +#: bp-core/classes/class-bp-attachment-cover-image.php:40 +msgid "That image is too big. Please upload one smaller than %s" +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:243 +msgid "Your new cover image was uploaded successfully." +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:244 +msgid "There was a problem deleting your cover image. Please try again." +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:245 +msgid "Your cover image was deleted successfully!" +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:261 +msgid "The group cover image was uploaded successfully." +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:262 +msgid "There was a problem deleting the group cover image. Please try again." +msgstr "" + +#: bp-core/classes/class-bp-attachment-cover-image.php:263 +msgid "The group cover image was deleted successfully!" +msgstr "" + +#: bp-core/classes/class-bp-attachment.php:166 msgid "The file was uploaded successfully" msgstr "" -#: bp-core/classes/class-bp-attachment.php:158 +#: bp-core/classes/class-bp-attachment.php:167 msgid "The uploaded file exceeds the maximum allowed file size for this site" msgstr "" -#: bp-core/classes/class-bp-attachment.php:159 +#: bp-core/classes/class-bp-attachment.php:168 msgid "The uploaded file exceeds the maximum allowed file size of: %s" msgstr "" -#: bp-core/classes/class-bp-attachment.php:160 +#: bp-core/classes/class-bp-attachment.php:169 msgid "The uploaded file was only partially uploaded." msgstr "" -#: bp-core/classes/class-bp-attachment.php:161 +#: bp-core/classes/class-bp-attachment.php:170 msgid "No file was uploaded." msgstr "" -#: bp-core/classes/class-bp-attachment.php:163 +#: bp-core/classes/class-bp-attachment.php:172 msgid "Missing a temporary folder." msgstr "" -#: bp-core/classes/class-bp-attachment.php:164 +#: bp-core/classes/class-bp-attachment.php:173 msgid "Failed to write file to disk." msgstr "" -#: bp-core/classes/class-bp-attachment.php:165 +#: bp-core/classes/class-bp-attachment.php:174 msgid "File upload stopped by extension." msgstr "" -#: bp-core/classes/class-bp-attachment.php:432 +#: bp-core/classes/class-bp-attachment.php:449 msgid "Cropping the file failed: missing source file." msgstr "" -#: bp-core/classes/class-bp-attachment.php:437 +#: bp-core/classes/class-bp-attachment.php:454 msgid "Cropping the file failed: the file path is not allowed." msgstr "" -#: bp-core/classes/class-bp-attachment.php:478 +#: bp-core/classes/class-bp-attachment.php:495 msgid "Cropping the file failed: %s is not a supported image file." msgstr "" -#: bp-core/classes/class-bp-attachment.php:511 +#: bp-core/classes/class-bp-attachment.php:528 msgid "Sorry, uploading the file failed." msgstr "" -#: bp-core/classes/class-bp-attachment.php:512 +#: bp-core/classes/class-bp-attachment.php:529 msgid "File successfully uploaded." msgstr "" -#: bp-core/classes/class-bp-core-user.php:202 -#: bp-groups/bp-groups-template.php:5512 +#: bp-core/classes/class-bp-core-login-widget.php:30 +msgid "" +"Show a Log In form to logged-out visitors, and a Log Out link to those who " +"are logged in." +msgstr "" + +#: bp-core/classes/class-bp-core-login-widget.php:107 +#: bp-members/classes/class-bp-members-list-table.php:150 +#: bp-members/classes/class-bp-members-ms-list-table.php:137 +#: bp-templates/bp-legacy/buddypress/members/register.php:76 +msgid "Username" +msgstr "" + +#: bp-core/classes/class-bp-core-login-widget.php:110 +msgid "Password" +msgstr "" + +#: bp-core/classes/class-bp-core-login-widget.php:113 +msgid "Remember Me" +msgstr "" + +#: bp-core/classes/class-bp-core-login-widget.php:119 +msgid "Register for a new account" +msgstr "" + +#: bp-core/classes/class-bp-core-login-widget.php:179 +#: bp-groups/classes/class-bp-groups-widget.php:205 +#: bp-members/classes/class-bp-core-members-widget.php:195 +#: bp-members/classes/class-bp-core-recently-active-widget.php:136 +#: bp-members/classes/class-bp-core-whos-online-widget.php:136 +#: bp-messages/classes/class-bp-messages-sitewide-notices-widget.php:115 +#: bp-templates/bp-legacy/buddypress/forums/index.php:168 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:106 +msgid "Title:" +msgstr "" + +#: bp-core/classes/class-bp-core-user.php:203 +#: bp-groups/classes/class-bp-groups-invite-template.php:244 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 +#: bp-core/deprecated/1.5.php:146 +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:55 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:28 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:510 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:29 +#: bp-core/deprecated/1.5.php:153 +#: bp-members/classes/class-bp-members-list-table.php:151 +#: bp-members/classes/class-bp-members-ms-list-table.php:138 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:35 msgid "Name" msgstr "" -#: bp-core/deprecated/1.5.php:158 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:38 +#: bp-core/deprecated/1.5.php:162 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:44 msgid "About Me" msgstr "" -#: bp-core/deprecated/1.5.php:167 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:47 +#: bp-core/deprecated/1.5.php:171 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:53 msgid "Website" msgstr "" -#: bp-core/deprecated/1.5.php:176 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:56 +#: bp-core/deprecated/1.5.php:180 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:62 msgid "Jabber" msgstr "" -#: bp-core/deprecated/1.5.php:185 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:65 +#: bp-core/deprecated/1.5.php:189 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:71 msgid "AOL Messenger" msgstr "" -#: bp-core/deprecated/1.5.php:194 -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:74 +#: bp-core/deprecated/1.5.php:198 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:80 msgid "Yahoo Messenger" msgstr "" -#: bp-core/deprecated/1.5.php:352 +#: bp-core/deprecated/1.5.php:358 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:4798 bp-groups/bp-groups-template.php:4819 +#: bp-core/deprecated/1.5.php:360 +msgid "" +"%1$s mentioned you in the group \"%2$s\":\n" +"\n" +"\"%3$s\"\n" +"\n" +"To view and respond to the message, log in and visit: %4$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-core/deprecated/1.6.php:127 bp-core/deprecated/1.6.php:148 +#: bp-groups/bp-groups-template.php:5002 bp-groups/bp-groups-template.php:5025 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 +#: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:151 +#: bp-friends/classes/class-bp-core-friends-widget.php:94 +#: bp-friends/classes/class-bp-core-friends-widget.php:189 +#: bp-groups/bp-groups-template.php:4273 +#: bp-groups/classes/class-bp-groups-widget.php:111 +#: bp-groups/classes/class-bp-groups-widget.php:214 +#: bp-members/classes/class-bp-core-members-widget.php:101 +#: bp-members/classes/class-bp-core-members-widget.php:217 +#: bp-templates/bp-legacy/buddypress/blogs/index.php:90 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:21 msgid "Newest" msgstr "" -#: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155 -#: bp-groups/bp-groups-template.php:4803 bp-groups/bp-groups-template.php:4834 +#: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:154 +#: bp-groups/bp-groups-template.php:5007 bp-groups/bp-groups-template.php:5040 msgid "Alphabetically" msgstr "" -#: bp-core/deprecated/2.1.php:123 bp-core/deprecated/2.1.php:315 +#: bp-core/deprecated/2.1.php:74 bp-core/deprecated/2.1.php:266 msgid "Dashboard" msgstr "" -#: bp-core/deprecated/2.1.php:124 bp-core/deprecated/2.1.php:319 +#: bp-core/deprecated/2.1.php:75 bp-core/deprecated/2.1.php:270 msgid "New Post" msgstr "" -#: bp-core/deprecated/2.1.php:125 bp-core/deprecated/2.1.php:320 +#: bp-core/deprecated/2.1.php:76 bp-core/deprecated/2.1.php:271 msgid "Manage Posts" msgstr "" -#: bp-core/deprecated/2.1.php:126 bp-core/deprecated/2.1.php:321 +#: bp-core/deprecated/2.1.php:77 bp-core/deprecated/2.1.php:272 msgid "Manage Comments" msgstr "" -#: bp-core/deprecated/2.1.php:139 +#: bp-core/deprecated/2.1.php:90 msgid "Create a Site!" msgstr "" -#: bp-core/deprecated/2.1.php:159 +#: bp-core/deprecated/2.1.php:110 msgid "Switch to WordPress Toolbar" msgstr "" -#: bp-core/deprecated/2.1.php:243 +#: bp-core/deprecated/2.1.php:194 msgid "Sign Up" msgstr "" -#: bp-core/deprecated/2.1.php:341 +#: bp-core/deprecated/2.1.php:292 msgid "Visit" msgstr "" -#: bp-core/deprecated/2.1.php:343 +#: bp-core/deprecated/2.1.php:294 msgid "Random Member" msgstr "" -#: bp-core/deprecated/2.1.php:347 +#: bp-core/deprecated/2.1.php:298 msgid "Random Group" msgstr "" -#: bp-core/deprecated/2.1.php:353 +#: bp-core/deprecated/2.1.php:304 msgid "Random Site" msgstr "" -#: bp-core/deprecated/2.1.php:413 bp-core/deprecated/2.1.php:542 +#: bp-core/deprecated/2.1.php:364 bp-core/deprecated/2.1.php:493 msgid "Admin Options" msgstr "" -#: bp-core/deprecated/2.1.php:416 +#: bp-core/deprecated/2.1.php:367 msgid "Edit Details" msgstr "" -#: bp-core/deprecated/2.1.php:418 +#: bp-core/deprecated/2.1.php:369 msgid "Group Settings" msgstr "" -#: bp-core/deprecated/2.1.php:422 bp-groups/bp-groups-loader.php:718 +#: bp-core/deprecated/2.1.php:373 +#: bp-groups/classes/class-bp-groups-component.php:785 msgid "Group Profile Photo" msgstr "" -#: bp-core/deprecated/2.1.php:428 +#: bp-core/deprecated/2.1.php:379 msgid "Manage Invitations" msgstr "" -#: bp-core/deprecated/2.1.php:432 +#: bp-core/deprecated/2.1.php:383 msgid "Manage Members" msgstr "" -#: bp-core/deprecated/2.1.php:436 +#: bp-core/deprecated/2.1.php:387 msgid "Membership Requests" msgstr "" -#: 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 +#: bp-core/deprecated/2.1.php:391 bp-groups/bp-groups-admin.php:990 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:468 +#: bp-xprofile/bp-xprofile-admin.php:154 msgid "Delete Group" msgstr "" -#: bp-core/deprecated/2.1.php:491 +#: bp-core/deprecated/2.1.php:442 msgid "Blog Authors" msgstr "" -#: bp-core/deprecated/2.1.php:547 +#: bp-core/deprecated/2.1.php:498 msgid "Edit %s's Profile" msgstr "" -#: bp-core/deprecated/2.1.php:551 +#: bp-core/deprecated/2.1.php:502 msgid "Edit %s's Profile Photo" msgstr "" -#: bp-core/deprecated/2.1.php:553 bp-members/bp-members-adminbar.php:125 +#: bp-core/deprecated/2.1.php:504 bp-members/bp-members-adminbar.php:135 msgid "User Capabilities" msgstr "" -#: bp-core/deprecated/2.1.php:555 +#: bp-core/deprecated/2.1.php:506 msgid "Delete %s's Account" msgstr "" -#: bp-core/deprecated/2.1.php:603 +#: bp-core/deprecated/2.1.php:554 msgid "No new notifications." msgstr "" @@ -2636,272 +3291,272 @@ msgstr "" msgid "Discussion Forums" msgstr "" -#: bp-forums/bp-forums-loader.php:71 +#: bp-forums/bp-forums-loader.php:74 msgid "Search Forums..." msgstr "" -#: bp-forums/bp-forums-loader.php:155 bp-forums/bp-forums-loader.php:208 +#: bp-forums/bp-forums-loader.php:162 bp-forums/bp-forums-loader.php:215 msgid "Topics Started" msgstr "" -#: bp-forums/bp-forums-loader.php:166 +#: bp-forums/bp-forums-loader.php:173 msgid "Replied To" msgstr "" -#: bp-forums/bp-forums-loader.php:216 +#: bp-forums/bp-forums-loader.php:223 msgid "Replies" msgstr "" -#: bp-forums/bp-forums-loader.php:224 +#: bp-forums/bp-forums-loader.php:231 msgid "Favorite Topics" msgstr "" -#: bp-forums/bp-forums-screens.php:25 bp-forums/bp-forums-screens.php:262 +#: bp-forums/bp-forums-screens.php:26 bp-forums/bp-forums-screens.php:263 msgid "The forums component has not been set up yet." msgstr "" -#: bp-forums/bp-forums-screens.php:53 bp-groups/bp-groups-screens.php:516 +#: bp-forums/bp-forums-screens.php:54 bp-groups/bp-groups-screens.php:528 msgid "Please provide a title for your forum topic." msgstr "" -#: bp-forums/bp-forums-screens.php:55 bp-groups/bp-groups-screens.php:518 +#: bp-forums/bp-forums-screens.php:56 bp-groups/bp-groups-screens.php:530 msgid "Forum posts cannot be empty. Please enter some text." msgstr "" -#: bp-forums/bp-forums-screens.php:62 bp-groups/bp-groups-screens.php:530 +#: bp-forums/bp-forums-screens.php:63 bp-groups/bp-groups-screens.php:542 msgid "There was an error when creating the topic" msgstr "" -#: bp-forums/bp-forums-screens.php:65 bp-groups/bp-groups-screens.php:533 +#: bp-forums/bp-forums-screens.php:66 bp-groups/bp-groups-screens.php:545 msgid "The topic was created successfully" msgstr "" -#: bp-forums/bp-forums-screens.php:73 bp-forums/bp-forums-screens.php:78 +#: bp-forums/bp-forums-screens.php:74 bp-forums/bp-forums-screens.php:79 msgid "Please pick the group forum where you would like to post this topic." msgstr "" -#: 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 +#: bp-forums/bp-forums-screens.php:289 bp-groups/bp-groups-template.php:3170 +#: bp-groups/bp-groups-template.php:3171 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:30 msgid "New Topic" msgstr "" -#: 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:2146 -#: bp-messages/bp-messages-template.php:2387 -#: bp-messages/classes/class-bp-messages-thread.php:786 +#: bp-forums/bp-forums-template.php:877 bp-forums/bp-forums-template.php:1038 +#: bp-forums/bp-forums-template.php:2412 +#: bp-messages/bp-messages-template.php:1617 +#: bp-messages/bp-messages-template.php:1866 +#: bp-messages/classes/class-bp-messages-thread.php:800 msgid "Deleted User" msgstr "" -#: bp-forums/bp-forums-template.php:1102 +#: bp-forums/bp-forums-template.php:1092 msgid "Group logo for %s" msgstr "" -#: bp-forums/bp-forums-template.php:1360 bp-groups/bp-groups-template.php:2070 +#: bp-forums/bp-forums-template.php:1350 bp-groups/bp-groups-template.php:1920 msgid "%d post" msgstr "" -#: bp-forums/bp-forums-template.php:1364 bp-groups/bp-groups-template.php:2072 +#: bp-forums/bp-forums-template.php:1354 bp-groups/bp-groups-template.php:1922 msgid "%d posts" msgstr "" -#: bp-forums/bp-forums-template.php:1594 +#: bp-forums/bp-forums-template.php:1585 msgid "Edit Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1598 +#: bp-forums/bp-forums-template.php:1589 msgid "Sticky Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1600 +#: bp-forums/bp-forums-template.php:1591 msgid "Un-stick Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1603 +#: bp-forums/bp-forums-template.php:1594 msgid "Open Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1605 +#: bp-forums/bp-forums-template.php:1596 msgid "Close Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1607 +#: bp-forums/bp-forums-template.php:1598 msgid "Delete Topic" msgstr "" -#: bp-forums/bp-forums-template.php:1879 +#: bp-forums/bp-forums-template.php:1871 msgid " matching tag \"%s\"" msgstr "" -#: bp-forums/bp-forums-template.php:1882 +#: bp-forums/bp-forums-template.php:1874 msgid "Viewing 1 topic" msgstr "" -#: bp-forums/bp-forums-template.php:1884 +#: bp-forums/bp-forums-template.php:1876 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:2632 +#: bp-forums/bp-forums-template.php:2607 msgid "Viewing 1 post" msgstr "" -#: bp-forums/bp-forums-template.php:2634 +#: bp-forums/bp-forums-template.php:2609 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] "" -#: bp-forums/deprecated/1.6.php:31 bp-forums/deprecated/1.6.php:133 +#: bp-forums/deprecated/1.6.php:30 bp-forums/deprecated/1.6.php:130 msgid "Configure bbPress" msgstr "" -#: bp-forums/deprecated/1.6.php:34 bp-forums/deprecated/1.6.php:136 +#: bp-forums/deprecated/1.6.php:33 bp-forums/deprecated/1.6.php:133 msgid "Install bbPress" msgstr "" -#: bp-forums/deprecated/1.6.php:47 +#: bp-forums/deprecated/1.6.php:44 msgid "Settings Saved." msgstr "" -#: bp-forums/deprecated/1.6.php:68 +#: bp-forums/deprecated/1.6.php:65 msgid "(Installed)" msgstr "" -#: bp-forums/deprecated/1.6.php:68 bp-forums/deprecated/1.6.php:210 +#: bp-forums/deprecated/1.6.php:65 bp-forums/deprecated/1.6.php:209 msgid "Forums for Groups" msgstr "" -#: bp-forums/deprecated/1.6.php:70 bp-forums/deprecated/1.6.php:212 +#: bp-forums/deprecated/1.6.php:67 bp-forums/deprecated/1.6.php:211 msgid "" "Give each individual group its own discussion forum. Choose this if you'd " "like to keep your members' conversations separated into distinct areas." msgstr "" -#: bp-forums/deprecated/1.6.php:72 bp-forums/deprecated/1.6.php:214 +#: bp-forums/deprecated/1.6.php:69 bp-forums/deprecated/1.6.php:213 msgid "" "Note: This component is retired and will not be receiving any updates in " "the future. Only use this component if your current site relies on it." msgstr "" -#: bp-forums/deprecated/1.6.php:74 bp-forums/deprecated/1.6.php:216 +#: bp-forums/deprecated/1.6.php:71 bp-forums/deprecated/1.6.php:215 msgid "Features" msgstr "" -#: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:218 +#: bp-forums/deprecated/1.6.php:73 bp-forums/deprecated/1.6.php:217 msgid "Group Integration" msgstr "" -#: bp-forums/deprecated/1.6.php:77 bp-forums/deprecated/1.6.php:219 +#: bp-forums/deprecated/1.6.php:74 bp-forums/deprecated/1.6.php:218 msgid "Member Profile Integration" msgstr "" -#: bp-forums/deprecated/1.6.php:78 bp-forums/deprecated/1.6.php:220 +#: bp-forums/deprecated/1.6.php:75 bp-forums/deprecated/1.6.php:219 msgid "Activity Stream Integration" msgstr "" -#: bp-forums/deprecated/1.6.php:79 bp-forums/deprecated/1.6.php:221 +#: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:220 msgid "@ Mention Integration" msgstr "" -#: bp-forums/deprecated/1.6.php:83 +#: bp-forums/deprecated/1.6.php:80 msgid "Uninstall Group Forums" msgstr "" -#: bp-forums/deprecated/1.6.php:88 bp-forums/deprecated/1.6.php:231 +#: bp-forums/deprecated/1.6.php:85 bp-forums/deprecated/1.6.php:230 msgid "New! bbPress" msgstr "" -#: bp-forums/deprecated/1.6.php:89 bp-forums/deprecated/1.6.php:232 +#: bp-forums/deprecated/1.6.php:86 bp-forums/deprecated/1.6.php:231 msgid "" "bbPress is a brand-new forum plugin from one of the lead developers of " "BuddyPress." msgstr "" -#: bp-forums/deprecated/1.6.php:91 bp-forums/deprecated/1.6.php:234 +#: bp-forums/deprecated/1.6.php:88 bp-forums/deprecated/1.6.php:233 msgid "" "It boasts a bunch of cool features that the BP Legacy Discussion Forums " "does not have including:" msgstr "" -#: bp-forums/deprecated/1.6.php:94 bp-forums/deprecated/1.6.php:237 +#: bp-forums/deprecated/1.6.php:91 bp-forums/deprecated/1.6.php:236 msgid "Non-group specific forum creation" msgstr "" -#: bp-forums/deprecated/1.6.php:95 bp-forums/deprecated/1.6.php:238 +#: bp-forums/deprecated/1.6.php:92 bp-forums/deprecated/1.6.php:237 msgid "Moderation via the WP admin dashboard" msgstr "" -#: bp-forums/deprecated/1.6.php:96 bp-forums/deprecated/1.6.php:239 +#: bp-forums/deprecated/1.6.php:93 bp-forums/deprecated/1.6.php:238 msgid "Topic splitting" msgstr "" -#: bp-forums/deprecated/1.6.php:97 bp-forums/deprecated/1.6.php:240 +#: bp-forums/deprecated/1.6.php:94 bp-forums/deprecated/1.6.php:239 msgid "Revisions" msgstr "" -#: bp-forums/deprecated/1.6.php:98 bp-forums/deprecated/1.6.php:241 +#: bp-forums/deprecated/1.6.php:95 bp-forums/deprecated/1.6.php:240 msgid "Spam management" msgstr "" -#: bp-forums/deprecated/1.6.php:99 bp-forums/deprecated/1.6.php:242 +#: bp-forums/deprecated/1.6.php:96 bp-forums/deprecated/1.6.php:241 msgid "Subscriptions" msgstr "" -#: bp-forums/deprecated/1.6.php:100 bp-forums/deprecated/1.6.php:243 +#: bp-forums/deprecated/1.6.php:97 bp-forums/deprecated/1.6.php:242 msgid "And more!" msgstr "" -#: bp-forums/deprecated/1.6.php:103 bp-forums/deprecated/1.6.php:246 +#: bp-forums/deprecated/1.6.php:100 bp-forums/deprecated/1.6.php:245 msgid "" "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>." msgstr "" -#: bp-forums/deprecated/1.6.php:143 +#: bp-forums/deprecated/1.6.php:140 msgid "The bb-config.php file was not found at that location. Please try again." msgstr "" -#: bp-forums/deprecated/1.6.php:146 +#: bp-forums/deprecated/1.6.php:143 msgid "Forums were set up correctly using your existing bbPress install!" msgstr "" -#: bp-forums/deprecated/1.6.php:147 +#: bp-forums/deprecated/1.6.php:144 msgid "" "BuddyPress will now use its internal copy of bbPress to run the forums on " "your site. If you wish, you can remove your old bbPress installation files, " "as long as you keep the bb-config.php file in the same location." msgstr "" -#: bp-forums/deprecated/1.6.php:152 +#: bp-forums/deprecated/1.6.php:149 msgid "Existing bbPress Installation" msgstr "" -#: bp-forums/deprecated/1.6.php:153 +#: bp-forums/deprecated/1.6.php:150 msgid "" "BuddyPress can make use of your existing bbPress install. Just provide the " "location of your <code>bb-config.php</code> file, and BuddyPress will do " "the rest." msgstr "" -#: bp-forums/deprecated/1.6.php:155 bp-forums/deprecated/1.6.php:187 +#: bp-forums/deprecated/1.6.php:152 bp-forums/deprecated/1.6.php:187 msgid "Complete Installation" msgstr "" -#: bp-forums/deprecated/1.6.php:171 +#: bp-forums/deprecated/1.6.php:169 msgid "" -"<p>All done! Configuration settings have been saved to the file " -"<code>bb-config.php</code> in the root of your WordPress install.</p>" +"All done! Configuration settings have been saved to the file " +"<code>bb-config.php</code> in the root of your WordPress install." msgstr "" #: bp-forums/deprecated/1.6.php:175 msgid "" -"<p>A configuration file could not be created. No problem, but you will need " -"to save the text shown below into a file named <code>bb-config.php</code> " -"in the root directory of your WordPress installation before you can start " -"using the forum functionality.</p>" +"A configuration file could not be created. No problem, but you will need to " +"save the text shown below into a file named <code>bb-config.php</code> in " +"the root directory of your WordPress installation before you can start " +"using the forum functionality." msgstr "" #: bp-forums/deprecated/1.6.php:184 @@ -2921,252 +3576,232 @@ msgid "" "download a copy of bbPress and make sure it is in the folder: \"%s\"" msgstr "" -#: bp-forums/deprecated/1.6.php:225 +#: bp-forums/deprecated/1.6.php:224 msgid "Install Group Forums" msgstr "" -#: bp-forums/deprecated/1.6.php:226 +#: bp-forums/deprecated/1.6.php:225 msgid "Use Existing Installation" msgstr "" -#: bp-friends/bp-friends-actions.php:38 +#: bp-friends/bp-friends-actions.php:40 msgid "Friendship could not be requested." msgstr "" -#: bp-friends/bp-friends-actions.php:40 +#: bp-friends/bp-friends-actions.php:42 msgid "Friendship requested" msgstr "" -#: bp-friends/bp-friends-actions.php:44 +#: bp-friends/bp-friends-actions.php:46 msgid "You are already friends with this user" msgstr "" -#: bp-friends/bp-friends-actions.php:46 +#: bp-friends/bp-friends-actions.php:48 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:1343 +#: bp-friends/bp-friends-actions.php:80 +#: bp-templates/bp-legacy/buddypress-functions.php:1372 msgid "Friendship could not be canceled." msgstr "" -#: bp-friends/bp-friends-actions.php:78 +#: bp-friends/bp-friends-actions.php:82 msgid "Friendship canceled" msgstr "" -#: bp-friends/bp-friends-actions.php:82 +#: bp-friends/bp-friends-actions.php:86 msgid "You are not yet friends with this user" msgstr "" -#: bp-friends/bp-friends-actions.php:84 +#: bp-friends/bp-friends-actions.php:88 msgid "You have a pending friendship request with this user" msgstr "" -#: bp-friends/bp-friends-activity.php:98 +#: bp-friends/bp-friends-activity.php:104 msgid "Friendships accepted" msgstr "" -#: bp-friends/bp-friends-activity.php:100 -#: bp-friends/bp-friends-activity.php:109 bp-friends/bp-friends-loader.php:229 +#: bp-friends/bp-friends-activity.php:106 +#: bp-friends/bp-friends-activity.php:115 +#: bp-friends/classes/class-bp-friends-component.php:242 msgid "Friendships" msgstr "" -#: bp-friends/bp-friends-activity.php:107 +#: bp-friends/bp-friends-activity.php:113 msgid "New friendships" msgstr "" -#: bp-friends/bp-friends-activity.php:114 +#: bp-friends/bp-friends-activity.php:120 msgid "New friendship created" msgstr "" -#: bp-friends/bp-friends-activity.php:137 -#: bp-friends/bp-friends-activity.php:171 +#: bp-friends/bp-friends-activity.php:144 +#: bp-friends/bp-friends-activity.php:178 msgid "%1$s and %2$s are now friends" msgstr "" -#: bp-friends/bp-friends-loader.php:92 -msgid "Search Friends..." -msgstr "" - -#: bp-friends/bp-friends-loader.php:119 -msgid "Friends <span class=\"%s\">%s</span>" -msgstr "" - -#: bp-friends/bp-friends-notifications.php:43 -msgid "New friendship request from %s" -msgstr "" - -#: bp-friends/bp-friends-notifications.php:44 -msgid "" -"%1$s wants to add you as a friend.\n" -"\n" -"To view all of your pending friendship requests: %2$s\n" -"\n" -"To view %3$s's profile: %4$s\n" -"\n" -"---------------------\n" +#: bp-friends/bp-friends-notifications.php:108 +msgid "%d friends accepted your friendship requests" msgstr "" -#: bp-friends/bp-friends-notifications.php:132 -#: bp-friends/bp-friends-notifications.php:222 +#: bp-friends/bp-friends-notifications.php:111 msgid "%s accepted your friendship request" msgstr "" -#: bp-friends/bp-friends-notifications.php:133 -msgid "" -"%1$s accepted your friend request.\n" -"\n" -"To view %2$s's profile: %3$s\n" -"\n" -"---------------------\n" -msgstr "" - -#: bp-friends/bp-friends-notifications.php:219 -msgid "%d friends accepted your friendship requests" -msgstr "" - -#: bp-friends/bp-friends-notifications.php:235 +#: bp-friends/bp-friends-notifications.php:124 msgid "You have %d pending friendship requests" msgstr "" -#: bp-friends/bp-friends-notifications.php:238 +#: bp-friends/bp-friends-notifications.php:127 msgid "You have a friendship request from %s" msgstr "" -#: bp-friends/bp-friends-screens.php:48 +#: bp-friends/bp-friends-screens.php:52 msgid "Friendship accepted" msgstr "" -#: bp-friends/bp-friends-screens.php:50 +#: bp-friends/bp-friends-screens.php:54 msgid "Friendship could not be accepted" msgstr "" -#: bp-friends/bp-friends-screens.php:59 +#: bp-friends/bp-friends-screens.php:63 msgid "Friendship rejected" msgstr "" -#: bp-friends/bp-friends-screens.php:61 +#: bp-friends/bp-friends-screens.php:65 msgid "Friendship could not be rejected" msgstr "" -#: bp-friends/bp-friends-screens.php:70 +#: bp-friends/bp-friends-screens.php:74 msgid "Friendship request withdrawn" msgstr "" -#: bp-friends/bp-friends-screens.php:72 +#: bp-friends/bp-friends-screens.php:76 msgid "Friendship request could not be withdrawn" msgstr "" -#: bp-friends/bp-friends-template.php:82 +#: bp-friends/bp-friends-template.php:86 msgid "My Friends" msgstr "" -#: bp-friends/bp-friends-template.php:82 +#: bp-friends/bp-friends-template.php:86 +#: bp-friends/classes/class-bp-core-friends-widget.php:56 msgid "%s's Friends" msgstr "" -#: bp-friends/bp-friends-template.php:82 +#: bp-friends/bp-friends-template.php:86 msgid "See All" msgstr "" -#: bp-friends/bp-friends-template.php:102 +#: bp-friends/bp-friends-template.php:106 msgid "You haven't added any friend connections yet." msgstr "" -#: bp-friends/bp-friends-template.php:102 +#: bp-friends/bp-friends-template.php:106 msgid "%s hasn't created any friend connections yet." msgstr "" -#: bp-friends/bp-friends-template.php:172 +#: bp-friends/bp-friends-template.php:176 msgid "There aren't enough site members to show a random sample just yet." msgstr "" -#: bp-friends/bp-friends-template.php:189 +#: bp-friends/bp-friends-template.php:193 msgid "Filter Friends" msgstr "" -#: bp-friends/bp-friends-template.php:241 +#: bp-friends/bp-friends-template.php:249 msgid "%d friend" msgstr "" -#: bp-friends/bp-friends-template.php:245 +#: bp-friends/bp-friends-template.php:253 msgid "%d friends" msgstr "" -#: bp-friends/bp-friends-template.php:355 -#: bp-templates/bp-legacy/buddypress-functions.php:1355 +#: bp-friends/bp-friends-template.php:373 +#: bp-templates/bp-legacy/buddypress-functions.php:1384 msgid "Cancel Friendship Request" msgstr "" -#: bp-friends/bp-friends-template.php:356 +#: bp-friends/bp-friends-template.php:374 msgid "Cancel Friendship Requested" msgstr "" -#: bp-friends/bp-friends-template.php:372 -#: bp-friends/bp-friends-template.php:373 +#: bp-friends/bp-friends-template.php:390 +#: bp-friends/bp-friends-template.php:391 msgid "Friendship Requested" msgstr "" -#: bp-friends/bp-friends-template.php:389 -#: bp-friends/bp-friends-template.php:390 +#: bp-friends/bp-friends-template.php:407 +#: bp-friends/bp-friends-template.php:408 msgid "Cancel Friendship" msgstr "" -#: 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 +#: bp-friends/bp-friends-template.php:424 +#: bp-friends/bp-friends-template.php:425 +#: bp-templates/bp-legacy/buddypress-functions.php:1374 +#: bp-templates/bp-legacy/buddypress-functions.php:1392 msgid "Add Friend" msgstr "" -#: bp-friends/bp-friends-template.php:674 +#: bp-friends/bp-friends-template.php:717 msgid "%s friend" msgid_plural "%s friends" msgstr[0] "" msgstr[1] "" -#: bp-friends/bp-friends-widgets.php:48 +#: bp-friends/bp-friends-widgets.php:91 bp-members/bp-members-widgets.php:105 +msgid "There were no members found, please try another filter." +msgstr "" + +#: bp-friends/classes/class-bp-core-friends-widget.php:27 msgid "" "A dynamic list of recently active, popular, and newest Friends of the " "displayed member. Widget is only shown when viewing a member profile." msgstr "" -#: bp-friends/bp-friends-widgets.php:73 -msgid "%s’s Friends" -msgstr "" - -#: 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 +#: bp-friends/classes/class-bp-core-friends-widget.php:95 +#: bp-friends/classes/class-bp-core-friends-widget.php:190 +#: bp-groups/classes/class-bp-groups-widget.php:113 +#: bp-groups/classes/class-bp-groups-widget.php:215 +#: bp-members/classes/class-bp-core-members-widget.php:103 +#: bp-members/classes/class-bp-core-members-widget.php:218 +#: bp-members/classes/class-bp-members-admin.php:991 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 +#: bp-friends/classes/class-bp-core-friends-widget.php:96 +#: bp-friends/classes/class-bp-core-friends-widget.php:191 +#: bp-groups/classes/class-bp-groups-widget.php:115 +#: bp-groups/classes/class-bp-groups-widget.php:216 +#: bp-members/classes/class-bp-core-members-widget.php:107 +#: bp-members/classes/class-bp-core-members-widget.php:219 msgid "Popular" msgstr "" -#: bp-friends/bp-friends-widgets.php:145 -#: bp-templates/bp-legacy/buddypress/members/members-loop.php:147 +#: bp-friends/classes/class-bp-core-friends-widget.php:131 +#: bp-templates/bp-legacy/buddypress/members/members-loop.php:142 msgid "Sorry, no members were found." msgstr "" -#: bp-friends/bp-friends-widgets.php:189 bp-members/bp-members-widgets.php:197 +#: bp-friends/classes/class-bp-core-friends-widget.php:182 +#: bp-members/classes/class-bp-core-members-widget.php:203 msgid "Link widget title to Members directory" msgstr "" -#: bp-friends/bp-friends-widgets.php:191 +#: bp-friends/classes/class-bp-core-friends-widget.php:184 msgid "Max friends to show:" msgstr "" -#: bp-friends/bp-friends-widgets.php:194 +#: bp-friends/classes/class-bp-core-friends-widget.php:187 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." +#: bp-friends/classes/class-bp-friends-component.php:101 +msgid "Search Friends..." +msgstr "" + +#: bp-friends/classes/class-bp-friends-component.php:140 +msgid "Friends <span class=\"%s\">%s</span>" msgstr "" #: bp-groups/bp-groups-actions.php:39 @@ -3177,136 +3812,132 @@ msgstr "" msgid "You are not an admin of this group." msgstr "" -#: bp-groups/bp-groups-actions.php:107 +#: bp-groups/bp-groups-actions.php:110 msgid "Sorry, you are not allowed to create groups." msgstr "" -#: bp-groups/bp-groups-actions.php:132 bp-groups/bp-groups-actions.php:167 -#: bp-groups/bp-groups-actions.php:191 +#: bp-groups/bp-groups-actions.php:135 bp-groups/bp-groups-actions.php:170 +#: bp-groups/bp-groups-actions.php:194 msgid "There was an error saving group details. Please try again." msgstr "" -#: bp-groups/bp-groups-actions.php:147 +#: bp-groups/bp-groups-actions.php:150 msgid "Only the group creator may continue editing this group." msgstr "" -#: bp-groups/bp-groups-actions.php:160 +#: bp-groups/bp-groups-actions.php:163 msgid "Please fill in all of the required fields" msgstr "" -#: bp-groups/bp-groups-actions.php:308 bp-groups/bp-groups-screens.php:668 +#: bp-groups/bp-groups-actions.php:311 bp-groups/bp-groups-screens.php:684 msgid "Invite successfully removed" msgstr "" -#: bp-groups/bp-groups-actions.php:312 bp-groups/bp-groups-screens.php:679 +#: bp-groups/bp-groups-actions.php:315 bp-groups/bp-groups-screens.php:695 msgid "There was an error removing the invite" msgstr "" -#: bp-groups/bp-groups-actions.php:343 +#: bp-groups/bp-groups-actions.php:344 msgid "" "There was an error saving the group profile photo, please try uploading " "again." msgstr "" -#: bp-groups/bp-groups-actions.php:345 -msgid "The group profile photo was uploaded successfully!" -msgstr "" - -#: bp-groups/bp-groups-actions.php:380 bp-groups/bp-groups-actions.php:387 +#: bp-groups/bp-groups-actions.php:385 bp-groups/bp-groups-actions.php:392 msgid "There was an error joining the group." msgstr "" -#: bp-groups/bp-groups-actions.php:389 +#: bp-groups/bp-groups-actions.php:394 msgid "You joined the group!" msgstr "" -#: bp-groups/bp-groups-actions.php:434 bp-groups/bp-groups-screens.php:1045 +#: bp-groups/bp-groups-actions.php:441 bp-groups/bp-groups-screens.php:1138 msgid "This group must have at least one admin" msgstr "" -#: bp-groups/bp-groups-actions.php:436 +#: bp-groups/bp-groups-actions.php:443 msgid "There was an error leaving the group." msgstr "" -#: bp-groups/bp-groups-actions.php:438 bp-groups/bp-groups-functions.php:447 +#: bp-groups/bp-groups-actions.php:445 bp-groups/bp-groups-functions.php:453 msgid "You successfully left the group." msgstr "" -#: bp-groups/bp-groups-actions.php:534 +#: bp-groups/bp-groups-actions.php:545 msgid "Activity feed for the group, %s." msgstr "" -#: bp-groups/bp-groups-activity.php:31 +#: bp-groups/bp-groups-activity.php:33 msgid "Created a group" msgstr "" -#: bp-groups/bp-groups-activity.php:33 +#: bp-groups/bp-groups-activity.php:35 msgid "New Groups" msgstr "" -#: bp-groups/bp-groups-activity.php:40 +#: bp-groups/bp-groups-activity.php:42 msgid "Joined a group" msgstr "" -#: bp-groups/bp-groups-activity.php:42 +#: bp-groups/bp-groups-activity.php:44 msgid "Group Memberships" msgstr "" -#: bp-groups/bp-groups-activity.php:49 +#: bp-groups/bp-groups-activity.php:51 msgid "Group details edited" msgstr "" -#: bp-groups/bp-groups-activity.php:51 +#: bp-groups/bp-groups-activity.php:53 msgid "Group Updates" msgstr "" -#: bp-groups/bp-groups-activity.php:62 +#: bp-groups/bp-groups-activity.php:64 msgid "New group forum topic" msgstr "" -#: bp-groups/bp-groups-activity.php:64 +#: bp-groups/bp-groups-activity.php:66 msgid "Forum Topics" msgstr "" -#: bp-groups/bp-groups-activity.php:71 +#: bp-groups/bp-groups-activity.php:73 msgid "New group forum post" msgstr "" -#: bp-groups/bp-groups-activity.php:73 +#: bp-groups/bp-groups-activity.php:75 msgid "Forum Replies" msgstr "" -#: bp-groups/bp-groups-activity.php:106 +#: bp-groups/bp-groups-activity.php:107 msgid "%1$s created the group %2$s" msgstr "" -#: bp-groups/bp-groups-activity.php:138 bp-groups/bp-groups-activity.php:444 +#: bp-groups/bp-groups-activity.php:138 bp-groups/bp-groups-activity.php:443 msgid "%1$s joined the group %2$s" msgstr "" -#: bp-groups/bp-groups-activity.php:189 +#: bp-groups/bp-groups-activity.php:188 msgid "%1$s updated details for the group %2$s" msgstr "" -#: bp-groups/bp-groups-activity.php:193 +#: bp-groups/bp-groups-activity.php:192 msgid "%1$s changed the name and description of the group %2$s" msgstr "" -#: bp-groups/bp-groups-activity.php:197 +#: bp-groups/bp-groups-activity.php:196 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 +#: bp-groups/bp-groups-activity.php:200 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 +#: bp-groups/bp-groups-admin.php:119 msgid "" "This page is a convenient way to edit the details associated with one of " "your groups." msgstr "" -#: bp-groups/bp-groups-admin.php:121 +#: bp-groups/bp-groups-admin.php:120 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 " @@ -3314,11 +3945,11 @@ msgid "" "unhide, or to choose a 1- or 2-column layout for this screen." msgstr "" -#: bp-groups/bp-groups-admin.php:127 +#: bp-groups/bp-groups-admin.php:126 msgid "Support Forums" msgstr "" -#: bp-groups/bp-groups-admin.php:160 +#: bp-groups/bp-groups-admin.php:159 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, " @@ -3326,24 +3957,24 @@ msgid "" "Actions." msgstr "" -#: bp-groups/bp-groups-admin.php:165 +#: bp-groups/bp-groups-admin.php:164 msgid "Group Actions" msgstr "" -#: bp-groups/bp-groups-admin.php:167 +#: bp-groups/bp-groups-admin.php:166 msgid "" "Clicking \"Visit\" will take you to the group’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:168 +#: bp-groups/bp-groups-admin.php:167 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:169 +#: bp-groups/bp-groups-admin.php:168 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 " @@ -3351,1918 +3982,1886 @@ msgid "" "the group(s)." msgstr "" -#: bp-groups/bp-groups-admin.php:184 +#: bp-groups/bp-groups-admin.php:180 +msgid "Groups list navigation" +msgstr "" + +#: bp-groups/bp-groups-admin.php:190 msgid "Start typing a username to add a new member." msgstr "" -#: bp-groups/bp-groups-admin.php:185 +#: bp-groups/bp-groups-admin.php:191 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:500 +#: bp-groups/bp-groups-admin.php:505 msgid "You cannot remove all administrators from a group." msgstr "" -#: bp-groups/bp-groups-admin.php:506 +#: bp-groups/bp-groups-admin.php:511 msgid "Group name cannot be empty." msgstr "" -#: bp-groups/bp-groups-admin.php:510 +#: bp-groups/bp-groups-admin.php:515 msgid "Group description cannot be empty." msgstr "" -#: bp-groups/bp-groups-admin.php:514 +#: bp-groups/bp-groups-admin.php:519 msgid "Group name and description cannot be empty." msgstr "" -#: bp-groups/bp-groups-admin.php:518 +#: bp-groups/bp-groups-admin.php:523 msgid "An error occurred when trying to update your group details." msgstr "" -#: bp-groups/bp-groups-admin.php:523 +#: bp-groups/bp-groups-admin.php:528 msgid "The group has been updated successfully." msgstr "" -#: 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:531 -msgid "The following users were successfully added to the group: <em>%s</em>" +#: bp-groups/bp-groups-admin.php:532 +msgid "The following users could not be added to the group: %s" msgstr "" #: bp-groups/bp-groups-admin.php:536 -msgid "An error occurred when trying to modify the following members: <em>%s</em>" +msgid "The following users were successfully added to the group: %s" msgstr "" #: bp-groups/bp-groups-admin.php:541 -msgid "The following members were successfully modified: <em>%s</em>" +msgid "An error occurred when trying to modify the following members: %s" +msgstr "" + +#: bp-groups/bp-groups-admin.php:546 +msgid "The following members were successfully modified: %s" msgstr "" -#: bp-groups/bp-groups-admin.php:570 bp-groups/bp-groups-adminbar.php:45 -#: bp-xprofile/bp-xprofile-admin.php:140 +#: bp-groups/bp-groups-admin.php:574 bp-groups/bp-groups-adminbar.php:45 +#: bp-xprofile/bp-xprofile-admin.php:149 msgid "Edit Group" msgstr "" -#: bp-groups/bp-groups-admin.php:573 bp-groups/bp-groups-admin.php:728 +#: bp-groups/bp-groups-admin.php:577 bp-groups/bp-groups-admin.php:731 msgid "Add New" msgstr "" -#: bp-groups/bp-groups-admin.php:592 +#: bp-groups/bp-groups-admin.php:596 msgid "Name and Description" msgstr "" -#: bp-groups/bp-groups-admin.php:596 +#: bp-groups/bp-groups-admin.php:598 +msgid "Group Name" +msgstr "" + +#: bp-groups/bp-groups-admin.php:601 msgid "Permalink:" msgstr "" -#: bp-groups/bp-groups-admin.php:596 +#: bp-groups/bp-groups-admin.php:601 msgid "Visit Group" msgstr "" -#: bp-groups/bp-groups-admin.php:623 +#: bp-groups/bp-groups-admin.php:604 +msgid "Group Description" +msgstr "" + +#: bp-groups/bp-groups-admin.php:628 msgid "No group found with this ID. <a href=\"%s\">Go back and try again</a>." msgstr "" -#: bp-groups/bp-groups-admin.php:666 +#: bp-groups/bp-groups-admin.php:670 msgid "Delete Groups" msgstr "" -#: bp-groups/bp-groups-admin.php:667 +#: bp-groups/bp-groups-admin.php:671 msgid "You are about to delete the following groups:" msgstr "" -#: bp-groups/bp-groups-admin.php:675 bp-members/bp-members-admin.php:1997 +#: bp-groups/bp-groups-admin.php:679 +#: bp-members/classes/class-bp-members-admin.php:2010 msgid "This action cannot be undone." msgstr "" -#: bp-groups/bp-groups-admin.php:704 +#: bp-groups/bp-groups-admin.php:708 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: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 +#: bp-groups/bp-groups-admin.php:728 bp-groups/bp-groups-notifications.php:444 +#: bp-groups/bp-groups-notifications.php:533 +#: bp-groups/bp-groups-notifications.php:619 +#: bp-groups/bp-groups-notifications.php:701 +#: bp-groups/classes/class-bp-groups-widget.php:65 +#: bp-groups/classes/class-bp-groups-widget.php:192 msgid "Groups" msgstr "" -#: bp-groups/bp-groups-admin.php:745 +#: bp-groups/bp-groups-admin.php:748 msgid "Search all Groups" msgstr "" -#: 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 +#: bp-groups/bp-groups-admin.php:771 +#: bp-templates/bp-legacy/buddypress/groups/create.php:156 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:91 msgid "Enable discussion forum" msgstr "" -#: bp-groups/bp-groups-admin.php:774 +#: bp-groups/bp-groups-admin.php:777 msgid "Privacy" msgstr "" -#: bp-groups/bp-groups-admin.php:777 bp-groups/bp-groups-admin.php:1653 -#: bp-groups/bp-groups-template.php:1270 +#: bp-groups/bp-groups-admin.php:780 bp-groups/bp-groups-template.php:1013 +#: bp-groups/classes/class-bp-groups-list-table.php:556 msgid "Public" msgstr "" -#: bp-groups/bp-groups-admin.php:778 bp-groups/bp-groups-admin.php:1656 -#: bp-groups/bp-groups-template.php:1272 +#: bp-groups/bp-groups-admin.php:781 bp-groups/bp-groups-template.php:1015 +#: bp-groups/classes/class-bp-groups-list-table.php:559 msgid "Private" msgstr "" -#: bp-groups/bp-groups-admin.php:779 bp-groups/bp-groups-admin.php:1659 +#: bp-groups/bp-groups-admin.php:782 +#: bp-groups/classes/class-bp-groups-list-table.php:562 msgid "Hidden" msgstr "" -#: bp-groups/bp-groups-admin.php:786 +#: bp-groups/bp-groups-admin.php:789 msgid "Who can invite others to this group?" msgstr "" -#: 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 +#: bp-groups/bp-groups-admin.php:792 +#: bp-templates/bp-legacy/buddypress/groups/create.php:139 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:138 msgid "All group members" msgstr "" -#: bp-groups/bp-groups-admin.php:790 +#: bp-groups/bp-groups-admin.php:793 #: bp-templates/bp-legacy/buddypress/groups/create.php:141 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:140 msgid "Group admins and mods only" msgstr "" -#: 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 +#: bp-groups/bp-groups-admin.php:794 +#: bp-templates/bp-legacy/buddypress/groups/create.php:143 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:142 msgid "Group admins only" msgstr "" -#: bp-groups/bp-groups-admin.php:807 +#: bp-groups/bp-groups-admin.php:812 +msgid "Add new members" +msgstr "" + +#: bp-groups/bp-groups-admin.php:813 msgid "Enter a comma-separated list of user logins." msgstr "" -#: bp-groups/bp-groups-admin.php:862 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:234 +#: bp-groups/bp-groups-admin.php:868 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:262 msgid "Administrators" msgstr "" -#: bp-groups/bp-groups-admin.php:863 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:262 +#: bp-groups/bp-groups-admin.php:869 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:290 msgid "Moderators" msgstr "" -#: 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 +#: bp-groups/bp-groups-admin.php:870 +#: bp-groups/classes/class-bp-groups-component.php:646 +#: bp-members/classes/class-bp-core-members-widget.php:238 +#: bp-members/classes/class-bp-members-component.php:36 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:316 msgid "Members" msgstr "" -#: bp-groups/bp-groups-admin.php:865 +#: bp-groups/bp-groups-admin.php:871 msgid "Banned Members" msgstr "" -#: bp-groups/bp-groups-admin.php:901 +#: bp-groups/bp-groups-admin.php:906 +msgid "Select group role for member" +msgstr "" + +#: bp-groups/bp-groups-admin.php:908 msgid "Roles" msgstr "" -#: bp-groups/bp-groups-admin.php:902 +#: bp-groups/bp-groups-admin.php:909 msgid "Administrator" msgstr "" -#: bp-groups/bp-groups-admin.php:903 +#: bp-groups/bp-groups-admin.php:910 msgid "Moderator" msgstr "" -#: bp-groups/bp-groups-admin.php:904 bp-members/bp-members-admin.php:760 +#: bp-groups/bp-groups-admin.php:911 +#: bp-members/classes/class-bp-members-admin.php:763 msgid "Member" msgstr "" -#: bp-groups/bp-groups-admin.php:906 +#: bp-groups/bp-groups-admin.php:913 msgid "Banned" msgstr "" -#: 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 +#: bp-groups/bp-groups-admin.php:916 +#: bp-members/classes/class-bp-members-admin.php:1436 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:74 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:18 msgid "Actions" msgstr "" -#: bp-groups/bp-groups-admin.php:910 +#: bp-groups/bp-groups-admin.php:917 msgid "Remove" msgstr "" -#: bp-groups/bp-groups-admin.php:912 +#: bp-groups/bp-groups-admin.php:919 msgid "Ban" msgstr "" -#: bp-groups/bp-groups-admin.php:958 +#: bp-groups/bp-groups-admin.php:965 msgid "No members of this type" msgstr "" -#: 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:1037 -msgid "«" -msgstr "" - -#: bp-groups/bp-groups-admin.php:1038 -msgid "»" -msgstr "" - -#: 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:1114 -#. translators: 1: user_login, 2: user_email -msgid "%1$s (%2$s)" -msgstr "" - -#: bp-groups/bp-groups-admin.php:1308 -msgid "No groups found." -msgstr "" - -#: bp-groups/bp-groups-admin.php:1387 -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:1388 -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:1389 -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:1521 -msgid "Select group %1$d" -msgstr "" - -#: 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-forums.php:278 -msgid "%1$s started the forum topic %2$s in the group %3$s" -msgstr "" - -#: 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-functions.php:166 -#: bp-groups/classes/class-bp-groups-member.php:285 -msgid "Group Admin" -msgstr "" - -#: bp-groups/bp-groups-functions.php:438 -msgid "As the only admin, you cannot leave the group." -msgstr "" - -#: bp-groups/bp-groups-functions.php:951 -msgid "%1$s posted an update in the group %2$s" -msgstr "" - -#: bp-groups/bp-groups-loader.php:427 bp-groups/bp-groups-loader.php:457 -msgid "Memberships" -msgstr "" - -#: bp-groups/bp-groups-loader.php:438 -msgid "Invitations" -msgstr "" - -#: bp-groups/bp-groups-loader.php:564 -msgid "Details" -msgstr "" - -#: bp-groups/bp-groups-loader.php:577 -msgid "Photo" -msgstr "" - -#: bp-groups/bp-groups-loader.php:591 -msgid "Requests" -msgstr "" - -#: bp-groups/bp-groups-loader.php:722 -msgid "No Group Profile Photo" -msgstr "" - -#: bp-groups/bp-groups-notifications.php:64 -msgid "Group Details Updated" -msgstr "" - -#: bp-groups/bp-groups-notifications.php:83 -msgid "" -"Group details for the group \"%1$s\" were updated: %2$s\n" -"\n" -"To view the group: %3$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:994 +#: bp-groups/classes/class-bp-group-extension.php:522 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:69 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:157 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:92 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:123 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:105 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:40 +#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:34 +msgid "Save Changes" msgstr "" -#: bp-groups/bp-groups-notifications.php:194 -msgid "Membership request for group: %s" +#: bp-groups/bp-groups-admin.php:1043 +msgid "«" msgstr "" -#: 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" +#: bp-groups/bp-groups-admin.php:1044 +msgid "»" msgstr "" -#: bp-groups/bp-groups-notifications.php:214 -msgid "" -"%1$s wants to join the group \"%2$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" -"%3$s\n" -"\n" -"To view %4$s's profile: %5$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:1050 bp-groups/bp-groups-template.php:4117 +#: bp-members/bp-members-template.php:498 +msgid "Viewing 1 member" msgstr "" -#: bp-groups/bp-groups-notifications.php:327 -msgid "Membership request for group \"%s\" accepted" -msgstr "" +#: bp-groups/bp-groups-admin.php:1053 bp-groups/bp-groups-template.php:4119 +#: bp-members/bp-members-template.php:500 +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-notifications.php:328 -msgid "" -"Your membership request for the group \"%1$s\" has been accepted.\n" -"\n" -"To view the group please login and visit: %2$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:1119 +#. Translators: 1: user_login, 2: user_email. +msgid "%1$s (%2$s)" msgstr "" -#: bp-groups/bp-groups-notifications.php:337 -msgid "Membership request for group \"%s\" rejected" +#: bp-groups/bp-groups-forums.php:148 bp-groups/bp-groups-forums.php:444 +msgid "%1$s replied to the forum topic %2$s in the group %3$s" msgstr "" -#: bp-groups/bp-groups-notifications.php:338 -msgid "" -"Your membership request for the group \"%1$s\" has been rejected.\n" -"\n" -"To submit another request please log in and visit: %2$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-forums.php:275 +msgid "%1$s started the forum topic %2$s in the group %3$s" msgstr "" -#: bp-groups/bp-groups-notifications.php:414 -msgid "an administrator" +#: bp-groups/bp-groups-forums.php:373 +msgid "%1$s edited the forum topic %2$s in the group %3$s" msgstr "" -#: bp-groups/bp-groups-notifications.php:417 -msgid "a moderator" +#: bp-groups/bp-groups-functions.php:168 +#: bp-groups/classes/class-bp-groups-member.php:299 +msgid "Group Admin" msgstr "" -#: bp-groups/bp-groups-notifications.php:444 -msgid "You have been promoted in the group: \"%s\"" +#: bp-groups/bp-groups-functions.php:444 +msgid "As the only admin, you cannot leave the group." msgstr "" -#: bp-groups/bp-groups-notifications.php:445 -msgid "" -"You have been promoted to %1$s for the group: \"%2$s\".\n" -"\n" -"To view the group please visit: %3$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-functions.php:987 +msgid "%1$s posted an update in the group %2$s" msgstr "" -#: bp-groups/bp-groups-notifications.php:556 -msgid "You have an invitation to the group: \"%s\"" +#: bp-groups/bp-groups-notifications.php:207 +msgid "an administrator" msgstr "" -#: bp-groups/bp-groups-notifications.php:557 -msgid "" -"One of your friends %1$s has invited you to the group: \"%2$s\".\n" -"\n" -"To view your group invites visit: %3$s\n" -"\n" -"To view the group visit: %4$s\n" -"\n" -"To view %5$s's profile visit: %6$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-notifications.php:210 +msgid "a moderator" msgstr "" -#: bp-groups/bp-groups-notifications.php:655 +#: bp-groups/bp-groups-notifications.php:325 msgid "%1$d new membership requests for the group \"%2$s\"" msgstr "" -#: bp-groups/bp-groups-notifications.php:676 +#: bp-groups/bp-groups-notifications.php:346 msgid "Group Membership Requests" msgstr "" -#: bp-groups/bp-groups-notifications.php:701 -#: bp-groups/bp-groups-notifications.php:721 +#: bp-groups/bp-groups-notifications.php:371 +#: bp-groups/bp-groups-notifications.php:391 msgid "%s requests group membership" msgstr "" -#: bp-groups/bp-groups-notifications.php:756 +#: bp-groups/bp-groups-notifications.php:426 msgid "%d accepted group membership requests" msgstr "" -#: bp-groups/bp-groups-notifications.php:795 +#: bp-groups/bp-groups-notifications.php:465 msgid "Membership for group \"%s\" accepted" msgstr "" -#: bp-groups/bp-groups-notifications.php:845 +#: bp-groups/bp-groups-notifications.php:515 msgid "%d rejected group membership requests" msgstr "" -#: bp-groups/bp-groups-notifications.php:884 +#: bp-groups/bp-groups-notifications.php:554 msgid "Membership for group \"%s\" rejected" msgstr "" -#: bp-groups/bp-groups-notifications.php:933 +#: bp-groups/bp-groups-notifications.php:603 msgid "You were promoted to an admin in %d groups" msgstr "" -#: bp-groups/bp-groups-notifications.php:968 +#: bp-groups/bp-groups-notifications.php:638 msgid "You were promoted to an admin in the group \"%s\"" msgstr "" -#: bp-groups/bp-groups-notifications.php:1015 +#: bp-groups/bp-groups-notifications.php:685 msgid "You were promoted to a mod in %d groups" msgstr "" -#: bp-groups/bp-groups-notifications.php:1050 +#: bp-groups/bp-groups-notifications.php:720 msgid "You were promoted to a mod in the group \"%s\"" msgstr "" -#: bp-groups/bp-groups-notifications.php:1098 +#: bp-groups/bp-groups-notifications.php:768 msgid "You have %d new group invitations" msgstr "" -#: bp-groups/bp-groups-notifications.php:1113 +#: bp-groups/bp-groups-notifications.php:783 msgid "Group Invites" msgstr "" -#: bp-groups/bp-groups-notifications.php:1132 +#: bp-groups/bp-groups-notifications.php:802 msgid "You have an invitation to the group: %s" msgstr "" -#: bp-groups/bp-groups-screens.php:77 +#: bp-groups/bp-groups-screens.php:85 msgid "Group invite could not be accepted" msgstr "" -#: bp-groups/bp-groups-screens.php:79 bp-groups/bp-groups-screens.php:704 +#: bp-groups/bp-groups-screens.php:87 bp-groups/bp-groups-screens.php:722 msgid "Group invite accepted" msgstr "" -#: bp-groups/bp-groups-screens.php:104 +#: bp-groups/bp-groups-screens.php:112 msgid "Group invite could not be rejected" msgstr "" -#: bp-groups/bp-groups-screens.php:106 +#: bp-groups/bp-groups-screens.php:114 msgid "Group invite rejected" msgstr "" -#: bp-groups/bp-groups-screens.php:211 +#: bp-groups/bp-groups-screens.php:223 msgid "It looks like you've already said that!" msgstr "" -#: bp-groups/bp-groups-screens.php:214 +#: bp-groups/bp-groups-screens.php:226 msgid "There was an error when replying to that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:216 +#: bp-groups/bp-groups-screens.php:228 msgid "Your reply was posted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:237 +#: bp-groups/bp-groups-screens.php:249 msgid "There was an error when making that topic a sticky" msgstr "" -#: bp-groups/bp-groups-screens.php:239 +#: bp-groups/bp-groups-screens.php:251 msgid "The topic was made sticky successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:259 +#: bp-groups/bp-groups-screens.php:271 msgid "There was an error when unsticking that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:261 +#: bp-groups/bp-groups-screens.php:273 msgid "The topic was unstuck successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:281 +#: bp-groups/bp-groups-screens.php:293 msgid "There was an error when closing that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:283 +#: bp-groups/bp-groups-screens.php:295 msgid "The topic was closed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:303 +#: bp-groups/bp-groups-screens.php:315 msgid "There was an error when opening that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:305 +#: bp-groups/bp-groups-screens.php:317 msgid "The topic was opened successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:342 +#: bp-groups/bp-groups-screens.php:354 msgid "There was an error deleting the topic" msgstr "" -#: bp-groups/bp-groups-screens.php:344 +#: bp-groups/bp-groups-screens.php:356 msgid "The topic was deleted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:375 +#: bp-groups/bp-groups-screens.php:387 msgid "There was an error when editing that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:377 +#: bp-groups/bp-groups-screens.php:389 msgid "The topic was edited successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:423 +#: bp-groups/bp-groups-screens.php:435 msgid "There was an error deleting that post" msgstr "" -#: bp-groups/bp-groups-screens.php:425 +#: bp-groups/bp-groups-screens.php:437 msgid "The post was deleted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:456 +#: bp-groups/bp-groups-screens.php:468 msgid "There was an error when editing that post" msgstr "" -#: bp-groups/bp-groups-screens.php:458 +#: bp-groups/bp-groups-screens.php:470 msgid "The post was edited successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:482 bp-groups/bp-groups-screens.php:508 +#: bp-groups/bp-groups-screens.php:494 bp-groups/bp-groups-screens.php:520 msgid "You have been banned from this group." msgstr "" -#: bp-groups/bp-groups-screens.php:522 +#: bp-groups/bp-groups-screens.php:534 msgid "This group does not have a forum setup yet." msgstr "" -#: bp-groups/bp-groups-screens.php:617 +#: bp-groups/bp-groups-screens.php:633 msgid "Group invites sent." msgstr "" -#: bp-groups/bp-groups-screens.php:673 +#: bp-groups/bp-groups-screens.php:689 msgid "You are not allowed to send or remove invites" msgstr "" -#: bp-groups/bp-groups-screens.php:676 +#: bp-groups/bp-groups-screens.php:692 msgid "The member requested to join the group" msgstr "" -#: bp-groups/bp-groups-screens.php:706 +#: bp-groups/bp-groups-screens.php:724 msgid "There was an error accepting the group invitation. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:718 +#: bp-groups/bp-groups-screens.php:736 msgid "There was an error sending your group membership request. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:720 +#: bp-groups/bp-groups-screens.php:738 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:793 +#: bp-groups/bp-groups-screens.php:845 msgid "There was an error updating group details. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:795 +#: bp-groups/bp-groups-screens.php:847 msgid "Group details were successfully updated." msgstr "" -#: bp-groups/bp-groups-screens.php:863 +#: bp-groups/bp-groups-screens.php:917 msgid "There was an error updating group settings. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:865 +#: bp-groups/bp-groups-screens.php:919 msgid "Group settings were successfully updated." msgstr "" -#: bp-groups/bp-groups-screens.php:968 +#: bp-groups/bp-groups-screens.php:1024 msgid "The new group profile photo was uploaded successfully." msgstr "" -#: bp-groups/bp-groups-screens.php:1016 +#: bp-groups/bp-groups-screens.php:1109 msgid "There was an error when promoting that user. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1018 +#: bp-groups/bp-groups-screens.php:1111 msgid "User promoted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:1049 +#: bp-groups/bp-groups-screens.php:1142 msgid "There was an error when demoting that user. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1051 +#: bp-groups/bp-groups-screens.php:1144 msgid "User demoted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:1075 +#: bp-groups/bp-groups-screens.php:1168 msgid "There was an error when banning that user. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1077 +#: bp-groups/bp-groups-screens.php:1170 msgid "User banned successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:1101 +#: bp-groups/bp-groups-screens.php:1194 msgid "There was an error when unbanning that user. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1103 +#: bp-groups/bp-groups-screens.php:1196 msgid "User ban removed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:1127 +#: bp-groups/bp-groups-screens.php:1220 msgid "There was an error removing that user from the group. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1129 +#: bp-groups/bp-groups-screens.php:1222 msgid "User removed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:1191 +#: bp-groups/bp-groups-screens.php:1286 msgid "There was an error accepting the membership request. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1193 +#: bp-groups/bp-groups-screens.php:1288 msgid "Group membership request accepted" msgstr "" -#: bp-groups/bp-groups-screens.php:1202 +#: bp-groups/bp-groups-screens.php:1297 msgid "There was an error rejecting the membership request. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1204 +#: bp-groups/bp-groups-screens.php:1299 msgid "Group membership request rejected" msgstr "" -#: bp-groups/bp-groups-screens.php:1271 bp-xprofile/bp-xprofile-admin.php:295 +#: bp-groups/bp-groups-screens.php:1368 bp-xprofile/bp-xprofile-admin.php:314 msgid "There was an error deleting the group. Please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:1273 -msgid "The group was deleted successfully" +#: bp-groups/bp-groups-screens.php:1370 bp-xprofile/bp-xprofile-admin.php:317 +msgid "The group was deleted successfully." msgstr "" -#: bp-groups/bp-groups-template.php:804 +#: bp-groups/bp-groups-template.php:480 msgid "Public Group" msgstr "" -#: bp-groups/bp-groups-template.php:806 +#: bp-groups/bp-groups-template.php:482 msgid "Hidden Group" msgstr "" -#: bp-groups/bp-groups-template.php:808 +#: bp-groups/bp-groups-template.php:484 msgid "Private Group" msgstr "" -#: bp-groups/bp-groups-template.php:810 +#: bp-groups/bp-groups-template.php:486 msgid "Group" msgstr "" -#: bp-groups/bp-groups-template.php:1017 +#: bp-groups/bp-groups-template.php:723 msgid "not yet active" msgstr "" -#: bp-groups/bp-groups-template.php:1502 +#: bp-groups/bp-groups-template.php:1285 msgid "Group creator profile photo of %s" msgstr "" -#: bp-groups/bp-groups-template.php:1577 +#: bp-groups/bp-groups-template.php:1368 msgid "No Admins" msgstr "" -#: bp-groups/bp-groups-template.php:1624 +#: bp-groups/bp-groups-template.php:1417 msgid "No Mods" msgstr "" -#: bp-groups/bp-groups-template.php:1750 +#: bp-groups/bp-groups-template.php:1557 msgid "Filter Groups" msgstr "" -#: bp-groups/bp-groups-template.php:1840 +#: bp-groups/bp-groups-template.php:1657 msgid "Viewing 1 group" msgstr "" -#: bp-groups/bp-groups-template.php:1842 +#: bp-groups/bp-groups-template.php:1659 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:1930 +#: bp-groups/bp-groups-template.php:1759 msgid "%s member" msgid_plural "%s members" msgstr[0] "" msgstr[1] "" -#: bp-groups/bp-groups-template.php:2012 +#: bp-groups/bp-groups-template.php:1854 msgid "%d topic" msgstr "" -#: bp-groups/bp-groups-template.php:2014 +#: bp-groups/bp-groups-template.php:1856 msgid "%d topics" msgstr "" -#: 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 +#: bp-groups/bp-groups-template.php:2182 bp-groups/bp-groups-template.php:2258 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:275 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:302 msgid "Demote to Member" msgstr "" -#: bp-groups/bp-groups-template.php:2332 bp-groups/bp-groups-template.php:2407 -#: bp-groups/bp-groups-template.php:4140 +#: bp-groups/bp-groups-template.php:2195 bp-groups/bp-groups-template.php:2271 +#: bp-groups/bp-groups-template.php:4003 msgid "joined %s" msgstr "" -#: bp-groups/bp-groups-template.php:2355 +#: bp-groups/bp-groups-template.php:2218 msgid "This group has no administrators" msgstr "" -#: 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 +#: bp-groups/bp-groups-template.php:2257 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:301 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:357 msgid "Promote to Admin" msgstr "" -#: bp-groups/bp-groups-template.php:2427 +#: bp-groups/bp-groups-template.php:2291 msgid "This group has no moderators" msgstr "" -#: bp-groups/bp-groups-template.php:2747 +#: bp-groups/bp-groups-template.php:2652 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:3270 bp-groups/bp-groups-template.php:3271 -#: bp-templates/bp-legacy/buddypress-functions.php:1441 -#: bp-templates/bp-legacy/buddypress-functions.php:1454 +#: bp-groups/bp-groups-template.php:3240 bp-groups/bp-groups-template.php:3241 +#: bp-templates/bp-legacy/buddypress-functions.php:1473 +#: bp-templates/bp-legacy/buddypress-functions.php:1486 msgid "Leave Group" msgstr "" -#: bp-groups/bp-groups-template.php:3292 bp-groups/bp-groups-template.php:3293 -#: bp-templates/bp-legacy/buddypress-functions.php:1475 +#: bp-groups/bp-groups-template.php:3262 bp-groups/bp-groups-template.php:3263 +#: bp-templates/bp-legacy/buddypress-functions.php:1507 msgid "Join Group" msgstr "" -#: bp-groups/bp-groups-template.php:3311 bp-groups/bp-groups-template.php:3312 +#: bp-groups/bp-groups-template.php:3281 bp-groups/bp-groups-template.php:3282 msgid "Accept Invitation" msgstr "" -#: bp-groups/bp-groups-template.php:3327 bp-groups/bp-groups-template.php:3328 +#: bp-groups/bp-groups-template.php:3297 bp-groups/bp-groups-template.php:3298 +#: bp-templates/bp-legacy/buddypress-functions.php:1496 msgid "Request Sent" msgstr "" -#: bp-groups/bp-groups-template.php:3343 bp-groups/bp-groups-template.php:3344 -#: bp-templates/bp-legacy/buddypress-functions.php:1477 +#: bp-groups/bp-groups-template.php:3313 bp-groups/bp-groups-template.php:3314 +#: bp-templates/bp-legacy/buddypress-functions.php:1509 msgid "Request Membership" msgstr "" -#: bp-groups/bp-groups-template.php:3488 +#: bp-groups/bp-groups-template.php:3462 msgid "This group is not currently accessible." msgstr "" -#: bp-groups/bp-groups-template.php:3499 +#: bp-groups/bp-groups-template.php:3473 msgid "" "You must accept your pending invitation before you can access this private " "group." msgstr "" -#: bp-groups/bp-groups-template.php:3501 +#: bp-groups/bp-groups-template.php:3475 msgid "" "This is a private group and you must request group membership in order to " "join." msgstr "" -#: bp-groups/bp-groups-template.php:3504 +#: bp-groups/bp-groups-template.php:3478 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:3507 +#: bp-groups/bp-groups-template.php:3481 msgid "" "This is a private group. Your membership request is awaiting approval from " "the group administrator." msgstr "" -#: bp-groups/bp-groups-template.php:3515 +#: bp-groups/bp-groups-template.php:3489 msgid "This is a hidden group and only invited members can join." msgstr "" -#: 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 -#: bp-templates/bp-legacy/buddypress/members/single/groups.php:20 +#: bp-groups/bp-groups-template.php:4271 +#: bp-notifications/bp-notifications-template.php:905 +#: bp-templates/bp-legacy/buddypress/blogs/index.php:87 +#: bp-templates/bp-legacy/buddypress/forums/index.php:86 +#: bp-templates/bp-legacy/buddypress/groups/index.php:80 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:50 +#: bp-templates/bp-legacy/buddypress/members/index.php:83 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:18 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:17 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:19 msgid "Order By:" msgstr "" -#: bp-groups/bp-groups-template.php:4292 +#: bp-groups/bp-groups-template.php:4274 msgid "Oldest" msgstr "" -#: bp-groups/bp-groups-template.php:4295 +#: bp-groups/bp-groups-template.php:4277 msgid "Group Activity" msgstr "" -#: 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 +#: bp-groups/bp-groups-template.php:4280 +#: bp-templates/bp-legacy/buddypress/blogs/index.php:91 +#: bp-templates/bp-legacy/buddypress/groups/index.php:86 +#: bp-templates/bp-legacy/buddypress/members/index.php:89 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:23 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:24 msgid "Alphabetical" msgstr "" -#: bp-groups/bp-groups-template.php:4612 bp-groups/bp-groups-template.php:4914 -msgid "Group avatar" +#: bp-groups/bp-groups-template.php:4705 +msgid "Group photo" msgstr "" -#: bp-groups/bp-groups-template.php:4799 bp-groups/bp-groups-template.php:4822 +#: bp-groups/bp-groups-template.php:5003 bp-groups/bp-groups-template.php:5028 msgid "Recently Joined" msgstr "" -#: bp-groups/bp-groups-template.php:4800 bp-groups/bp-groups-template.php:4825 +#: bp-groups/bp-groups-template.php:5004 bp-groups/bp-groups-template.php:5031 msgid "Most Popular" msgstr "" -#: bp-groups/bp-groups-template.php:4801 bp-groups/bp-groups-template.php:4828 +#: bp-groups/bp-groups-template.php:5005 bp-groups/bp-groups-template.php:5034 msgid "Administrator Of" msgstr "" -#: bp-groups/bp-groups-template.php:4802 bp-groups/bp-groups-template.php:4831 +#: bp-groups/bp-groups-template.php:5006 bp-groups/bp-groups-template.php:5037 msgid "Moderator Of" msgstr "" -#: bp-groups/bp-groups-template.php:5278 +#: bp-groups/bp-groups-template.php:5121 +msgid "Group avatar" +msgstr "" + +#: bp-groups/bp-groups-template.php:5381 msgid "requested %s" msgstr "" -#: bp-groups/bp-groups-template.php:5346 +#: bp-groups/bp-groups-template.php:5452 msgid "Viewing 1 request" msgstr "" -#: bp-groups/bp-groups-template.php:5348 +#: bp-groups/bp-groups-template.php:5454 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:5725 +#: bp-groups/bp-groups-template.php:5721 msgid "Viewing 1 invitation" msgstr "" -#: bp-groups/bp-groups-template.php:5727 +#: bp-groups/bp-groups-template.php:5723 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:5748 +#: bp-groups/bp-groups-template.php:5744 msgid "Group Activity RSS Feed" msgstr "" -#: bp-groups/bp-groups-template.php:6039 +#: bp-groups/bp-groups-template.php:6034 msgid "%s group" msgid_plural "%s groups" msgstr[0] "" msgstr[1] "" -#: bp-groups/bp-groups-widgets.php:24 +#: bp-groups/bp-groups-widgets.php:69 +#: bp-groups/classes/class-bp-groups-widget.php:131 +msgid "created %s" +msgstr "" + +#: bp-groups/bp-groups-widgets.php:87 +msgid "No groups matched the current filter." +msgstr "" + +#: bp-groups/classes/class-bp-group-extension.php:857 +msgid "You do not have access to this content." +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:459 +#: bp-groups/classes/class-bp-groups-component.php:489 +msgid "Memberships" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:470 +msgid "Invitations" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:618 +msgid "Details" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:631 +msgid "Photo" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:639 +msgid "Cover Image" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:653 +msgid "Requests" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:789 +msgid "No Group Profile Photo" +msgstr "" + +#: bp-groups/classes/class-bp-groups-list-table.php:208 +msgid "No groups found." +msgstr "" + +#: bp-groups/classes/class-bp-groups-list-table.php:219 +msgid "Groups list" +msgstr "" + +#: bp-groups/classes/class-bp-groups-list-table.php:287 +msgid "Filter groups list" +msgstr "" + +#: bp-groups/classes/class-bp-groups-list-table.php:291 +msgid "Public <span class=\"count\">(%s)</span>" +msgid_plural "Public <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" + +#: bp-groups/classes/class-bp-groups-list-table.php:292 +msgid "Private <span class=\"count\">(%s)</span>" +msgid_plural "Private <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" + +#: bp-groups/classes/class-bp-groups-list-table.php:293 +msgid "Hidden <span class=\"count\">(%s)</span>" +msgid_plural "Hidden <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" + +#: bp-groups/classes/class-bp-groups-list-table.php:425 +msgid "Select group %1$d" +msgstr "" + +#: bp-groups/classes/class-bp-groups-member.php:293 +msgid "Group Mod" +msgstr "" + +#: bp-groups/classes/class-bp-groups-widget.php:27 msgid "A dynamic list of recently active, popular, and newest groups" msgstr "" -#: bp-groups/bp-groups-widgets.php:110 bp-groups/bp-groups-widgets.php:222 -msgid "created %s" +#: bp-groups/classes/class-bp-groups-widget.php:151 +msgid "There are no groups to display." +msgstr "" + +#: bp-groups/classes/class-bp-groups-widget.php:207 +msgid "Link widget title to Groups directory" +msgstr "" + +#: bp-groups/classes/class-bp-groups-widget.php:209 +msgid "Max groups to show:" +msgstr "" + +#: bp-groups/classes/class-bp-groups-widget.php:212 +msgid "Default groups to show:" +msgstr "" + +#: bp-loader.php:172 bp-loader.php:179 +msgid "Cheatin’ huh?" +msgstr "" + +#: bp-loader.php:633 +msgid "BuddyPress Default" +msgstr "" + +#: bp-members/bp-members-actions.php:55 +#: bp-members/classes/class-bp-members-admin.php:303 +msgid "User removed as spammer." +msgstr "" + +#: bp-members/bp-members-actions.php:91 +msgid "%s has been deleted from the system." +msgstr "" + +#: bp-members/bp-members-actions.php:93 +msgid "There was an error deleting %s from the system. Please try again." +msgstr "" + +#: 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:52 +msgid "%s became a registered member" +msgstr "" + +#: bp-members/bp-members-adminbar.php:41 +msgid "Edit My Profile" +msgstr "" + +#: bp-members/bp-members-adminbar.php:55 +msgid "Log in" +msgstr "" + +#: bp-members/bp-members-adminbar.php:95 +msgid "Edit Member" +msgstr "" + +#: bp-members/bp-members-adminbar.php:104 +#: bp-members/classes/class-bp-members-admin.php:381 +#: bp-members/classes/class-bp-members-admin.php:382 +#: bp-members/classes/class-bp-members-admin.php:419 +#: bp-members/classes/class-bp-members-admin.php:420 +#: bp-xprofile/bp-xprofile-template.php:1115 +#: bp-xprofile/bp-xprofile-template.php:1116 +msgid "Edit Profile" +msgstr "" + +#: bp-members/bp-members-adminbar.php:113 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:468 +msgid "Edit Profile Photo" +msgstr "" + +#: bp-members/bp-members-adminbar.php:123 +msgid "Edit Cover Image" +msgstr "" + +#: bp-members/bp-members-adminbar.php:143 +#: bp-settings/classes/class-bp-settings-component.php:148 +#: bp-settings/classes/class-bp-settings-component.php:209 +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:43 +msgid "Delete Account" +msgstr "" + +#: bp-members/bp-members-functions.php:1178 +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:1208 +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:1417 +#: bp-members/bp-members-functions.php:2416 +msgid "<strong>ERROR</strong>: Your account has been marked as a spammer." +msgstr "" + +#: bp-members/bp-members-functions.php:1625 +msgid "Please check your email address." +msgstr "" + +#: bp-members/bp-members-functions.php:1629 +#: bp-members/bp-members-functions.php:1633 +msgid "Sorry, that email address is not allowed!" +msgstr "" + +#: bp-members/bp-members-functions.php:1637 +msgid "Sorry, that email address is already used!" +msgstr "" + +#: bp-members/bp-members-functions.php:1675 +msgid "Please enter a username" +msgstr "" + +#: bp-members/bp-members-functions.php:1681 +msgid "That username is not allowed" +msgstr "" + +#: bp-members/bp-members-functions.php:1686 +msgid "Usernames can contain only letters, numbers, ., -, and @" +msgstr "" + +#: bp-members/bp-members-functions.php:1691 +msgid "Username must be at least 4 characters" +msgstr "" + +#: bp-members/bp-members-functions.php:1696 +msgid "Sorry, usernames may not contain the character \"_\"!" +msgstr "" + +#: bp-members/bp-members-functions.php:1703 +msgid "Sorry, usernames must have letters too!" +msgstr "" + +#: bp-members/bp-members-functions.php:1715 +msgid "Sorry, that username already exists!" +msgstr "" + +#: bp-members/bp-members-functions.php:1921 +#: bp-members/bp-members-functions.php:1948 +msgid "Invalid activation key." +msgstr "" + +#: bp-members/bp-members-functions.php:1928 +msgid "The user is already active." +msgstr "" + +#: bp-members/bp-members-functions.php:1930 +msgid "The site is already active." +msgstr "" + +#: bp-members/bp-members-functions.php:1963 +msgid "Could not create user" +msgstr "" + +#: bp-members/bp-members-functions.php:1977 +msgid "That username is already activated." +msgstr "" + +#: bp-members/bp-members-functions.php:2281 +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:2283 +msgid "" +"<strong>ERROR</strong>: Your account has not been activated. Check your " +"email for the activation link." +msgstr "" + +#: bp-members/bp-members-functions.php:2314 +msgid "<strong>ERROR</strong>: Your account has already been activated." msgstr "" -#: bp-groups/bp-groups-widgets.php:129 -msgid "There are no groups to display." +#: bp-members/bp-members-functions.php:2316 +msgid "Activation email resent! Please check your inbox or spam folder." msgstr "" -#: bp-groups/bp-groups-widgets.php:166 -msgid "Link widget title to Groups directory" +#: bp-members/bp-members-functions.php:2451 +msgid "Member type already exists." msgstr "" -#: bp-groups/bp-groups-widgets.php:168 -msgid "Max groups to show:" +#: bp-members/bp-members-functions.php:2474 +msgid "You may not register a member type with this name." msgstr "" -#: bp-groups/bp-groups-widgets.php:171 -msgid "Default groups to show:" +#: bp-members/bp-members-screens.php:124 +msgid "Please make sure you enter your password twice" msgstr "" -#: bp-groups/bp-groups-widgets.php:240 -msgid "No groups matched the current filter." +#: bp-members/bp-members-screens.php:128 +msgid "The passwords you entered do not match." msgstr "" -#: bp-groups/classes/class-bp-group-extension.php:851 -msgid "You do not have access to this content." +#: bp-members/bp-members-screens.php:151 +msgid "This is a required field" msgstr "" -#: bp-groups/classes/class-bp-groups-member.php:279 -msgid "Group Mod" +#: bp-members/bp-members-screens.php:362 +msgid "Your account is now active!" msgstr "" -#: bp-loader.php:171 bp-loader.php:178 -msgid "Cheatin’ huh?" +#: bp-members/bp-members-template.php:480 +msgid "Viewing 1 active member" msgstr "" -#: bp-loader.php:611 -msgid "BuddyPress Default" +#: bp-members/bp-members-template.php:482 +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:486 +msgid "Viewing 1 member with friends" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:137 -#: bp-members/admin/bp-members-admin-classes.php:299 -#: bp-members/admin/bp-members-admin-classes.php:511 -#: bp-members/admin/bp-members-admin-classes.php:678 -#: bp-settings/bp-settings-loader.php:106 -#: bp-settings/bp-settings-loader.php:180 -msgid "Email" +#: bp-members/bp-members-template.php:488 +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:492 +msgid "Viewing 1 online member" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:138 -#: bp-members/admin/bp-members-admin-classes.php:512 -msgid "Registered" +#: bp-members/bp-members-template.php:494 +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:1729 +msgid "Viewing members of the type: %s" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:139 -#: bp-members/admin/bp-members-admin-classes.php:513 -msgid "Last Sent" +#: bp-members/bp-members-template.php:2110 +msgid "Your Profile Photo" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:140 -#: bp-members/admin/bp-members-admin-classes.php:514 -msgid "Emails Sent" +#: bp-members/bp-members-template.php:2213 +msgid "Activity RSS Feed" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:172 -#: bp-members/admin/bp-members-admin-classes.php:545 -msgid "No pending accounts found." +#: bp-members/classes/class-bp-core-members-widget.php:27 +msgid "A dynamic list of recently active, popular, and newest members" msgstr "" -#: 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:550 -msgid "Edit settings" +#: bp-members/classes/class-bp-core-members-widget.php:148 +msgid "No one has signed up yet!" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:183 -#: bp-members/admin/bp-members-admin-classes.php:553 -msgid "Registration is disabled. %s" +#: bp-members/classes/class-bp-core-members-widget.php:209 +#: bp-members/classes/class-bp-core-recently-active-widget.php:143 +#: bp-members/classes/class-bp-core-whos-online-widget.php:143 +msgid "Max members to show:" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:249 -#: bp-members/admin/bp-members-admin-classes.php:628 -msgid "Select user: %s" +#: bp-members/classes/class-bp-core-members-widget.php:215 +msgid "Default members to show:" msgstr "" -#: bp-members/bp-members-actions.php:55 bp-members/bp-members-admin.php:292 -msgid "User removed as spammer." +#: bp-members/classes/class-bp-core-recently-active-widget.php:25 +msgid "Profile photos of recently active members" msgstr "" -#: bp-members/bp-members-actions.php:88 -msgid "%s has been deleted from the system." +#: bp-members/classes/class-bp-core-recently-active-widget.php:95 +msgid "There are no recently active members" msgstr "" -#: bp-members/bp-members-actions.php:90 -msgid "There was an error deleting %s from the system. Please try again." +#: bp-members/classes/class-bp-core-recently-active-widget.php:163 +msgid "Recently Active Members" msgstr "" -#: bp-members/bp-members-activity.php:26 -msgid "New member registered" +#: bp-members/classes/class-bp-core-whos-online-widget.php:25 +msgid "Profile photos of online users" msgstr "" -#: bp-members/bp-members-activity.php:28 -msgid "New Members" +#: bp-members/classes/class-bp-core-whos-online-widget.php:95 +msgid "There are no users currently online" msgstr "" -#: bp-members/bp-members-activity.php:53 -msgid "%s became a registered member" +#: bp-members/classes/class-bp-core-whos-online-widget.php:163 +msgid "Who's Online" msgstr "" -#: bp-members/bp-members-admin.php:286 +#: bp-members/classes/class-bp-members-admin.php:297 msgid "Profile photo was deleted." msgstr "" -#: bp-members/bp-members-admin.php:304 +#: bp-members/classes/class-bp-members-admin.php:315 msgid "Profile updated." msgstr "" -#: bp-members/bp-members-admin.php:316 +#: bp-members/classes/class-bp-members-admin.php:327 msgid "There was a problem deleting that profile photo. Please try again." msgstr "" -#: bp-members/bp-members-admin.php:322 +#: bp-members/classes/class-bp-members-admin.php:333 msgid "User could not be removed as spammer." msgstr "" -#: bp-members/bp-members-admin.php:328 +#: bp-members/classes/class-bp-members-admin.php:339 msgid "User could not be marked as spammer." msgstr "" -#: bp-members/bp-members-admin.php:334 +#: bp-members/classes/class-bp-members-admin.php:345 msgid "An error occurred while trying to update the profile." msgstr "" -#: bp-members/bp-members-admin.php:340 bp-xprofile/bp-xprofile-screens.php:111 +#: bp-members/classes/class-bp-members-admin.php:351 +#: bp-xprofile/bp-xprofile-screens.php:110 msgid "" "Please make sure you fill in all required fields in this profile field " "group before saving." msgstr "" -#: bp-members/bp-members-admin.php:346 bp-xprofile/bp-xprofile-screens.php:177 +#: bp-members/classes/class-bp-members-admin.php:357 +#: bp-xprofile/bp-xprofile-screens.php:176 msgid "" "There was a problem updating some of your profile information. Please try " "again." msgstr "" -#: 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:422 bp-members/bp-members-admin.php:423 +#: bp-members/classes/class-bp-members-admin.php:431 +#: bp-members/classes/class-bp-members-admin.php:432 msgid "Manage Signups" msgstr "" -#: bp-members/bp-members-admin.php:648 bp-members/bp-members-admin.php:856 +#: bp-members/classes/class-bp-members-admin.php:652 +#: bp-members/classes/class-bp-members-admin.php:858 msgid "Profile" msgstr "" -#: bp-members/bp-members-admin.php:652 +#: bp-members/classes/class-bp-members-admin.php:656 msgid "Extended Profile" msgstr "" -#: bp-members/bp-members-admin.php:675 +#: bp-members/classes/class-bp-members-admin.php:678 msgid "You cannot edit the requested user." msgstr "" -#: bp-members/bp-members-admin.php:717 +#: bp-members/classes/class-bp-members-admin.php:720 msgid "This is the admin view of a user's profile." msgstr "" -#: bp-members/bp-members-admin.php:718 +#: bp-members/classes/class-bp-members-admin.php:721 msgid "" "In the main column, you can edit the fields of the user's extended " "profile." msgstr "" -#: bp-members/bp-members-admin.php:719 +#: bp-members/classes/class-bp-members-admin.php:722 msgid "" "In the right-hand column, you can update the user's status, delete the " "user's avatar, and view recent statistics." msgstr "" -#: bp-members/bp-members-admin.php:725 +#: bp-members/classes/class-bp-members-admin.php:728 msgid "" "<a " "href=\"https://codex.buddypress.org/administrator-guide/extended-profiles/\"" ">Managing Profiles</a>" msgstr "" -#: bp-members/bp-members-admin.php:858 +#: bp-members/classes/class-bp-members-admin.php:860 msgid "Edit User" msgstr "" -#: bp-members/bp-members-admin.php:880 +#: bp-members/classes/class-bp-members-admin.php:882 msgid "← Back to Users" msgstr "" -#: bp-members/bp-members-admin.php:936 +#: bp-members/classes/class-bp-members-admin.php:937 msgid "No user found with this ID. <a href=\"%s\">Go back and try again</a>." msgstr "" -#: bp-members/bp-members-admin.php:966 +#: bp-members/classes/class-bp-members-admin.php:966 msgid "User account has not yet been activated" msgstr "" -#: bp-members/bp-members-admin.php:992 +#: bp-members/classes/class-bp-members-admin.php:992 msgid "Spammer" msgstr "" -#: bp-members/bp-members-admin.php:1004 -msgid "Registered on: <strong>%1$s</strong>" +#: bp-members/classes/class-bp-members-admin.php:1004 +msgid "Registered on: %s" msgstr "" -#: bp-members/bp-members-admin.php:1014 +#: bp-members/classes/class-bp-members-admin.php:1014 msgid "View Profile" msgstr "" -#: bp-members/bp-members-admin.php:1015 +#: bp-members/classes/class-bp-members-admin.php:1015 msgid "Update Profile" msgstr "" -#: bp-members/bp-members-admin.php:1035 bp-xprofile/bp-xprofile-admin.php:1031 +#: bp-members/classes/class-bp-members-admin.php:1034 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:422 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:1067 +#: bp-members/classes/class-bp-members-admin.php:1065 msgid "Last active: %1$s" msgstr "" -#: 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 +#: bp-members/classes/class-bp-members-admin.php:1105 +msgid "Select member type" +msgstr "" + +#: bp-members/classes/class-bp-members-admin.php:1107 +#: bp-templates/bp-legacy/buddypress/forums/index.php:180 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:196 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:219 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:227 +#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:104 #. translators: no option picked in select box msgid "----" msgstr "" -#: bp-members/bp-members-admin.php:1189 +#: bp-members/classes/class-bp-members-admin.php:1184 msgid "Extended" msgstr "" -#: bp-members/bp-members-admin.php:1434 +#: bp-members/classes/class-bp-members-admin.php:1428 msgid "This is the administration screen for pending accounts on your site." msgstr "" -#: bp-members/bp-members-admin.php:1435 +#: bp-members/classes/class-bp-members-admin.php:1429 msgid "" "From the screen options, you can customize the displayed columns and the " "pagination of this screen." msgstr "" -#: bp-members/bp-members-admin.php:1436 +#: bp-members/classes/class-bp-members-admin.php:1430 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:1437 +#: bp-members/classes/class-bp-members-admin.php:1431 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:1444 +#: bp-members/classes/class-bp-members-admin.php:1438 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:1445 +#: bp-members/classes/class-bp-members-admin.php:1439 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:1446 +#: bp-members/classes/class-bp-members-admin.php:1440 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:1447 +#: bp-members/classes/class-bp-members-admin.php:1441 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:1448 +#: bp-members/classes/class-bp-members-admin.php:1442 msgid "Bulk actions allow you to perform these 3 actions for the selected rows." msgstr "" -#: bp-members/bp-members-admin.php:1713 +#: bp-members/classes/class-bp-members-admin.php:1454 +msgid "Filter users list" +msgstr "" + +#: bp-members/classes/class-bp-members-admin.php:1455 +msgid "Pending users list navigation" +msgstr "" + +#: bp-members/classes/class-bp-members-admin.php:1456 +msgid "Pending users list" +msgstr "" + +#: bp-members/classes/class-bp-members-admin.php:1717 msgid "There was a problem sending the activation emails. Please try again." msgstr "" -#: bp-members/bp-members-admin.php:1720 +#: bp-members/classes/class-bp-members-admin.php:1724 msgid "There was a problem activating accounts. Please try again." msgstr "" -#: bp-members/bp-members-admin.php:1727 +#: bp-members/classes/class-bp-members-admin.php:1731 msgid "There was a problem deleting sign-ups. Please try again." msgstr "" -#: bp-members/bp-members-admin.php:1844 +#: bp-members/classes/class-bp-members-admin.php:1853 msgid "Users" msgstr "" -#: bp-members/bp-members-admin.php:1868 +#: bp-members/classes/class-bp-members-admin.php:1877 msgid "Search Pending Users" msgstr "" -#: bp-members/bp-members-admin.php:1916 +#: bp-members/classes/class-bp-members-admin.php:1924 msgid "Delete Pending Accounts" msgstr "" -#: bp-members/bp-members-admin.php:1918 +#: bp-members/classes/class-bp-members-admin.php:1926 msgid "You are about to delete the following account:" msgstr "" -#: bp-members/bp-members-admin.php:1920 +#: bp-members/classes/class-bp-members-admin.php:1928 msgid "You are about to delete the following accounts:" msgstr "" -#: bp-members/bp-members-admin.php:1925 +#: bp-members/classes/class-bp-members-admin.php:1933 msgid "Activate Pending Accounts" msgstr "" -#: bp-members/bp-members-admin.php:1927 +#: bp-members/classes/class-bp-members-admin.php:1935 msgid "You are about to activate the following account:" msgstr "" -#: bp-members/bp-members-admin.php:1929 +#: bp-members/classes/class-bp-members-admin.php:1937 msgid "You are about to activate the following accounts:" msgstr "" -#: bp-members/bp-members-admin.php:1934 +#: bp-members/classes/class-bp-members-admin.php:1942 msgid "Resend Activation Emails" msgstr "" -#: bp-members/bp-members-admin.php:1936 +#: bp-members/classes/class-bp-members-admin.php:1944 msgid "You are about to resend an activation email to the following account:" msgstr "" -#: bp-members/bp-members-admin.php:1938 +#: bp-members/classes/class-bp-members-admin.php:1946 msgid "You are about to resend an activation email to the following accounts:" msgstr "" -#: bp-members/bp-members-admin.php:1979 +#: bp-members/classes/class-bp-members-admin.php:1992 msgid "Last notified: %s" msgstr "" -#: bp-members/bp-members-admin.php:1983 +#: bp-members/classes/class-bp-members-admin.php:1996 msgid "(less than 24 hours ago)" msgstr "" -#: bp-members/bp-members-admin.php:2001 +#: bp-members/classes/class-bp-members-admin.php:2014 msgid "Confirm" msgstr "" -#: bp-members/bp-members-adminbar.php:41 -msgid "Edit My Profile" -msgstr "" - -#: bp-members/bp-members-adminbar.php:55 -msgid "Log in" -msgstr "" - -#: bp-members/bp-members-adminbar.php:95 -msgid "Edit Member" -msgstr "" - -#: bp-members/bp-members-adminbar.php:113 -#: bp-xprofile/bp-xprofile-admin.php:1078 -msgid "Edit Profile Photo" -msgstr "" - -#: 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: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: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: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:1645 -msgid "Please check your email address." -msgstr "" - -#: 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:1657 -msgid "Sorry, that email address is already used!" -msgstr "" - -#: bp-members/bp-members-functions.php:1696 -msgid "Please enter a username" -msgstr "" - -#: bp-members/bp-members-functions.php:1702 -msgid "That username is not allowed" -msgstr "" - -#: bp-members/bp-members-functions.php:1707 -msgid "Usernames can contain only letters, numbers, ., -, and @" -msgstr "" - -#: bp-members/bp-members-functions.php:1712 -msgid "Username must be at least 4 characters" -msgstr "" - -#: bp-members/bp-members-functions.php:1717 -msgid "Sorry, usernames may not contain the character \"_\"!" -msgstr "" - -#: bp-members/bp-members-functions.php:1724 -msgid "Sorry, usernames must have letters too!" -msgstr "" - -#: bp-members/bp-members-functions.php:1736 -msgid "Sorry, that username already exists!" -msgstr "" - -#: bp-members/bp-members-functions.php:1947 -msgid "Invalid activation key." -msgstr "" - -#: bp-members/bp-members-functions.php:1954 -msgid "The user is already active." -msgstr "" - -#: bp-members/bp-members-functions.php:1956 -msgid "The site is already active." -msgstr "" - -#: bp-members/bp-members-functions.php:1974 -msgid "Invalid activation key" -msgstr "" - -#: bp-members/bp-members-functions.php:1989 -msgid "Could not create user" -msgstr "" - -#: bp-members/bp-members-functions.php:2003 -msgid "That username is already activated." -msgstr "" - -#: 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: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:2374 -msgid "<strong>ERROR</strong>: Your account has already been activated." -msgstr "" - -#: bp-members/bp-members-functions.php:2376 -msgid "Activation email resent! Please check your inbox or spam folder." -msgstr "" - -#: bp-members/bp-members-functions.php:2511 -msgid "Member type already exists." -msgstr "" - -#: bp-members/bp-members-loader.php:104 +#: bp-members/classes/class-bp-members-component.php:110 msgid "Search Members..." msgstr "" -#: bp-members/bp-members-loader.php:269 +#: bp-members/classes/class-bp-members-component.php:287 msgid "You" msgstr "" -#: bp-members/bp-members-screens.php:121 -msgid "Please make sure you enter your password twice" -msgstr "" - -#: bp-members/bp-members-screens.php:125 -msgid "The passwords you entered do not match." -msgstr "" - -#: bp-members/bp-members-screens.php:148 -msgid "This is a required field" -msgstr "" - -#: bp-members/bp-members-screens.php:365 -msgid "Your account is now active!" -msgstr "" - -#: bp-members/bp-members-screens.php:673 -msgid "Check Your Email To Activate Your Account!" -msgstr "" - -#: bp-members/bp-members-screens.php:681 -msgid "Account Activated" -msgstr "" - -#: 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: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: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: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:2348 -msgid "Activity RSS Feed" -msgstr "" - -#: bp-members/bp-members-widgets.php:39 -msgid "A dynamic list of recently active, popular, and newest members" -msgstr "" - -#: bp-members/bp-members-widgets.php:144 -msgid "No one has signed up yet!" +#: bp-members/classes/class-bp-members-list-table.php:152 +#: bp-members/classes/class-bp-members-list-table.php:313 +#: bp-members/classes/class-bp-members-ms-list-table.php:139 +#: bp-members/classes/class-bp-members-ms-list-table.php:306 +#: bp-settings/classes/class-bp-settings-component.php:123 +#: bp-settings/classes/class-bp-settings-component.php:198 +msgid "Email" msgstr "" -#: bp-members/bp-members-widgets.php:203 -msgid "Max members to show:" +#: bp-members/classes/class-bp-members-list-table.php:153 +#: bp-members/classes/class-bp-members-ms-list-table.php:140 +msgid "Registered" msgstr "" -#: bp-members/bp-members-widgets.php:209 -msgid "Default members to show:" +#: bp-members/classes/class-bp-members-list-table.php:154 +#: bp-members/classes/class-bp-members-ms-list-table.php:141 +msgid "Last Sent" msgstr "" -#: bp-members/bp-members-widgets.php:254 -msgid "Profile photos of online users" +#: bp-members/classes/class-bp-members-list-table.php:155 +#: bp-members/classes/class-bp-members-ms-list-table.php:142 +msgid "Emails Sent" msgstr "" -#: bp-members/bp-members-widgets.php:318 -msgid "There are no users currently online" +#: bp-members/classes/class-bp-members-list-table.php:187 +#: bp-members/classes/class-bp-members-ms-list-table.php:173 +msgid "No pending accounts found." msgstr "" -#: bp-members/bp-members-widgets.php:365 bp-members/bp-members-widgets.php:515 -msgid "Max Members to show:" +#: bp-members/classes/class-bp-members-list-table.php:193 +#: bp-members/classes/class-bp-members-list-table.php:195 +#: bp-members/classes/class-bp-members-ms-list-table.php:178 +msgid "Edit settings" msgstr "" -#: bp-members/bp-members-widgets.php:386 -msgid "Who's Online" +#: bp-members/classes/class-bp-members-list-table.php:198 +#: bp-members/classes/class-bp-members-ms-list-table.php:181 +msgid "Registration is disabled. %s" msgstr "" -#: bp-members/bp-members-widgets.php:404 -msgid "Profile photos of recently active members" +#: bp-members/classes/class-bp-members-list-table.php:263 +#: bp-members/classes/class-bp-members-ms-list-table.php:256 +msgid "Select user: %s" msgstr "" -#: bp-members/bp-members-widgets.php:468 -msgid "There are no recently active members" +#: bp-members/classes/class-bp-registration-theme-compat.php:103 +msgid "Check Your Email To Activate Your Account!" msgstr "" -#: bp-members/bp-members-widgets.php:536 -msgid "Recently Active Members" +#: bp-members/classes/class-bp-registration-theme-compat.php:111 +msgid "Account Activated" msgstr "" -#: bp-members/classes/class-bp-signup.php:585 -#: bp-members/classes/class-bp-signup.php:673 -#: bp-members/classes/class-bp-signup.php:751 +#: bp-members/classes/class-bp-signup.php:580 +#: bp-members/classes/class-bp-signup.php:667 +#: bp-members/classes/class-bp-signup.php:744 msgid "the sign-up has already been activated." msgstr "" -#: bp-messages/bp-messages-actions.php:48 -msgid "Your reply was sent successfully" +#: bp-messages/bp-messages-actions.php:44 +msgid "Your message was not sent. Please enter a subject line." msgstr "" -#: bp-messages/bp-messages-actions.php:50 -msgid "There was a problem sending your reply. Please try again." +#: bp-messages/bp-messages-actions.php:46 +#: bp-messages/bp-messages-functions.php:62 +msgid "Your message was not sent. Please enter some content." msgstr "" -#: bp-messages/bp-messages-actions.php:90 -msgid "There was an error deleting that message." +#: bp-messages/bp-messages-actions.php:61 +msgid "Notice successfully created." msgstr "" -#: bp-messages/bp-messages-actions.php:92 -msgid "Message deleted." +#: bp-messages/bp-messages-actions.php:67 +msgid "Notice was not created. Please try again." msgstr "" -#: bp-messages/bp-messages-actions.php:130 -msgid "Message marked as read." +#: bp-messages/bp-messages-actions.php:98 +msgid "Message successfully sent." msgstr "" -#: bp-messages/bp-messages-actions.php:132 -#: bp-messages/bp-messages-actions.php:173 -msgid "There was a problem marking that message." +#: bp-messages/bp-messages-actions.php:170 +msgid "Notice deactivated successfully." msgstr "" #: bp-messages/bp-messages-actions.php:171 -msgid "Message marked unread." +msgid "There was a problem deactivating that notice." msgstr "" -#: bp-messages/bp-messages-actions.php:214 -msgid "There was a problem managing your messages." +#: bp-messages/bp-messages-actions.php:178 +msgid "Notice activated successfully." 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." +#: bp-messages/bp-messages-actions.php:179 +msgid "There was a problem activating that notice." msgstr "" -#: bp-messages/bp-messages-actions.php:232 -msgid "Messages marked as read" +#: bp-messages/bp-messages-actions.php:186 +msgid "Notice deleted successfully." msgstr "" -#: bp-messages/bp-messages-actions.php:239 -msgid "Messages marked as unread." +#: bp-messages/bp-messages-actions.php:187 +msgid "There was a problem deleting that notice." msgstr "" -#: bp-messages/bp-messages-actions.php:269 -msgid "There was an error deleting messages." +#: bp-messages/bp-messages-actions.php:242 +msgid "Your reply was sent successfully" msgstr "" -#: bp-messages/bp-messages-functions.php:78 -msgid "Re: %s" +#: bp-messages/bp-messages-actions.php:244 +msgid "There was a problem sending your reply. Please try again." msgstr "" -#: bp-messages/bp-messages-functions.php:91 -msgid "No Subject" +#: bp-messages/bp-messages-actions.php:284 +msgid "There was an error deleting that message." msgstr "" -#: bp-messages/bp-messages-loader.php:39 -msgid "Private Messages" +#: bp-messages/bp-messages-actions.php:286 +msgid "Message deleted." msgstr "" -#: bp-messages/bp-messages-loader.php:118 -msgid "Search Messages..." +#: bp-messages/bp-messages-actions.php:324 +msgid "Message marked as read." msgstr "" -#: bp-messages/bp-messages-loader.php:136 -msgid "Messages <span class=\"%s\">%s</span>" +#: bp-messages/bp-messages-actions.php:326 +#: bp-messages/bp-messages-actions.php:367 +msgid "There was a problem marking that message." msgstr "" -#: bp-messages/bp-messages-loader.php:138 -#: bp-messages/bp-messages-loader.php:244 -#: bp-messages/bp-messages-screens.php:268 -msgid "Messages" +#: bp-messages/bp-messages-actions.php:365 +msgid "Message marked unread." msgstr "" -#: bp-messages/bp-messages-loader.php:166 -#: bp-messages/bp-messages-loader.php:245 -#: bp-messages/bp-messages-notifications.php:169 -msgid "Inbox" +#: bp-messages/bp-messages-actions.php:408 +msgid "There was a problem managing your messages." msgstr "" -#: bp-messages/bp-messages-loader.php:177 -#: bp-messages/bp-messages-loader.php:269 bp-messages/bp-messages-star.php:104 -#: bp-templates/bp-legacy/buddypress-functions.php:340 -msgid "Starred" +#: bp-messages/bp-messages-actions.php:419 +#: bp-messages/bp-messages-actions.php:465 +#: bp-templates/bp-legacy/buddypress-functions.php:1669 +msgid "Messages deleted." msgstr "" -#: bp-messages/bp-messages-loader.php:188 -#: bp-messages/bp-messages-loader.php:278 -msgid "Sent" +#: bp-messages/bp-messages-actions.php:426 +msgid "Messages marked as read" msgstr "" -#: bp-messages/bp-messages-loader.php:198 -#: bp-messages/bp-messages-loader.php:286 -msgid "Compose" +#: bp-messages/bp-messages-actions.php:433 +msgid "Messages marked as unread." msgstr "" -#: bp-messages/bp-messages-loader.php:209 -msgid "Notices" +#: bp-messages/bp-messages-actions.php:463 +msgid "There was an error deleting messages." msgstr "" -#: bp-messages/bp-messages-loader.php:241 -msgid "Messages <span class=\"count\">%s</span>" +#: bp-messages/bp-messages-functions.php:59 +msgid "Your message was not sent. Please use a valid sender." msgstr "" -#: bp-messages/bp-messages-loader.php:242 -msgid "Inbox <span class=\"count\">%s</span>" +#: bp-messages/bp-messages-functions.php:95 +msgid "Re: %s" msgstr "" -#: bp-messages/bp-messages-loader.php:295 -msgid "All Member Notices" +#: bp-messages/bp-messages-functions.php:104 +msgid "Message could not be sent. Please enter a recipient." msgstr "" -#: bp-messages/bp-messages-loader.php:312 -msgid "My Messages" +#: bp-messages/bp-messages-functions.php:112 +msgid "No Subject" msgstr "" -#: bp-messages/bp-messages-notifications.php:76 -msgid "New message from %s" +#: bp-messages/bp-messages-functions.php:164 +msgid "" +"Message could not be sent because you have entered an invalid username. " +"Please try again." msgstr "" -#: bp-messages/bp-messages-notifications.php:78 -msgid "" -"%1$s sent you a new message:\n" -"\n" -"Subject: %2$s\n" -"\n" -"\"%3$s\"\n" -"\n" -"To view and read your messages please log in and visit: %4$s\n" -"\n" -"---------------------\n" +#: bp-messages/bp-messages-functions.php:184 +msgid "Message was not sent. Please try again." msgstr "" -#: bp-messages/bp-messages-notifications.php:92 -msgid "To disable these notifications, please log in and go to: %s" +#: bp-messages/bp-messages-notifications.php:107 +#: bp-messages/classes/class-bp-messages-component.php:167 +#: bp-messages/classes/class-bp-messages-component.php:243 +msgid "Inbox" msgstr "" -#: bp-messages/bp-messages-notifications.php:175 +#: bp-messages/bp-messages-notifications.php:113 msgid "You have %d new messages" msgstr "" -#: bp-messages/bp-messages-notifications.php:187 +#: bp-messages/bp-messages-notifications.php:125 msgid "%s sent you a new private message" msgstr "" -#: bp-messages/bp-messages-notifications.php:189 +#: bp-messages/bp-messages-notifications.php:127 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: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:95 -msgid "Notice sent successfully!" -msgstr "" - -#: 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:122 -msgid "Message sent successfully!" -msgstr "" - -#: bp-messages/bp-messages-screens.php:170 -msgid "Messages <span>%s</span>" -msgstr "" - -#: bp-messages/bp-messages-screens.php:209 -msgid "There was a problem deactivating that notice." +#: bp-messages/bp-messages-screens.php:133 +#: bp-messages/classes/class-bp-messages-component.php:149 +msgid "Messages <span class=\"%s\">%s</span>" msgstr "" -#: bp-messages/bp-messages-screens.php:211 -msgid "Notice deactivated." +#: bp-messages/bp-messages-screens.php:206 +#: bp-messages/classes/class-bp-messages-component.php:151 +#: bp-messages/classes/class-bp-messages-component.php:242 +msgid "Messages" msgstr "" #: bp-messages/bp-messages-screens.php:215 -msgid "There was a problem activating that notice." -msgstr "" - -#: bp-messages/bp-messages-screens.php:217 -msgid "Notice activated." -msgstr "" - -#: bp-messages/bp-messages-screens.php:221 -msgid "There was a problem deleting that notice." +msgid "A member sends you a new message" msgstr "" -#: bp-messages/bp-messages-screens.php:223 -msgid "Notice deleted." +#: bp-messages/bp-messages-star.php:107 +#: bp-templates/bp-legacy/buddypress-functions.php:336 +msgid "Unstar" msgstr "" -#: bp-messages/bp-messages-screens.php:277 -msgid "A member sends you a new message" +#: bp-messages/bp-messages-star.php:108 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:71 +#: bp-templates/bp-legacy/buddypress-functions.php:337 +msgid "Star" msgstr "" -#: bp-messages/bp-messages-star.php:102 +#: bp-messages/bp-messages-star.php:109 +#: bp-messages/classes/class-bp-messages-component.php:178 +#: bp-messages/classes/class-bp-messages-component.php:268 #: bp-templates/bp-legacy/buddypress-functions.php:338 -msgid "Unstar" +msgid "Starred" msgstr "" -#: bp-messages/bp-messages-star.php:103 -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:65 +#: bp-messages/bp-messages-star.php:110 #: bp-templates/bp-legacy/buddypress-functions.php:339 -msgid "Star" -msgstr "" - -#: bp-messages/bp-messages-star.php:105 -#: bp-templates/bp-legacy/buddypress-functions.php:341 msgid "Not starred" msgstr "" -#: bp-messages/bp-messages-star.php:106 -#: bp-templates/bp-legacy/buddypress-functions.php:342 +#: bp-messages/bp-messages-star.php:111 +#: bp-templates/bp-legacy/buddypress-functions.php:340 msgid "Remove all starred messages in this thread" msgstr "" -#: bp-messages/bp-messages-star.php:107 -#: bp-templates/bp-legacy/buddypress-functions.php:343 +#: bp-messages/bp-messages-star.php:112 +#: bp-templates/bp-legacy/buddypress-functions.php:341 msgid "Star the first message in this thread" msgstr "" -#: bp-messages/bp-messages-star.php:446 +#: bp-messages/bp-messages-star.php:451 msgid "%s message was successfully starred" msgid_plural "%s messages were successfully starred" msgstr[0] "" msgstr[1] "" -#: bp-messages/bp-messages-star.php:460 +#: bp-messages/bp-messages-star.php:465 msgid "%s message was successfully unstarred" msgid_plural "%s messages were successfully unstarred" msgstr[0] "" msgstr[1] "" -#: bp-messages/bp-messages-star.php:496 +#: bp-messages/bp-messages-star.php:501 msgid "Add star" msgstr "" -#: bp-messages/bp-messages-star.php:497 +#: bp-messages/bp-messages-star.php:502 msgid "Remove star" msgstr "" -#: bp-messages/bp-messages-template.php:918 +#: bp-messages/bp-messages-template.php:580 msgid "%d unread" msgid_plural "%d unread" msgstr[0] "" msgstr[1] "" -#: bp-messages/bp-messages-template.php:1092 +#: bp-messages/bp-messages-template.php:752 msgid "Viewing 1 message" msgstr "" -#: bp-messages/bp-messages-template.php:1094 +#: bp-messages/bp-messages-template.php:754 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:1120 +#: bp-messages/bp-messages-template.php:780 msgid "Search Messages" msgstr "" -#: bp-messages/bp-messages-template.php:1263 +#: bp-messages/bp-messages-template.php:923 msgid "Select:" msgstr "" -#: bp-messages/bp-messages-template.php:1267 +#: bp-messages/bp-messages-template.php:927 +#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:186 +#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:167 msgid "Select" msgstr "" -#: bp-messages/bp-messages-template.php:1280 +#: bp-messages/bp-messages-template.php:940 msgid "Delete Selected" msgstr "" -#: bp-messages/bp-messages-template.php:1292 -#: bp-notifications/bp-notifications-template.php:1274 +#: bp-messages/bp-messages-template.php:952 +#: bp-notifications/bp-notifications-template.php:927 msgid "Select Bulk Action" msgstr "" -#: bp-messages/bp-messages-template.php:1294 -#: bp-notifications/bp-notifications-template.php:1276 +#: bp-messages/bp-messages-template.php:954 +#: bp-notifications/bp-notifications-template.php:929 msgid "Bulk Actions" msgstr "" -#: bp-messages/bp-messages-template.php:1295 -#: bp-notifications/bp-notifications-template.php:1279 +#: bp-messages/bp-messages-template.php:955 +#: bp-notifications/bp-notifications-template.php:932 msgid "Mark read" msgstr "" -#: bp-messages/bp-messages-template.php:1296 -#: bp-notifications/bp-notifications-template.php:1281 +#: bp-messages/bp-messages-template.php:956 +#: bp-notifications/bp-notifications-template.php:934 msgid "Mark unread" msgstr "" -#: bp-messages/bp-messages-template.php:1307 -#: bp-notifications/bp-notifications-template.php:1285 +#: bp-messages/bp-messages-template.php:967 +#: bp-notifications/bp-notifications-template.php:938 msgid "Apply" msgstr "" -#: bp-messages/bp-messages-template.php:1358 +#: bp-messages/bp-messages-template.php:1021 msgid "Currently Active" msgstr "" -#: bp-messages/bp-messages-template.php:1530 +#: bp-messages/bp-messages-template.php:1193 msgid "Deactivate" msgstr "" -#: bp-messages/bp-messages-template.php:1597 -#: 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 +#: bp-messages/bp-messages-template.php:1260 +#: bp-templates/bp-legacy/buddypress/members/register.php:194 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:72 +#: bp-templates/bp-legacy/buddypress-functions.php:298 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:392 msgid "Close" msgstr "" -#: bp-messages/bp-messages-template.php:1675 +#: bp-messages/bp-messages-template.php:1338 msgid "Send a private message to this user." msgstr "" -#: bp-messages/bp-messages-template.php:1676 +#: bp-messages/bp-messages-template.php:1339 msgid "Private Message" msgstr "" -#: bp-messages/bp-messages-template.php:2083 +#: bp-messages/bp-messages-template.php:1554 msgid "%s recipients" msgstr "" -#: bp-messages/bp-messages-template.php:2444 -#: bp-templates/bp-legacy/buddypress-functions.php:1558 +#: bp-messages/bp-messages-template.php:1931 msgid "Sent %s" msgstr "" -#: bp-messages/bp-messages-widgets.php:34 +#: bp-messages/classes/class-bp-messages-component.php:39 +msgid "Private Messages" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:118 +msgid "Search Messages..." +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:189 +#: bp-messages/classes/class-bp-messages-component.php:278 +msgid "Sent" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:199 +#: bp-messages/classes/class-bp-messages-component.php:287 +msgid "Compose" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:210 +msgid "Notices" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:239 +msgid "Messages <span class=\"count\">%s</span>" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:240 +msgid "Inbox <span class=\"count\">%s</span>" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:297 +msgid "All Member Notices" +msgstr "" + +#: bp-messages/classes/class-bp-messages-component.php:316 +msgid "My Messages" +msgstr "" + +#: bp-messages/classes/class-bp-messages-sitewide-notices-widget.php:26 msgid "(BuddyPress) Sitewide Notices" msgstr "" -#: bp-messages/bp-messages-widgets.php:37 +#: bp-messages/classes/class-bp-messages-sitewide-notices-widget.php:29 msgid "Display Sitewide Notices posted by the site administrator" msgstr "" -#: bp-messages/classes/class-bp-messages-thread.php:778 +#: bp-messages/classes/class-bp-messages-thread.php:791 msgid "%s Recipients" msgstr "" @@ -5303,161 +5902,137 @@ msgstr "" msgid "Notifications marked as unread." msgstr "" -#: bp-notifications/bp-notifications-adminbar.php:54 +#: bp-notifications/bp-notifications-adminbar.php:56 msgid "No new notifications" msgstr "" -#: bp-notifications/bp-notifications-loader.php:85 -msgid "Search Notifications..." -msgstr "" - -#: bp-notifications/bp-notifications-template.php:781 +#: bp-notifications/bp-notifications-template.php:421 msgid "Date not found" msgstr "" -#: bp-notifications/bp-notifications-template.php:861 -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:122 +#: bp-notifications/bp-notifications-template.php:503 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:128 msgid "Read" msgstr "" -#: bp-notifications/bp-notifications-template.php:1189 +#: bp-notifications/bp-notifications-template.php:842 msgid "Viewing 1 notification" msgstr "" -#: bp-notifications/bp-notifications-template.php:1191 +#: bp-notifications/bp-notifications-template.php:844 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:1255 +#: bp-notifications/bp-notifications-template.php:908 msgid "Newest First" msgstr "" -#: bp-notifications/bp-notifications-template.php:1256 +#: bp-notifications/bp-notifications-template.php:909 msgid "Oldest First" msgstr "" -#: bp-notifications/bp-notifications-template.php:1260 +#: bp-notifications/bp-notifications-template.php:913 msgid "Go" msgstr "" -#: bp-settings/bp-settings-actions.php:105 -msgid "" -"Dear %1$s,\n" -"\n" -"You recently changed the email address associated with your account on " -"%2$s.\n" -"If this is correct, please click on the following link to complete the " -"change:\n" -"%3$s\n" -"\n" -"You can safely ignore and delete this email if you do not want to take this " -"action or if you have received this email in error.\n" -"\n" -"This email has been sent to %4$s.\n" -"\n" -"Regards,\n" -"%5$s\n" -"%6$s" -msgstr "" - -#: bp-settings/bp-settings-actions.php:141 -msgid "[%s] Verify your new email address" +#: bp-notifications/classes/class-bp-notifications-component.php:87 +msgid "Search Notifications..." msgstr "" -#: bp-settings/bp-settings-actions.php:218 +#: bp-settings/bp-settings-actions.php:193 msgid "That email address is invalid. Check the formatting and try again." msgstr "" -#: bp-settings/bp-settings-actions.php:221 +#: bp-settings/bp-settings-actions.php:196 msgid "That email address is currently unavailable for use." msgstr "" -#: bp-settings/bp-settings-actions.php:224 +#: bp-settings/bp-settings-actions.php:199 msgid "That email address is already taken." msgstr "" -#: bp-settings/bp-settings-actions.php:227 +#: bp-settings/bp-settings-actions.php:202 msgid "Email address cannot be empty." msgstr "" -#: bp-settings/bp-settings-actions.php:237 +#: bp-settings/bp-settings-actions.php:212 msgid "Your current password is invalid." msgstr "" -#: bp-settings/bp-settings-actions.php:240 +#: bp-settings/bp-settings-actions.php:215 msgid "The new password fields did not match." msgstr "" -#: bp-settings/bp-settings-actions.php:243 +#: bp-settings/bp-settings-actions.php:218 msgid "One of the password fields was empty." msgstr "" -#: bp-settings/bp-settings-actions.php:246 +#: bp-settings/bp-settings-actions.php:221 msgid "The new password must be different from the current password." msgstr "" -#: bp-settings/bp-settings-actions.php:255 +#: bp-settings/bp-settings-actions.php:230 msgid "Your settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:261 +#: bp-settings/bp-settings-actions.php:236 msgid "No changes were made to your account." msgstr "" -#: bp-settings/bp-settings-actions.php:263 +#: bp-settings/bp-settings-actions.php:238 msgid "No changes were made to this account." msgstr "" -#: bp-settings/bp-settings-actions.php:311 +#: bp-settings/bp-settings-actions.php:288 msgid "Your notification settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:313 +#: bp-settings/bp-settings-actions.php:290 msgid "This user's notification settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:437 +#: bp-settings/bp-settings-actions.php:418 msgid "%s was successfully deleted." msgstr "" -#: bp-settings/bp-settings-actions.php:483 +#: bp-settings/bp-settings-actions.php:464 msgid "You have successfully verified your new email address." msgstr "" -#: bp-settings/bp-settings-actions.php:486 +#: bp-settings/bp-settings-actions.php:467 msgid "There was a problem verifying your new email address. Please try again." msgstr "" -#: bp-settings/bp-settings-actions.php:495 +#: bp-settings/bp-settings-actions.php:476 msgid "You have successfully dismissed your pending email change." msgstr "" -#: bp-settings/bp-settings-loader.php:94 bp-settings/bp-settings-loader.php:171 -msgid "General" +#: bp-settings/bp-settings-template.php:91 +msgid "" +"There is a pending change of your email address to %1$s.<br />Check your " +"email (%2$s) for the verification link. <a href=\"%3$s\">Cancel</a>" msgstr "" -#: bp-settings/bp-settings-loader.php:118 -msgid "Capabilities" +#: bp-settings/classes/class-bp-settings-component.php:111 +#: bp-settings/classes/class-bp-settings-component.php:188 +msgid "General" msgstr "" -#: 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>" +#: bp-settings/classes/class-bp-settings-component.php:135 +msgid "Capabilities" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:27 +#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:33 msgid "Load More" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:41 +#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:47 msgid "Sorry, there was no activity found. Please try a different filter." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/comment.php:34 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:29 #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4: #. activity timestamp msgid "" @@ -5465,286 +6040,320 @@ msgid "" "class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/entry.php:64 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:59 msgid "View Conversation" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/entry.php:72 -msgid "Comment <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:67 +msgid "Comment %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/entry.php:80 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:75 msgid "Mark as Favorite" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:75 +#: bp-templates/bp-legacy/buddypress-functions.php:301 +#: bp-templates/bp-legacy/buddypress-functions.php:1202 +#: bp-templates/bp-legacy/buddypress-functions.php:1220 msgid "Favorite" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:79 +#: bp-templates/bp-legacy/buddypress-functions.php:304 +#: bp-templates/bp-legacy/buddypress-functions.php:1200 +#: bp-templates/bp-legacy/buddypress-functions.php:1222 msgid "Remove Favorite" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/entry.php:130 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:123 +msgid "Comment" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/activity/entry.php:126 msgid "Post" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:47 +#: bp-templates/bp-legacy/buddypress/activity/index.php:55 msgid "The public activity for everyone on this site." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:47 -#: bp-templates/bp-legacy/buddypress/members/index.php:47 -msgid "All Members <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/activity/index.php:55 +#: bp-templates/bp-legacy/buddypress/members/index.php:53 +msgid "All Members %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:64 +#: bp-templates/bp-legacy/buddypress/activity/index.php:72 msgid "The activity of my friends only." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:64 -#: bp-templates/bp-legacy/buddypress/members/index.php:50 -msgid "My Friends <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/activity/index.php:72 +#: bp-templates/bp-legacy/buddypress/members/index.php:56 +msgid "My Friends %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:83 +#: bp-templates/bp-legacy/buddypress/activity/index.php:91 msgid "The activity of groups I am a member of." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:83 -#: bp-templates/bp-legacy/buddypress/groups/index.php:46 -msgid "My Groups <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/activity/index.php:91 +#: bp-templates/bp-legacy/buddypress/groups/index.php:52 +msgid "My Groups %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:100 +#: bp-templates/bp-legacy/buddypress/activity/index.php:108 msgid "The activity I've marked as a favorite." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:100 -msgid "My Favorites <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/activity/index.php:108 +msgid "My Favorites %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:115 +#: bp-templates/bp-legacy/buddypress/activity/index.php:123 msgid "Activity that I have been mentioned in." msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:115 +#: bp-templates/bp-legacy/buddypress/activity/index.php:123 msgid "Mentions" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:134 -#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3 +#: bp-templates/bp-legacy/buddypress/activity/index.php:142 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:12 msgid "RSS Feed" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/index.php:134 -#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3 +#: bp-templates/bp-legacy/buddypress/activity/index.php:142 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:12 msgid "RSS" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/activity/index.php:154 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:24 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:17 msgid "Show:" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/activity/index.php:156 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:26 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:19 msgid "— Everything —" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/post-form.php:30 +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:29 msgid "What's new in %s, %s?" msgstr "" -#: bp-templates/bp-legacy/buddypress/activity/post-form.php:32 +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:31 msgid "What's new, %s?" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:36 +msgid "Post what's new" +msgstr "" + #: bp-templates/bp-legacy/buddypress/activity/post-form.php:44 msgid "Post Update" msgstr "" #: bp-templates/bp-legacy/buddypress/activity/post-form.php:51 +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:53 msgid "Post in" msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:16 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:17 msgid "Your browser does not support this feature." msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:23 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:24 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 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/camera.php:25 +#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:29 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1116 +#: bp-xprofile/classes/class-bp-xprofile-group.php:710 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 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/avatars/crop.php:23 +#: bp-templates/bp-legacy/buddypress/groups/create.php:232 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:206 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:57 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 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:41 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 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:42 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:462 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 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:42 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 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:178 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 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:180 msgid "Delete Group Profile Photo" msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:15 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:26 +msgid "" +"If you'd like to delete your current cover image but not upload a new one, " +"please use the delete Cover Image button." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:27 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:30 +msgid "Delete Cover Image" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:27 +msgid "Delete My Cover Image" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:29 +msgid "" +"If you'd like to remove the existing group cover image but not upload a new " +"one, please use the delete group cover image button." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/assets/_attachments/cover-images/index.php:30 +msgid "Delete Group Cover Image" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:16 msgid "The web browser on your device cannot be used to upload files." msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:17 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:18 msgid "Upload Limit Exceeded" msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:22 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:23 msgid "Drop your file here" msgstr "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:24 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:25 msgid "Select your File" msgstr "" -#: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:125 +#: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:120 msgid "Sorry, there were no sites found." msgstr "" -#: bp-templates/bp-legacy/buddypress/blogs/create.php:31 +#: bp-templates/bp-legacy/buddypress/blogs/create.php:37 msgid "Site registration is currently disabled" msgstr "" -#: bp-templates/bp-legacy/buddypress/blogs/index.php:47 -msgid "All Sites <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:53 +msgid "All Sites %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/blogs/index.php:51 -msgid "My Sites <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:57 +msgid "My Sites %s" msgstr "" -#: 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 -#: bp-templates/bp-legacy/buddypress/members/single/groups.php:22 +#: bp-templates/bp-legacy/buddypress/blogs/index.php:89 +#: bp-templates/bp-legacy/buddypress/forums/index.php:88 +#: bp-templates/bp-legacy/buddypress/groups/index.php:83 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:52 +#: bp-templates/bp-legacy/buddypress/members/index.php:85 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:20 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:21 msgid "Last Active" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:53 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:52 msgid "Topic" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:55 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54 msgid "Freshness" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:75 -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:123 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:74 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:129 msgid "Permanent link to this post" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:82 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:81 #. translators: "started by [poster] in [forum]" msgid "Started by %1$s" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:93 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:92 #. translators: "started by [poster] in [forum]" msgid "in %1$s" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:164 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:163 msgid "Sorry, there were no forum topics found." msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:43 -msgid "All Topics <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/forums/index.php:52 +msgid "All Topics %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:47 -msgid "My Topics <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/forums/index.php:56 +msgid "My Topics %s" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/forums/index.php:89 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:53 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:20 msgid "Most Posts" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/forums/index.php:90 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:54 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:21 msgid "Unreplied" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:152 +#: bp-templates/bp-legacy/buddypress/forums/index.php:161 msgid "Create New Topic:" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/forums/index.php:171 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:77 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:109 msgid "Content:" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/forums/index.php:174 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:80 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:112 msgid "Tags (comma separated):" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:168 +#: bp-templates/bp-legacy/buddypress/forums/index.php:177 msgid "Post In Group Forum:" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:195 -#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:119 +#: bp-templates/bp-legacy/buddypress/forums/index.php:204 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:125 msgid "Post Topic" msgstr "" -#: bp-templates/bp-legacy/buddypress/forums/index.php:207 +#: bp-templates/bp-legacy/buddypress/forums/index.php:216 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 " @@ -5753,592 +6362,619 @@ msgid "" "you can post your topic in that group's forum." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:60 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:30 +#: bp-templates/bp-legacy/buddypress/groups/create.php:66 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:39 msgid "Group Name (required)" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:65 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:33 +#: bp-templates/bp-legacy/buddypress/groups/create.php:71 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:42 msgid "Group Description (required)" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:95 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:91 +#: bp-templates/bp-legacy/buddypress/groups/create.php:101 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:100 msgid "Privacy Options" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:98 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:96 +#: bp-templates/bp-legacy/buddypress/groups/create.php:105 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:104 msgid "This is a public group" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:100 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:98 +#: bp-templates/bp-legacy/buddypress/groups/create.php:108 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:107 msgid "Any site member can join this group." msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/create.php:109 +#: bp-templates/bp-legacy/buddypress/groups/create.php:118 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:108 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:116 msgid "This group will be listed in the groups directory and in search results." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:102 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:100 +#: bp-templates/bp-legacy/buddypress/groups/create.php:110 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109 msgid "Group content and activity will be visible to any site member." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:108 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:106 +#: bp-templates/bp-legacy/buddypress/groups/create.php:114 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:112 msgid "This is a private group" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:111 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:108 +#: bp-templates/bp-legacy/buddypress/groups/create.php:117 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:115 msgid "Only users who request membership and are accepted can join the group." msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/create.php:119 +#: bp-templates/bp-legacy/buddypress/groups/create.php:128 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:117 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:125 msgid "Group content and activity will only be visible to members of the group." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:119 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:116 +#: bp-templates/bp-legacy/buddypress/groups/create.php:123 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:120 msgid "This is a hidden group" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:122 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:118 +#: bp-templates/bp-legacy/buddypress/groups/create.php:126 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:123 msgid "Only users who are invited can join the group." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:123 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:119 +#: bp-templates/bp-legacy/buddypress/groups/create.php:127 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:124 msgid "This group will not be listed in the groups directory or search results." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:129 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127 +#: bp-templates/bp-legacy/buddypress/groups/create.php:133 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:132 msgid "Group Invitations" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:131 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:129 +#: bp-templates/bp-legacy/buddypress/groups/create.php:135 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:134 msgid "Which members of this group are allowed to invite others?" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:156 +#: bp-templates/bp-legacy/buddypress/groups/create.php:153 msgid "Should this group have a forum?" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:163 +#: bp-templates/bp-legacy/buddypress/groups/create.php:160 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:203 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:169 +#: bp-templates/bp-legacy/buddypress/groups/create.php:200 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:167 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:207 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:173 -#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:25 +#: bp-templates/bp-legacy/buddypress/groups/create.php:203 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:170 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:34 +msgid "Select an image" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/create.php:205 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:172 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:36 msgid "Upload Image" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:211 +#: bp-templates/bp-legacy/buddypress/groups/create.php:209 msgid "" "To skip the group profile photo upload process, hit the \"Next Step\" " "button." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:226 +#: bp-templates/bp-legacy/buddypress/groups/create.php:224 msgid "Crop Group Profile Photo" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:228 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:201 +#: bp-templates/bp-legacy/buddypress/groups/create.php:226 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:200 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:51 msgid "Profile photo to crop" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:231 -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:204 +#: bp-templates/bp-legacy/buddypress/groups/create.php:229 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:203 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:54 msgid "Profile photo preview" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:287 +#: bp-templates/bp-legacy/buddypress/groups/create.php:270 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:234 +msgid "The Cover Image will be used to customize the header of your group." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/create.php:316 msgid "Select people to invite from your friends list." msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/create.php:334 +#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:74 +#: bp-templates/bp-legacy/buddypress-functions.php:1322 msgid "Remove Invite" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:322 +#: bp-templates/bp-legacy/buddypress/groups/create.php:351 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:367 +#: bp-templates/bp-legacy/buddypress/groups/create.php:396 msgid "Back to Previous Step" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:374 +#: bp-templates/bp-legacy/buddypress/groups/create.php:403 msgid "Next Step" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:381 +#: bp-templates/bp-legacy/buddypress/groups/create.php:410 msgid "Create Group and Continue" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/create.php:388 +#: bp-templates/bp-legacy/buddypress/groups/create.php:417 msgid "Finish" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:132 +#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:131 msgid "There were no groups found." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/index.php:43 -msgid "All Groups <span>%s</span>" +#: bp-templates/bp-legacy/buddypress/groups/index.php:49 +msgid "All Groups %s" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/index.php:78 -#: bp-templates/bp-legacy/buddypress/members/single/groups.php:23 +#: bp-templates/bp-legacy/buddypress/groups/index.php:84 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:22 msgid "Most Members" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/index.php:79 -#: bp-templates/bp-legacy/buddypress/members/single/groups.php:24 +#: bp-templates/bp-legacy/buddypress/groups/index.php:85 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:23 msgid "Newly Created" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:56 msgid "Notify group members of these changes via email" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:199 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:198 msgid "Crop Profile Photo" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:317 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:223 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php:11 +msgid "Change Cover Image" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:345 msgid "(banned)" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:323 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:351 msgid "Unban this member" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:323 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:351 msgid "Remove Ban" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:327 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:355 msgid "Kick and ban this member" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:327 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:355 msgid "Kick & Ban" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:328 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:356 msgid "Promote to Mod" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:333 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:361 msgid "Remove this member" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:333 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:361 msgid "Remove from group" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:354 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:382 msgid "This group has no members." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:425 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:453 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:428 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:456 msgid "I understand the consequences of deleting this group." msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php:73 +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:22 +msgid "Group Admins" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php:93 +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:42 +msgid "Group Mods" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:29 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:30 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:38 msgid "Forum Directory" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:32 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:38 msgid "Edit:" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:129 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:111 +msgid "Edit text" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:136 msgid "This topic does not exist." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:16 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:22 msgid "New Reply" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:39 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:45 msgid "Topic tags:" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:102 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:108 msgid "%1$s said %2$s:" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:154 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:160 msgid "There are no posts for this topic." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:169 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:175 msgid "You will auto join this group when you reply to this topic." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:181 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:187 msgid "Add a reply:" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:186 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:193 msgid "Post Reply" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:204 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:211 msgid "This topic is closed, replies are no longer accepted." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:94 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:100 msgid "You will auto join this group when you start a new topic." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:98 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:104 msgid "Post a New Topic:" msgstr "" -#: 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:36 -msgid "Group Mods" -msgstr "" - -#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:102 +#: bp-templates/bp-legacy/buddypress/groups/single/invites-loop.php:110 msgid "Select friends to invite." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/members.php:121 +#: bp-templates/bp-legacy/buddypress/groups/single/members.php:131 msgid "No members were found." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:11 +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:17 msgid "You are requesting to become a member of the group '%s'." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:14 +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:20 msgid "Comments (optional)" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:26 +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:32 msgid "Send Request" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:48 +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:57 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:45 msgid "Accept" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:50 +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:58 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:46 msgid "Reject" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:76 +#: bp-templates/bp-legacy/buddypress/groups/single/requests-loop.php:86 msgid "There are no pending membership requests." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:22 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:28 msgid "Send Invites" msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:37 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:43 msgid "Group invitations can only be extended to friends." msgstr "" -#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:38 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:44 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 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:52 msgid "All of your friends already belong to this group." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/activate.php:31 +#: bp-templates/bp-legacy/buddypress/members/activate.php:41 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:33 +#: bp-templates/bp-legacy/buddypress/members/activate.php:43 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:38 +#: bp-templates/bp-legacy/buddypress/members/activate.php:48 msgid "Please provide a valid activation key." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/activate.php:42 +#: bp-templates/bp-legacy/buddypress/members/activate.php:52 msgid "Activation Key:" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/index.php:80 -#: bp-templates/bp-legacy/buddypress/members/single/friends.php:23 +#: bp-templates/bp-legacy/buddypress/members/index.php:86 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:22 msgid "Newest Registered" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:30 +#: bp-templates/bp-legacy/buddypress/members/register.php:40 msgid "User registration is currently not allowed." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:49 +#: bp-templates/bp-legacy/buddypress/members/register.php:59 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:64 +#: bp-templates/bp-legacy/buddypress/members/register.php:74 msgid "Account Details" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/members/register.php:76 +#: bp-templates/bp-legacy/buddypress/members/register.php:87 +#: bp-templates/bp-legacy/buddypress/members/register.php:98 +#: bp-templates/bp-legacy/buddypress/members/register.php:110 +#: bp-templates/bp-legacy/buddypress/members/register.php:270 +#: bp-templates/bp-legacy/buddypress/members/register.php:286 +#: bp-xprofile/bp-xprofile-template.php:1294 msgid "(required)" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:77 +#: bp-templates/bp-legacy/buddypress/members/register.php:87 msgid "Email Address" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:88 +#: bp-templates/bp-legacy/buddypress/members/register.php:98 msgid "Choose a Password" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:100 +#: bp-templates/bp-legacy/buddypress/members/register.php:110 msgid "Confirm Password" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:146 +#: bp-templates/bp-legacy/buddypress/members/register.php:156 msgid "Profile Details" msgstr "" -#: 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>" +#: bp-templates/bp-legacy/buddypress/members/register.php:180 +#: bp-templates/bp-legacy/buddypress/members/register.php:201 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:58 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:78 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:371 +msgid "This field can be seen by: %s" msgstr "" -#: 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 +#: bp-templates/bp-legacy/buddypress/members/register.php:189 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:67 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:387 msgid "Who can see this field?" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:243 +#: bp-templates/bp-legacy/buddypress/members/register.php:264 msgid "Blog Details" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:245 +#: bp-templates/bp-legacy/buddypress/members/register.php:266 msgid "Yes, I'd like to create a new site" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:249 +#: bp-templates/bp-legacy/buddypress/members/register.php:270 msgid "Blog URL" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:265 +#: bp-templates/bp-legacy/buddypress/members/register.php:286 msgid "Site Title" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:323 +#: bp-templates/bp-legacy/buddypress/members/register.php:344 msgid "Complete Sign Up" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:355 +#: bp-templates/bp-legacy/buddypress/members/register.php:376 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:357 +#: bp-templates/bp-legacy/buddypress/members/register.php:378 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:96 +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:102 msgid "You have no pending friendship requests." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:60 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:66 msgid "You have no outstanding group invites." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:12 +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:21 msgid "Send To (Username or Friend's Name)" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:30 msgid "This is a notice to all users." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:24 -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:50 +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:33 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:56 msgid "Subject" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:27 +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:36 msgid "Message" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:42 +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:51 msgid "Send Message" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:48 -#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:6 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:54 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:15 msgid "Select all" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:49 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:55 msgid "From" msgstr "" #: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:84 +msgid "Select this message" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:90 msgid "From:" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:91 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:97 msgid "To:" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:98 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:104 msgid "View Message" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:124 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:130 msgid "Unread" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:165 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:180 msgid "Sorry, no messages were found." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:57 +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:63 msgid "Sent:" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:71 +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:77 msgid "Delete Message" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:89 +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:95 msgid "Sorry, no notices were found." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:30 msgid "You are alone in this conversation." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:25 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:34 msgid "Conversation between %s recipients." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:29 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:38 msgid "Conversation between %s and you." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:35 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:44 msgid "Delete Conversation" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:139 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:101 msgid "Send a Reply" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:172 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:122 +msgid "Reply to Message" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:135 msgid "Send Reply" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:7 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:16 msgid "You have no unread notifications." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:11 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:20 msgid "This member has no unread notifications." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:28 msgid "You have no notifications." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:23 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/feedback-no-notifications.php:32 msgid "This member has no notifications." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:7 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:16 msgid "Notification" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:8 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:17 msgid "Date Received" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:1 +#: bp-templates/bp-legacy/buddypress/members/single/notifications/notifications-loop.php:28 +msgid "Select this notification" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:11 msgid "Change Profile Photo" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:14 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24 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 " @@ -6346,25 +6982,17 @@ msgid "" "computer." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31 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:38 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:49 msgid "Crop Your New Profile Photo" msgstr "" -#: 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:43 -msgid "Profile Photo preview" -msgstr "" - -#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:70 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:81 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 " @@ -6372,476 +7000,552 @@ msgid "" "you used to register with this site." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:20 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-cover-image.php:22 +msgid "Your Cover Image will be used to customize the header of your profile." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:26 msgid "Editing '%s' Profile Group" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:50 -#: bp-xprofile/bp-xprofile-admin.php:986 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:62 +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:378 msgid "Change" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:22 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:28 msgid "%s's Profile" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:25 msgid "This user is a spammer." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:10 +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:16 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:14 +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:20 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:33 +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:39 msgid "I understand the consequences." msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:10 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16 msgid "" "Current Password <span>(required to update email or change current " "password)</span>" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:11 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:17 msgid "Password Lost and Found" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:11 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:17 msgid "Lost your password?" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:15 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:21 msgid "Account Email" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:18 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:24 msgid "Change Password <span>(leave blank for no change)</span>" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:25 msgid "New Password" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:27 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:28 msgid "Repeat New Password" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:7 +#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:13 msgid "Send an email notice when:" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:22 -#: bp-xprofile/classes/class-bp-xprofile-field.php:885 +#: bp-templates/bp-legacy/buddypress/members/single/settings/profile.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1390 msgid "Visibility" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:63 +#: bp-templates/bp-legacy/buddypress-functions.php:62 msgid "BuddyPress Legacy" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:299 +#: bp-templates/bp-legacy/buddypress-functions.php:297 msgid "Accepted" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:301 +#: bp-templates/bp-legacy/buddypress-functions.php:299 msgid "comments" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:302 +#: bp-templates/bp-legacy/buddypress-functions.php:300 msgid "Are you sure you want to leave this group?" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:304 +#: bp-templates/bp-legacy/buddypress-functions.php:302 msgid "My Favorites" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:305 +#: bp-templates/bp-legacy/buddypress-functions.php:303 msgid "Rejected" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:307 +#: bp-templates/bp-legacy/buddypress-functions.php:305 msgid "Show all" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:308 +#: bp-templates/bp-legacy/buddypress-functions.php:306 msgid "Show all comments for this thread" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:309 +#: bp-templates/bp-legacy/buddypress-functions.php:307 msgid "Show all %d comments" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:310 +#: bp-templates/bp-legacy/buddypress-functions.php:308 msgid "" "Your profile has unsaved changes. If you leave the page, the changes will " "be lost." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:942 +#: bp-templates/bp-legacy/buddypress-functions.php:961 msgid "There was a problem posting your update. Please try again." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1074 -#: bp-templates/bp-legacy/buddypress-functions.php:1111 +#: bp-templates/bp-legacy/buddypress-functions.php:1096 +#: bp-templates/bp-legacy/buddypress-functions.php:1134 msgid "There was a problem when deleting. Please try again." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1298 +#: bp-templates/bp-legacy/buddypress-functions.php:1326 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:1353 +#: bp-templates/bp-legacy/buddypress-functions.php:1382 msgid " Friendship could not be requested." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1365 +#: bp-templates/bp-legacy/buddypress-functions.php:1394 msgid "Friendship request could not be cancelled." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1370 +#: bp-templates/bp-legacy/buddypress-functions.php:1399 msgid "Request Pending" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1390 +#: bp-templates/bp-legacy/buddypress-functions.php:1420 msgid "There was a problem accepting that request. Please try again." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1409 +#: bp-templates/bp-legacy/buddypress-functions.php:1440 msgid "There was a problem rejecting that request. Please try again." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1439 +#: bp-templates/bp-legacy/buddypress-functions.php:1471 msgid "Error joining group" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1452 -#: bp-templates/bp-legacy/buddypress-functions.php:1462 +#: bp-templates/bp-legacy/buddypress-functions.php:1484 +#: bp-templates/bp-legacy/buddypress-functions.php:1494 msgid "Error requesting membership" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1464 -msgid "Membership Requested" -msgstr "" - -#: bp-templates/bp-legacy/buddypress-functions.php:1473 +#: bp-templates/bp-legacy/buddypress-functions.php:1505 msgid "Error leaving group" msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1496 +#: bp-templates/bp-legacy/buddypress-functions.php:1529 msgid "There was a problem closing the notice." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1599 +#: bp-templates/bp-legacy/buddypress-functions.php:1592 msgid "There was a problem sending that reply. Please try again." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1617 +#: bp-templates/bp-legacy/buddypress-functions.php:1611 msgid "There was a problem marking messages as unread." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1642 +#: bp-templates/bp-legacy/buddypress-functions.php:1637 msgid "There was a problem marking messages as read." msgstr "" -#: bp-templates/bp-legacy/buddypress-functions.php:1667 +#: bp-templates/bp-legacy/buddypress-functions.php:1663 msgid "There was a problem deleting messages." msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:31 +#: bp-xprofile/bp-xprofile-activity.php:30 msgid "Member changed profile picture" msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:33 +#: bp-xprofile/bp-xprofile-activity.php:32 msgid "Updated Profile Photos" msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:39 +#: bp-xprofile/bp-xprofile-activity.php:38 msgid "Updated Profile" msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:41 -#: bp-xprofile/bp-xprofile-activity.php:347 +#: bp-xprofile/bp-xprofile-activity.php:40 +#: bp-xprofile/bp-xprofile-activity.php:344 msgid "Profile Updates" msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:65 +#: bp-xprofile/bp-xprofile-activity.php:64 msgid "%s changed their profile picture" msgstr "" -#: bp-xprofile/bp-xprofile-activity.php:99 -msgid "%s’s profile was updated" +#: bp-xprofile/bp-xprofile-activity.php:98 +msgid "%s's profile was updated" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:91 -#: bp-xprofile/classes/class-bp-xprofile-group.php:655 +#: bp-xprofile/bp-xprofile-admin.php:94 +#: bp-xprofile/classes/class-bp-xprofile-group.php:708 msgid "Add New Field Group" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:120 bp-xprofile/bp-xprofile-admin.php:499 +#: bp-xprofile/bp-xprofile-admin.php:126 bp-xprofile/bp-xprofile-admin.php:556 msgid "(Primary)" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:139 -#: bp-xprofile/classes/class-bp-xprofile-field.php:671 +#: bp-xprofile/bp-xprofile-admin.php:148 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1114 msgid "Add New Field" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:172 +#: bp-xprofile/bp-xprofile-admin.php:186 msgid "Fields for \"%s\" Group" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:197 +#: bp-xprofile/bp-xprofile-admin.php:212 msgid "There are no fields in this group." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:205 +#: bp-xprofile/bp-xprofile-admin.php:220 msgid "* Fields in this group appear on the signup page." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:213 +#: bp-xprofile/bp-xprofile-admin.php:228 msgid "You have no groups." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:214 +#: bp-xprofile/bp-xprofile-admin.php:229 msgid "Add New Group" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:252 +#: bp-xprofile/bp-xprofile-admin.php:269 msgid "There was an error saving the group. Please try again." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:257 +#: bp-xprofile/bp-xprofile-admin.php:274 msgid "The group was saved successfully." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:298 -msgid "The group was deleted successfully." -msgstr "" - -#: bp-xprofile/bp-xprofile-admin.php:353 +#: bp-xprofile/bp-xprofile-admin.php:380 msgid "There was an error saving the field. Please try again." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:356 +#: bp-xprofile/bp-xprofile-admin.php:383 msgid "The field was saved successfully." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:420 +#: bp-xprofile/bp-xprofile-admin.php:467 msgid "field" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:420 +#: bp-xprofile/bp-xprofile-admin.php:467 msgid "option" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:424 +#: bp-xprofile/bp-xprofile-admin.php:471 msgid "There was an error deleting the %s. Please try again." msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:427 +#: bp-xprofile/bp-xprofile-admin.php:474 msgid "The %s was deleted successfully!" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:500 -msgid "(Required)" -msgstr "" - -#: bp-xprofile/bp-xprofile-admin.php:501 +#: bp-xprofile/bp-xprofile-admin.php:558 msgid "(Sign-up)" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:982 -msgid "This field can be seen by: <span class=\"%s\">%s</span>" -msgstr "" - -#: bp-xprofile/bp-xprofile-screens.php:179 +#: bp-xprofile/bp-xprofile-screens.php:178 msgid "Changes saved." msgstr "" -#: bp-xprofile/bp-xprofile-settings.php:43 +#: bp-xprofile/bp-xprofile-settings.php:51 msgid "Your profile settings have been saved." msgstr "" -#: bp-xprofile/bp-xprofile-settings.php:47 +#: bp-xprofile/bp-xprofile-settings.php:55 msgid "This member's profile settings have been saved." msgstr "" -#: bp-xprofile/bp-xprofile-template.php:1089 +#: bp-xprofile/bp-xprofile-template.php:1017 msgid "Profile not recently updated." msgstr "" -#: bp-xprofile/bp-xprofile-template.php:1107 +#: bp-xprofile/bp-xprofile-template.php:1041 msgid "Profile updated %s" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:1285 +#: bp-xprofile/bp-xprofile-template.php:1238 +msgid "Select visibility" +msgstr "" + +#: bp-xprofile/bp-xprofile-template.php:1251 msgid "This field's visibility cannot be changed." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:193 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:102 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:277 +msgid "Select day" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:110 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:282 +msgid "Select month" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:118 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:287 +msgid "Select year" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:205 msgid "January" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:194 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:206 msgid "February" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:195 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:207 msgid "March" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:196 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:208 msgid "April" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:197 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:209 msgid "May" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:198 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:210 msgid "June" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:199 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:211 msgid "July" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:200 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:212 msgid "August" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:201 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:213 msgid "September" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:202 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:214 msgid "October" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:203 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:215 msgid "November" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:204 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:216 msgid "December" msgstr "" -#: 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 +#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:95 +#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:85 +#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:177 msgid "Clear" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:263 +#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:97 +msgid "Number field" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:97 +msgid "Textbox" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:100 +msgid "URL" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:299 msgid "Please enter options for this Field:" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:266 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:302 msgid "Sort Order:" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:268 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:304 msgid "Custom" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:269 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:305 msgid "Ascending" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:270 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:306 msgid "Descending" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:335 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:368 +msgid "Add an option" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:372 msgid "Default Value" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type.php:352 +#: bp-xprofile/classes/class-bp-xprofile-field-type.php:389 msgid "Add Another Option" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:593 +#: bp-xprofile/classes/class-bp-xprofile-field.php:745 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1361 +msgid "Users with no member type" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:748 +msgid "(Member types: %s)" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:750 +msgid "(Unavailable to all members)" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1037 msgid "Profile fields must have a name." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:599 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1043 msgid "Profile field requirement is missing." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:605 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1049 msgid "Profile field type is missing." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:611 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1055 msgid "The profile field type %s is not registered." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:626 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1070 msgid "These field options are invalid." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:637 -#: bp-xprofile/classes/class-bp-xprofile-field.php:643 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1081 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1087 msgid "%s require at least one option." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:684 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1130 msgid "Edit Field" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:795 -#: bp-xprofile/classes/class-bp-xprofile-group.php:712 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1246 +#: bp-xprofile/classes/class-bp-xprofile-group.php:764 msgid "Submit" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:905 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1314 +#: bp-xprofile/classes/class-bp-xprofile-group.php:744 +msgid "Add description" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1344 +msgid "Member Types" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1346 +msgid "This field should be available to:" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1366 +msgid "Unavailable to all members." +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1410 msgid "Allow members to override" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:909 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1414 msgid "Enforce field visibility" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:934 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1439 msgid "Requirement" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:937 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1442 msgid "Not Required" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:938 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1443 msgid "Required" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:961 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1468 +msgid "Autolink" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1470 +msgid "" +"On user profiles, link this field to a search of the Members directory, " +"using the field value as a search term." +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1473 +msgid "Autolink status for this field" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1475 +msgid "Enabled" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1476 +msgid "Disabled" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-field.php:1500 msgid "Type" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-group.php:524 +#: bp-xprofile/classes/class-bp-xprofile-group.php:576 msgid "Please make sure you give the group a name." msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-group.php:661 +#: bp-xprofile/classes/class-bp-xprofile-group.php:714 msgid "Edit Field Group" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-group.php:686 +#: bp-xprofile/classes/class-bp-xprofile-group.php:737 msgid "Field Group Name" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-group.php:691 +#: bp-xprofile/classes/class-bp-xprofile-group.php:742 msgid "Field Group Description" msgstr "" @@ -6851,1179 +7555,1427 @@ msgstr "" #. Description of the plugin/theme msgid "" -"BuddyPress helps you run any kind of social network on your WordPress, with " -"member profiles, activity streams, user groups, messaging, and more." +"BuddyPress helps you build any type of community website using WordPress, " +"with member profiles, activity streams, user groups, messaging, and more." msgstr "" #. Author of the plugin/theme msgid "The BuddyPress Community" msgstr "" -#: bp-activity/bp-activity-admin.php:32 +#: bp-activity/bp-activity-admin.php:34 msgctxt "Admin Dashbord SWA page title" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:33 +#: bp-activity/bp-activity-admin.php:35 msgctxt "Admin Dashbord SWA menu" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:253 +#: bp-activity/bp-activity-admin.php:249 msgctxt "activity admin edit screen" msgid "Status" msgstr "" -#: bp-activity/bp-activity-admin.php:254 +#: bp-activity/bp-activity-admin.php:250 msgctxt "activity admin edit screen" msgid "Primary Item/Secondary Item" msgstr "" -#: bp-activity/bp-activity-admin.php:255 +#: bp-activity/bp-activity-admin.php:251 msgctxt "activity admin edit screen" msgid "Link" msgstr "" -#: bp-activity/bp-activity-admin.php:256 +#: bp-activity/bp-activity-admin.php:252 msgctxt "activity admin edit screen" msgid "Type" msgstr "" -#: bp-activity/bp-activity-admin.php:257 +#: bp-activity/bp-activity-admin.php:253 msgctxt "activity admin edit screen" msgid "Author ID" msgstr "" -#: bp-activity/bp-activity-admin.php:270 +#: bp-activity/bp-activity-admin.php:273 msgctxt "Activity items per page (screen options)" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:972 +#: bp-activity/bp-activity-admin.php:990 msgctxt "Admin SWA page" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:1336 -msgctxt "Admin SWA column header" -msgid "Author" -msgstr "" - -#: bp-activity/bp-activity-admin.php:1337 -msgctxt "Admin SWA column header" -msgid "Activity" -msgstr "" - -#: bp-activity/bp-activity-admin.php:1338 -msgctxt "Admin SWA column header" -msgid "Action" -msgstr "" - -#: bp-activity/bp-activity-admin.php:1339 -msgctxt "Admin SWA column header" -msgid "In Response To" +#: bp-activity/bp-activity-functions.php:517 +msgctxt "Post Type generic activity post admin filter" +msgid "New item published" msgstr "" -#: bp-activity/bp-activity-akismet.php:612 -msgctxt "x hours ago - akismet cleared this item" -msgid "<span>%1$s</span> — %2$s" +#: bp-activity/bp-activity-functions.php:550 +msgctxt "Post Type generic comments activity admin filter" +msgid "New item comment posted" msgstr "" -#: bp-activity/bp-activity-functions.php:481 -msgctxt "Post Type generic activity post admin filter" -msgid "New item published" +#: bp-activity/bp-activity-functions.php:561 +msgctxt "Post Type generic comments activity front filter" +msgid "Item comments" msgstr "" -#: bp-activity/bp-activity-functions.php:1400 +#: bp-activity/bp-activity-functions.php:1581 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 +#: bp-activity/bp-activity-functions.php:1587 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 +#: bp-activity/bp-activity-functions.php:1632 +msgctxt "Activity Custom Post Type comment action" +msgid "%1$s commented on the <a href=\"%2$s\">item</a>, on the site %3$s" +msgstr "" + +#: bp-activity/bp-activity-functions.php:1638 +msgctxt "Activity Custom Post Type post comment action" +msgid "%1$s commented on the <a href=\"%2$s\">item</a>" +msgstr "" + +#: bp-activity/classes/class-bp-activity-component.php:115 msgctxt "component directory title" msgid "Site-Wide Activity" msgstr "" -#: bp-blogs/bp-blogs-loader.php:69 +#: bp-blogs/classes/class-bp-blogs-component.php:73 msgctxt "component directory title" msgid "Sites" msgstr "" -#: bp-core/bp-core-filters.php:741 +#: bp-core/bp-core-template.php:3062 msgctxt "component directory title" msgid "Directory" msgstr "" -#: bp-groups/bp-groups-loader.php:166 +#: bp-groups/classes/class-bp-groups-component.php:164 msgctxt "component directory title" msgid "Groups" msgstr "" -#: bp-members/bp-members-loader.php:103 +#: bp-members/classes/class-bp-members-component.php:109 msgctxt "component directory title" msgid "Members" msgstr "" -#: bp-activity/bp-activity-loader.php:140 +#: bp-activity/classes/class-bp-activity-component.php:160 msgctxt "Profile activity screen nav" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-loader.php:166 +#: bp-activity/classes/class-bp-activity-component.php:170 msgctxt "Profile activity screen sub nav" msgid "Personal" msgstr "" -#: bp-activity/bp-activity-loader.php:177 +#: bp-activity/classes/class-bp-activity-component.php:181 msgctxt "Profile activity screen sub nav" msgid "Mentions" msgstr "" -#: bp-activity/bp-activity-loader.php:190 +#: bp-activity/classes/class-bp-activity-component.php:194 msgctxt "Profile activity screen sub nav" msgid "Favorites" msgstr "" -#: bp-activity/bp-activity-loader.php:203 +#: bp-activity/classes/class-bp-activity-component.php:207 msgctxt "Profile activity screen sub nav" msgid "Friends" msgstr "" -#: bp-activity/bp-activity-loader.php:216 +#: bp-activity/classes/class-bp-activity-component.php:220 msgctxt "Profile activity screen sub nav" msgid "Groups" msgstr "" -#: bp-activity/bp-activity-loader.php:261 +#: bp-activity/classes/class-bp-activity-component.php:263 msgctxt "Toolbar Mention logged in user" msgid "Mentions <span class=\"count\">%s</span>" msgstr "" -#: bp-activity/bp-activity-loader.php:263 +#: bp-activity/classes/class-bp-activity-component.php:265 msgctxt "Toolbar Mention logged in user" msgid "Mentions" msgstr "" -#: bp-activity/bp-activity-loader.php:271 +#: bp-activity/classes/class-bp-activity-component.php:273 msgctxt "My Account Activity sub nav" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-loader.php:279 +#: bp-activity/classes/class-bp-activity-component.php:281 msgctxt "My Account Activity sub nav" msgid "Personal" msgstr "" -#: bp-activity/bp-activity-loader.php:299 +#: bp-activity/classes/class-bp-activity-component.php:302 msgctxt "My Account Activity sub nav" msgid "Favorites" msgstr "" -#: bp-activity/bp-activity-loader.php:309 +#: bp-activity/classes/class-bp-activity-component.php:313 msgctxt "My Account Activity sub nav" msgid "Friends" msgstr "" -#: bp-activity/bp-activity-loader.php:319 +#: bp-activity/classes/class-bp-activity-component.php:324 msgctxt "My Account Activity sub nav" msgid "Groups" msgstr "" -#: bp-activity/bp-activity-loader.php:343 +#: bp-activity/classes/class-bp-activity-component.php:350 msgctxt "Page and <title>" msgid "My Activity" msgstr "" -#: bp-activity/bp-activity-template.php:394 -msgctxt "Activity pagination previous text" -msgid "←" +#: bp-activity/classes/class-bp-activity-list-table.php:370 +msgctxt "Admin SWA column header" +msgid "Author" msgstr "" -#: bp-activity/bp-activity-template.php:395 -msgctxt "Activity pagination next text" -msgid "→" +#: bp-activity/classes/class-bp-activity-list-table.php:371 +msgctxt "Admin SWA column header" +msgid "Activity" msgstr "" -#: bp-blogs/bp-blogs-template.php:250 -msgctxt "Blog pagination previous text" +#: bp-activity/classes/class-bp-activity-list-table.php:372 +msgctxt "Admin SWA column header" +msgid "Action" +msgstr "" + +#: bp-activity/classes/class-bp-activity-list-table.php:373 +msgctxt "Admin SWA column header" +msgid "In Response To" +msgstr "" + +#: bp-activity/classes/class-bp-activity-template.php:292 +msgctxt "Activity pagination previous text" msgid "←" msgstr "" -#: bp-blogs/bp-blogs-template.php:251 -msgctxt "Blog pagination next text" +#: bp-activity/classes/class-bp-activity-template.php:293 +msgctxt "Activity pagination next text" msgid "→" msgstr "" -#: bp-blogs/bp-blogs-widgets.php:38 +#: bp-activity/classes/class-bp-akismet.php:608 +msgctxt "x hours ago - akismet cleared this item" +msgid "%1$s — %2$s" +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:26 msgctxt "widget name" msgid "(BuddyPress) Recent Networkwide Posts" msgstr "" -#: bp-friends/bp-friends-widgets.php:51 +#: bp-friends/classes/class-bp-core-friends-widget.php:30 msgctxt "widget name" msgid "(BuddyPress) Friends" msgstr "" -#: bp-groups/bp-groups-widgets.php:27 +#: bp-groups/classes/class-bp-groups-widget.php:30 msgctxt "widget name" msgid "(BuddyPress) Groups" msgstr "" -#: bp-members/bp-members-widgets.php:38 +#: bp-members/classes/class-bp-core-members-widget.php:26 msgctxt "widget name" msgid "(BuddyPress) Members" msgstr "" -#: bp-members/bp-members-widgets.php:253 +#: bp-members/classes/class-bp-core-recently-active-widget.php:24 msgctxt "widget name" -msgid "(BuddyPress) Who's Online" +msgid "(BuddyPress) Recently Active Members" msgstr "" -#: bp-members/bp-members-widgets.php:403 +#: bp-members/classes/class-bp-core-whos-online-widget.php:24 msgctxt "widget name" -msgid "(BuddyPress) Recently Active Members" +msgid "(BuddyPress) Who's Online" msgstr "" -#: bp-blogs/bp-blogs-widgets.php:158 +#: bp-blogs/classes/class-bp-blogs-recent-posts-widget.php:158 msgctxt "Label for the Title field of the Recent Networkwide Posts widget" msgid "Title:" msgstr "" -#: bp-core/admin/bp-core-admin-components.php:152 +#: bp-blogs/classes/class-bp-blogs-template.php:150 +msgctxt "Blog pagination previous text" +msgid "←" +msgstr "" + +#: bp-blogs/classes/class-bp-blogs-template.php:151 +msgctxt "Blog pagination next text" +msgid "→" +msgstr "" + +#: bp-core/admin/bp-core-admin-components.php:156 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-admin-schema.php:350 +#: bp-core/admin/bp-core-admin-schema.php:351 msgctxt "First field-group name" msgid "General" msgstr "" -#: bp-core/admin/bp-core-admin-schema.php:354 +#: bp-core/admin/bp-core-admin-schema.php:355 msgctxt "Display name field" msgid "Display Name" msgstr "" -#: bp-core/admin/bp-core-admin-tools.php:404 +#: bp-core/admin/bp-core-admin-tools.php:416 msgctxt "buddypress tools intro" msgid "Use the %s to repair these relationships." msgstr "" -#: bp-core/bp-core-admin.php:339 -msgctxt "BuddyPress setting tab" -msgid "Profile Settings" -msgstr "" - -#: 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" +#: bp-core/bp-core-customizer-email.php:34 bp-core/bp-core-filters.php:1115 +msgctxt "screen heading" +msgid "BuddyPress Emails" msgstr "" -#: bp-core/bp-core-admin.php:617 -msgctxt "About screen, link to development blog" -msgid "Development Blog" +#: bp-core/classes/class-bp-admin.php:349 +#: bp-core/classes/class-bp-admin.php:350 +msgctxt "screen heading" +msgid "Emails" msgstr "" -#: bp-core/bp-core-admin.php:618 -msgctxt "official Twitter accounts:" -msgid "Twitter:" +#: bp-core/bp-core-customizer-email.php:145 +msgctxt "email" +msgid "Header" msgstr "" -#: bp-core/bp-core-admin.php:618 -msgctxt "@buddypress twitter account name" -msgid "BuddyPress" +#: bp-core/bp-core-customizer-email.php:150 +msgctxt "email" +msgid "Body" msgstr "" -#: bp-core/bp-core-admin.php:618 -msgctxt "@bptrac twitter account name" -msgid "Trac" +#: bp-core/bp-core-customizer-email.php:155 +msgctxt "email" +msgid "Footer" msgstr "" -#: bp-core/bp-core-admin.php:618 -msgctxt "@buddypressdev twitter account name" -msgid "Development" +#: bp-core/bp-core-functions.php:3046 +#. translators: email disclaimer, e.g. "© 2016 Site Name". +msgctxt "email" +msgid "© %s %s" msgstr "" -#: bp-core/bp-core-catchuri.php:277 -msgctxt "member type URL base" -msgid "type" +#: bp-templates/bp-legacy/buddypress/assets/emails/single-bp-email.php:202 +msgctxt "email" +msgid "unsubscribe" msgstr "" -#: bp-core/bp-core-filters.php:954 +#: bp-core/bp-core-filters.php:782 msgctxt "customizer menu type label" msgid "Custom Link" msgstr "" -#: bp-core/bp-core-filters.php:974 +#: bp-core/bp-core-filters.php:803 msgctxt "customizer menu section title" msgid "BuddyPress (logged-in)" msgstr "" -#: bp-core/bp-core-filters.php:979 +#: bp-core/bp-core-filters.php:808 msgctxt "customizer menu section title" msgid "BuddyPress (logged-out)" msgstr "" -#: bp-core/bp-core-functions.php:640 +#: bp-core/bp-core-functions.php:617 msgctxt "Page title for the Activity directory." msgid "Activity" msgstr "" -#: bp-core/bp-core-functions.php:641 +#: bp-core/bp-core-functions.php:618 msgctxt "Page title for the Groups directory." msgid "Groups" msgstr "" -#: bp-core/bp-core-functions.php:642 +#: bp-core/bp-core-functions.php:619 msgctxt "Page title for the Sites directory." msgid "Sites" msgstr "" -#: bp-core/bp-core-functions.php:643 +#: bp-core/bp-core-functions.php:620 msgctxt "Page title for the Members directory." msgid "Members" msgstr "" -#: bp-core/bp-core-functions.php:644 +#: bp-core/bp-core-functions.php:621 msgctxt "Page title for the user activation screen." msgid "Activate" msgstr "" -#: bp-core/bp-core-functions.php:645 +#: bp-core/bp-core-functions.php:622 msgctxt "Page title for the user registration screen." msgid "Register" msgstr "" -#: bp-core/bp-core-functions.php:1186 -msgctxt "Separator in time since" -msgid "," +#: bp-core/bp-core-functions.php:1203 +msgctxt "Separator in time since" +msgid "," +msgstr "" + +#: bp-core/bp-core-functions.php:2673 +msgctxt "email post type label" +msgid "Add New" +msgstr "" + +#: bp-core/bp-core-functions.php:2674 +msgctxt "email post type label" +msgid "Add a New Email" +msgstr "" + +#: bp-core/bp-core-functions.php:2675 +msgctxt "email post type label" +msgid "All Emails" +msgstr "" + +#: bp-core/bp-core-functions.php:2676 +msgctxt "email post type label" +msgid "Edit Email" +msgstr "" + +#: bp-core/bp-core-functions.php:2677 +msgctxt "email post type label" +msgid "Filter email list" +msgstr "" + +#: bp-core/bp-core-functions.php:2678 +msgctxt "email post type label" +msgid "Email list" +msgstr "" + +#: bp-core/bp-core-functions.php:2679 +msgctxt "email post type label" +msgid "Email list navigation" +msgstr "" + +#: bp-core/bp-core-functions.php:2681 +msgctxt "email post type label" +msgid "BuddyPress Emails" +msgstr "" + +#: bp-core/bp-core-functions.php:2682 +msgctxt "email post type label" +msgid "New Email" +msgstr "" + +#: bp-core/bp-core-functions.php:2683 +msgctxt "email post type label" +msgid "No emails found" +msgstr "" + +#: bp-core/bp-core-functions.php:2684 +msgctxt "email post type label" +msgid "No emails found in Trash" +msgstr "" + +#: bp-core/bp-core-functions.php:2685 +msgctxt "email post type label" +msgid "Search Emails" +msgstr "" + +#: bp-core/bp-core-functions.php:2687 +msgctxt "email post type label" +msgid "Uploaded to this email" +msgstr "" + +#: bp-core/bp-core-functions.php:2688 +msgctxt "email post type label" +msgid "View Email" +msgstr "" + +#: bp-core/bp-core-functions.php:2680 +msgctxt "email post type name" +msgid "Emails" +msgstr "" + +#: bp-core/bp-core-functions.php:2686 +msgctxt "email post type singular name" +msgid "Email" +msgstr "" + +#: bp-core/bp-core-functions.php:2764 +msgctxt "email type taxonomy label" +msgid "New Email Situation" +msgstr "" + +#: bp-core/bp-core-functions.php:2765 +msgctxt "email type taxonomy label" +msgid "All Email Situations" +msgstr "" + +#: bp-core/bp-core-functions.php:2766 +msgctxt "email type taxonomy label" +msgid "Edit Email Situations" +msgstr "" + +#: bp-core/bp-core-functions.php:2767 +msgctxt "email type taxonomy label" +msgid "Email list" +msgstr "" + +#: bp-core/bp-core-functions.php:2768 +msgctxt "email type taxonomy label" +msgid "Email list navigation" +msgstr "" + +#: bp-core/bp-core-functions.php:2769 +msgctxt "email type taxonomy label" +msgid "Situations" +msgstr "" + +#: bp-core/bp-core-functions.php:2771 +msgctxt "email type taxonomy label" +msgid "New email situation name" +msgstr "" + +#: bp-core/bp-core-functions.php:2772 +msgctxt "email type taxonomy label" +msgid "No email situations found." +msgstr "" + +#: bp-core/bp-core-functions.php:2773 +msgctxt "email type taxonomy label" +msgid "No email situations" +msgstr "" + +#: bp-core/bp-core-functions.php:2774 +msgctxt "email type taxonomy label" +msgid "Popular Email Situation" +msgstr "" + +#: bp-core/bp-core-functions.php:2775 +msgctxt "email type taxonomy label" +msgid "Search Emails" +msgstr "" + +#: bp-core/bp-core-functions.php:2777 +msgctxt "email type taxonomy label" +msgid "Update Email Situation" +msgstr "" + +#: bp-core/bp-core-functions.php:2778 +msgctxt "email type taxonomy label" +msgid "View Email Situation" +msgstr "" + +#: bp-core/bp-core-functions.php:2770 +msgctxt "email type taxonomy name" +msgid "Situation" +msgstr "" + +#: bp-core/bp-core-functions.php:2776 +msgctxt "email type taxonomy singular name" +msgid "Email" +msgstr "" + +#: bp-core/bp-core-taxonomy.php:33 +msgctxt "email type taxonomy description" +msgid "BuddyPress email types" +msgstr "" + +#: bp-core/bp-core-template.php:528 +msgctxt "search form" +msgid "Members" +msgstr "" + +#: bp-core/bp-core-template.php:532 +msgctxt "search form" +msgid "Groups" +msgstr "" + +#: bp-core/bp-core-template.php:536 +msgctxt "search form" +msgid "Blogs" +msgstr "" + +#: bp-core/bp-core-template.php:540 +msgctxt "search form" +msgid "Forums" +msgstr "" + +#: bp-core/bp-core-template.php:543 +msgctxt "search form" +msgid "Posts" +msgstr "" + +#: bp-core/bp-core-template.php:546 +msgctxt "search form" +msgid "Search these:" +msgstr "" + +#: bp-core/bp-core-template.php:3717 +msgctxt "recipient salutation" +msgid "Hi %s," +msgstr "" + +#: bp-core/classes/class-bp-admin.php:359 +#: bp-core/classes/class-bp-admin.php:360 +msgctxt "email menu label" +msgid "Customize" +msgstr "" + +#: bp-core/classes/class-bp-admin.php:407 +msgctxt "BuddyPress setting tab" +msgid "Profile Settings" msgstr "" -#: bp-core/bp-core-loader.php:289 -msgctxt "Main navigation" -msgid "Profile" +#: bp-core/classes/class-bp-admin.php:682 +msgctxt "About screen, website links" +msgid "Learn more:" msgstr "" -#: bp-core/bp-core-loader.php:300 -msgctxt "Profile sub nav" -msgid "View" +#: bp-core/classes/class-bp-admin.php:682 +msgctxt "About screen, link to project blog" +msgid "News" msgstr "" -#: bp-core/bp-core-template.php:501 -msgctxt "search form" -msgid "Members" +#: bp-core/classes/class-bp-admin.php:682 +msgctxt "About screen, link to support site" +msgid "Support" msgstr "" -#: bp-core/bp-core-template.php:505 -msgctxt "search form" -msgid "Groups" +#: bp-core/classes/class-bp-admin.php:682 +msgctxt "About screen, link to documentation" +msgid "Documentation" msgstr "" -#: bp-core/bp-core-template.php:509 -msgctxt "search form" -msgid "Blogs" +#: bp-core/classes/class-bp-admin.php:682 +msgctxt "About screen, link to development blog" +msgid "Development Blog" msgstr "" -#: bp-core/bp-core-template.php:513 -msgctxt "search form" -msgid "Forums" +#: bp-core/classes/class-bp-admin.php:684 +msgctxt "official Twitter accounts:" +msgid "Twitter:" msgstr "" -#: bp-core/bp-core-template.php:516 -msgctxt "search form" -msgid "Posts" +#: bp-core/classes/class-bp-admin.php:684 +msgctxt "@buddypress twitter account name" +msgid "BuddyPress" msgstr "" -#: bp-core/bp-core-template.php:519 -msgctxt "search form" -msgid "Search these:" +#: bp-core/classes/class-bp-admin.php:684 +msgctxt "@bptrac twitter account name" +msgid "Trac" msgstr "" -#: bp-core/bp-core-widgets.php:35 -msgctxt "Title of the login widget" -msgid "(BuddyPress) Log In" +#: bp-core/classes/class-bp-admin.php:684 +msgctxt "@buddypressdev twitter account name" +msgid "Development" msgstr "" -#: bp-core/classes/class-bp-attachment-avatar.php:55 +#: bp-core/classes/class-bp-attachment-avatar.php:58 msgctxt "avatar types separator" msgid "," msgstr "" -#: bp-core/classes/class-bp-attachment.php:456 +#: bp-core/classes/class-bp-attachment-cover-image.php:56 +msgctxt "cover image types separator" +msgid "," +msgstr "" + +#: bp-core/classes/class-bp-attachment.php:473 msgctxt "Attachment source file" msgid "source file" msgstr "" -#: bp-core/classes/class-bp-attachment.php:458 +#: bp-core/classes/class-bp-attachment.php:475 msgctxt "Attachment destination file" msgid "destination file" msgstr "" -#: bp-forums/bp-forums-template.php:359 bp-forums/bp-forums-template.php:647 +#: bp-core/classes/class-bp-core-login-widget.php:28 +msgctxt "Title of the login widget" +msgid "(BuddyPress) Log In" +msgstr "" + +#: bp-core/classes/class-bp-core.php:305 +msgctxt "email post type description" +msgid "BuddyPress emails" +msgstr "" + +#: bp-forums/bp-forums-template.php:348 bp-forums/bp-forums-template.php:637 msgctxt "Forum topic pagination previous text" msgid "←" msgstr "" -#: bp-forums/bp-forums-template.php:360 bp-forums/bp-forums-template.php:648 +#: bp-forums/bp-forums-template.php:349 bp-forums/bp-forums-template.php:638 msgctxt "Forum topic pagination next text" msgid "→" msgstr "" -#: bp-forums/bp-forums-template.php:2105 +#: bp-forums/bp-forums-template.php:2082 msgctxt "Forum thread pagination previous text" msgid "←" msgstr "" -#: bp-forums/bp-forums-template.php:2106 +#: bp-forums/bp-forums-template.php:2083 msgctxt "Forum thread pagination next text" msgid "→" msgstr "" -#: bp-friends/bp-friends-loader.php:24 +#: bp-friends/bp-friends-screens.php:115 +msgctxt "Friend settings on notification settings page" +msgid "Friends" +msgstr "" + +#: bp-friends/bp-friends-screens.php:124 +msgctxt "Friend settings on notification settings page" +msgid "A member sends you a friendship request" +msgstr "" + +#: bp-friends/bp-friends-screens.php:130 +msgctxt "Friend settings on notification settings page" +msgid "A member accepts your friendship request" +msgstr "" + +#: bp-friends/classes/class-bp-friends-component.php:30 msgctxt "Friends screen page <title>" msgid "Friend Connections" msgstr "" -#: bp-friends/bp-friends-loader.php:140 +#: bp-friends/classes/class-bp-friends-component.php:150 msgctxt "Friends screen sub nav" msgid "Friendships" msgstr "" -#: bp-friends/bp-friends-loader.php:150 +#: bp-friends/classes/class-bp-friends-component.php:160 msgctxt "Friends screen sub nav" msgid "Requests" msgstr "" -#: bp-friends/bp-friends-loader.php:185 +#: bp-friends/classes/class-bp-friends-component.php:193 msgctxt "My Account Friends menu" msgid "Friends <span class=\"count\">%s</span>" msgstr "" -#: bp-friends/bp-friends-loader.php:188 +#: bp-friends/classes/class-bp-friends-component.php:196 msgctxt "My Account Friends menu" msgid "Friends" msgstr "" -#: bp-friends/bp-friends-loader.php:186 +#: bp-friends/classes/class-bp-friends-component.php:194 msgctxt "My Account Friends menu sub nav" msgid "Pending Requests <span class=\"count\">%s</span>" msgstr "" -#: bp-friends/bp-friends-loader.php:189 +#: bp-friends/classes/class-bp-friends-component.php:197 msgctxt "My Account Friends menu sub nav" msgid "No Pending Requests" msgstr "" -#: bp-friends/bp-friends-loader.php:204 +#: bp-friends/classes/class-bp-friends-component.php:212 msgctxt "My Account Friends menu sub nav" msgid "Friendships" msgstr "" -#: bp-friends/bp-friends-screens.php:109 -msgctxt "Friend settings on notification settings page" -msgid "Friends" -msgstr "" - -#: 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:124 -msgctxt "Friend settings on notification settings page" -msgid "A member accepts your friendship request" -msgstr "" - -#: bp-groups/bp-groups-admin.php:32 +#: bp-groups/bp-groups-admin.php:34 msgctxt "Admin Groups page title" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-admin.php:33 +#: bp-groups/bp-groups-admin.php:35 msgctxt "Admin Groups menu" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-admin.php:131 +#: bp-groups/bp-groups-admin.php:130 msgctxt "group admin edit screen" msgid "Save" msgstr "" -#: bp-groups/bp-groups-admin.php:132 +#: bp-groups/bp-groups-admin.php:131 msgctxt "group admin edit screen" msgid "Settings" msgstr "" -#: bp-groups/bp-groups-admin.php:133 +#: bp-groups/bp-groups-admin.php:132 msgctxt "group admin edit screen" msgid "Add New Members" msgstr "" -#: bp-groups/bp-groups-admin.php:134 +#: bp-groups/bp-groups-admin.php:133 msgctxt "group admin edit screen" msgid "Manage Members" msgstr "" -#: bp-groups/bp-groups-admin.php:153 +#: bp-groups/bp-groups-admin.php:152 msgctxt "Groups per page (screen options)" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-admin.php:877 +#: bp-groups/bp-groups-admin.php:883 msgctxt "Group member user_id in group admin" msgid "ID" msgstr "" -#: bp-groups/bp-groups-admin.php:878 +#: bp-groups/bp-groups-admin.php:884 msgctxt "Group member name in group admin" msgid "Name" msgstr "" -#: bp-groups/bp-groups-admin.php:879 +#: bp-groups/bp-groups-admin.php:885 msgctxt "Group member role in group admin" msgid "Group Role" msgstr "" -#: bp-groups/bp-groups-admin.php:1447 -msgctxt "Groups admin Group Name column header" -msgid "Name" +#: bp-groups/bp-groups-adminbar.php:67 +msgctxt "Group WP Admin Bar manage links" +msgid "Edit Group %s" msgstr "" -#: bp-groups/bp-groups-admin.php:1448 -msgctxt "Groups admin Group Description column header" -msgid "Description" +#: bp-groups/bp-groups-adminbar.php:71 +msgctxt "Group WP Admin Bar delete link" +msgid "%s Group" msgstr "" -#: bp-groups/bp-groups-admin.php:1449 -msgctxt "Groups admin Privacy Status column header" -msgid "Status" +#: bp-groups/bp-groups-notifications.php:34 +msgctxt "Group update email text" +msgid "* Name changed from \"%s\" to \"%s\"." msgstr "" -#: bp-groups/bp-groups-admin.php:1450 -msgctxt "Groups admin Members column header" -msgid "# Members" +#: bp-groups/bp-groups-notifications.php:42 +msgctxt "Group update email text" +msgid "* Description changed from \"%s\" to \"%s\"." msgstr "" -#: bp-groups/bp-groups-admin.php:1451 -msgctxt "Groups admin Last Active column header" -msgid "Last Active" +#: bp-groups/bp-groups-screens.php:1430 +msgctxt "Group settings on notification settings page" +msgid "Groups" msgstr "" -#: bp-groups/bp-groups-adminbar.php:67 -msgctxt "Group WP Admin Bar manage links" -msgid "Edit Group %s" +#: bp-groups/bp-groups-screens.php:1439 +msgctxt "group settings on notification settings page" +msgid "A member invites you to join a group" msgstr "" -#: bp-groups/bp-groups-adminbar.php:71 -msgctxt "Group WP Admin Bar delete link" -msgid "%s Group" +#: bp-groups/bp-groups-screens.php:1445 +msgctxt "group settings on notification settings page" +msgid "Group information is updated" +msgstr "" + +#: bp-groups/bp-groups-screens.php:1451 +msgctxt "group settings on notification settings page" +msgid "You are promoted to a group administrator or moderator" +msgstr "" + +#: bp-groups/bp-groups-screens.php:1457 +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-loader.php:90 +#: bp-groups/classes/class-bp-groups-component.php:85 msgctxt "Group screen page <title>" msgid "User Groups" msgstr "" -#: bp-groups/bp-groups-loader.php:168 +#: bp-groups/classes/class-bp-groups-component.php:166 msgctxt "Component directory search" msgid "Search Groups..." msgstr "" -#: bp-groups/bp-groups-loader.php:291 +#: bp-groups/classes/class-bp-groups-component.php:297 msgctxt "Group screen nav" msgid "Details" msgstr "" -#: bp-groups/bp-groups-loader.php:295 +#: bp-groups/classes/class-bp-groups-component.php:301 msgctxt "Group screen nav" msgid "Settings" msgstr "" -#: bp-groups/bp-groups-loader.php:304 +#: bp-groups/classes/class-bp-groups-component.php:310 msgctxt "Group screen nav" msgid "Photo" msgstr "" -#: bp-groups/bp-groups-loader.php:312 +#: bp-groups/classes/class-bp-groups-component.php:317 +msgctxt "Group screen nav" +msgid "Cover Image" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:325 msgctxt "Group screen nav" msgid "Invites" msgstr "" -#: bp-groups/bp-groups-loader.php:489 +#: bp-groups/classes/class-bp-groups-component.php:521 msgctxt "Group screen nav" msgid "Request Membership" msgstr "" -#: bp-groups/bp-groups-loader.php:398 +#: bp-groups/classes/class-bp-groups-component.php:436 msgctxt "Group screen nav with counter" msgid "Groups <span class=\"%s\">%s</span>" msgstr "" -#: bp-groups/bp-groups-loader.php:400 +#: bp-groups/classes/class-bp-groups-component.php:438 msgctxt "Group screen nav without counter" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-loader.php:469 +#: bp-groups/classes/class-bp-groups-component.php:501 msgctxt "Group screen navigation title" msgid "Home" msgstr "" -#: bp-groups/bp-groups-loader.php:501 +#: bp-groups/classes/class-bp-groups-component.php:533 msgctxt "My Group screen nav" msgid "Forum" msgstr "" -#: bp-groups/bp-groups-loader.php:513 +#: bp-groups/classes/class-bp-groups-component.php:550 msgctxt "My Group screen nav" -msgid "Members <span>%s</span>" +msgid "Activity" +msgstr "" + +#: bp-groups/classes/class-bp-groups-component.php:566 +msgctxt "My Group screen nav" +msgid "Members %s" msgstr "" -#: bp-groups/bp-groups-loader.php:526 +#: bp-groups/classes/class-bp-groups-component.php:580 msgctxt "My Group screen nav" msgid "Send Invites" msgstr "" -#: bp-groups/bp-groups-loader.php:541 +#: bp-groups/classes/class-bp-groups-component.php:595 msgctxt "My Group screen nav" msgid "Manage" msgstr "" -#: bp-groups/bp-groups-loader.php:644 +#: bp-groups/classes/class-bp-groups-component.php:706 msgctxt "My Account Groups" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-loader.php:645 +#: bp-groups/classes/class-bp-groups-component.php:707 msgctxt "My Account Groups sub nav" msgid "No Pending Invites" msgstr "" -#: bp-groups/bp-groups-loader.php:649 +#: bp-groups/classes/class-bp-groups-component.php:711 msgctxt "My Account Groups sub nav" msgid "Pending Invites <span class=\"count\">%s</span>" msgstr "" -#: bp-groups/bp-groups-loader.php:664 +#: bp-groups/classes/class-bp-groups-component.php:726 msgctxt "My Account Groups sub nav" msgid "Memberships" msgstr "" -#: bp-groups/bp-groups-loader.php:681 +#: bp-groups/classes/class-bp-groups-component.php:745 msgctxt "My Account Groups sub nav" msgid "Create a Group" msgstr "" -#: bp-groups/bp-groups-loader.php:648 +#: bp-groups/classes/class-bp-groups-component.php:710 msgctxt "My Account Groups nav" msgid "Groups <span class=\"count\">%s</span>" msgstr "" -#: bp-groups/bp-groups-loader.php:699 +#: bp-groups/classes/class-bp-groups-component.php:766 msgctxt "My Groups page <title>" msgid "Memberships" msgstr "" -#: bp-groups/bp-groups-notifications.php:35 -msgctxt "Group update email text" -msgid "* Name changed from \"%s\" to \"%s\"" +#: bp-groups/classes/class-bp-groups-list-table.php:351 +msgctxt "Groups admin Group Name column header" +msgid "Name" msgstr "" -#: bp-groups/bp-groups-notifications.php:43 -msgctxt "Group update email text" -msgid "* Description changed from \"%s\" to \"%s\"" +#: bp-groups/classes/class-bp-groups-list-table.php:352 +msgctxt "Groups admin Group Description column header" +msgid "Description" msgstr "" -#: bp-groups/bp-groups-screens.php:1331 -msgctxt "Group settings on notification settings page" -msgid "Groups" +#: bp-groups/classes/class-bp-groups-list-table.php:353 +msgctxt "Groups admin Privacy Status column header" +msgid "Status" msgstr "" -#: bp-groups/bp-groups-screens.php:1340 -msgctxt "group settings on notification settings page" -msgid "A member invites you to join a group" +#: bp-groups/classes/class-bp-groups-list-table.php:354 +msgctxt "Groups admin Members column header" +msgid "# Members" msgstr "" -#: bp-groups/bp-groups-screens.php:1346 -msgctxt "group settings on notification settings page" -msgid "Group information is updated" +#: bp-groups/classes/class-bp-groups-list-table.php:355 +msgctxt "Groups admin Last Active column header" +msgid "Last Active" msgstr "" -#: bp-groups/bp-groups-screens.php:1352 -msgctxt "group settings on notification settings page" -msgid "You are promoted to a group administrator or moderator" +#: bp-groups/classes/class-bp-groups-template.php:289 +msgctxt "Group pagination previous text" +msgid "←" msgstr "" -#: 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" +#: bp-groups/classes/class-bp-groups-template.php:290 +msgctxt "Group pagination next text" +msgid "→" msgstr "" -#: bp-groups/bp-groups-screens.php:1543 +#: bp-groups/classes/class-bp-groups-theme-compat.php:173 msgctxt "Group creation page" msgid "Groups" msgstr "" -#: bp-groups/bp-groups-template.php:364 -msgctxt "Group pagination previous text" -msgid "←" +#: bp-members/bp-members-template.php:131 +msgctxt "member type URL base" +msgid "type" msgstr "" -#: bp-groups/bp-groups-template.php:365 -msgctxt "Group pagination next text" -msgid "→" +#: bp-members/bp-members-template.php:977 +msgctxt "member latest update in member directory" +msgid "- "%s"" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:100 -#: bp-members/admin/bp-members-admin-classes.php:488 -#: bp-members/bp-members-admin.php:1351 -msgctxt "signup users" -msgid "Pending %s" +#: bp-members/bp-members-template.php:1093 +msgctxt "Records the timestamp that the user registered into the activity stream" +msgid "registered %s" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:151 -#: bp-members/admin/bp-members-admin-classes.php:525 -msgctxt "Pending signup action" -msgid "Activate" +#: bp-members/classes/class-bp-core-members-template.php:176 +msgctxt "Member pagination previous text" +msgid "←" msgstr "" -#: bp-members/admin/bp-members-admin-classes.php:152 -#: bp-members/admin/bp-members-admin-classes.php:526 -msgctxt "Pending signup action" -msgid "Email" +#: bp-members/classes/class-bp-core-members-template.php:177 +msgctxt "Member pagination next text" +msgid "→" msgstr "" -#: bp-members/bp-members-admin.php:732 +#: bp-members/classes/class-bp-members-admin.php:735 msgctxt "members user-admin edit screen" msgid "Status" msgstr "" -#: bp-members/bp-members-admin.php:766 +#: bp-members/classes/class-bp-members-admin.php:769 msgctxt "members user-admin edit screen" msgid "%s's Stats" msgstr "" -#: bp-members/bp-members-admin.php:778 +#: bp-members/classes/class-bp-members-admin.php:781 msgctxt "members user-admin edit screen" msgid "Member Type" msgstr "" -#: bp-members/bp-members-admin.php:896 bp-members/bp-members-admin.php:1848 +#: bp-members/classes/class-bp-members-admin.php:897 +#: bp-members/classes/class-bp-members-admin.php:1857 msgctxt "user" msgid "Add New" msgstr "" -#: bp-members/bp-members-admin.php:900 bp-members/bp-members-admin.php:1852 +#: bp-members/classes/class-bp-members-admin.php:901 +#: bp-members/classes/class-bp-members-admin.php:1861 msgctxt "user" msgid "Add Existing" msgstr "" -#: bp-members/bp-members-admin.php:1428 +#: bp-members/classes/class-bp-members-admin.php:1346 +msgctxt "signup users" +msgid "Pending %s" +msgstr "" + +#: bp-members/classes/class-bp-members-admin.php:1422 msgctxt "Pending Accounts per page (screen options)" msgid "Pending Accounts" msgstr "" -#: bp-members/bp-members-admin.php:1611 +#: bp-members/classes/class-bp-members-admin.php:1615 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:1645 +#: bp-members/classes/class-bp-members-admin.php:1649 msgctxt "signup resent" msgid "%s account successfully activated! " msgid_plural "%s accounts successfully activated! " msgstr[0] "" msgstr[1] "" -#: bp-members/bp-members-admin.php:1622 +#: bp-members/classes/class-bp-members-admin.php:1626 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:1656 +#: bp-members/classes/class-bp-members-admin.php:1660 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:1679 +#: bp-members/classes/class-bp-members-admin.php:1683 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:1690 +#: bp-members/classes/class-bp-members-admin.php:1694 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:237 +#: bp-members/classes/class-bp-members-component.php:259 msgctxt "Member profile main navigation" msgid "Profile" msgstr "" -#: bp-members/bp-members-loader.php:251 +#: bp-members/classes/class-bp-members-component.php:269 msgctxt "Member profile view" msgid "View" msgstr "" -#: bp-members/bp-members-template.php:349 -msgctxt "Member pagination previous text" -msgid "←" -msgstr "" - -#: bp-members/bp-members-template.php:350 -msgctxt "Member pagination next text" -msgid "→" -msgstr "" - -#: bp-members/bp-members-template.php:1136 -msgctxt "member latest update in member directory" -msgid "- "%s"" -msgstr "" - -#: 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:228 -msgctxt "Message pagination previous text" -msgid "←" +#: bp-members/classes/class-bp-members-list-table.php:166 +#: bp-members/classes/class-bp-members-ms-list-table.php:153 +msgctxt "Pending signup action" +msgid "Activate" msgstr "" -#: bp-messages/bp-messages-template.php:229 -msgctxt "Message pagination next text" -msgid "→" +#: bp-members/classes/class-bp-members-list-table.php:167 +#: bp-members/classes/class-bp-members-ms-list-table.php:154 +msgctxt "Pending signup action" +msgid "Email" msgstr "" -#: bp-messages/bp-messages-template.php:1268 +#: bp-messages/bp-messages-template.php:928 msgctxt "Message dropdown filter" msgid "Read" msgstr "" -#: bp-messages/bp-messages-template.php:1269 +#: bp-messages/bp-messages-template.php:929 msgctxt "Message dropdown filter" msgid "Unread" msgstr "" -#: bp-messages/bp-messages-template.php:1270 +#: bp-messages/bp-messages-template.php:930 msgctxt "Message dropdown filter" msgid "All" msgstr "" -#: bp-messages/bp-messages-template.php:1275 +#: bp-messages/bp-messages-template.php:935 msgctxt "Message management markup" msgid "Mark as Read" msgstr "" -#: bp-messages/bp-messages-template.php:1276 +#: bp-messages/bp-messages-template.php:936 msgctxt "Message management markup" msgid "Mark as Unread" msgstr "" -#: bp-notifications/bp-notifications-loader.php:26 +#: bp-messages/classes/class-bp-messages-box-template.php:216 +msgctxt "Message pagination previous text" +msgid "←" +msgstr "" + +#: bp-messages/classes/class-bp-messages-box-template.php:217 +msgctxt "Message pagination next text" +msgid "→" +msgstr "" + +#: bp-notifications/bp-notifications-template.php:585 +msgctxt "Notification screen action" +msgid "Unread" +msgstr "" + +#: bp-notifications/classes/class-bp-notifications-component.php:28 msgctxt "Page <title>" msgid "Notifications" msgstr "" -#: bp-notifications/bp-notifications-loader.php:110 +#: bp-notifications/classes/class-bp-notifications-component.php:125 msgctxt "Profile screen nav" msgid "Notifications <span class=\"%s\">%s</span>" msgstr "" -#: bp-notifications/bp-notifications-loader.php:112 +#: bp-notifications/classes/class-bp-notifications-component.php:127 msgctxt "Profile screen nav" msgid "Notifications" msgstr "" -#: bp-notifications/bp-notifications-loader.php:139 +#: bp-notifications/classes/class-bp-notifications-component.php:143 msgctxt "Notification screen nav" msgid "Unread" msgstr "" -#: bp-notifications/bp-notifications-loader.php:150 +#: bp-notifications/classes/class-bp-notifications-component.php:154 msgctxt "Notification screen nav" msgid "Read" msgstr "" -#: bp-notifications/bp-notifications-loader.php:184 +#: bp-notifications/classes/class-bp-notifications-component.php:188 msgctxt "My Account Notification pending" msgid "Notifications <span class=\"count\">%s</span>" msgstr "" -#: bp-notifications/bp-notifications-loader.php:185 +#: bp-notifications/classes/class-bp-notifications-component.php:189 msgctxt "My Account Notification pending" msgid "Unread <span class=\"count\">%s</span>" msgstr "" -#: bp-notifications/bp-notifications-loader.php:187 +#: bp-notifications/classes/class-bp-notifications-component.php:191 msgctxt "My Account Notification" msgid "Notifications" msgstr "" -#: bp-notifications/bp-notifications-loader.php:188 +#: bp-notifications/classes/class-bp-notifications-component.php:192 msgctxt "My Account Notification sub nav" msgid "Unread" msgstr "" -#: bp-notifications/bp-notifications-loader.php:211 +#: bp-notifications/classes/class-bp-notifications-component.php:216 msgctxt "My Account Notification sub nav" msgid "Read" msgstr "" -#: bp-notifications/bp-notifications-template.php:369 +#: bp-notifications/classes/class-bp-notifications-template.php:240 msgctxt "Notifications pagination previous text" msgid "←" msgstr "" -#: bp-notifications/bp-notifications-template.php:370 +#: bp-notifications/classes/class-bp-notifications-template.php:241 msgctxt "Notifications pagination next text" msgid "→" msgstr "" -#: bp-notifications/bp-notifications-template.php:939 -msgctxt "Notification screen action" -msgid "Unread" -msgstr "" - -#: bp-templates/bp-legacy/buddypress/activity/index.php:115 +#: bp-templates/bp-legacy/buddypress/activity/index.php:123 msgctxt "Number of new activity mentions" msgid "%s new" msgid_plural "%s new" msgstr[0] "" msgstr[1] "" -#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:23 +#: bp-templates/bp-legacy/buddypress/assets/_attachments/uploader.php:24 msgctxt "Uploader: Drop your file here - or - Select your File" msgid "or" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/register.php:168 +#: bp-templates/bp-legacy/buddypress/members/register.php:184 msgctxt "Change profile field visibility level" msgid "Change" msgstr "" -#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:23 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:29 msgctxt "Group member count" msgid "%d member" msgid_plural "%d members" msgstr[0] "" msgstr[1] "" -#: bp-xprofile/bp-xprofile-admin.php:29 +#: bp-xprofile/bp-xprofile-admin.php:31 msgctxt "xProfile admin page title" msgid "Profile Fields" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:29 +#: bp-xprofile/bp-xprofile-admin.php:31 msgctxt "Admin Users menu" msgid "Profile Fields" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:90 +#: bp-xprofile/bp-xprofile-admin.php:93 msgctxt "Settings page header" msgid "Profile Fields" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:593 +#: bp-xprofile/bp-xprofile-admin.php:653 msgctxt "xprofile field type category" msgid "Other" msgstr "" -#: 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 +#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:28 msgctxt "xprofile field type category" msgid "Multi Fields" msgstr "" -#: 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 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:28 msgctxt "xprofile field type category" msgid "Single Fields" msgstr "" -#: 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:779 -msgctxt "xprofile user-admin edit screen" -msgid "Profile Photo" -msgstr "" - -#: bp-xprofile/bp-xprofile-loader.php:43 +#: bp-xprofile/classes/class-bp-xprofile-component.php:46 msgctxt "Component page <title>" msgid "Extended Profiles" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:123 +#: bp-xprofile/classes/class-bp-xprofile-component.php:131 msgctxt "Visibility level setting" msgid "Everyone" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:127 +#: bp-xprofile/classes/class-bp-xprofile-component.php:135 msgctxt "Visibility level setting" msgid "Only Me" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:131 +#: bp-xprofile/classes/class-bp-xprofile-component.php:139 msgctxt "Visibility level setting" msgid "All Members" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:138 +#: bp-xprofile/classes/class-bp-xprofile-component.php:146 msgctxt "Visibility level setting" msgid "My Friends" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:178 +#: bp-xprofile/classes/class-bp-xprofile-component.php:200 msgctxt "Profile header menu" msgid "Profile" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:199 +#: bp-xprofile/classes/class-bp-xprofile-component.php:210 msgctxt "Profile header sub menu" msgid "View" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:209 +#: bp-xprofile/classes/class-bp-xprofile-component.php:220 msgctxt "Profile header sub menu" msgid "Edit" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:221 +#: bp-xprofile/classes/class-bp-xprofile-component.php:232 msgctxt "Profile header sub menu" msgid "Change Profile Photo" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:264 +#: bp-xprofile/classes/class-bp-xprofile-component.php:245 +msgctxt "Profile header sub menu" +msgid "Change Cover Image" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-component.php:288 msgctxt "Profile settings sub nav" msgid "Profile Visibility" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:293 +#: bp-xprofile/classes/class-bp-xprofile-component.php:315 msgctxt "My Account Profile" msgid "Profile" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:301 +#: bp-xprofile/classes/class-bp-xprofile-component.php:323 msgctxt "My Account Profile sub nav" msgid "View" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:309 +#: bp-xprofile/classes/class-bp-xprofile-component.php:332 msgctxt "My Account Profile sub nav" msgid "Edit" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:318 +#: bp-xprofile/classes/class-bp-xprofile-component.php:342 msgctxt "My Account Profile sub nav" msgid "Change Profile Photo" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:345 +#: bp-xprofile/classes/class-bp-xprofile-component.php:352 +msgctxt "My Account Profile sub nav" +msgid "Change Cover Image" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-component.php:380 msgctxt "Page title" msgid "My Profile" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:350 +#: bp-xprofile/classes/class-bp-xprofile-component.php:385 msgctxt "Avatar alt" msgid "Profile picture of %s" msgstr "" -#: bp-xprofile/bp-xprofile-loader.php:393 +#: bp-xprofile/classes/class-bp-xprofile-component.php:430 msgctxt "My Account Settings sub nav" msgid "Profile" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-checkbox.php:29 msgctxt "xprofile field type" msgid "Checkboxes" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php:29 msgctxt "xprofile field type" msgid "Date Selector" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-multiselectbox.php:29 msgctxt "xprofile field type" msgid "Multi Select Box" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-number.php:29 msgctxt "xprofile field type" msgid "Number" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-radiobutton.php:29 msgctxt "xprofile field type" msgid "Radio Buttons" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-selectbox.php:29 msgctxt "xprofile field type" msgid "Drop Down Select Box" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-textarea.php:29 msgctxt "xprofile field type" msgid "Multi-line Text Area" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-textbox.php:29 msgctxt "xprofile field type" msgid "Text Box" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:28 +#: bp-xprofile/classes/class-bp-xprofile-field-type-url.php:29 msgctxt "xprofile field type" msgid "URL" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:855 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1306 msgctxt "XProfile admin edit field" msgid "Name" msgstr "" -#: bp-xprofile/classes/class-bp-xprofile-field.php:861 +#: bp-xprofile/classes/class-bp-xprofile-field.php:1312 msgctxt "XProfile admin edit field" msgid "Description" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:150 +msgctxt "xprofile user-admin edit screen" +msgid "User marked as a spammer" +msgstr "" + +#: bp-xprofile/classes/class-bp-xprofile-user-admin.php:162 +msgctxt "xprofile user-admin edit screen" +msgid "Profile Photo" msgstr "" \ No newline at end of file diff --git a/wp-content/plugins/buddypress/composer.json b/wp-content/plugins/buddypress/composer.json index 5c6f39e33dd0e9cbdf34376222c5a3f6304188f9..af8240febbe02ec2cf04ddc4e64afbf87595b9ac 100644 --- a/wp-content/plugins/buddypress/composer.json +++ b/wp-content/plugins/buddypress/composer.json @@ -1,33 +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" - } + "name": "buddypress/buddypress", + "description": "BuddyPress helps you build any type of community website using 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/readme.txt b/wp-content/plugins/buddypress/readme.txt index 0d1850834046d8318372ca205685f30d70b70b4c..159fb19ea86044f9c9eebac847f359dc4bb1480c 100644 --- a/wp-content/plugins/buddypress/readme.txt +++ b/wp-content/plugins/buddypress/readme.txt @@ -1,13 +1,13 @@ === BuddyPress === 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.3.1 -Stable tag: 2.3.5 +Requires at least: 4.1 +Tested up to: 4.5 +Stable tag: 2.5.2 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html -BuddyPress helps you run any kind of social network on your WordPress, with member profiles, activity streams, user groups, messaging, and more. +BuddyPress helps you build any type of community website using WordPress, with member profiles, activity streams, user groups, messaging, and more. == Description == @@ -114,10 +114,28 @@ BuddyPress is free software, built by an international community of volunteers. 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! +Please consider helping translate BuddyPress at our <a href="https://translate.wordpress.org/projects/wp-plugins/buddypress">GlotPress project</a>. Growing the BuddyPress community means better software for everyone! == Upgrade Notice == += 2.5.1 = +See: https://codex.buddypress.org/releases/version-2-5-1/ + += 2.5 = +See: https://codex.buddypress.org/releases/version-2-5-0/ + += 2.4.3 = +See: https://codex.buddypress.org/releases/version-2-4-3/ + += 2.4.2 = +See: https://codex.buddypress.org/releases/version-2-4-2/ + += 2.4.1 = +See: https://codex.buddypress.org/releases/version-2-4-1/ + += 2.4 = +See: https://codex.buddypress.org/releases/version-2-4-0/ + = 2.3.5 = See: https://codex.buddypress.org/releases/version-2-3-5/ @@ -228,6 +246,24 @@ Fixes over 10 bugs. == Changelog == += 2.5.1 = +See: https://codex.buddypress.org/releases/version-2-5-1/ + += 2.5 = +See: https://codex.buddypress.org/releases/version-2-5-0/ + += 2.4.3 = +See: https://codex.buddypress.org/releases/version-2-4-3/ + += 2.4.2 = +See: https://codex.buddypress.org/releases/version-2-4-2/ + += 2.4.1 = +See: https://codex.buddypress.org/releases/version-2-4-1/ + += 2.4 = +See: https://codex.buddypress.org/releases/version-2-4-0/ + = 2.3.5 = See: https://codex.buddypress.org/releases/version-2-3-5/ @@ -243,7 +279,7 @@ See: https://codex.buddypress.org/releases/version-2-3-2/ = 2.3.1 = See: https://codex.buddypress.org/releases/version-2-3-1/ -= 2.3.0 = += 2.3 = See: https://codex.buddypress.org/releases/version-2-3-0/ = 2.2.1 =