BuddyPress - Version 7.0.0-RC2

Version Description

= 6.4.0 = See: https://codex.buddypress.org/releases/version-6-4-0/

= 6.3.0 = See: https://codex.buddypress.org/releases/version-6-3-0/

= 6.2.0 = See: https://codex.buddypress.org/releases/version-6-2-0/

= 6.1.0 = See: https://codex.buddypress.org/releases/version-6-1-0/

= 6.0.0 = See: https://codex.buddypress.org/releases/version-6-0-0/

= 5.2.0 = See: https://codex.buddypress.org/releases/version-5-2-0/

= 5.1.2 = See: https://codex.buddypress.org/releases/version-5-1-2/

= 5.1.1 = See: https://codex.buddypress.org/releases/version-5-1-1/

= 5.1.0 = See: https://codex.buddypress.org/releases/version-5-1-0/

= 5.0.0 = See: https://codex.buddypress.org/releases/version-5-0-0/

= 4.4.0 = See: https://codex.buddypress.org/releases/version-4-4-0/

= 4.3.0 = See: https://codex.buddypress.org/releases/version-4-3-0/

= 4.2.0 = See: https://codex.buddypress.org/releases/version-4-2-0/

= 4.1.0 = See: https://codex.buddypress.org/releases/version-4-1-0/

= 4.0.0 = See: https://codex.buddypress.org/releases/version-4-0-0/

Download this release

Release Info

Developer imath
Plugin Icon 128x128 BuddyPress
Version 7.0.0-RC2
Comparing to
See all releases

Code changes from version 6.4.0 to 7.0.0-RC2

Files changed (173) hide show
  1. bp-activity/admin/css/admin-rtl.css +5 -0
  2. bp-activity/admin/css/admin-rtl.min.css +1 -1
  3. bp-activity/admin/css/admin.css +5 -0
  4. bp-activity/admin/css/admin.min.css +1 -1
  5. bp-activity/bp-activity-admin.php +138 -28
  6. bp-activity/bp-activity-blocks.php +33 -0
  7. bp-activity/bp-activity-embeds.php +1 -1
  8. bp-activity/bp-activity-filters.php +18 -14
  9. bp-activity/bp-activity-functions.php +3 -3
  10. bp-activity/classes/class-bp-activity-component.php +31 -1
  11. bp-activity/classes/class-bp-activity-list-table.php +9 -8
  12. bp-activity/classes/class-bp-activity-query.php +1 -1
  13. bp-activity/classes/class-bp-akismet.php +1 -1
  14. bp-activity/classes/class-bp-rest-activity-endpoint.php +22 -12
  15. bp-activity/js/blocks/embed-activity.js +20 -0
  16. bp-activity/js/blocks/embed-activity.js.map +1 -0
  17. bp-activity/js/mentions.js +1 -1
  18. bp-activity/js/mentions.min.js +1 -1
  19. bp-blogs/bp-blogs-filters.php +25 -0
  20. bp-blogs/bp-blogs-functions.php +143 -5
  21. bp-blogs/bp-blogs-template.php +211 -190
  22. bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php +23 -12
  23. bp-blogs/classes/class-bp-rest-blogs-endpoint.php +237 -8
  24. bp-core/admin/bp-core-admin-components.php +2 -1
  25. bp-core/admin/bp-core-admin-functions.php +139 -67
  26. bp-core/admin/bp-core-admin-settings.php +3 -2
  27. bp-core/admin/bp-core-admin-slugs.php +5 -4
  28. bp-core/admin/bp-core-admin-tools.php +78 -11
  29. bp-core/admin/bp-core-admin-types.php +298 -0
  30. bp-core/admin/css/common-rtl.css +2 -51
  31. bp-core/admin/css/common-rtl.min.css +1 -1
  32. bp-core/admin/css/common.css +2 -51
  33. bp-core/admin/css/common.min.css +1 -1
  34. bp-core/admin/js/types-admin.js +41 -0
  35. bp-core/admin/js/types-admin.min.js +1 -0
  36. bp-core/bp-core-actions.php +2 -1
  37. bp-core/bp-core-blocks.php +2 -1
  38. bp-core/bp-core-cache.php +25 -0
  39. bp-core/bp-core-caps.php +45 -3
  40. bp-core/bp-core-catchuri.php +1 -1
  41. bp-core/bp-core-dependency.php +15 -0
  42. bp-core/bp-core-filters.php +38 -0
  43. bp-core/bp-core-functions.php +293 -10
  44. bp-core/bp-core-moderation.php +34 -19
  45. bp-core/bp-core-rest-api.php +1 -1
  46. bp-core/bp-core-taxonomy.php +244 -21
  47. bp-core/bp-core-template-loader.php +24 -12
  48. bp-core/bp-core-template.php +1 -1
  49. bp-core/bp-core-theme-compatibility.php +1 -1
  50. bp-core/bp-core-wpabstraction.php +23 -2
  51. bp-core/classes/class-bp-admin-types.php +614 -0
  52. bp-core/classes/class-bp-admin.php +145 -97
  53. bp-core/classes/class-bp-core-notification.php +78 -43
  54. bp-core/classes/class-bp-core-user.php +5 -4
  55. bp-core/classes/class-bp-core.php +25 -4
  56. bp-core/classes/class-bp-embed.php +2 -7
  57. bp-core/classes/class-bp-invitation-manager.php +1 -1
  58. bp-core/classes/class-bp-rest-components-endpoint.php +4 -4
  59. bp-core/classes/class-bp-user-query.php +6 -4
  60. bp-core/classes/class-bp-walker-nav-menu-checklist.php +17 -0
  61. bp-core/classes/trait-attachments.php +20 -5
  62. bp-core/deprecated/7.0.php +45 -0
  63. bp-core/images/bp-blocks.gif +0 -0
  64. bp-core/images/bp-new-blocks.png +0 -0
  65. bp-core/images/bp-nouveau-2021.png +0 -0
  66. bp-core/images/bp-nouveau-wide-aligns.png +0 -0
  67. bp-core/images/bp-types-illustration.png +0 -0
  68. bp-core/images/mystery-blog-50.png +0 -0
  69. bp-core/images/mystery-blog.png +0 -0
  70. bp-core/js/block-components.js +1 -1
  71. bp-core/js/block-components.js.map +1 -1
  72. bp-friends/classes/class-bp-rest-friends-endpoint.php +7 -7
  73. bp-groups/bp-groups-admin.php +142 -66
  74. bp-groups/bp-groups-blocks.php +134 -2
  75. bp-groups/bp-groups-cssjs.php +1 -1
  76. bp-groups/bp-groups-filters.php +1 -3
  77. bp-groups/bp-groups-functions.php +285 -8
  78. bp-groups/bp-groups-template.php +118 -28
  79. bp-groups/bp-groups-widgets.php +2 -2
  80. bp-groups/classes/class-bp-groups-component.php +56 -5
  81. bp-groups/classes/class-bp-groups-group.php +2 -2
  82. bp-groups/classes/class-bp-groups-invite-template.php +2 -2
  83. bp-groups/classes/class-bp-groups-template.php +2 -0
  84. bp-groups/classes/class-bp-groups-widget.php +2 -2
  85. bp-groups/classes/class-bp-rest-group-invites-endpoint.php +6 -7
  86. bp-groups/classes/class-bp-rest-group-membership-endpoint.php +1 -1
  87. bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php +6 -6
  88. bp-groups/classes/class-bp-rest-groups-endpoint.php +239 -72
  89. bp-groups/css/blocks/group-rtl.css +43 -32
  90. bp-groups/css/blocks/group-rtl.min.css +1 -1
  91. bp-groups/css/blocks/group.css +43 -32
  92. bp-groups/css/blocks/group.min.css +1 -1
  93. bp-groups/css/blocks/groups-rtl.css +177 -0
  94. bp-groups/css/blocks/groups-rtl.min.css +1 -0
  95. bp-groups/css/blocks/groups.css +177 -0
  96. bp-groups/css/blocks/groups.min.css +1 -0
  97. bp-groups/js/blocks/group.js +7 -3
  98. bp-groups/js/blocks/group.js.map +1 -1
  99. bp-groups/js/blocks/groups.js +28 -0
  100. bp-groups/js/blocks/groups.js.map +1 -0
  101. bp-groups/sass/blocks/group.scss +153 -0
  102. bp-groups/sass/blocks/groups.scss +202 -0
  103. bp-groups/screens/single/admin/group-settings.php +2 -2
  104. bp-loader.php +2 -2
  105. bp-members/bp-members-admin.php +82 -0
  106. bp-members/bp-members-blocks.php +164 -1
  107. bp-members/bp-members-functions.php +330 -30
  108. bp-members/bp-members-template.php +199 -21
  109. bp-members/classes/class-bp-core-members-template.php +94 -34
  110. bp-members/classes/class-bp-members-admin.php +84 -108
  111. bp-members/classes/class-bp-members-component.php +56 -0
  112. bp-members/classes/class-bp-rest-members-endpoint.php +261 -50
  113. bp-members/classes/class-bp-rest-signup-endpoint.php +2 -2
  114. bp-members/classes/class-bp-signup.php +3 -3
  115. bp-members/css/blocks/member-rtl.css +39 -27
  116. bp-members/css/blocks/member-rtl.min.css +1 -1
  117. bp-members/css/blocks/member.css +39 -27
  118. bp-members/css/blocks/member.min.css +1 -1
  119. bp-members/css/blocks/members-rtl.css +199 -0
  120. bp-members/css/blocks/members-rtl.min.css +1 -0
  121. bp-members/css/blocks/members.css +199 -0
  122. bp-members/css/blocks/members.min.css +1 -0
  123. bp-members/js/blocks/member.js +7 -3
  124. bp-members/js/blocks/member.js.map +1 -1
  125. bp-members/js/blocks/members.js +28 -0
  126. bp-members/js/blocks/members.js.map +1 -0
  127. bp-members/sass/blocks/member.scss +140 -0
  128. bp-members/sass/blocks/members.scss +227 -0
  129. bp-members/screens/register.php +21 -9
  130. bp-messages/bp-messages-filters.php +6 -6
  131. bp-messages/classes/class-bp-messages-notices-admin.php +3 -11
  132. bp-messages/classes/class-bp-rest-messages-endpoint.php +1 -1
  133. bp-notifications/classes/class-bp-notifications-notification.php +6 -2
  134. bp-notifications/classes/class-bp-rest-notifications-endpoint.php +4 -4
  135. bp-settings/actions/general.php +14 -30
  136. bp-settings/bp-settings-functions.php +6 -6
  137. bp-settings/classes/class-bp-settings-component.php +2 -2
  138. bp-templates/bp-legacy/buddypress/activity/entry.php +1 -1
  139. bp-templates/bp-legacy/buddypress/blogs/create.php +30 -26
  140. bp-templates/bp-legacy/buddypress/groups/groups-loop.php +8 -1
  141. bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php +6 -1
  142. bp-templates/bp-legacy/buddypress/groups/single/group-header.php +6 -1
  143. bp-templates/bp-legacy/css/buddypress-rtl.css +14 -0
  144. bp-templates/bp-legacy/css/buddypress-rtl.min.css +1 -1
  145. bp-templates/bp-legacy/css/buddypress.css +14 -0
  146. bp-templates/bp-legacy/css/buddypress.min.css +1 -1
  147. bp-templates/bp-legacy/js/buddypress.js +1 -1
  148. bp-templates/bp-legacy/js/buddypress.min.js +1 -1
  149. bp-templates/bp-legacy/js/password-verify.js +6 -1
  150. bp-templates/bp-legacy/js/password-verify.min.js +1 -1
  151. bp-templates/bp-nouveau/buddypress-functions.php +27 -0
  152. bp-templates/bp-nouveau/buddypress/activity/comment-form.php +1 -1
  153. bp-templates/bp-nouveau/buddypress/activity/comment.php +6 -2
  154. bp-templates/bp-nouveau/buddypress/groups/groups-loop.php +36 -35
  155. bp-templates/bp-nouveau/buddypress/groups/single/admin/group-cover-image.php +3 -3
  156. bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php +40 -18
  157. bp-templates/bp-nouveau/buddypress/groups/single/group-header.php +28 -11
  158. bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php +15 -2
  159. bp-templates/bp-nouveau/buddypress/members/single/member-header.php +14 -1
  160. bp-templates/bp-nouveau/buddypress/members/single/settings/delete-account.php +3 -3
  161. bp-templates/bp-nouveau/common-styles/_bp_blogs_loop.scss +13 -0
  162. bp-templates/bp-nouveau/common-styles/_bp_buttons.scss +1 -0
  163. bp-templates/bp-nouveau/common-styles/_bp_forms.scss +3 -3
  164. bp-templates/bp-nouveau/common-styles/_bp_generic_and_typography.scss +6 -3
  165. bp-templates/bp-nouveau/common-styles/_bp_group_header.scss +11 -1
  166. bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss +27 -17
  167. bp-templates/bp-nouveau/common-styles/_bp_layouts.scss +3 -3
  168. bp-templates/bp-nouveau/common-styles/_bp_navigation.scss +3 -5
  169. bp-templates/bp-nouveau/common-styles/_bp_search.scss +3 -3
  170. bp-templates/bp-nouveau/common-styles/_bp_tables.scss +3 -2
  171. bp-templates/bp-nouveau/common-styles/_bp_user_header.scss +30 -10
  172. bp-templates/bp-nouveau/css/buddypress-rtl.css +66 -13
  173. bp-templates/bp-nouveau/css/buddypress-rtl.min.css +1 -1
bp-activity/admin/css/admin-rtl.css CHANGED
@@ -97,6 +97,11 @@
97
  width: 12%;
98
  }
99
 
 
 
 
 
 
100
  @media screen and (max-width: 782px) {
101
 
102
  body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
97
  width: 12%;
98
  }
99
 
100
+ ul.bp-activity-delete-list {
101
+ list-style-type: disc;
102
+ margin: 4px 26px;
103
+ }
104
+
105
  @media screen and (max-width: 782px) {
106
 
107
  body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
bp-activity/admin/css/admin-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:left}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-bottom:5px;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:left}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-bottom:5px;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}ul.bp-activity-delete-list{list-style-type:disc;margin:4px 26px}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
bp-activity/admin/css/admin.css CHANGED
@@ -97,6 +97,11 @@
97
  width: 12%;
98
  }
99
 
 
 
 
 
 
100
  @media screen and (max-width: 782px) {
101
 
102
  body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
97
  width: 12%;
98
  }
99
 
100
+ ul.bp-activity-delete-list {
101
+ list-style-type: disc;
102
+ margin: 4px 26px;
103
+ }
104
+
105
  @media screen and (max-width: 782px) {
106
 
107
  body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
bp-activity/admin/css/admin.min.css CHANGED
@@ -1 +1 @@
1
- .akismet-status{float:right}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-bottom:5px;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
1
+ .akismet-status{float:right}.akismet-status a{color:#aaa;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-bottom:5px;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}ul.bp-activity-delete-list{list-style-type:disc;margin:4px 26px}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
bp-activity/bp-activity-admin.php CHANGED
@@ -85,12 +85,12 @@ function bp_activity_admin_reply() {
85
 
86
  // Check that a reply has been entered.
87
  if ( empty( $_REQUEST['content'] ) )
88
- die( __( 'ERROR: Please type a reply.', 'buddypress' ) );
89
 
90
  // Check parent activity exists.
91
  $parent_activity = new BP_Activity_Activity( $parent_id );
92
  if ( empty( $parent_activity->component ) )
93
- die( __( 'ERROR: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) );
94
 
95
  // @todo: Check if user is allowed to create new activity items
96
  // if ( ! current_user_can( 'bp_new_activity' ) )
@@ -323,14 +323,14 @@ function bp_activity_admin_load() {
323
  do_action( 'bp_activity_admin_enqueue_scripts' );
324
 
325
  // Handle spam/un-spam/delete of activities.
326
- if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) {
327
 
328
  // Build redirection URL.
329
  $redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() );
330
  $redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to );
331
 
332
  // Get activity IDs.
333
- $activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] );
334
 
335
  /**
336
  * Filters list of IDs being spammed/un-spammed/deleted.
@@ -349,7 +349,11 @@ function bp_activity_admin_load() {
349
  // Trim 'bulk_' off the action name to avoid duplicating a ton of code.
350
  $doaction = substr( $doaction, 5 );
351
 
352
- // This is a request to delete, spam, or un-spam, a single item.
 
 
 
 
353
  } elseif ( !empty( $_REQUEST['aid'] ) ) {
354
 
355
  // Check this is a valid form submission.
@@ -375,31 +379,37 @@ function bp_activity_admin_load() {
375
  }
376
 
377
  switch ( $doaction ) {
378
- case 'delete' :
379
- if ( 'activity_comment' == $activity->type )
380
- bp_activity_delete_comment( $activity->item_id, $activity->id );
381
- else
382
- bp_activity_delete( array( 'id' => $activity->id ) );
383
-
384
- $deleted++;
 
 
 
 
 
385
  break;
386
 
387
  case 'ham' :
388
  /**
389
- * Remove moderation and blacklist checks in case we want to ham an activity
390
  * which contains one of these listed keys.
391
  */
392
  remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2 );
393
- remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2 );
394
 
395
  bp_activity_mark_as_ham( $activity );
396
  $result = $activity->save();
397
 
398
  // Check for any error during activity save.
399
- if ( ! $result )
400
  $errors[] = $activity->id;
401
- else
402
  $unspammed++;
 
403
  break;
404
 
405
  case 'spam' :
@@ -407,10 +417,11 @@ function bp_activity_admin_load() {
407
  $result = $activity->save();
408
 
409
  // Check for any error during activity save.
410
- if ( ! $result )
411
  $errors[] = $activity->id;
412
- else
413
  $spammed++;
 
414
  break;
415
 
416
  default:
@@ -435,18 +446,22 @@ function bp_activity_admin_load() {
435
  do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids );
436
 
437
  // Add arguments to the redirect URL so that on page reload, we can easily display what we've just done.
438
- if ( $spammed )
439
  $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
 
440
 
441
- if ( $unspammed )
442
  $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
 
443
 
444
- if ( $deleted )
445
  $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
 
446
 
447
  // If an error occurred, pass back the activity ID that failed.
448
- if ( ! empty( $errors ) )
449
  $redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
 
450
 
451
  /**
452
  * Filters redirect URL after activity spamming/un-spamming/deletion occurs.
@@ -604,17 +619,100 @@ function bp_activity_admin_load() {
604
  */
605
  function bp_activity_admin() {
606
  // Decide whether to load the index or edit screen.
607
- $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
608
 
609
  // Display the single activity edit screen.
610
- if ( 'edit' == $doaction && ! empty( $_GET['aid'] ) )
611
  bp_activity_admin_edit();
612
 
 
 
 
 
613
  // Otherwise, display the Activity index screen.
614
- else
615
  bp_activity_admin_index();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
616
  }
617
 
 
618
  /**
619
  * Display the single activity edit screen.
620
  *
@@ -660,13 +758,15 @@ function bp_activity_admin_edit() {
660
  do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
661
 
662
  <div class="wrap">
663
- <h1>
664
  <?php
665
  /* translators: %s: the activity ID */
666
  printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) );
667
  ?>
668
  </h1>
669
 
 
 
670
  <?php if ( ! empty( $activity ) ) : ?>
671
 
672
  <form action="<?php echo esc_url( $form_url ); ?>" id="bp-activities-edit-form" method="post">
@@ -741,6 +841,10 @@ function bp_activity_admin_edit() {
741
  * @param object $item Activity item.
742
  */
743
  function bp_activity_admin_edit_metabox_status( $item ) {
 
 
 
 
744
  ?>
745
 
746
  <div class="submitbox" id="submitcomment">
@@ -783,6 +887,10 @@ function bp_activity_admin_edit_metabox_status( $item ) {
783
  </div><!-- #minor-publishing -->
784
 
785
  <div id="major-publishing-actions">
 
 
 
 
786
  <div id="publishing-action">
787
  <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false ); ?>
788
  </div>
@@ -1045,7 +1153,7 @@ function bp_activity_admin_index() {
1045
  do_action( 'bp_activity_admin_index', $messages ); ?>
1046
 
1047
  <div class="wrap">
1048
- <h1>
1049
  <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
1050
  <?php
1051
  /* translators: %s: the activity ID */
@@ -1065,9 +1173,11 @@ function bp_activity_admin_index() {
1065
  <?php endif; ?>
1066
  </h1>
1067
 
 
 
1068
  <?php // If the user has just made a change to an activity item, display the status messages. ?>
1069
  <?php if ( !empty( $messages ) ) : ?>
1070
- <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
1071
  <?php endif; ?>
1072
 
1073
  <?php // Display each activity on its own row. ?>
85
 
86
  // Check that a reply has been entered.
87
  if ( empty( $_REQUEST['content'] ) )
88
+ die( __( 'Error: Please type a reply.', 'buddypress' ) );
89
 
90
  // Check parent activity exists.
91
  $parent_activity = new BP_Activity_Activity( $parent_id );
92
  if ( empty( $parent_activity->component ) )
93
+ die( __( 'Error: The item you are trying to reply to cannot be found, or it has been deleted.', 'buddypress' ) );
94
 
95
  // @todo: Check if user is allowed to create new activity items
96
  // if ( ! current_user_can( 'bp_new_activity' ) )
323
  do_action( 'bp_activity_admin_enqueue_scripts' );
324
 
325
  // Handle spam/un-spam/delete of activities.
326
+ if ( ! empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', 'delete', 'bulk_delete' ) ) ) {
327
 
328
  // Build redirection URL.
329
  $redirect_to = remove_query_arg( array( 'aid', 'deleted', 'error', 'spammed', 'unspammed', ), wp_get_referer() );
330
  $redirect_to = add_query_arg( 'paged', $bp_activity_list_table->get_pagenum(), $redirect_to );
331
 
332
  // Get activity IDs.
333
+ $activity_ids = wp_parse_id_list( $_REQUEST['aid'] );
334
 
335
  /**
336
  * Filters list of IDs being spammed/un-spammed/deleted.
349
  // Trim 'bulk_' off the action name to avoid duplicating a ton of code.
350
  $doaction = substr( $doaction, 5 );
351
 
352
+ // This is a request to delete single or multiple item.
353
+ } elseif ( 'do_delete' === $doaction && ! empty( $_REQUEST['aid'] ) ) {
354
+ check_admin_referer( 'bp-activities-delete' );
355
+
356
+ // This is a request to spam, or un-spam, a single item.
357
  } elseif ( !empty( $_REQUEST['aid'] ) ) {
358
 
359
  // Check this is a valid form submission.
379
  }
380
 
381
  switch ( $doaction ) {
382
+ case 'do_delete' :
383
+ if ( 'activity_comment' === $activity->type ) {
384
+ $delete_result = bp_activity_delete_comment( $activity->item_id, $activity->id );
385
+ } else {
386
+ $delete_result = bp_activity_delete( array( 'id' => $activity->id ) );
387
+ }
388
+
389
+ if ( ! $delete_result ) {
390
+ $errors[] = $activity->id;
391
+ } else {
392
+ $deleted++;
393
+ }
394
  break;
395
 
396
  case 'ham' :
397
  /**
398
+ * Remove moderation and disallowed keyword checks in case we want to ham an activity
399
  * which contains one of these listed keys.
400
  */
401
  remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2 );
402
+ remove_action( 'bp_activity_before_save', 'bp_activity_check_disallowed_keys', 2 );
403
 
404
  bp_activity_mark_as_ham( $activity );
405
  $result = $activity->save();
406
 
407
  // Check for any error during activity save.
408
+ if ( ! $result ) {
409
  $errors[] = $activity->id;
410
+ } else {
411
  $unspammed++;
412
+ }
413
  break;
414
 
415
  case 'spam' :
417
  $result = $activity->save();
418
 
419
  // Check for any error during activity save.
420
+ if ( ! $result ) {
421
  $errors[] = $activity->id;
422
+ } else {
423
  $spammed++;
424
+ }
425
  break;
426
 
427
  default:
446
  do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids );
447
 
448
  // Add arguments to the redirect URL so that on page reload, we can easily display what we've just done.
449
+ if ( $spammed ) {
450
  $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
451
+ }
452
 
453
+ if ( $unspammed ) {
454
  $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
455
+ }
456
 
457
+ if ( $deleted ) {
458
  $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
459
+ }
460
 
461
  // If an error occurred, pass back the activity ID that failed.
462
+ if ( ! empty( $errors ) ) {
463
  $redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to );
464
+ }
465
 
466
  /**
467
  * Filters redirect URL after activity spamming/un-spamming/deletion occurs.
619
  */
620
  function bp_activity_admin() {
621
  // Decide whether to load the index or edit screen.
622
+ $doaction = bp_admin_list_table_current_bulk_action();
623
 
624
  // Display the single activity edit screen.
625
+ if ( 'edit' === $doaction && ! empty( $_GET['aid'] ) ) {
626
  bp_activity_admin_edit();
627
 
628
+ // Display the activty delete confirmation screen.
629
+ } elseif ( in_array( $doaction, array( 'bulk_delete', 'delete' ) ) && ! empty( $_GET['aid'] ) ) {
630
+ bp_activity_admin_delete();
631
+
632
  // Otherwise, display the Activity index screen.
633
+ } else {
634
  bp_activity_admin_index();
635
+ }
636
+ }
637
+
638
+ /**
639
+ * Display the Activity delete confirmation screen.
640
+ *
641
+ * @since 7.0.0
642
+ */
643
+ function bp_activity_admin_delete() {
644
+
645
+ if ( ! bp_current_user_can( 'bp_moderate' ) ) {
646
+ die( '-1' );
647
+ }
648
+
649
+ $activity_ids = isset( $_REQUEST['aid'] ) ? $_REQUEST['aid'] : 0;
650
+
651
+ if ( ! is_array( $activity_ids ) ) {
652
+ $activity_ids = explode( ',', $activity_ids );
653
+ }
654
+
655
+ $activities = bp_activity_get( array(
656
+ 'in' => $activity_ids,
657
+ 'show_hidden' => true,
658
+ 'spam' => 'all',
659
+ 'display_comments' => 0,
660
+ 'per_page' => null
661
+ ) );
662
+
663
+ // Create a new list of activity ids, based on those that actually exist.
664
+ $aids = array();
665
+ foreach ( $activities['activities'] as $activity ) {
666
+ $aids[] = $activity->id;
667
+ }
668
+
669
+ $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'aid' ), $_SERVER['REQUEST_URI'] ); ?>
670
+
671
+ <div class="wrap">
672
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Delete Activities', 'buddypress' ) ?></h1>
673
+ <hr class="wp-header-end">
674
+
675
+ <p><?php esc_html_e( 'You are about to delete the following activities:', 'buddypress' ) ?></p>
676
+
677
+ <ul class="bp-activity-delete-list">
678
+ <?php foreach ( $activities['activities'] as $activity ) : ?>
679
+ <li>
680
+ <?php
681
+ $actions = bp_activity_admin_get_activity_actions();
682
+
683
+ if ( isset( $actions[ $activity->type ] ) ) {
684
+ $activity_type = $actions[ $activity->type ];
685
+ } else {
686
+ /* translators: %s: the name of the activity type */
687
+ $activity_type = sprintf( __( 'Unregistered action - %s', 'buddypress' ), $activity->type );
688
+ }
689
+
690
+ printf(
691
+ /* translators: 1: activity type. 2: activity author. 3: activity date and time. */
692
+ __( '"%1$s" activity submitted by %2$s on %3$s', 'buddypress' ),
693
+ esc_html( $activity_type ),
694
+ bp_core_get_userlink( $activity->user_id ),
695
+ sprintf(
696
+ '<a href="%1$s">%2$s</a>',
697
+ esc_url( bp_activity_get_permalink( $activity->id, $activity ) ),
698
+ date_i18n( bp_get_option( 'date_format' ), strtotime( $activity->date_recorded ) )
699
+ )
700
+ );
701
+ ?>
702
+ </li>
703
+ <?php endforeach; ?>
704
+ </ul>
705
+
706
+ <p><strong><?php esc_html_e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p>
707
+
708
+ <a class="button-primary" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'aid' => implode( ',', $aids ) ), $base_url ), 'bp-activities-delete' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ) ?></a>
709
+ <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php esc_html_e( 'Cancel', 'buddypress' ) ?></a>
710
+ </div>
711
+
712
+ <?php
713
  }
714
 
715
+
716
  /**
717
  * Display the single activity edit screen.
718
  *
758
  do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?>
759
 
760
  <div class="wrap">
761
+ <h1 class="wp-heading-inline">
762
  <?php
763
  /* translators: %s: the activity ID */
764
  printf( __( 'Editing Activity (ID #%s)', 'buddypress' ), number_format_i18n( (int) $_REQUEST['aid'] ) );
765
  ?>
766
  </h1>
767
 
768
+ <hr class="wp-header-end">
769
+
770
  <?php if ( ! empty( $activity ) ) : ?>
771
 
772
  <form action="<?php echo esc_url( $form_url ); ?>" id="bp-activities-edit-form" method="post">
841
  * @param object $item Activity item.
842
  */
843
  function bp_activity_admin_edit_metabox_status( $item ) {
844
+ $base_url = add_query_arg( array(
845
+ 'page' => 'bp-activity',
846
+ 'aid' => $item->id
847
+ ), bp_get_admin_url( 'admin.php' ) );
848
  ?>
849
 
850
  <div class="submitbox" id="submitcomment">
887
  </div><!-- #minor-publishing -->
888
 
889
  <div id="major-publishing-actions">
890
+ <div id="delete-action">
891
+ <a class="submitdelete deletion" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-activities-delete' ) ); ?>"><?php esc_html_e( 'Delete Permanently', 'buddypress' ) ?></a>
892
+ </div>
893
+
894
  <div id="publishing-action">
895
  <?php submit_button( __( 'Update', 'buddypress' ), 'primary', 'save', false ); ?>
896
  </div>
1153
  do_action( 'bp_activity_admin_index', $messages ); ?>
1154
 
1155
  <div class="wrap">
1156
+ <h1 class="wp-heading-inline">
1157
  <?php if ( !empty( $_REQUEST['aid'] ) ) : ?>
1158
  <?php
1159
  /* translators: %s: the activity ID */
1173
  <?php endif; ?>
1174
  </h1>
1175
 
1176
+ <hr class="wp-header-end">
1177
+
1178
  <?php // If the user has just made a change to an activity item, display the status messages. ?>
1179
  <?php if ( !empty( $messages ) ) : ?>
1180
+ <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
1181
  <?php endif; ?>
1182
 
1183
  <?php // Display each activity on its own row. ?>
bp-activity/bp-activity-blocks.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BP Activity Blocks Functions.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage ActvityBlocks
7
+ * @since 7.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * Add BP Activity blocks specific settings to the BP Blocks Editor ones.
17
+ *
18
+ * @since 7.0.0
19
+ *
20
+ * @param array $bp_editor_settings BP blocks editor settings.
21
+ * @return array BP Activity blocks editor settings.
22
+ */
23
+ function bp_activity_editor_settings( $bp_editor_settings = array() ) {
24
+ return array_merge(
25
+ $bp_editor_settings,
26
+ array(
27
+ 'activity' => array(
28
+ 'embedScriptURL' => includes_url( 'js/wp-embed.min.js' ),
29
+ ),
30
+ )
31
+ );
32
+ }
33
+ add_filter( 'bp_blocks_editor_settings', 'bp_activity_editor_settings' );
bp-activity/bp-activity-embeds.php CHANGED
@@ -267,7 +267,7 @@ EOD;
267
  $float_width = 350;
268
 
269
  // Set up thumb.
270
- $content = sprintf( '<div class="thumb" style="max-width:%1$spx">%2$s<a href="%3$s" rel="nofollow" onclick="top.location.href=\'%3$s\'"><img src="%4$s" /></a></div>', $thumb_width, $play_icon, esc_url( $url ), esc_url( $thumbnail ) );
271
 
272
  // Show title.
273
  if ( isset( $oembed->title ) ) {
267
  $float_width = 350;
268
 
269
  // Set up thumb.
270
+ $content = sprintf( '<div class="thumb" style="max-width:%1$spx">%2$s<a href="%3$s" rel="nofollow" onclick="top.location.href=\'%3$s\'"><img loading="lazy" src="%4$s" alt="" /></a></div>', $thumb_width, $play_icon, esc_url( $url ), esc_url( $thumbnail ) );
271
 
272
  // Show title.
273
  if ( isset( $oembed->title ) ) {
bp-activity/bp-activity-filters.php CHANGED
@@ -31,9 +31,7 @@ add_filter( 'bp_get_activity_feed_item_description', 'force_balance_tags' );
31
  add_filter( 'bp_activity_content_before_save', 'force_balance_tags' );
32
  add_filter( 'bp_activity_action_before_save', 'force_balance_tags' );
33
 
34
- if ( function_exists( 'wp_encode_emoji' ) ) {
35
- add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );
36
- }
37
 
38
  add_filter( 'bp_get_activity_action', 'wptexturize' );
39
  add_filter( 'bp_get_activity_content_body', 'wptexturize' );
@@ -93,6 +91,9 @@ add_filter( 'bp_get_activity_latest_update', 'bp_activity_make_nofollow_
93
  add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' );
94
  add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
95
 
 
 
 
96
  add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
97
  add_filter( 'the_content', 'bp_activity_at_name_filter' );
98
  add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_at_name_filter' );
@@ -117,7 +118,7 @@ add_action( 'bp_activity_before_save', 'bp_activity_at_name_filter_updates' );
117
 
118
  // Activity stream moderation.
119
  add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
120
- add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2, 1 );
121
 
122
  /** Functions *****************************************************************/
123
 
@@ -170,13 +171,13 @@ function bp_activity_check_moderation_keys( $activity ) {
170
  }
171
 
172
  /**
173
- * Mark the posted activity as spam, if it contains blacklist keywords.
174
  *
175
- * @since 1.6.0
176
  *
177
  * @param BP_Activity_Activity $activity The activity object to check.
178
  */
179
- function bp_activity_check_blacklist_keys( $activity ) {
180
 
181
  // Only check specific types of activity updates.
182
  if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) {
@@ -185,9 +186,9 @@ function bp_activity_check_blacklist_keys( $activity ) {
185
 
186
  // Send back the error so activity update fails.
187
  // @todo This is temporary until some kind of trash status is built.
188
- $blacklist = bp_core_check_for_blacklist( $activity->user_id, '', $activity->content, 'wp_error' );
189
- if ( is_wp_error( $blacklist ) ) {
190
- $activity->errors = $blacklist;
191
 
192
  // Backpat.
193
  $activity->component = false;
@@ -376,17 +377,20 @@ function bp_activity_make_nofollow_filter( $text ) {
376
  }
377
 
378
  /**
379
- * Add rel=nofollow to a link.
380
  *
381
- * @since 1.2.0
 
382
  *
383
  * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter().
384
  * @return string $text Link with rel=nofollow added.
385
  */
386
  function bp_activity_make_nofollow_filter_callback( $matches ) {
387
  $text = $matches[1];
388
- $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
389
- return "<a $text rel=\"nofollow\">";
 
 
390
  }
391
 
392
  /**
31
  add_filter( 'bp_activity_content_before_save', 'force_balance_tags' );
32
  add_filter( 'bp_activity_action_before_save', 'force_balance_tags' );
33
 
34
+ add_filter( 'bp_activity_content_before_save', 'wp_encode_emoji' );
 
 
35
 
36
  add_filter( 'bp_get_activity_action', 'wptexturize' );
37
  add_filter( 'bp_get_activity_content_body', 'wptexturize' );
91
  add_filter( 'bp_get_activity_latest_update_excerpt', 'bp_activity_make_nofollow_filter' );
92
  add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_filter' );
93
 
94
+ add_filter( 'bp_get_activity_content_body', 'bp_core_add_loading_lazy_attribute' );
95
+ add_filter( 'bp_activity_comment_content', 'bp_core_add_loading_lazy_attribute' );
96
+
97
  add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' );
98
  add_filter( 'the_content', 'bp_activity_at_name_filter' );
99
  add_filter( 'bp_activity_get_embed_excerpt', 'bp_activity_at_name_filter' );
118
 
119
  // Activity stream moderation.
120
  add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
121
+ add_action( 'bp_activity_before_save', 'bp_activity_check_disallowed_keys', 2, 1 );
122
 
123
  /** Functions *****************************************************************/
124
 
171
  }
172
 
173
  /**
174
+ * Mark the posted activity as spam, if it contains disallowed keywords.
175
  *
176
+ * @since 7.0.0
177
  *
178
  * @param BP_Activity_Activity $activity The activity object to check.
179
  */
180
+ function bp_activity_check_disallowed_keys( $activity ) {
181
 
182
  // Only check specific types of activity updates.
183
  if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) {
186
 
187
  // Send back the error so activity update fails.
188
  // @todo This is temporary until some kind of trash status is built.
189
+ $disallowed = bp_core_check_for_disallowed_keys( $activity->user_id, '', $activity->content, 'wp_error' );
190
+ if ( is_wp_error( $disallowed ) ) {
191
+ $activity->errors = $disallowed;
192
 
193
  // Backpat.
194
  $activity->component = false;
377
  }
378
 
379
  /**
380
+ * Adds `rel="nofollow ugc"` to a link.
381
  *
382
+ * @since 1.2.0 Adds the nofollow rel attribute.
383
+ * @since 7.0.0 Adds the ugc rel attribute.
384
  *
385
  * @param array $matches Items matched by preg_replace_callback() in bp_activity_make_nofollow_filter().
386
  * @return string $text Link with rel=nofollow added.
387
  */
388
  function bp_activity_make_nofollow_filter_callback( $matches ) {
389
  $text = $matches[1];
390
+
391
+ // The WP `make_clickable()` formatting function is adding the rel="nofollow" attribute.
392
+ $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'" ), '', $text );
393
+ return "<a $text rel=\"nofollow ugc\">";
394
  }
395
 
396
  /**
bp-activity/bp-activity-functions.php CHANGED
@@ -847,7 +847,7 @@ function bp_activity_get_types() {
847
  *
848
  * The "context" is the current view type, corresponding roughly to the
849
  * current component. Use this context to determine which activity actions
850
- * should be whitelisted for the filter dropdown.
851
  *
852
  * @since 2.8.0
853
  *
@@ -4143,7 +4143,7 @@ function bp_activity_transition_post_type_comment_status( $new_status, $old_stat
4143
  bp_activity_mark_as_ham( $activity );
4144
  }
4145
 
4146
- // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated.
4147
  $post_type_comment_action = $activity_comment_object->action_id;
4148
  $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) {
4149
  $activity_types[] = $post_type_comment_action;
@@ -4161,7 +4161,7 @@ function bp_activity_transition_post_type_comment_status( $new_status, $old_stat
4161
  // Restore the action.
4162
  add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
4163
 
4164
- // Remove the "new_blog_comment" activity type whitelist so we don't break anything.
4165
  remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
4166
  }
4167
  add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 );
847
  *
848
  * The "context" is the current view type, corresponding roughly to the
849
  * current component. Use this context to determine which activity actions
850
+ * should be permitted in the filter dropdown.
851
  *
852
  * @since 2.8.0
853
  *
4143
  bp_activity_mark_as_ham( $activity );
4144
  }
4145
 
4146
+ // Add "new_post_type_comment" to the allowed activity types, so that the activity's Akismet history is generated.
4147
  $post_type_comment_action = $activity_comment_object->action_id;
4148
  $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) {
4149
  $activity_types[] = $post_type_comment_action;
4161
  // Restore the action.
4162
  add_action( 'bp_activity_before_save', 'bp_blogs_sync_activity_edit_to_post_comment', 20 );
4163
 
4164
+ // Remove the dynamic permitting of the "new_blog_comment" activity type so we don't break anything.
4165
  remove_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
4166
  }
4167
  add_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 );
bp-activity/classes/class-bp-activity-component.php CHANGED
@@ -55,7 +55,8 @@ class BP_Activity_Component extends BP_Component {
55
  'adminbar',
56
  'template',
57
  'functions',
58
- 'cache'
 
59
  );
60
 
61
  // Notifications support.
@@ -472,4 +473,33 @@ class BP_Activity_Component extends BP_Component {
472
  public function rest_api_init( $controllers = array() ) {
473
  parent::rest_api_init( array( 'BP_REST_Activity_Endpoint' ) );
474
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  }
55
  'adminbar',
56
  'template',
57
  'functions',
58
+ 'cache',
59
+ 'blocks',
60
  );
61
 
62
  // Notifications support.
473
  public function rest_api_init( $controllers = array() ) {
474
  parent::rest_api_init( array( 'BP_REST_Activity_Endpoint' ) );
475
  }
476
+
477
+ /**
478
+ * Register the BP Activity Blocks.
479
+ *
480
+ * @since 7.0.0
481
+ *
482
+ * @param array $blocks Optional. See BP_Component::blocks_init() for
483
+ * description.
484
+ */
485
+ public function blocks_init( $blocks = array() ) {
486
+ parent::blocks_init(
487
+ array(
488
+ 'bp/embed-activity' => array(
489
+ 'name' => 'bp/embed-activity',
490
+ 'editor_script' => 'bp-embed-activity-block',
491
+ 'editor_script_url' => plugins_url( 'js/blocks/embed-activity.js', dirname( __FILE__ ) ),
492
+ 'editor_script_deps' => array(
493
+ 'wp-blocks',
494
+ 'wp-element',
495
+ 'wp-i18n',
496
+ 'wp-components',
497
+ 'wp-block-editor',
498
+ 'wp-data',
499
+ 'wp-compose',
500
+ ),
501
+ ),
502
+ )
503
+ );
504
+ }
505
  }
bp-activity/classes/class-bp-activity-list-table.php CHANGED
@@ -648,23 +648,24 @@ class BP_Activity_List_Table extends WP_List_Table {
648
  // Reply - JavaScript only; implemented by AJAX.
649
  if ( 'spam' != $item_status ) {
650
  if ( $this->can_comment( $item ) ) {
651
- $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', __( 'Reply', 'buddypress' ) );
652
  } else {
653
- $actions['reply'] = sprintf( '<span class="form-input-tip">%s</span>', __( 'Replies disabled', 'buddypress' ) );
654
  }
655
 
656
  // Edit.
657
- $actions['edit'] = sprintf( '<a href="%s">%s</a>', $edit_url, __( 'Edit', 'buddypress' ) );
658
  }
659
 
660
  // Spam/unspam.
661
- if ( 'spam' == $item_status )
662
- $actions['unspam'] = sprintf( '<a href="%s">%s</a>', $ham_url, __( 'Not Spam', 'buddypress' ) );
663
- else
664
- $actions['spam'] = sprintf( '<a href="%s">%s</a>', $spam_url, __( 'Spam', 'buddypress' ) );
 
665
 
666
  // Delete.
667
- $actions['delete'] = sprintf( '<a href="%s" onclick="%s">%s</a>', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddypress' ) ) . "'); ", __( 'Delete Permanently', 'buddypress' ) );
668
 
669
  // Start timestamp.
670
  echo '<div class="submitted-on">';
648
  // Reply - JavaScript only; implemented by AJAX.
649
  if ( 'spam' != $item_status ) {
650
  if ( $this->can_comment( $item ) ) {
651
+ $actions['reply'] = sprintf( '<a href="#" class="reply hide-if-no-js">%s</a>', esc_html__( 'Reply', 'buddypress' ) );
652
  } else {
653
+ $actions['reply'] = sprintf( '<span class="form-input-tip">%s</span>', esc_html__( 'Replies disabled', 'buddypress' ) );
654
  }
655
 
656
  // Edit.
657
+ $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), esc_html__( 'Edit', 'buddypress' ) );
658
  }
659
 
660
  // Spam/unspam.
661
+ if ( 'spam' == $item_status ) {
662
+ $actions['unspam'] = sprintf( '<a href="%s">%s</a>', esc_url( $ham_url ), esc_html__( 'Not Spam', 'buddypress' ) );
663
+ } else {
664
+ $actions['spam'] = sprintf( '<a href="%s">%s</a>', esc_url( $spam_url ), esc_html__( 'Spam', 'buddypress' ) );
665
+ }
666
 
667
  // Delete.
668
+ $actions['delete'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $delete_url ), esc_html__( 'Delete Permanently', 'buddypress' ) );
669
 
670
  // Start timestamp.
671
  echo '<div class="submitted-on">';
bp-activity/classes/class-bp-activity-query.php CHANGED
@@ -229,7 +229,7 @@ class BP_Activity_Query extends BP_Recursive_Query {
229
  /**
230
  * Validates a column name parameter.
231
  *
232
- * Column names are checked against a whitelist of known tables.
233
  * See {@link BP_Activity_Query::db_tables}.
234
  *
235
  * @since 2.2.0
229
  /**
230
  * Validates a column name parameter.
231
  *
232
+ * Column names are checked against a list of known tables.
233
  * See {@link BP_Activity_Query::db_tables}.
234
  *
235
  * @since 2.2.0
bp-activity/classes/class-bp-akismet.php CHANGED
@@ -562,7 +562,7 @@ class BP_Akismet {
562
  // Keys to ignore.
563
  $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
564
 
565
- // Loop through _SERVER args and remove whitelisted keys.
566
  foreach ( $_SERVER as $key => $value ) {
567
 
568
  // Key should not be ignored.
562
  // Keys to ignore.
563
  $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' );
564
 
565
+ // Loop through _SERVER args and remove specified keys.
566
  foreach ( $_SERVER as $key => $value ) {
567
 
568
  // Key should not be ignored.
bp-activity/classes/class-bp-rest-activity-endpoint.php CHANGED
@@ -164,7 +164,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
164
  $args['since'] = $request['after'];
165
  }
166
 
167
- if ( isset( $request['user_id'] ) ) {
168
  $args['filter']['user_id'] = $request['user_id'];
169
  }
170
 
@@ -173,6 +173,10 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
173
  $args['filter']['object'] = 'groups';
174
  $args['filter']['primary_id'] = $args['group_id'];
175
 
 
 
 
 
176
  $item_id = $args['group_id'];
177
  }
178
 
@@ -184,7 +188,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
184
  }
185
 
186
  if ( empty( $args['group_id'] ) && empty( $args['site_id'] ) ) {
187
- if ( isset( $request['component'] ) ) {
188
  $args['filter']['object'] = $request['component'];
189
  }
190
 
@@ -363,7 +367,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
363
  'bp_rest_create_activity_empty_content',
364
  __( 'Please, enter some content.', 'buddypress' ),
365
  array(
366
- 'status' => 500,
367
  )
368
  );
369
  }
@@ -421,7 +425,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
421
  array(
422
  'in' => $activity_id,
423
  'display_comments' => 'stream',
424
- 'show_hidden' => $request['hidden'],
425
  )
426
  );
427
 
@@ -432,6 +436,9 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
432
  return $fields_update;
433
  }
434
 
 
 
 
435
  $retval = array(
436
  $this->prepare_response_for_collection(
437
  $this->prepare_item_for_response( $activity, $request )
@@ -475,8 +482,8 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
475
  );
476
  }
477
 
478
- $item_id = $request['primary_item_id'];
479
- $component = $request['component'];
480
 
481
  if ( true === $retval && bp_is_active( 'groups' ) && buddypress()->groups->id === $component && ! is_null( $item_id ) ) {
482
  if ( ! $this->show_hidden( $component, $item_id ) ) {
@@ -517,7 +524,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
517
  'bp_rest_update_activity_empty_content',
518
  __( 'Please, enter some content.', 'buddypress' ),
519
  array(
520
- 'status' => 500,
521
  )
522
  );
523
  }
@@ -601,7 +608,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
601
  'bp_rest_authorization_required',
602
  __( 'Sorry, you are not allowed to update this activity.', 'buddypress' ),
603
  array(
604
- 'status' => 500,
605
  )
606
  );
607
  }
@@ -1239,7 +1246,7 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
1239
  * @return array Endpoint arguments.
1240
  */
1241
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
1242
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
1243
  $key = 'get_item';
1244
 
1245
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
@@ -1546,9 +1553,12 @@ class BP_REST_Activity_Endpoint extends WP_REST_Controller {
1546
 
1547
  $params['type'] = array(
1548
  'description' => __( 'Limit result set to items with a specific activity type.', 'buddypress' ),
1549
- 'type' => 'string',
1550
- 'enum' => array_keys( bp_activity_get_types() ),
1551
- 'sanitize_callback' => 'sanitize_key',
 
 
 
1552
  'validate_callback' => 'rest_validate_request_arg',
1553
  );
1554
 
164
  $args['since'] = $request['after'];
165
  }
166
 
167
+ if ( ! empty( $request['user_id'] ) ) {
168
  $args['filter']['user_id'] = $request['user_id'];
169
  }
170
 
173
  $args['filter']['object'] = 'groups';
174
  $args['filter']['primary_id'] = $args['group_id'];
175
 
176
+ if ( empty( $request['component'] ) ) {
177
+ $request['component'] = 'groups';
178
+ }
179
+
180
  $item_id = $args['group_id'];
181
  }
182
 
188
  }
189
 
190
  if ( empty( $args['group_id'] ) && empty( $args['site_id'] ) ) {
191
+ if ( ! empty( $request['component'] ) ) {
192
  $args['filter']['object'] = $request['component'];
193
  }
194
 
367
  'bp_rest_create_activity_empty_content',
368
  __( 'Please, enter some content.', 'buddypress' ),
369
  array(
370
+ 'status' => 400,
371
  )
372
  );
373
  }
425
  array(
426
  'in' => $activity_id,
427
  'display_comments' => 'stream',
428
+ 'show_hidden' => true,
429
  )
430
  );
431
 
436
  return $fields_update;
437
  }
438
 
439
+ // Update current user's last activity.
440
+ bp_update_user_last_activity();
441
+
442
  $retval = array(
443
  $this->prepare_response_for_collection(
444
  $this->prepare_item_for_response( $activity, $request )
482
  );
483
  }
484
 
485
+ $item_id = $request->get_param( 'primary_item_id' );
486
+ $component = $request->get_param( 'component' );
487
 
488
  if ( true === $retval && bp_is_active( 'groups' ) && buddypress()->groups->id === $component && ! is_null( $item_id ) ) {
489
  if ( ! $this->show_hidden( $component, $item_id ) ) {
524
  'bp_rest_update_activity_empty_content',
525
  __( 'Please, enter some content.', 'buddypress' ),
526
  array(
527
+ 'status' => 400,
528
  )
529
  );
530
  }
608
  'bp_rest_authorization_required',
609
  __( 'Sorry, you are not allowed to update this activity.', 'buddypress' ),
610
  array(
611
+ 'status' => rest_authorization_required_code(),
612
  )
613
  );
614
  }
1246
  * @return array Endpoint arguments.
1247
  */
1248
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
1249
+ $args = parent::get_endpoint_args_for_item_schema( $method );
1250
  $key = 'get_item';
1251
 
1252
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
1553
 
1554
  $params['type'] = array(
1555
  'description' => __( 'Limit result set to items with a specific activity type.', 'buddypress' ),
1556
+ 'type' => 'array',
1557
+ 'items' => array(
1558
+ 'enum' => array_keys( bp_activity_get_types() ),
1559
+ 'type' => 'string',
1560
+ ),
1561
+ 'sanitize_callback' => 'wp_parse_list',
1562
  'validate_callback' => 'rest_validate_request_arg',
1563
  );
1564
 
bp-activity/js/blocks/embed-activity.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"dEOc":[function(require,module,exports) {
2
+ function r(r){if(Array.isArray(r))return r}module.exports=r;
3
+ },{}],"RonT":[function(require,module,exports) {
4
+ function r(r,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var e=[],n=!0,o=!1,l=void 0;try{for(var i,u=r[Symbol.iterator]();!(n=(i=u.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(a){o=!0,l=a}finally{try{n||null==u.return||u.return()}finally{if(o)throw l}}return e}}module.exports=r;
5
+ },{}],"LGpM":[function(require,module,exports) {
6
+ function n(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,l=new Array(r);e<r;e++)l[e]=n[e];return l}module.exports=n;
7
+ },{}],"Vzqv":[function(require,module,exports) {
8
+ var r=require("./arrayLikeToArray");function t(t,e){if(t){if("string"==typeof t)return r(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(t,e):void 0}}module.exports=t;
9
+ },{"./arrayLikeToArray":"LGpM"}],"sa4T":[function(require,module,exports) {
10
+ function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e;
11
+ },{}],"xkYc":[function(require,module,exports) {
12
+ var r=require("./arrayWithHoles"),e=require("./iterableToArrayLimit"),t=require("./unsupportedIterableToArray"),i=require("./nonIterableRest");function u(u,a){return r(u)||e(u,a)||t(u,a)||i()}module.exports=u;
13
+ },{"./arrayWithHoles":"dEOc","./iterableToArrayLimit":"RonT","./unsupportedIterableToArray":"Vzqv","./nonIterableRest":"sa4T"}],"Sjre":[function(require,module,exports) {
14
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("@babel/runtime/helpers/slicedToArray"));function t(e){return e&&e.__esModule?e:{default:e}}var i=wp,r=i.element,n=r.createElement,o=r.Fragment,s=r.useState,l=i.i18n.__,a=i.components,d=a.Placeholder,u=a.Disabled,c=a.SandBox,p=a.Button,b=a.ExternalLink,m=a.Spinner,y=a.ToolbarGroup,v=a.ToolbarButton,h=i.compose.compose,f=i.data.withSelect,g=i.blockEditor,_=g.RichText,w=g.BlockControls,E=function(t){var i=t.attributes,r=t.setAttributes,a=t.isSelected,h=t.bpSettings,f=t.preview,g=t.fetching,E=i.url,k=i.caption,S=h.embedScriptURL,x=l("BuddyPress Activity URL","buddypress"),P=s(E),L=(0,e.default)(P,2),N=L[0],R=L[1],B=s(!E),T=(0,e.default)(B,2),U=T[0],A=T[1],C=n(w,null,n(y,null,n(v,{icon:"edit",title:l("Edit URL","buddypress"),onClick:function(e){e&&e.preventDefault(),A(!0)}})));return U?n(d,{icon:"buddicons-activity",label:x,className:"wp-block-embed",instructions:l("Paste the link to the activity content you want to display on your site.","buddypress")},n("form",{onSubmit:function(e){e&&e.preventDefault(),A(!1),r({url:N})}},n("input",{type:"url",value:N||"",className:"components-placeholder__input","aria-label":x,placeholder:l("Enter URL to embed here…","buddypress"),onChange:function(e){return R(e.target.value)}}),n(p,{isPrimary:!0,type:"submit"},l("Embed","buddypress"))),n("div",{className:"components-placeholder__learn-more"},n(b,{href:l("https://codex.buddypress.org/activity-embeds/")},l("Learn more about activity embeds","buddypress")))):g?n("div",{className:"wp-block-embed is-loading"},n(m,null),n("p",null,l("Embedding…","buddypress"))):f&&f.x_buddypress&&"activity"===f.x_buddypress?n(o,null,!U&&C,n("figure",{className:"wp-block-embed is-type-bp-activity"},n("div",{className:"wp-block-embed__wrapper"},n(u,null,n(c,{html:f&&f.html?f.html:"",scripts:[S]}))),(!_.isEmpty(k)||a)&&n(_,{tagName:"figcaption",placeholder:l("Write caption…","buddypress"),value:k,onChange:function(e){return r({caption:e})},inlineToolbar:!0}))):n(o,null,C,n(d,{icon:"buddicons-activity",label:x},n("p",{className:"components-placeholder__error"},l("The URL you provided is not a permalink to a public BuddyPress Activity. Please use another URL.","buddypress"))))},k=h([f(function(e,t){var i=t.attributes.url,r=e("core/editor").getEditorSettings(),n=e("core"),o=n.getEmbedPreview,s=n.isRequestingEmbedPreview,l=!!i&&o(i),a=!!i&&s(i);return{bpSettings:r.bp.activity||{},preview:l,fetching:a}})])(E),S=k;exports.default=S;
15
+ },{"@babel/runtime/helpers/slicedToArray":"xkYc"}],"zmBI":[function(require,module,exports) {
16
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=wp,t=e.blockEditor.RichText,a=e.element.createElement,r=function(e){var r=e.attributes,i=r.url,c=r.caption;return i?a("figure",{className:"wp-block-embed is-type-bp-activity"},a("div",{className:"wp-block-embed__wrapper"},"\n".concat(i,"\n")),!t.isEmpty(c)&&a(t.Content,{tagName:"figcaption",value:c})):null},i=r;exports.default=i;
17
+ },{}],"hBDw":[function(require,module,exports) {
18
+ "use strict";var t=i(require("./embed-activity/edit")),e=i(require("./embed-activity/save"));function i(t){return t&&t.__esModule?t:{default:t}}var s=wp,r=s.i18n.__,d=s.blocks.registerBlockType;d("bp/embed-activity",{title:r("Embed an activity","buddypress"),description:r("Add a block that displays the activity content pulled from this or other community sites.","buddypress"),icon:"buddicons-activity",category:"buddypress",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"}},supports:{align:!0},edit:t.default,save:e.default});
19
+ },{"./embed-activity/edit":"Sjre","./embed-activity/save":"zmBI"}]},{},["hBDw"], null)
20
+ //# sourceMappingURL=/bp-activity/js/blocks/embed-activity.js.map
bp-activity/js/blocks/embed-activity.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","bp-activity/js/blocks/embed-activity/edit.js","bp-activity/js/blocks/embed-activity/save.js","bp-activity/js/blocks/embed-activity.js"],"names":["editEmbedActivityBlock","wp","element","createElement","Fragment","useState","__","i18n","components","Placeholder","Disabled","SandBox","Button","ExternalLink","Spinner","ToolbarGroup","ToolbarButton","compose","withSelect","data","blockEditor","RichText","BlockControls","EditEmbedActivity","attributes","setAttributes","isSelected","bpSettings","preview","fetching","url","caption","embedScriptURL","label","value","setURL","isEditingURL","setIsEditingURL","editToolbar","event","preventDefault","target","html","isEmpty","select","ownProps","editorSettings","getEditorSettings","getEmbedPreview","isRequestingEmbedPreview","bp","activity","saveEmbedActivityBlock","registerBlockType","blocks","title","description","icon","category","type","source","selector","supports","align","edit","save"],"mappings":";AAAA,SAAA,EAAA,GACA,GAAA,MAAA,QAAA,GAAA,OAAA,EAGA,OAAA,QAAA;;ACJA,SAAA,EAAA,EAAA,GACA,GAAA,oBAAA,QAAA,OAAA,YAAA,OAAA,GAAA,CACA,IAAA,EAAA,GACA,GAAA,EACA,GAAA,EACA,OAAA,EAEA,IACA,IAAA,IAAA,EAAA,EAAA,EAAA,OAAA,cAAA,GAAA,EAAA,EAAA,QAAA,QACA,EAAA,KAAA,EAAA,QAEA,GAAA,EAAA,SAAA,GAHA,GAAA,IAKA,MAAA,GACA,GAAA,EACA,EAAA,EACA,QACA,IACA,GAAA,MAAA,EAAA,QAAA,EAAA,SACA,QACA,GAAA,EAAA,MAAA,GAIA,OAAA,GAGA,OAAA,QAAA;;AC3BA,SAAA,EAAA,EAAA,IACA,MAAA,GAAA,EAAA,EAAA,UAAA,EAAA,EAAA,QAEA,IAAA,IAAA,EAAA,EAAA,EAAA,IAAA,MAAA,GAAA,EAAA,EAAA,IACA,EAAA,GAAA,EAAA,GAGA,OAAA,EAGA,OAAA,QAAA;;ACVA,IAAA,EAAA,QAAA,sBAEA,SAAA,EAAA,EAAA,GACA,GAAA,EAAA,CACA,GAAA,iBAAA,EAAA,OAAA,EAAA,EAAA,GACA,IAAA,EAAA,OAAA,UAAA,SAAA,KAAA,GAAA,MAAA,GAAA,GAEA,MADA,WAAA,GAAA,EAAA,cAAA,EAAA,EAAA,YAAA,MACA,QAAA,GAAA,QAAA,EAAA,MAAA,KAAA,GACA,cAAA,GAAA,2CAAA,KAAA,GAAA,EAAA,EAAA,QAAA,GAGA,OAAA,QAAA;;ACXA,SAAA,IACA,MAAA,IAAA,UAAA,6IAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,oBAEA,EAAA,QAAA,0BAEA,EAAA,QAAA,gCAEA,EAAA,QAAA,qBAEA,SAAA,EAAA,EAAA,GACA,OAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,IAAA,IAGA,OAAA,QAAA;;AC0KeA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,yCAAAA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GAtJXC,IAAAA,EAAAA,GA5BHC,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,SAGAC,EADDC,EAAAA,KACCD,GAEDE,EAAAA,EAAAA,WACCC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,cAGAC,EADDA,EAAAA,QACCA,QAGAC,EADDC,EAAAA,KACCD,WAEDE,EAAAA,EAAAA,YACCC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAIIC,EAAoB,SAOnB,GANNC,IAAAA,EAAAA,EAAAA,WACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,WACAC,EAAAA,EAAAA,WACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,SAEQC,EAAiBN,EAAjBM,IAAKC,EAAYP,EAAZO,QACLC,EAAmBL,EAAnBK,eACFC,EAAQ3B,EAAI,0BAA2B,cACnBD,EAAAA,EAAUyB,GAJ9B,GAAA,EAAA,EAAA,SAAA,EAAA,GAIEI,EAJF,EAAA,GAISC,EAJT,EAAA,GAKoC9B,EAAAA,GAAYyB,GALhD,GAAA,EAAA,EAAA,SAAA,EAAA,GAKEM,EALF,EAAA,GAKgBC,EALhB,EAAA,GAwBAC,EACL,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAK,OACL,MAAQhC,EAAI,WAAY,cACxB,QAdyB,SAAEiC,GACzBA,GACJA,EAAMC,iBAGPH,GAAiB,QAebD,OAAAA,EAEH,EAAC,EAAD,CACC,KAAK,qBACL,MAAQH,EACR,UAAU,iBACV,aAAe3B,EAAI,2EAA4E,eAE/F,EAAA,OAAA,CAAM,SArCQ,SAAEiC,GACbA,GACJA,EAAMC,iBAGPH,GAAiB,GACjBZ,EAAe,CAAEK,IAAKI,MAgCnB,EAAA,QAAA,CACC,KAAK,MACL,MAAQA,GAAS,GACjB,UAAU,gCACGD,aAAAA,EACb,YAAc3B,EAAI,2BAA4B,cAC9C,SAAW,SAAEiC,GAAWJ,OAAAA,EAAQI,EAAME,OAAOP,UAE9C,EAAC,EAAD,CAAQ,WAAR,EAAkB,KAAK,UACpB5B,EAAI,QAAS,gBAGjB,EAAA,MAAA,CAAK,UAAU,sCACd,EAAC,EAAD,CACC,KAAOA,EACN,kDAGCA,EAAI,mCAAoC,iBAO1CuB,EAEH,EAAA,MAAA,CAAK,UAAU,6BACd,EAAC,EADF,MAEC,EAAKvB,IAAAA,KAAAA,EAAI,aAAc,gBAKnBsB,GAAaA,EAAO,cAAoB,aAAeA,EAAO,aAiBpE,EAAC,EACE,MAAEQ,GAAgBE,EACpB,EAAA,SAAA,CAAQ,UAAU,sCACjB,EAAA,MAAA,CAAK,UAAU,2BACd,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAOV,GAAWA,EAAQc,KAAOd,EAAQc,KAAO,GAChD,QAAU,CAAEV,SAITX,EAASsB,QAASZ,IAAaL,IACpC,EAAC,EAAD,CACC,QAAQ,aACR,YAAcpB,EAAI,iBAAkB,cACpC,MAAQyB,EACR,SAAW,SAAEG,GAAWT,OAAAA,EAAe,CAAEM,QAASG,KAClD,eAAa,MAhChB,EAAC,EACEI,KAAAA,EACF,EAAC,EAAD,CACC,KAAK,qBACL,MAAQL,GAER,EAAA,IAAA,CAAG,UAAU,iCACV3B,EAAI,mGAAoG,kBAiC1GN,EAAyBiB,EAAS,CACvCC,EAAY,SAAE0B,EAAQC,GACbf,IAAAA,EAAQe,EAASrB,WAAjBM,IACFgB,EAAiBF,EAAQ,eAAgBG,oBAI3CH,EAAAA,EAAQ,QAFXI,EAAAA,EAAAA,gBACAC,EAAAA,EAAAA,yBAGKrB,IAAaE,GAAOkB,EAAiBlB,GACrCD,IAAcC,GAAOmB,EAA0BnB,GAE9C,MAAA,CACNH,WAAYmB,EAAeI,GAAGC,UAAY,GAC1CvB,QAASA,EACTC,SAAUA,MAfkBZ,CAkB1BM,GAEUvB,EAAAA,EAAAA,QAAAA,QAAAA;;AClJAoD,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EA1BXnD,IAAAA,EAAAA,GALFoB,EADDD,EAAAA,YACCC,SAGAlB,EADDD,EAAAA,QACCC,cAIIiD,EAAyB,SAAsB,GAAlB5B,IAAAA,EAAAA,EAAAA,WAC1BM,EAAiBN,EAAjBM,IAAKC,EAAYP,EAAZO,QAER,OAAED,EAKN,EAAA,SAAA,CAAQ,UAAU,sCACjB,EAAA,MAAA,CAAK,UAAU,2BAERA,KAAAA,OAAAA,EAFP,QAKIT,EAASsB,QAASZ,IACrB,EAAC,EAAS,QAAV,CACC,QAAQ,aACR,MAAQA,KAbJ,MAoBMqB,EAAAA,EAAAA,QAAAA,QAAAA;;AClBf,aAHA,IAAA,EAAA,EAAA,QAAA,0BACA,EAAA,EAAA,QAAA,0BAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GARInD,IAAAA,EAAAA,GALFK,EADDC,EAAAA,KACCD,GAGA+C,EADDC,EAAAA,OACCD,kBAUFA,EAAmB,oBAAqB,CACvCE,MAAOjD,EAAI,oBAAqB,cAChCkD,YAAalD,EAAI,4FAA6F,cAC9GmD,KAAM,qBACNC,SAAU,aACVlC,WAAY,CACXM,IAAK,CACJ6B,KAAM,UAEP5B,QAAS,CACR4B,KAAM,SACNC,OAAQ,OACRC,SAAU,eAGZC,SAAU,CACTC,OAAO,GAERC,KAAMhE,EAlBiC,QAmBvCiE,KAAMb,EAAAA","file":"embed-activity.js","sourceRoot":"../src/js","sourcesContent":["function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","/**\n * WordPress dependencies.\n */\nconst {\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\tcomponents: {\n\t\tPlaceholder,\n\t\tDisabled,\n\t\tSandBox,\n\t\tButton,\n\t\tExternalLink,\n\t\tSpinner,\n\t\tToolbarGroup,\n\t\tToolbarButton,\n\t},\n\tcompose: {\n\t\tcompose,\n\t},\n\tdata: {\n\t\twithSelect,\n\t},\n\tblockEditor: {\n\t\tRichText,\n\t\tBlockControls,\n\t}\n} = wp;\n\nconst EditEmbedActivity = ( {\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tbpSettings,\n\tpreview,\n\tfetching\n} ) => {\n\tconst { url, caption } = attributes;\n\tconst { embedScriptURL } = bpSettings;\n\tconst label = __( 'BuddyPress Activity URL', 'buddypress' );\n\tconst [ value, setURL ] = useState( url );\n\tconst [ isEditingURL, setIsEditingURL ] = useState( ! url );\n\n\tconst onSubmit = ( event ) => {\n\t\tif ( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tsetIsEditingURL( false );\n\t\tsetAttributes( { url: value } );\n\t};\n\n\tconst switchBackToURLInput = ( event ) => {\n\t\tif ( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\n\t\tsetIsEditingURL( true );\n\t};\n\n\tconst editToolbar = (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\ttitle={ __( 'Edit URL', 'buddypress' ) }\n\t\t\t\t\tonClick={ switchBackToURLInput }\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tif ( isEditingURL ) {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon=\"buddicons-activity\"\n\t\t\t\tlabel={ label }\n\t\t\t\tclassName=\"wp-block-embed\"\n\t\t\t\tinstructions={ __( 'Paste the link to the activity content you want to display on your site.', 'buddypress' ) }\n\t\t\t>\n\t\t\t\t<form onSubmit={ onSubmit }>\n\t\t\t\t\t<input\n\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\tplaceholder={ __( 'Enter URL to embed here…', 'buddypress' ) }\n\t\t\t\t\t\tonChange={ ( event ) => setURL( event.target.value ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<Button isPrimary type=\"submit\">\n\t\t\t\t\t\t{ __( 'Embed', 'buddypress' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</form>\n\t\t\t\t<div className=\"components-placeholder__learn-more\">\n\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t'https://codex.buddypress.org/activity-embeds/'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Learn more about activity embeds', 'buddypress' ) }\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</div>\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\tif ( fetching ) {\n\t\treturn (\n\t\t\t<div className=\"wp-block-embed is-loading\">\n\t\t\t\t<Spinner />\n\t\t\t\t<p>{ __( 'Embedding…', 'buddypress' ) }</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! preview || ! preview['x_buddypress'] || 'activity' !== preview['x_buddypress'] ) {\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t{ editToolbar }\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon=\"buddicons-activity\"\n\t\t\t\t\tlabel={ label }\n\t\t\t\t>\n\t\t\t\t\t<p className=\"components-placeholder__error\">\n\t\t\t\t\t\t{ __( 'The URL you provided is not a permalink to a public BuddyPress Activity. Please use another URL.', 'buddypress' ) }\n\t\t\t\t\t</p>\n\t\t\t\t</Placeholder>\n\t\t\t</Fragment>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t{ ! isEditingURL && editToolbar }\n\t\t\t<figure className=\"wp-block-embed is-type-bp-activity\">\n\t\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t\t\t<Disabled>\n\t\t\t\t\t\t<SandBox\n\t\t\t\t\t\t\thtml={ preview && preview.html ? preview.html : '' }\n\t\t\t\t\t\t\tscripts={ [ embedScriptURL ] }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Disabled>\n\t\t\t\t</div>\n\t\t\t\t{ ( ! RichText.isEmpty( caption ) || isSelected ) && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\t\tplaceholder={ __( 'Write caption…', 'buddypress' ) }\n\t\t\t\t\t\tvalue={ caption }\n\t\t\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\t\t\tinlineToolbar\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</figure>\n\t\t</Fragment>\n\t);\n}\n\nconst editEmbedActivityBlock = compose( [\n\twithSelect( ( select, ownProps ) => {\n\t\tconst { url } = ownProps.attributes;\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\t\tconst {\n\t\t\tgetEmbedPreview,\n\t\t\tisRequestingEmbedPreview,\n\t\t} = select( 'core' );\n\n\t\tconst preview = !! url && getEmbedPreview( url );\n\t\tconst fetching = !! url && isRequestingEmbedPreview( url );\n\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.activity || {},\n\t\t\tpreview: preview,\n\t\t\tfetching: fetching,\n\t\t};\n\t} ),\n] )( EditEmbedActivity );\n\nexport default editEmbedActivityBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblockEditor: {\n\t\tRichText,\n\t},\n\telement: {\n\t\tcreateElement,\n\t},\n} = wp;\n\nconst saveEmbedActivityBlock = ( { attributes } ) => {\n\tconst { url, caption } = attributes;\n\n\tif ( ! url ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<figure className=\"wp-block-embed is-type-bp-activity\">\n\t\t\t<div className=\"wp-block-embed__wrapper\">\n\t\t\t{\n\t\t\t\t`\\n${ url }\\n` /* URL needs to be on its own line. */\n\t\t\t}\n\t\t\t</div>\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n};\n\nexport default saveEmbedActivityBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n\tblocks: {\n\t\tregisterBlockType,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport editEmbedActivityBlock from './embed-activity/edit';\nimport saveEmbedActivityBlock from './embed-activity/save';\n\nregisterBlockType( 'bp/embed-activity', {\n\ttitle: __( 'Embed an activity', 'buddypress' ),\n\tdescription: __( 'Add a block that displays the activity content pulled from this or other community sites.', 'buddypress' ),\n\ticon: 'buddicons-activity',\n\tcategory: 'buddypress',\n\tattributes: {\n\t\turl: {\n\t\t\ttype: 'string',\n\t\t},\n\t\tcaption: {\n\t\t\ttype: 'string',\n\t\t\tsource: 'html',\n\t\t\tselector: 'figcaption',\n\t\t},\n\t},\n\tsupports: {\n\t\talign: true,\n\t},\n\tedit: editEmbedActivityBlock,\n\tsave: saveEmbedActivityBlock,\n} );\n"]}
bp-activity/js/mentions.js CHANGED
@@ -232,7 +232,7 @@ window.bp = window.bp || {};
232
 
233
  at: '@',
234
  searchKey: 'search',
235
- displayTpl: '<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'
236
  },
237
 
238
  opts = $.extend( true, {}, suggestionsDefaults, mentionsDefaults, options );
232
 
233
  at: '@',
234
  searchKey: 'search',
235
+ displayTpl: '<li data-value="@${ID}"><img src="${image}" alt="" /><span class="username">@${ID}</span><small>${name}</small></li>'
236
  },
237
 
238
  opts = $.extend( true, {}, suggestionsDefaults, mentionsDefaults, options );
bp-activity/js/mentions.min.js CHANGED
@@ -1 +1 @@
1
- window.bp=window.bp||{},function(t,e,i){var n,s=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),e.fn.bp_mentions=function(t){e.isArray(t)&&(t={data:t});var i={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){var n,s,r,o=[],a=new RegExp("^"+t+"| "+t,"ig");for(s=0,r=e.length;s<r;s++)(n=e[s])[i].toLowerCase().match(a)&&o.push(n);return o},highlighter:function(t,e){if(!e)return t;var i=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return t.replace(i,function(t,e,i,n){return">"+e+"<strong>"+i+"</strong>"+n+"<"})},before_reposition:function(t){var i,n,s,r,o=e("#atwho-ground-"+this.id+" .atwho-view"),a=e("body"),u=this.$inputor.data("atwho");"undefined"!==u&&"undefined"!==u.iframe&&null!==u.iframe?(i=this.$inputor.caret("offset",{iframe:u.iframe}),"undefined"!==(s=e(u.iframe).offset())&&(i.left+=s.left,i.top+=s.top)):i=this.$inputor.caret("offset"),i.left>a.width()/2?(o.addClass("right"),r=i.left-t.left-this.view.$el.width()):(o.removeClass("right"),r=i.left-t.left+1),a.width()<=400&&e(document).scrollTop(i.top-6),(!(n=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10))||n<5)&&(n=19),t.top=i.top+n,t.left+=r},inserting_wrapper:function(t,e,i){return""+e+i}}},r={callbacks:{remoteFilter:function(t,i){var r=e(this),o={};"object"!=typeof(n=s[t])?(r.xhr&&r.xhr.abort(),o={action:"bp_get_suggestions",term:t,type:"members"},e.isNumeric(this.$inputor.data("suggestions-group-id"))&&(o["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),r.xhr=e.getJSON(ajaxurl,o).done(function(n){if(n.success){var r=e.map(n.data,function(t){return t.search=t.search||t.ID+" "+t.name,t});s[t]=r,i(r)}})):i(n)}},data:e.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},o=e.extend(!0,{},i,r,t);return e.fn.atwho.call(this,o)},e(document).ready(function(){e(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0!==window.tinyMCE&&null!==window.tinyMCE.activeEditor&&void 0!==window.tinyMCE.activeEditor&&e(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",e(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery);
1
+ window.bp=window.bp||{},function(t,e,i){var n,s=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),e.fn.bp_mentions=function(t){e.isArray(t)&&(t={data:t});var i={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){var n,s,r,o=[],a=new RegExp("^"+t+"| "+t,"ig");for(s=0,r=e.length;s<r;s++)(n=e[s])[i].toLowerCase().match(a)&&o.push(n);return o},highlighter:function(t,e){if(!e)return t;var i=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return t.replace(i,function(t,e,i,n){return">"+e+"<strong>"+i+"</strong>"+n+"<"})},before_reposition:function(t){var i,n,s,r,o=e("#atwho-ground-"+this.id+" .atwho-view"),a=e("body"),u=this.$inputor.data("atwho");"undefined"!==u&&"undefined"!==u.iframe&&null!==u.iframe?(i=this.$inputor.caret("offset",{iframe:u.iframe}),"undefined"!==(s=e(u.iframe).offset())&&(i.left+=s.left,i.top+=s.top)):i=this.$inputor.caret("offset"),i.left>a.width()/2?(o.addClass("right"),r=i.left-t.left-this.view.$el.width()):(o.removeClass("right"),r=i.left-t.left+1),a.width()<=400&&e(document).scrollTop(i.top-6),(!(n=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10))||n<5)&&(n=19),t.top=i.top+n,t.left+=r},inserting_wrapper:function(t,e,i){return""+e+i}}},r={callbacks:{remoteFilter:function(t,i){var r=e(this),o={};"object"!=typeof(n=s[t])?(r.xhr&&r.xhr.abort(),o={action:"bp_get_suggestions",term:t,type:"members"},e.isNumeric(this.$inputor.data("suggestions-group-id"))&&(o["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),r.xhr=e.getJSON(ajaxurl,o).done(function(n){if(n.success){var r=e.map(n.data,function(t){return t.search=t.search||t.ID+" "+t.name,t});s[t]=r,i(r)}})):i(n)}},data:e.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'<li data-value="@${ID}"><img src="${image}" alt="" /><span class="username">@${ID}</span><small>${name}</small></li>'},o=e.extend(!0,{},i,r,t);return e.fn.atwho.call(this,o)},e(document).ready(function(){e(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0!==window.tinyMCE&&null!==window.tinyMCE.activeEditor&&void 0!==window.tinyMCE.activeEditor&&e(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",e(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery);
bp-blogs/bp-blogs-filters.php CHANGED
@@ -136,6 +136,31 @@ function bp_blogs_register_custom_site_icon_size( $sizes ) {
136
  }
137
  add_filter( 'site_icon_image_sizes', 'bp_blogs_register_custom_site_icon_size' );
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /**
140
  * Filters the column name during blog metadata queries.
141
  *
136
  }
137
  add_filter( 'site_icon_image_sizes', 'bp_blogs_register_custom_site_icon_size' );
138
 
139
+ /**
140
+ * Use the mystery blog avatar for blogs.
141
+ *
142
+ * @since 7.0.0
143
+ *
144
+ * @param string $avatar Current avatar src.
145
+ * @param array $params Avatar params.
146
+ * @return string
147
+ */
148
+ function bp_blogs_default_avatar( $avatar, $params ) {
149
+ if ( isset( $params['object'] ) && 'blog' === $params['object'] ) {
150
+ if ( isset( $params['type'] ) && 'thumb' === $params['type'] ) {
151
+ $file = 'mystery-blog-50.png';
152
+ } else {
153
+ $file = 'mystery-blog.png';
154
+ }
155
+
156
+ $avatar = buddypress()->plugin_url . "bp-core/images/$file";
157
+ }
158
+
159
+ return $avatar;
160
+ }
161
+ add_filter( 'bp_core_avatar_default', 'bp_blogs_default_avatar', 10, 2 );
162
+ add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 );
163
+
164
  /**
165
  * Filters the column name during blog metadata queries.
166
  *
bp-blogs/bp-blogs-functions.php CHANGED
@@ -549,13 +549,15 @@ add_action( 'update_option_comment_moderation', 'bp_blogs_update_option_comment_
549
  * @param int|string $new_value New value
550
  */
551
  function bp_blogs_update_option_site_icon( $old_value, $new_value ) {
 
 
552
  if ( 0 === $new_value ) {
553
- bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', 0 );
554
- bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', 0 );
555
  } else {
556
  // Save site icon URL as blogmeta.
557
- bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_thumb', get_site_icon_url( bp_core_avatar_thumb_width() ) );
558
- bp_blogs_update_blogmeta( get_current_blog_id(), 'site_icon_url_full', get_site_icon_url( bp_core_avatar_full_width() ) );
559
  }
560
  }
561
  add_action( 'update_option_site_icon', 'bp_blogs_update_option_site_icon', 10, 2 );
@@ -575,7 +577,7 @@ function bp_blogs_delete_url_blogmeta( $site_id = 0 ) {
575
  bp_blogs_delete_blogmeta( (int) $site_id, 'url' );
576
  }
577
 
578
- if ( function_exists( 'wp_switch_roles_and_user' ) ) {
579
  add_action( 'clean_site_cache', 'bp_blogs_delete_url_blogmeta' );
580
  } else {
581
  add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
@@ -1476,3 +1478,139 @@ function bp_blogs_restore_data( $user_id = 0 ) {
1476
  }
1477
  }
1478
  add_action( 'bp_make_ham_user', 'bp_blogs_restore_data', 10, 1 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
549
  * @param int|string $new_value New value
550
  */
551
  function bp_blogs_update_option_site_icon( $old_value, $new_value ) {
552
+ $blog_id = get_current_blog_id();
553
+
554
  if ( 0 === $new_value ) {
555
+ bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_thumb', 0 );
556
+ bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full', 0 );
557
  } else {
558
  // Save site icon URL as blogmeta.
559
+ bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_thumb', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_thumb_width() ) );
560
+ bp_blogs_update_blogmeta( $blog_id, 'site_icon_url_full', bp_blogs_get_site_icon_url( $blog_id, bp_core_avatar_full_width() ) );
561
  }
562
  }
563
  add_action( 'update_option_site_icon', 'bp_blogs_update_option_site_icon', 10, 2 );
577
  bp_blogs_delete_blogmeta( (int) $site_id, 'url' );
578
  }
579
 
580
+ if ( bp_is_running_wp( '4.9.0' ) ) {
581
  add_action( 'clean_site_cache', 'bp_blogs_delete_url_blogmeta' );
582
  } else {
583
  add_action( 'refresh_blog_details', 'bp_blogs_delete_url_blogmeta' );
1478
  }
1479
  }
1480
  add_action( 'bp_make_ham_user', 'bp_blogs_restore_data', 10, 1 );
1481
+
1482
+ /**
1483
+ * Checks whether blog creation is enabled.
1484
+ *
1485
+ * Returns true when blog creation is enabled for logged-in users only, or
1486
+ * when it's enabled for new registrations.
1487
+ *
1488
+ * @since 1.0.0
1489
+ * @since 7.0.0 The function has been moved into `bp-blogs/bp-blogs-functions.php`.
1490
+ *
1491
+ * @return bool True if blog registration is enabled.
1492
+ */
1493
+ function bp_blog_signup_enabled() {
1494
+ $bp = buddypress();
1495
+ $retval = true;
1496
+ $active_signup = 'all';
1497
+
1498
+ if ( isset( $bp->site_options['registration'] ) ) {
1499
+ $active_signup = $bp->site_options['registration'];
1500
+ }
1501
+
1502
+ /**
1503
+ * Filters whether or not blog creation is enabled.
1504
+ *
1505
+ * Return "all", "none", "blog" or "user".
1506
+ *
1507
+ * @since 1.0.0
1508
+ *
1509
+ * @param string $active_signup Value of the registration site option creation status.
1510
+ */
1511
+ $active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
1512
+
1513
+ if ( 'none' === $active_signup || 'user' === $active_signup ) {
1514
+ $retval = false;
1515
+ }
1516
+
1517
+ return $retval;
1518
+ }
1519
+
1520
+ /**
1521
+ * Returns the Blog signup's submitted vars.
1522
+ *
1523
+ * @since 7.0.0
1524
+ *
1525
+ * @return array An associative array containing the Blog signup's submitted vars.
1526
+ */
1527
+ function bp_blogs_get_signup_form_submitted_vars() {
1528
+ $exprected_vars = array(
1529
+ 'blogname' => '',
1530
+ 'blog_title' => '',
1531
+ 'blog_public' => 0,
1532
+ );
1533
+
1534
+ $submitted_vars = wp_parse_args( $_POST, $exprected_vars );
1535
+
1536
+ return array_map( 'wp_unslash', array_intersect_key( $submitted_vars, $exprected_vars ) );
1537
+ }
1538
+
1539
+ /**
1540
+ * Validate a blog creation submission.
1541
+ *
1542
+ * Essentially, a wrapper for {@link wpmu_validate_blog_signup()}.
1543
+ *
1544
+ * @since 1.0.0
1545
+ * @since 7.0.0 Add the blog_name and blog_title parameters.
1546
+ * The function has been moved into `bp-blogs/bp-blogs-functions.php`.
1547
+ *
1548
+ * @return array Contains the new site data and error messages.
1549
+ */
1550
+ function bp_blogs_validate_blog_form( $blog_name = '', $blog_title = '' ) {
1551
+ $user = '';
1552
+
1553
+ if ( is_user_logged_in() ) {
1554
+ $user = wp_get_current_user();
1555
+ }
1556
+
1557
+ if ( ! $blog_name && ! $blog_title ) {
1558
+ $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
1559
+
1560
+ if ( array_filter( $submitted_vars ) ) {
1561
+ $blog_name = $submitted_vars['blogname'];
1562
+ $blog_title = $submitted_vars['blog_title'];
1563
+ }
1564
+ }
1565
+
1566
+ return wpmu_validate_blog_signup( $blog_name, $blog_title, $user );
1567
+ }
1568
+
1569
+ /**
1570
+ * Gets the site icon URL even when BuddyPress is not network activated.
1571
+ *
1572
+ * @since 7.0.0
1573
+ *
1574
+ * @param integer $blog_id The ID of the blog to get the site icon URL for.
1575
+ * @param integer $size The size of the site icon.
1576
+ * @return string The site icon URL
1577
+ */
1578
+ function bp_blogs_get_site_icon_url( $blog_id = 0, $size = 512 ) {
1579
+ if ( is_multisite() && ! bp_is_network_activated() && ! bp_is_root_blog( $blog_id ) ) {
1580
+ $switched_blog = false;
1581
+ $url = '';
1582
+
1583
+ if ( $blog_id && get_current_blog_id() !== (int) $blog_id ) {
1584
+ switch_to_blog( $blog_id );
1585
+ $switched_blog = true;
1586
+ }
1587
+
1588
+ $site_icon_id = get_option( 'site_icon' );
1589
+
1590
+ if ( $site_icon_id ) {
1591
+ $site_icon_data = wp_get_attachment_metadata( $site_icon_id );
1592
+ $sizes = wp_list_pluck( $site_icon_data['sizes'], 'width' );
1593
+
1594
+ sort( $sizes );
1595
+ $closest = 'full';
1596
+
1597
+ foreach ( $sizes as $width ) {
1598
+ $closest = array( $width, $width );
1599
+
1600
+ if ( (int) $size < (int) $width ) {
1601
+ break;
1602
+ }
1603
+ }
1604
+
1605
+ $url = wp_get_attachment_image_url( $site_icon_id, $closest );
1606
+ }
1607
+
1608
+ if ( $switched_blog ) {
1609
+ restore_current_blog();
1610
+ }
1611
+
1612
+ return $url;
1613
+ }
1614
+
1615
+ return get_site_icon_url( $size, '', $blog_id );
1616
+ }
bp-blogs/bp-blogs-template.php CHANGED
@@ -298,11 +298,14 @@ function bp_blog_avatar( $args = '' ) {
298
  /**
299
  * Get a blog's avatar.
300
  *
301
- * At the moment, blog avatars are simply the user avatars of the blog
302
- * admin. Filter 'bp_get_blog_avatar_' . $blog_id to customize.
 
303
  *
304
  * @since 2.4.0 Introduced `$title` argument.
305
  * @since 6.0.0 Introduced the `$blog_id`, `$admin_user_id` and `html` arguments.
 
 
306
  *
307
  * @see bp_core_fetch_avatar() For a description of arguments and
308
  * return values.
@@ -333,40 +336,44 @@ function bp_blog_avatar( $args = '' ) {
333
  return false;
334
  }
335
 
336
- // Set default values.
337
- $author_displayname = '';
338
- $admin_user_id = 0;
339
- $blog_id = 0;
340
-
341
- if ( ! $blogs_template && isset( $args['admin_user_id'] ) && $args['admin_user_id'] ) {
342
- $admin_user_id = (int) $args['admin_user_id'];
343
- $author_displayname = bp_core_get_user_displayname( $admin_user_id );
344
- } else {
345
- $admin_user_id = $blogs_template->blog->admin_user_id;
346
- $author_displayname = bp_core_get_user_displayname( $blogs_template->blog->admin_user_id );
347
- }
348
 
349
  if ( ! $blogs_template && isset( $args['blog_id'] ) && $args['blog_id'] ) {
350
  $blog_id = (int) $args['blog_id'];
351
  } else {
352
  $blog_id = bp_get_blog_id();
 
 
 
353
  }
354
 
355
  // Parse the arguments.
356
  $r = bp_parse_args( $args, array(
357
- 'type' => 'full',
358
- 'width' => false,
359
- 'height' => false,
360
- 'class' => 'avatar',
361
- 'id' => false,
362
- 'alt' => sprintf(
363
- /* translators: %s: the author display name */
364
- __( 'Profile picture of site author %s', 'buddypress' ),
365
- esc_attr( $author_displayname )
366
- ),
367
- 'no_grav' => false,
368
- 'html' => true,
369
- ) );
 
 
 
 
 
 
 
 
 
 
 
370
 
371
  // Use site icon if available.
372
  $avatar = '';
@@ -375,8 +382,6 @@ function bp_blog_avatar( $args = '' ) {
375
 
376
  // Never attempted to fetch site icon before; do it now!
377
  if ( '' === $site_icon ) {
378
- switch_to_blog( $blog_id );
379
-
380
  // Fetch the other size first.
381
  if ( 'full' === $r['type'] ) {
382
  $size = bp_core_avatar_thumb_width();
@@ -386,7 +391,8 @@ function bp_blog_avatar( $args = '' ) {
386
  $save_size = 'full';
387
  }
388
 
389
- $site_icon = get_site_icon_url( $size );
 
390
  // Empty site icons get saved as integer 0.
391
  if ( empty( $site_icon ) ) {
392
  $site_icon = 0;
@@ -398,13 +404,11 @@ function bp_blog_avatar( $args = '' ) {
398
  // Now, fetch the size we want.
399
  if ( 0 !== $site_icon ) {
400
  $size = 'full' === $r['type'] ? bp_core_avatar_full_width() : bp_core_avatar_thumb_width();
401
- $site_icon = get_site_icon_url( $size );
402
  }
403
 
404
  // Sync site icon to blogmeta.
405
  bp_blogs_update_blogmeta( $blog_id, "site_icon_url_{$r['type']}", $site_icon );
406
-
407
- restore_current_blog();
408
  }
409
 
410
  // We have a site icon.
@@ -420,12 +424,6 @@ function bp_blog_avatar( $args = '' ) {
420
  $size = (int) $r['width'];
421
  }
422
 
423
- $alt_attribute = __( 'Site icon for the blog', 'buddypress' );
424
- if ( $blogs_template ) {
425
- /* translators: %s is the placeholder for the name of the blog */
426
- $alt_attribute = sprintf( __( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() );
427
- }
428
-
429
  $avatar = sprintf( '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" />',
430
  esc_url( $site_icon ),
431
  esc_attr( "{$r['class']} avatar-{$size}" ),
@@ -435,33 +433,11 @@ function bp_blog_avatar( $args = '' ) {
435
  }
436
  }
437
 
438
- // Fallback to user ID avatar.
439
  if ( '' === $avatar ) {
440
- $avatar = bp_core_fetch_avatar( array(
441
- 'item_id' => $admin_user_id,
442
- // 'avatar_dir' => 'blog-avatars',
443
- // 'object' => 'blog',
444
- 'type' => $r['type'],
445
- 'alt' => $r['alt'],
446
- 'css_id' => $r['id'],
447
- 'class' => $r['class'],
448
- 'width' => $r['width'],
449
- 'height' => $r['height'],
450
- 'no_grav' => $r['no_grav'],
451
- 'html' => $r['html'],
452
- ) );
453
  }
454
 
455
- /**
456
- * In future BuddyPress versions you will be able to set the avatar for a blog.
457
- * Right now you can use a filter with the ID of the blog to change it if you wish.
458
- * By default it will return the avatar for the primary blog admin.
459
- *
460
- * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version.
461
- * Use the 'bp_get_blog_avatar' filter instead.
462
- */
463
- $avatar = apply_filters( 'bp_get_blog_avatar_' . $blog_id, $avatar );
464
-
465
  /**
466
  * Filters a blog's avatar.
467
  *
@@ -662,7 +638,7 @@ function bp_blog_last_active( $args = array() ) {
662
  // Backwards compatibility for anyone forcing a 'true' active_format.
663
  if ( true === $r['active_format'] ) {
664
  /* translators: %s: human time diff of the last time the site was active. */
665
- $r['active_format'] = _x( 'active %s', 'last time the site was active', 'buddypress' );
666
  }
667
 
668
  // Blog has been posted to at least once.
@@ -1001,53 +977,24 @@ function bp_total_blog_count_for_user( $user_id = 0 ) {
1001
 
1002
  /** Blog Registration ********************************************************/
1003
 
1004
- /**
1005
- * Checks whether blog creation is enabled.
1006
- *
1007
- * Returns true when blog creation is enabled for logged-in users only, or
1008
- * when it's enabled for new registrations.
1009
- *
1010
- * @return bool True if blog registration is enabled.
1011
- */
1012
- function bp_blog_signup_enabled() {
1013
- $bp = buddypress();
1014
-
1015
- $active_signup = isset( $bp->site_options['registration'] )
1016
- ? $bp->site_options['registration']
1017
- : 'all';
1018
-
1019
- /**
1020
- * Filters whether or not blog creation is enabled.
1021
- *
1022
- * Return "all", "none", "blog" or "user".
1023
- *
1024
- * @since 1.0.0
1025
- *
1026
- * @param string $active_signup Value of the registration site option creation status.
1027
- */
1028
- $active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
1029
-
1030
- if ( 'none' == $active_signup || 'user' == $active_signup )
1031
- return false;
1032
-
1033
- return true;
1034
- }
1035
-
1036
  /**
1037
  * Output the wrapper markup for the blog signup form.
1038
  *
 
 
1039
  * @param string $blogname Optional. The default blog name (path or domain).
1040
  * @param string $blog_title Optional. The default blog title.
1041
  * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous
1042
  * submission attempt.
1043
  */
1044
- function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
1045
- global $current_user;
1046
 
1047
- if ( isset($_POST['submit']) ) {
1048
- bp_blogs_validate_blog_signup();
1049
- } else {
1050
- if ( ! is_wp_error($errors) ) {
 
1051
  $errors = new WP_Error();
1052
  }
1053
 
@@ -1063,17 +1010,35 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = ''
1063
  * }
1064
  */
1065
  $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
1066
- $blogname = $filtered_results['blogname'];
1067
- $blog_title = $filtered_results['blog_title'];
1068
- $errors = $filtered_results['errors'];
1069
 
1070
  if ( $errors->get_error_code() ) {
1071
- echo "<p>" . __('There was a problem; please correct the form below and try again.', 'buddypress') . "</p>";
 
 
 
 
 
 
 
 
 
 
1072
  }
 
 
 
 
 
 
 
1073
  ?>
1074
- <p><?php printf(__("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!", 'buddypress'), $current_user->display_name) ?></p>
1075
 
1076
- <p><?php _e("If you&#8217;re not going to use a great domain, leave it for a new user. Now have at it!", 'buddypress') ?></p>
 
 
1077
 
1078
  <form class="standard-form" id="setupform" method="post" action="">
1079
 
@@ -1087,81 +1052,145 @@ function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = ''
1087
  */
1088
  do_action( 'signup_hidden_fields' ); ?>
1089
 
1090
- <?php bp_blogs_signup_blog($blogname, $blog_title, $errors); ?>
1091
  <p>
1092
- <input id="submit" type="submit" name="submit" class="submit" value="<?php esc_attr_e('Create Site', 'buddypress') ?>" />
1093
  </p>
1094
 
1095
  <?php wp_nonce_field( 'bp_blog_signup_form' ) ?>
1096
  </form>
1097
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1098
  }
1099
  }
1100
 
1101
  /**
1102
  * Output the input fields for the blog creation form.
1103
  *
 
 
1104
  * @param string $blogname Optional. The default blog name (path or domain).
1105
  * @param string $blog_title Optional. The default blog title.
1106
  * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous
1107
  * submission attempt.
1108
  */
1109
  function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
1110
- global $current_site;
1111
-
1112
- // Blog name.
1113
- if( !is_subdomain_install() )
1114
- echo '<label for="blogname">' . __('Site Name:', 'buddypress') . '</label>';
1115
- else
1116
- echo '<label for="blogname">' . __('Site Domain:', 'buddypress') . '</label>';
1117
 
1118
- if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
 
1119
 
1120
- <p class="error"><?php echo $errmsg ?></p>
 
 
 
 
 
1121
 
1122
- <?php }
 
 
 
 
 
 
 
1123
 
1124
- if ( !is_subdomain_install() )
1125
- echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />';
1126
- else
1127
- echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" ' . bp_get_form_field_attributes( 'blogname' ) . '/> <span class="suffix_address">.' . bp_signup_get_subdomain_base() . '</span><br />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1128
 
1129
- if ( !is_user_logged_in() ) {
1130
- print '(<strong>' . __( 'Your address will be ' , 'buddypress');
 
 
 
 
 
1131
 
1132
- if ( !is_subdomain_install() ) {
1133
- print $current_site->domain . $current_site->path . __( 'blogname' , 'buddypress');
1134
- } else {
1135
- print __( 'domain.' , 'buddypress') . $current_site->domain . $current_site->path;
 
 
1136
  }
1137
 
1138
- echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddypress') . '</p>';
 
 
 
 
 
 
 
1139
  }
1140
 
1141
  // Blog Title.
1142
  ?>
 
 
 
1143
 
1144
- <label for="blog_title"><?php _e('Site Title:', 'buddypress') ?></label>
 
 
 
 
 
 
 
1145
 
1146
- <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
1147
 
1148
- <p class="error"><?php echo $errmsg ?></p>
 
 
 
 
 
1149
 
1150
- <?php }
1151
- echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
1152
- ?>
 
 
 
1153
 
1154
- <fieldset class="create-site">
1155
- <legend class="label"><?php _e('Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddypress') ?></legend>
1156
-
1157
- <label class="checkbox" for="blog_public_on">
1158
- <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
1159
- <strong><?php _e( 'Yes' , 'buddypress'); ?></strong>
1160
- </label>
1161
- <label class="checkbox" for="blog_public_off">
1162
- <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
1163
- <strong><?php _e( 'No' , 'buddypress'); ?></strong>
1164
- </label>
1165
  </fieldset>
1166
 
1167
  <?php
@@ -1173,7 +1202,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
1173
  *
1174
  * @param WP_Error $errors WP_Error object if any present.
1175
  */
1176
- do_action('signup_blogform', $errors);
1177
  }
1178
 
1179
  /**
@@ -1181,32 +1210,38 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' )
1181
  *
1182
  * Passes submitted values to {@link wpmu_create_blog()}.
1183
  *
1184
- * @return bool True on success, false on failure.
 
 
1185
  */
1186
  function bp_blogs_validate_blog_signup() {
1187
- global $wpdb, $current_user, $blogname, $blog_title, $errors, $domain, $path, $current_site;
1188
-
1189
- if ( !check_admin_referer( 'bp_blog_signup_form' ) )
1190
  return false;
 
1191
 
 
1192
  $current_user = wp_get_current_user();
 
 
 
1193
 
1194
- if( !is_user_logged_in() )
1195
- die();
 
1196
 
1197
- $result = bp_blogs_validate_blog_form();
1198
- extract($result);
1199
 
1200
- if ( $errors->get_error_code() ) {
1201
- unset($_POST['submit']);
1202
- bp_show_blog_signup_form( $blogname, $blog_title, $errors );
1203
- return false;
1204
  }
1205
 
1206
- $public = (int) $_POST['blog_public'];
1207
 
1208
- // Depreciated.
1209
- $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) );
 
1210
 
1211
  /**
1212
  * Filters the default values for Blog meta.
@@ -1218,35 +1253,21 @@ function bp_blogs_validate_blog_signup() {
1218
  * string $public Default public status.
1219
  * }
1220
  */
1221
- $meta = apply_filters( 'add_signup_meta', $meta );
1222
-
1223
- // If this is a subdomain install, set up the site inside the root domain.
1224
- if ( is_subdomain_install() )
1225
- $domain = $blogname . '.' . preg_replace( '|^www\.|', '', $current_site->domain );
1226
-
1227
- $blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
1228
- bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id );
1229
- return true;
1230
- }
1231
-
1232
- /**
1233
- * Validate a blog creation submission.
1234
- *
1235
- * Essentially, a wrapper for {@link wpmu_validate_blog_signup()}.
1236
- *
1237
- * @return array Contains the new site data and error messages.
1238
- */
1239
- function bp_blogs_validate_blog_form() {
1240
- $user = '';
1241
- if ( is_user_logged_in() )
1242
- $user = wp_get_current_user();
1243
-
1244
- return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
1245
  }
1246
 
1247
  /**
1248
  * Display a message after successful blog registration.
1249
  *
 
1250
  * @since 2.6.0 Introduced `$blog_id` parameter.
1251
  *
1252
  * @param string $domain The new blog's domain.
@@ -1264,7 +1285,7 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name,
1264
  restore_current_blog();
1265
 
1266
  ?>
1267
- <p><?php _e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
1268
  <p>
1269
  <?php printf(
1270
  '%s %s',
@@ -1289,7 +1310,7 @@ function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name,
1289
  *
1290
  * @since 1.0.0
1291
  */
1292
- do_action('signup_finished');
1293
  }
1294
 
1295
  /**
298
  /**
299
  * Get a blog's avatar.
300
  *
301
+ * At the moment, unless the blog has a site icon, the blog's avatar defaults
302
+ * to the /bp-core/images/mystery-blog.png image or the Blog's Admin user avatar
303
+ * if the `admin_user_id` argument contains the Blog's Admin user ID.
304
  *
305
  * @since 2.4.0 Introduced `$title` argument.
306
  * @since 6.0.0 Introduced the `$blog_id`, `$admin_user_id` and `html` arguments.
307
+ * @since 7.0.0 Introduced the Blog's default avatar {@see bp_blogs_default_avatar()}.
308
+ * Removed the `'bp_get_blog_avatar_' . $blog_id` filter (it was deprecated since 1.5).
309
  *
310
  * @see bp_core_fetch_avatar() For a description of arguments and
311
  * return values.
336
  return false;
337
  }
338
 
339
+ // Set default value for the `alt` attribute.
340
+ $alt_attribute = __( 'Site icon for the blog', 'buddypress' );
 
 
 
 
 
 
 
 
 
 
341
 
342
  if ( ! $blogs_template && isset( $args['blog_id'] ) && $args['blog_id'] ) {
343
  $blog_id = (int) $args['blog_id'];
344
  } else {
345
  $blog_id = bp_get_blog_id();
346
+
347
+ /* translators: %s is the blog name */
348
+ $alt_attribute = sprintf( __( 'Site icon for %s', 'buddypress' ), bp_get_blog_name() );
349
  }
350
 
351
  // Parse the arguments.
352
  $r = bp_parse_args( $args, array(
353
+ 'item_id' => $blog_id,
354
+ 'avatar_dir' => 'blog-avatars',
355
+ 'object' => 'blog',
356
+ 'type' => 'full',
357
+ 'width' => false,
358
+ 'height' => false,
359
+ 'class' => 'avatar',
360
+ 'id' => false,
361
+ 'alt' => $alt_attribute,
362
+ 'no_grav' => false,
363
+ 'html' => true,
364
+ ), 'blog_avatar' );
365
+
366
+ /**
367
+ * If the `admin_user_id` was provided, make the Blog avatar
368
+ * defaults to the Blog's Admin user one.
369
+ */
370
+ if ( isset( $r['admin_user_id'] ) && $r['admin_user_id'] ) {
371
+ $r['item_id'] = (int) $r['admin_user_id'];
372
+ $r['avatar_dir'] = 'avatars';
373
+ $r['object'] = 'user';
374
+ } elseif ( ! $r['no_grav'] ) {
375
+ $r['no_grav'] = true;
376
+ }
377
 
378
  // Use site icon if available.
379
  $avatar = '';
382
 
383
  // Never attempted to fetch site icon before; do it now!
384
  if ( '' === $site_icon ) {
 
 
385
  // Fetch the other size first.
386
  if ( 'full' === $r['type'] ) {
387
  $size = bp_core_avatar_thumb_width();
391
  $save_size = 'full';
392
  }
393
 
394
+ $site_icon = bp_blogs_get_site_icon_url( $blog_id, $size );
395
+
396
  // Empty site icons get saved as integer 0.
397
  if ( empty( $site_icon ) ) {
398
  $site_icon = 0;
404
  // Now, fetch the size we want.
405
  if ( 0 !== $site_icon ) {
406
  $size = 'full' === $r['type'] ? bp_core_avatar_full_width() : bp_core_avatar_thumb_width();
407
+ $site_icon = bp_blogs_get_site_icon_url( $blog_id, $size );
408
  }
409
 
410
  // Sync site icon to blogmeta.
411
  bp_blogs_update_blogmeta( $blog_id, "site_icon_url_{$r['type']}", $site_icon );
 
 
412
  }
413
 
414
  // We have a site icon.
424
  $size = (int) $r['width'];
425
  }
426
 
 
 
 
 
 
 
427
  $avatar = sprintf( '<img src="%1$s" class="%2$s" width="%3$s" height="%3$s" alt="%4$s" />',
428
  esc_url( $site_icon ),
429
  esc_attr( "{$r['class']} avatar-{$size}" ),
433
  }
434
  }
435
 
436
+ // Fallback to Default blog avatar.
437
  if ( '' === $avatar ) {
438
+ $avatar = bp_core_fetch_avatar( $r );
 
 
 
 
 
 
 
 
 
 
 
 
439
  }
440
 
 
 
 
 
 
 
 
 
 
 
441
  /**
442
  * Filters a blog's avatar.
443
  *
638
  // Backwards compatibility for anyone forcing a 'true' active_format.
639
  if ( true === $r['active_format'] ) {
640
  /* translators: %s: human time diff of the last time the site was active. */
641
+ $r['active_format'] = _x( 'Active %s', 'last time the site was active', 'buddypress' );
642
  }
643
 
644
  // Blog has been posted to at least once.
977
 
978
  /** Blog Registration ********************************************************/
979
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
980
  /**
981
  * Output the wrapper markup for the blog signup form.
982
  *
983
+ * @since 1.0.0
984
+ *
985
  * @param string $blogname Optional. The default blog name (path or domain).
986
  * @param string $blog_title Optional. The default blog title.
987
  * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous
988
  * submission attempt.
989
  */
990
+ function bp_show_blog_signup_form( $blogname = '', $blog_title = '', $errors = '' ) {
991
+ $blog_id = bp_blogs_validate_blog_signup();
992
 
993
+ // Display the signup form.
994
+ if ( false === $blog_id || is_wp_error( $blog_id ) ) {
995
+ if ( is_wp_error( $blog_id ) ) {
996
+ $errors = $blog_id;
997
+ } else {
998
  $errors = new WP_Error();
999
  }
1000
 
1010
  * }
1011
  */
1012
  $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors ));
1013
+ $blogname = $filtered_results['blogname'];
1014
+ $blog_title = $filtered_results['blog_title'];
1015
+ $errors = $filtered_results['errors'];
1016
 
1017
  if ( $errors->get_error_code() ) {
1018
+ if ( in_array( $errors->get_error_code(), array( 'blogname', 'blog_title' ), true ) ) {
1019
+ printf(
1020
+ '<p class="error">%s</p>',
1021
+ esc_html__( 'There was a problem; please correct the form below and try again.', 'buddypress' )
1022
+ );
1023
+ } else {
1024
+ printf(
1025
+ '<p class="error">%s</p>',
1026
+ $errors->get_error_message()
1027
+ );
1028
+ }
1029
  }
1030
+
1031
+ printf(
1032
+ '<p>%1$s <strong>%2$s</strong>. %3$s</p>',
1033
+ esc_html__( 'By filling out the form below, you can', 'buddypress' ),
1034
+ esc_html__( 'add a site to your account', 'buddypress' ),
1035
+ esc_html__( 'There is no limit to the number of sites that you can have, so create to your heart’s content, but blog responsibly!', 'buddypress' )
1036
+ );
1037
  ?>
 
1038
 
1039
+ <p>
1040
+ <?php esc_html_e( 'If you’re not going to use a great domain, leave it for a new user. Now have at it!', 'buddypress' ); ?>
1041
+ </p>
1042
 
1043
  <form class="standard-form" id="setupform" method="post" action="">
1044
 
1052
  */
1053
  do_action( 'signup_hidden_fields' ); ?>
1054
 
1055
+ <?php bp_blogs_signup_blog( $blogname, $blog_title, $errors ); ?>
1056
  <p>
1057
+ <input id="submit" type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site', 'buddypress' ); ?>" />
1058
  </p>
1059
 
1060
  <?php wp_nonce_field( 'bp_blog_signup_form' ) ?>
1061
  </form>
1062
  <?php
1063
+
1064
+ // Display the confirmation form.
1065
+ } elseif ( is_numeric( $blog_id ) ) {
1066
+ // Validate the site.
1067
+ $site = get_site( $blog_id );
1068
+
1069
+ if ( isset( $site->id ) && $site->id ) {
1070
+ $current_user = wp_get_current_user();
1071
+
1072
+ bp_blogs_confirm_blog_signup(
1073
+ $site->domain,
1074
+ $site->path,
1075
+ $site->blogname,
1076
+ $current_user->user_login,
1077
+ $current_user->user_email,
1078
+ '',
1079
+ $site->id
1080
+ );
1081
+ }
1082
  }
1083
  }
1084
 
1085
  /**
1086
  * Output the input fields for the blog creation form.
1087
  *
1088
+ * @since 1.0.0
1089
+ *
1090
  * @param string $blogname Optional. The default blog name (path or domain).
1091
  * @param string $blog_title Optional. The default blog title.
1092
  * @param string|WP_Error $errors Optional. The WP_Error object returned by a previous
1093
  * submission attempt.
1094
  */
1095
  function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
1096
+ $current_site = get_current_site();
 
 
 
 
 
 
1097
 
1098
+ if ( ! $blogname && ! $blog_title ) {
1099
+ $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
1100
 
1101
+ if ( array_filter( $submitted_vars ) ) {
1102
+ $blogname = $submitted_vars['blogname'];
1103
+ $blog_title = $submitted_vars['blog_title'];
1104
+ }
1105
+ }
1106
+ ?>
1107
 
1108
+ <p>
1109
+ <?php
1110
+ // Blog name.
1111
+ if ( ! is_subdomain_install() ) {
1112
+ printf( '<label for="blogname">%s</label>', esc_html__( 'Site Name:', 'buddypress' ) );
1113
+ } else {
1114
+ printf( '<label for="blogname">%s</label>', esc_html__( 'Site Domain:', 'buddypress' ) );
1115
+ }
1116
 
1117
+ if ( ! is_subdomain_install() ) {
1118
+ printf(
1119
+ '<span class="prefix_address">%1$s</span> <input name="blogname" type="text" id="blogname" value="%2$s" maxlength="63" style="width: auto!important" /><br />',
1120
+ esc_html( $current_site->domain . $current_site->path ),
1121
+ esc_attr( $blogname )
1122
+ );
1123
+ } else {
1124
+ printf(
1125
+ '<input name="blogname" type="text" id="blogname" value="%1$s" maxlength="63" style="width: auto!important" %2$s/> <span class="suffix_address">.%3$s</span><br />',
1126
+ esc_attr( $blogname ),
1127
+ bp_get_form_field_attributes( 'blogname' ),
1128
+ bp_signup_get_subdomain_base()
1129
+ );
1130
+ }
1131
+ if ( is_wp_error( $errors ) && $errors->get_error_message( 'blogname' ) ) {
1132
+ printf( '<div class="error">%s</div>', $errors->get_error_message( 'blogname' ) );
1133
+ }
1134
+ ?>
1135
+ </p>
1136
 
1137
+ <?php
1138
+ if ( ! is_user_logged_in() ) {
1139
+ $url = sprintf(
1140
+ /* translators: %s is the site domain and path. */
1141
+ __( 'domain.%s' , 'buddypress' ),
1142
+ $current_site->domain . $current_site->path
1143
+ );
1144
 
1145
+ if ( ! is_subdomain_install() ) {
1146
+ $url = sprintf(
1147
+ /* translators: %s is the site domain and path. */
1148
+ __( '%sblogname' , 'buddypress'),
1149
+ $current_site->domain . $current_site->path
1150
+ );
1151
  }
1152
 
1153
+ printf(
1154
+ '<p>(<strong>%1$s.</strong> %2$s)</p>',
1155
+ sprintf(
1156
+ /* translators: %s is the site url. */
1157
+ esc_html__( 'Your address will be %s' , 'buddypress' ), $url
1158
+ ),
1159
+ esc_html__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!' , 'buddypress' )
1160
+ );
1161
  }
1162
 
1163
  // Blog Title.
1164
  ?>
1165
+ <p>
1166
+ <label for="blog_title"><?php esc_html_e('Site Title:', 'buddypress') ?></label>
1167
+ <input name="blog_title" type="text" id="blog_title" value="<?php echo esc_html( $blog_title ); ?>" />
1168
 
1169
+ <?php
1170
+ if ( is_wp_error( $errors ) && $errors->get_error_message( 'blog_title' ) ) {
1171
+ printf( '<div class="error">%s</div>', $errors->get_error_message( 'blog_title' ) );
1172
+ }
1173
+ ?>
1174
+ </p>
1175
+
1176
+ <fieldset class="create-site">
1177
 
1178
+ <legend class="label"><?php esc_html_e( 'Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddypress' ) ?></legend>
1179
 
1180
+ <p>
1181
+ <label class="checkbox" for="blog_public_on">
1182
+ <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php checked( ! isset( $_POST['blog_public'] ) || 1 === (int) $_POST['blog_public'] ); ?> />
1183
+ <strong><?php esc_html_e( 'Yes' , 'buddypress'); ?></strong>
1184
+ </label>
1185
+ </p>
1186
 
1187
+ <p>
1188
+ <label class="checkbox" for="blog_public_off">
1189
+ <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php checked( isset( $_POST['blog_public'] ) && 0 === (int) $_POST['blog_public'] ); ?> />
1190
+ <strong><?php esc_html_e( 'No' , 'buddypress'); ?></strong>
1191
+ </label>
1192
+ </p>
1193
 
 
 
 
 
 
 
 
 
 
 
 
1194
  </fieldset>
1195
 
1196
  <?php
1202
  *
1203
  * @param WP_Error $errors WP_Error object if any present.
1204
  */
1205
+ do_action( 'signup_blogform', $errors );
1206
  }
1207
 
1208
  /**
1210
  *
1211
  * Passes submitted values to {@link wpmu_create_blog()}.
1212
  *
1213
+ * @since 1.0.0
1214
+ *
1215
+ * @return bool|int|WP_Error False if not a form submission, the Blog ID on success, a WP_Error object on failure.
1216
  */
1217
  function bp_blogs_validate_blog_signup() {
1218
+ if ( ! isset( $_POST['submit'] ) ) {
 
 
1219
  return false;
1220
+ }
1221
 
1222
+ $current_site = get_current_site();
1223
  $current_user = wp_get_current_user();
1224
+ $blog_name = '';
1225
+ $blog_title = '';
1226
+ $public = 1;
1227
 
1228
+ if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_POST['_wpnonce'] ), 'bp_blog_signup_form' ) || ! $current_user->ID ) {
1229
+ return new WP_Error( 'bp_blogs_doing_it_wrong', __( 'Sorry, we cannot create the site. Please try again later.', 'buddypress' ) );
1230
+ }
1231
 
1232
+ $submitted_vars = bp_blogs_get_signup_form_submitted_vars();
 
1233
 
1234
+ if ( array_filter( $submitted_vars ) ) {
1235
+ $blog_name = $submitted_vars['blogname'];
1236
+ $blog_title = $submitted_vars['blog_title'];
1237
+ $public = (int) $submitted_vars['blog_public'];
1238
  }
1239
 
1240
+ $blog = bp_blogs_validate_blog_form( $blog_name, $blog_title );
1241
 
1242
+ if ( is_wp_error( $blog['errors'] ) && $blog['errors']->get_error_code() ) {
1243
+ return $blog['errors'];
1244
+ }
1245
 
1246
  /**
1247
  * Filters the default values for Blog meta.
1253
  * string $public Default public status.
1254
  * }
1255
  */
1256
+ $meta = apply_filters( 'add_signup_meta', array( 'lang_id' => 1, 'public' => $public ) );
1257
+
1258
+ return wpmu_create_blog(
1259
+ $blog['domain'],
1260
+ $blog['path'],
1261
+ $blog['blog_title'],
1262
+ $current_user->ID, $meta,
1263
+ $current_site->id
1264
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1265
  }
1266
 
1267
  /**
1268
  * Display a message after successful blog registration.
1269
  *
1270
+ * @since 1.0.0
1271
  * @since 2.6.0 Introduced `$blog_id` parameter.
1272
  *
1273
  * @param string $domain The new blog's domain.
1285
  restore_current_blog();
1286
 
1287
  ?>
1288
+ <p class="success"><?php esc_html_e( 'Congratulations! You have successfully registered a new site.', 'buddypress' ) ?></p>
1289
  <p>
1290
  <?php printf(
1291
  '%s %s',
1310
  *
1311
  * @since 1.0.0
1312
  */
1313
+ do_action( 'signup_finished' );
1314
  }
1315
 
1316
  /**
bp-blogs/classes/class-bp-rest-attachments-blog-avatar-endpoint.php CHANGED
@@ -83,7 +83,9 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller {
83
  * @return WP_REST_Response|WP_Error
84
  */
85
  public function get_item( $request ) {
86
- if ( empty( $this->blog->admin_user_id ) ) {
 
 
87
  return new WP_Error(
88
  'bp_rest_blog_avatar_get_item_user_failed',
89
  __( 'There was a problem confirming the blog\'s user admin is valid.', 'buddypress' ),
@@ -93,20 +95,29 @@ class BP_REST_Attachments_Blog_Avatar_Endpoint extends WP_REST_Controller {
93
  );
94
  }
95
 
96
- $admin_user_admin = (int) $this->blog->admin_user_id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  $args = array();
99
  foreach ( array( 'full', 'thumb' ) as $type ) {
100
- $args[ $type ] = bp_get_blog_avatar(
101
- array(
102
- 'type' => $type,
103
- 'blog_id' => $request['id'],
104
- 'admin_user_id' => $admin_user_admin,
105
- 'html' => (bool) $request['html'],
106
- 'alt' => $request['alt'],
107
- 'no_grav' => (bool) $request['no_user_gravatar'],
108
- )
109
- );
110
  }
111
 
112
  // Get the avatar object.
83
  * @return WP_REST_Response|WP_Error
84
  */
85
  public function get_item( $request ) {
86
+ $no_user_grav = (bool) $request->get_param( 'no_user_gravatar' );
87
+
88
+ if ( empty( $this->blog->admin_user_id ) && ! $no_user_grav ) {
89
  return new WP_Error(
90
  'bp_rest_blog_avatar_get_item_user_failed',
91
  __( 'There was a problem confirming the blog\'s user admin is valid.', 'buddypress' ),
95
  );
96
  }
97
 
98
+ // Set the requested args.
99
+ $requested_args = array(
100
+ 'blog_id' => $request['id'],
101
+ 'no_grav' => $no_user_grav,
102
+ 'html' => (bool) $request['html'],
103
+ );
104
+
105
+ if ( $request['alt'] ) {
106
+ $requested_args['alt'] = $request['alt'];
107
+ }
108
+
109
+ if ( ! $no_user_grav ) {
110
+ $requested_args['admin_user_id'] = (int) $this->blog->admin_user_id;
111
+
112
+ if ( ! isset( $requested_args['alt'] ) ) {
113
+ $requested_args['alt'] = '';
114
+ }
115
+ }
116
 
117
  $args = array();
118
  foreach ( array( 'full', 'thumb' ) as $type ) {
119
+ $requested_args['type'] = $type;
120
+ $args[ $type ] = bp_get_blog_avatar( $requested_args );
 
 
 
 
 
 
 
 
121
  }
122
 
123
  // Get the avatar object.
bp-blogs/classes/class-bp-rest-blogs-endpoint.php CHANGED
@@ -44,6 +44,12 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
44
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
45
  'args' => $this->get_collection_params(),
46
  ),
 
 
 
 
 
 
47
  'schema' => array( $this, 'get_item_schema' ),
48
  )
49
  );
@@ -111,14 +117,14 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
111
  }
112
 
113
  // Check if user is valid.
114
- if ( 0 !== $request['user_id'] ) {
115
- $user = get_user_by( 'id', $request['user_id'] );
116
  if ( ! $user instanceof WP_User ) {
117
  return new WP_Error(
118
  'bp_rest_blogs_get_items_user_failed',
119
  __( 'There was a problem confirming if user ID provided is a valid one.', 'buddypress' ),
120
  array(
121
- 'status' => 500,
122
  )
123
  );
124
  }
@@ -181,7 +187,7 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
181
  * @return WP_REST_Response|WP_Error
182
  */
183
  public function get_item( $request ) {
184
- $blog = $this->get_blog_object( $request['id'] );
185
 
186
  if ( empty( $blog->blog_id ) || empty( $blog->admin_user_id ) ) {
187
  return new WP_Error(
@@ -236,6 +242,157 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
236
  return apply_filters( 'bp_rest_blogs_get_item_permissions_check', true, $request );
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  /**
240
  * Prepares blogs data for return as an object.
241
  *
@@ -280,11 +437,11 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
280
  );
281
  }
282
 
283
- $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
284
- $data = $this->add_additional_fields_to_object( $data, $request );
285
- $data = $this->filter_response_by_context( $data, $context );
286
-
287
  $response = rest_ensure_response( $data );
 
288
  $response->add_links( $this->prepare_links( $blog ) );
289
 
290
  /**
@@ -383,6 +540,78 @@ class BP_REST_Blogs_Endpoint extends WP_REST_Controller {
383
  return 0;
384
  }
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  /**
387
  * Get the blogs schema, conforming to JSON Schema.
388
  *
44
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
45
  'args' => $this->get_collection_params(),
46
  ),
47
+ array(
48
+ 'methods' => WP_REST_Server::CREATABLE,
49
+ 'callback' => array( $this, 'create_item' ),
50
+ 'permission_callback' => array( $this, 'create_item_permissions_check' ),
51
+ 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ),
52
+ ),
53
  'schema' => array( $this, 'get_item_schema' ),
54
  )
55
  );
117
  }
118
 
119
  // Check if user is valid.
120
+ if ( 0 !== absint( $args['user_id'] ) ) {
121
+ $user = get_user_by( 'id', absint( $args['user_id'] ) );
122
  if ( ! $user instanceof WP_User ) {
123
  return new WP_Error(
124
  'bp_rest_blogs_get_items_user_failed',
125
  __( 'There was a problem confirming if user ID provided is a valid one.', 'buddypress' ),
126
  array(
127
+ 'status' => 404,
128
  )
129
  );
130
  }
187
  * @return WP_REST_Response|WP_Error
188
  */
189
  public function get_item( $request ) {
190
+ $blog = $this->get_blog_object( $request->get_param( 'id' ) );
191
 
192
  if ( empty( $blog->blog_id ) || empty( $blog->admin_user_id ) ) {
193
  return new WP_Error(
242
  return apply_filters( 'bp_rest_blogs_get_item_permissions_check', true, $request );
243
  }
244
 
245
+ /**
246
+ * Create a new blog.
247
+ *
248
+ * @since 7.0.0
249
+ *
250
+ * @param WP_REST_Request $request Full details about the request.
251
+ * @return WP_REST_Response|WP_Error
252
+ */
253
+ public function create_item( $request ) {
254
+ $request->set_param( 'context', 'edit' );
255
+
256
+ // Get WP_User object.
257
+ $user = bp_rest_get_user( $request->get_param( 'user_id' ) );
258
+
259
+ // Validate blog signup.
260
+ $blog_meta = wpmu_validate_blog_signup(
261
+ $request->get_param( 'name' ),
262
+ $request->get_param( 'title' ),
263
+ $user
264
+ );
265
+
266
+ // Check if validation failed.
267
+ if ( is_wp_error( $blog_meta['errors'] ) && ! empty( $blog_meta['errors']->errors ) ) {
268
+ return new WP_Error(
269
+ 'bp_rest_blog_validation_failed',
270
+ $blog_meta['errors']->get_error_message(),
271
+ array(
272
+ 'status' => 500,
273
+ )
274
+ );
275
+ }
276
+
277
+ $site_id = $request->get_param( 'site_id' );
278
+ $meta = $request->get_param( 'meta' );
279
+
280
+ // Assign blog meta.
281
+ if ( empty( $meta['public'] ) ) {
282
+ $meta['public'] = 1;
283
+ }
284
+
285
+ if ( empty( $meta['lang_id'] ) ) {
286
+ $meta['lang_id'] = 1;
287
+ }
288
+
289
+ /**
290
+ * Filter the meta arguments for the new Blog.
291
+ *
292
+ * @since 7.0.0
293
+ *
294
+ * @param array $args Key value array of query var to query value.
295
+ * @param WP_REST_Request $request The request sent to the API.
296
+ */
297
+ $meta = apply_filters( 'bp_rest_blogs_create_item_meta', $meta, $request );
298
+
299
+ // Create blog.
300
+ $blog_id = wpmu_create_blog(
301
+ $blog_meta['domain'],
302
+ $blog_meta['path'],
303
+ $blog_meta['blog_title'],
304
+ $user->ID,
305
+ $meta,
306
+ $site_id
307
+ );
308
+
309
+ // If something went wrong, bail it.
310
+ if ( is_wp_error( $blog_id ) ) {
311
+ return new WP_Error(
312
+ 'bp_rest_blogs_create_error',
313
+ __( 'There was a problem creating blog.', 'buddypress' ),
314
+ array(
315
+ 'status' => 500,
316
+ )
317
+ );
318
+ }
319
+
320
+ $blog = $this->get_blog_object( $blog_id );
321
+
322
+ if ( empty( $blog->blog_id ) || empty( $blog->admin_user_id ) ) {
323
+ return new WP_Error(
324
+ 'bp_rest_blog_invalid_id',
325
+ __( 'Invalid blog ID.', 'buddypress' ),
326
+ array(
327
+ 'status' => 404,
328
+ )
329
+ );
330
+ }
331
+
332
+ $retval = array(
333
+ $this->prepare_response_for_collection(
334
+ $this->prepare_item_for_response( $blog, $request )
335
+ ),
336
+ );
337
+
338
+ $response = rest_ensure_response( $retval );
339
+
340
+ /**
341
+ * Fires after a blog is created via the REST API.
342
+ *
343
+ * @since 7.0.0
344
+ *
345
+ * @param stdClass $blog Created blog.
346
+ * @param WP_REST_Response $response The response data.
347
+ * @param WP_REST_Request $request The request sent to the API.
348
+ */
349
+ do_action( 'bp_rest_blogs_create_item', $blog, $response, $request );
350
+
351
+ return $response;
352
+ }
353
+
354
+ /**
355
+ * Check if a given request has access to create a blog.
356
+ *
357
+ * @since 7.0.0
358
+ *
359
+ * @param WP_REST_Request $request Full details about the request.
360
+ * @return WP_Error|bool
361
+ */
362
+ public function create_item_permissions_check( $request ) {
363
+ $retval = true;
364
+
365
+ if ( ! is_user_logged_in() ) {
366
+ $retval = new WP_Error(
367
+ 'bp_rest_authorization_required',
368
+ __( 'Sorry, you are not allowed to perform this action.', 'buddypress' ),
369
+ array(
370
+ 'status' => rest_authorization_required_code(),
371
+ )
372
+ );
373
+ }
374
+
375
+ if ( true === $retval && false === bp_blog_signup_enabled() ) {
376
+ $retval = new WP_Error(
377
+ 'bp_rest_blogs_signup_disabled',
378
+ __( 'Sorry, blog creation is disabled.', 'buddypress' ),
379
+ array(
380
+ 'status' => 500,
381
+ )
382
+ );
383
+ }
384
+
385
+ /**
386
+ * Filter the blogs `create_item` permissions check.
387
+ *
388
+ * @since 7.0.0
389
+ *
390
+ * @param bool|WP_Error $retval Returned value.
391
+ * @param WP_REST_Request $request The request sent to the API.
392
+ */
393
+ return apply_filters( 'bp_rest_blogs_create_item_permissions_check', $retval, $request );
394
+ }
395
+
396
  /**
397
  * Prepares blogs data for return as an object.
398
  *
437
  );
438
  }
439
 
440
+ $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
441
+ $data = $this->add_additional_fields_to_object( $data, $request );
442
+ $data = $this->filter_response_by_context( $data, $context );
 
443
  $response = rest_ensure_response( $data );
444
+
445
  $response->add_links( $this->prepare_links( $blog ) );
446
 
447
  /**
540
  return 0;
541
  }
542
 
543
+ /**
544
+ * Edit the type of the some properties for the CREATABLE method.
545
+ *
546
+ * @since 7.0.0
547
+ *
548
+ * @param string $method Optional. HTTP method of the request.
549
+ * @return array Endpoint arguments.
550
+ */
551
+ public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
552
+ $args = parent::get_endpoint_args_for_item_schema( $method );
553
+ $key = 'get_item';
554
+
555
+ if ( WP_REST_Server::CREATABLE === $method ) {
556
+ $key = 'create_item';
557
+
558
+ unset( $args['last_activity'] );
559
+
560
+ $args['name'] = array(
561
+ 'required' => true,
562
+ 'description' => __( 'The new site\'s name (used for the site URL).', 'buddypress' ),
563
+ 'type' => 'string',
564
+ 'sanitize_callback' => 'sanitize_key',
565
+ 'validate_callback' => 'rest_validate_request_arg',
566
+ );
567
+
568
+ $args['title'] = array(
569
+ 'required' => true,
570
+ 'description' => __( 'The new site\'s title.', 'buddypress' ),
571
+ 'type' => 'string',
572
+ 'sanitize_callback' => 'sanitize_text_field',
573
+ 'validate_callback' => 'rest_validate_request_arg',
574
+ );
575
+
576
+ $args['site_id'] = array(
577
+ 'required' => false,
578
+ 'default' => get_current_network_id(),
579
+ 'description' => __( 'The new site\'s network ID. (Only relevant on multi-network installations)', 'buddypress' ),
580
+ 'type' => 'integer',
581
+ 'sanitize_callback' => 'absint',
582
+ 'validate_callback' => 'rest_validate_request_arg',
583
+ );
584
+
585
+ $args['user_id'] = array(
586
+ 'required' => false,
587
+ 'default' => bp_loggedin_user_id(),
588
+ 'description' => __( 'The user ID of the new site\'s admin.', 'buddypress' ),
589
+ 'type' => 'integer',
590
+ 'sanitize_callback' => 'absint',
591
+ 'validate_callback' => 'rest_validate_request_arg',
592
+ );
593
+
594
+ $args['meta'] = array(
595
+ 'required' => false,
596
+ 'description' => __( 'Set initial Blog options.', 'buddypress' ),
597
+ 'default' => array(),
598
+ 'type' => 'array',
599
+ 'items' => array( 'type' => 'string' ),
600
+ 'validate_callback' => 'rest_validate_request_arg',
601
+ );
602
+ }
603
+
604
+ /**
605
+ * Filters the method query arguments.
606
+ *
607
+ * @since 7.0.0
608
+ *
609
+ * @param array $args Query arguments.
610
+ * @param string $method HTTP method of the request.
611
+ */
612
+ return apply_filters( "bp_rest_blogs_{$key}_query_arguments", $args, $method );
613
+ }
614
+
615
  /**
616
  * Get the blogs schema, conforming to JSON Schema.
617
  *
bp-core/admin/bp-core-admin-components.php CHANGED
@@ -21,7 +21,8 @@ function bp_core_admin_components_settings() {
21
 
22
  <div class="wrap">
23
 
24
- <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
 
25
 
26
  <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2>
27
  <form action="" method="post" id="bp-admin-component-form">
21
 
22
  <div class="wrap">
23
 
24
+ <h1 class="wp-heading-inline"><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
25
+ <hr class="wp-header-end">
26
 
27
  <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Components', 'buddypress' ) ); ?></h2>
28
  <form action="" method="post" id="bp-admin-component-form">
bp-core/admin/bp-core-admin-functions.php CHANGED
@@ -102,9 +102,10 @@ function bp_core_admin_backpat_page() {
102
  $settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
103
 
104
  <div class="wrap">
105
- <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
 
106
 
107
- <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>
108
  <p>
109
  <?php
110
  printf(
@@ -151,7 +152,7 @@ function bp_core_print_admin_notices() {
151
 
152
  foreach ( $notice_types as $type ) {
153
  $notices = wp_list_filter( buddypress()->admin->notices, array( 'type' => $type ) );
154
- printf( '<div id="message" class="fade %s">', sanitize_html_class( $type ) );
155
 
156
  foreach ( $notices as $notice ) {
157
  printf( '<p>%s</p>', $notice['message'] );
@@ -755,96 +756,167 @@ function bp_admin_wp_nav_menu_meta_box() {
755
  return;
756
  }
757
 
758
- add_meta_box( 'add-buddypress-nav-menu', __( 'BuddyPress', 'buddypress' ), 'bp_admin_do_wp_nav_menu_meta_box', 'nav-menus', 'side', 'default' );
759
 
760
  add_action( 'admin_print_footer_scripts', 'bp_admin_wp_nav_menu_restrict_items' );
761
  }
762
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
  /**
764
  * Build and populate the BuddyPress accordion on Appearance > Menus.
765
  *
766
  * @since 1.9.0
 
767
  *
768
  * @global $nav_menu_selected_id
769
  */
770
- function bp_admin_do_wp_nav_menu_meta_box() {
771
  global $nav_menu_selected_id;
772
 
773
- $walker = new BP_Walker_Nav_Menu_Checklist( false );
774
- $args = array( 'walker' => $walker );
 
 
775
 
776
- $post_type_name = 'buddypress';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
 
778
- $tabs = array();
 
779
 
780
- $tabs['loggedin']['label'] = __( 'Logged-In', 'buddypress' );
781
- $tabs['loggedin']['pages'] = bp_nav_menu_get_loggedin_pages();
 
782
 
783
- $tabs['loggedout']['label'] = __( 'Logged-Out', 'buddypress' );
784
- $tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages();
 
 
 
 
 
 
 
 
 
 
785
 
786
- ?>
 
 
787
 
788
- <div id="buddypress-menu" class="posttypediv">
789
- <h4><?php _e( 'Logged-In', 'buddypress' ); ?></h4>
790
- <p><?php _e( '<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in.', 'buddypress' ); ?></p>
 
 
 
 
 
 
 
 
 
791
 
792
- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedin" class="tabs-panel tabs-panel-active">
793
- <ul id="buddypress-menu-checklist-loggedin" class="categorychecklist form-no-clear">
794
- <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args ); ?>
795
- </ul>
796
- </div>
797
 
798
- <h4><?php _e( 'Logged-Out', 'buddypress' ); ?></h4>
799
- <p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', 'buddypress' ); ?></p>
 
 
 
 
 
 
800
 
801
- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedout" class="tabs-panel tabs-panel-active">
802
- <ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear">
803
- <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args ); ?>
804
- </ul>
805
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
806
 
807
- <?php
808
- $removed_args = array(
809
- 'action',
810
- 'customlink-tab',
811
- 'edit-menu-item',
812
- 'menu-item',
813
- 'page-tab',
814
- '_wpnonce',
 
 
815
  );
816
- ?>
817
 
818
- <p class="button-controls">
819
- <span class="list-controls">
820
- <a href="
821
- <?php
822
- echo esc_url(
823
- add_query_arg(
824
- array(
825
- $post_type_name . '-tab' => 'all',
826
- 'selectall' => 1,
827
- ),
828
- remove_query_arg( $removed_args )
829
- )
830
- );
831
- ?>
832
- #buddypress-menu" class="select-all"><?php _e( 'Select All', 'buddypress' ); ?></a>
833
- </span>
834
- <span class="add-to-menu">
835
- <input type="submit"
836
- <?php
837
- if ( function_exists( 'wp_nav_menu_disabled_check' ) ) :
838
- wp_nav_menu_disabled_check( $nav_menu_selected_id );
839
- endif;
840
- ?>
841
- class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'buddypress' ); ?>" name="add-custom-menu-item" id="submit-buddypress-menu" />
842
- <span class="spinner"></span>
843
- </span>
844
- </p>
845
- </div><!-- /#buddypress-menu -->
846
 
847
- <?php
 
 
 
 
 
 
848
  }
849
 
850
  /**
102
  $settings_url = add_query_arg( 'page', 'bp-components', $url ); ?>
103
 
104
  <div class="wrap">
105
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h1>
106
+ <hr class="wp-header-end">
107
 
108
+ <p><?php esc_html_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>
109
  <p>
110
  <?php
111
  printf(
152
 
153
  foreach ( $notice_types as $type ) {
154
  $notices = wp_list_filter( buddypress()->admin->notices, array( 'type' => $type ) );
155
+ printf( '<div id="message" class="fade %s notice is-dismissible">', sanitize_html_class( $type ) );
156
 
157
  foreach ( $notices as $notice ) {
158
  printf( '<p>%s</p>', $notice['message'] );
756
  return;
757
  }
758
 
759
+ add_meta_box( 'add-buddypress-nav-menu', __( 'BuddyPress Member', 'buddypress' ), 'bp_admin_do_wp_nav_menu_meta_box', 'nav-menus', 'side', 'default' );
760
 
761
  add_action( 'admin_print_footer_scripts', 'bp_admin_wp_nav_menu_restrict_items' );
762
  }
763
 
764
+ /**
765
+ * BP Member nav menu filter to short-circuit WP's query.
766
+ *
767
+ * @since 7.0.0
768
+ *
769
+ * @param null $null A null value.
770
+ * @param WP_Query $wp_query The WP_Query instance (passed by reference).
771
+ * @return array The BP Member nav items to short-circuit WP's query,
772
+ */
773
+ function bp_admin_get_wp_nav_menu_items( $null, $wp_query ) {
774
+ if ( isset( $wp_query->query['orderby'], $wp_query->query['order'] ) && 'post_date' === $wp_query->query['orderby'] && 'DESC' === $wp_query->query['order'] ) {
775
+ return bp_nav_menu_get_loggedin_pages();
776
+ } elseif ( isset( $wp_query->query['nopaging'] ) && true === $wp_query->query['nopaging'] ) {
777
+ return array_merge( bp_nav_menu_get_loggedin_pages(), bp_nav_menu_get_loggedout_pages() );
778
+ }
779
+
780
+ return bp_nav_menu_get_loggedout_pages();
781
+ }
782
+
783
  /**
784
  * Build and populate the BuddyPress accordion on Appearance > Menus.
785
  *
786
  * @since 1.9.0
787
+ * @since 7.0.0 Uses wp_nav_menu_item_post_type_meta_box()
788
  *
789
  * @global $nav_menu_selected_id
790
  */
791
+ function bp_admin_do_wp_nav_menu_meta_box( $object = '', $box = array() ) {
792
  global $nav_menu_selected_id;
793
 
794
+ $box['args'] = (object) array(
795
+ 'name' => 'bp_nav_menu_item',
796
+ '_default_query' => array(),
797
+ );
798
 
799
+ // Temporarly register a post type.
800
+ register_post_type(
801
+ 'bp_nav_menu_item',
802
+ array(
803
+ 'label' => 'BuddyPress',
804
+ 'labels' => array(
805
+ 'search_items' => __( 'Search BuddyPress member menu items', 'buddypress' ),
806
+ 'all_items' => __( 'All BuddyPress Member menu items', 'buddypress' ),
807
+ ),
808
+ 'public' => true,
809
+ 'hierarchical' => false,
810
+ 'has_archive' => false,
811
+ 'rewrite' => false,
812
+ )
813
+ );
814
 
815
+ // Temporarly override the posts query results.
816
+ add_filter( 'posts_pre_query', 'bp_admin_get_wp_nav_menu_items', 10, 2 );
817
 
818
+ ob_start();
819
+ wp_nav_menu_item_post_type_meta_box( 'buddypress', $box );
820
+ $output = ob_get_clean();
821
 
822
+ $get_bp_items = new WP_Query;
823
+ $all_bp_items = $get_bp_items->query( array( 'nopaging' => true ) );
824
+ $walker = new Walker_Nav_Menu_Checklist();
825
+ $all_bp_tabs = sprintf(
826
+ '<div id="bp_nav_menu_item-all" class="tabs-panel tabs-panel-view-all tabs-panel-inactive" role="region" aria-label="%1$s" tabindex="0">
827
+ <ul id="bp_nav_menu_itemchecklist" data-wp-lists="list:bp_nav_menu_item" class="categorychecklist form-no-clear">
828
+ %2$s
829
+ </ul>
830
+ </div>',
831
+ esc_html__( 'All BuddyPress Member menu items', 'buddypress' ),
832
+ walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $all_bp_items ), 0, (object) array( 'walker' => $walker ) )
833
+ );
834
 
835
+ // Remove temporary post type and filter.
836
+ unregister_post_type( 'bp_nav_menu_item' );
837
+ remove_filter( 'posts_pre_query', 'bp_admin_get_wp_nav_menu_items', 10, 2 );
838
 
839
+ $tab_name = 'bp_nav_menu_item-tab';
840
+ $current_tab = 'logged-in';
841
+ $tabs = array(
842
+ 'logged-in' => __( 'Logged-In', 'buddypress' ),
843
+ 'logged-out' => __( 'Logged-Out', 'buddypress' ),
844
+ 'all' => __( 'All', 'buddypress' ),
845
+ );
846
+ $tab_urls = array(
847
+ 'all' => '',
848
+ 'logged-in' => '',
849
+ 'logged-out' => '',
850
+ );
851
 
852
+ if ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array_keys( $tabs ), true ) ) {
853
+ $current_tab = $_REQUEST[ $tab_name ];
854
+ }
 
 
855
 
856
+ $removed_args = array(
857
+ 'action',
858
+ 'customlink-tab',
859
+ 'edit-menu-item',
860
+ 'menu-item',
861
+ 'page-tab',
862
+ '_wpnonce',
863
+ );
864
 
865
+ if ( $nav_menu_selected_id ) {
866
+ $tab_urls['all'] = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) );
867
+ $tab_urls['logged-in'] = esc_url( add_query_arg( $tab_name, 'logged-in', remove_query_arg( $removed_args ) ) );
868
+ $tab_urls['logged-out'] = esc_url( add_query_arg( $tab_name, 'logged-out', remove_query_arg( $removed_args ) ) );
869
+ }
870
+
871
+ $bp_tabs_nav = '';
872
+ foreach ( $tabs as $tab => $tab_text ) {
873
+ $class = '';
874
+ $datatype = 'bp_nav_menu_item-' . $tab;
875
+
876
+ if ( $current_tab === $tab ) {
877
+ $class = ' class="tabs"';
878
+ }
879
+
880
+ if ( 'all' !== $tab ) {
881
+ $datatype = 'tabs-panel-posttype-bp_nav_menu_item-' . $tab;
882
+ }
883
 
884
+ $bp_tabs_nav .= sprintf(
885
+ '<li%1$s>
886
+ <a class="nav-tab-link" data-type="%2$s" href="%3$s">
887
+ %4$s
888
+ </a>
889
+ </li>',
890
+ $class,
891
+ $datatype,
892
+ esc_url( $tab_urls[ $tab ] ) . '#' . $datatype,
893
+ esc_html( $tab_text )
894
  );
895
+ }
896
 
897
+ $output = str_replace(
898
+ array(
899
+ 'tabs-panel-posttype-bp_nav_menu_item-most-recent',
900
+ 'bp_nav_menu_itemchecklist-most-recent',
901
+ 'bp_nav_menu_item-all',
902
+ 'bp_nav_menu_itemchecklist',
903
+ ),
904
+ array(
905
+ 'tabs-panel-posttype-bp_nav_menu_item-logged-in',
906
+ 'bp_nav_menu_itemchecklist-logged-in',
907
+ 'tabs-panel-posttype-bp_nav_menu_item-logged-out',
908
+ 'bp_nav_menu_itemchecklist-logged-out',
909
+ ),
910
+ $output
911
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
912
 
913
+ preg_match( '/\<ul\sid=\"posttype-bp_nav_menu_item-tabs\"[^>]*>(.*?)\<\/ul\>\<!-- \.posttype-tabs --\>/s', $output, $tabs_nav );
914
+
915
+ if ( isset( $tabs_nav[1] ) ) {
916
+ $output = str_replace( $tabs_nav[1], $bp_tabs_nav, $output );
917
+ }
918
+
919
+ echo preg_replace( '/\<div\sclass=\".*\"\sid=\"tabs-panel-posttype-bp_nav_menu_item-search\"[^>]*>(.*?)\<\/div\>/s', $all_bp_tabs, $output );
920
  }
921
 
922
  /**
bp-core/admin/bp-core-admin-settings.php CHANGED
@@ -272,9 +272,10 @@ function bp_core_admin_settings() {
272
 
273
  <div class="wrap">
274
 
275
- <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
 
276
 
277
- <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Options', 'buddypress' ) ); ?></h2>
278
 
279
  <form action="<?php echo esc_url( $form_action ) ?>" method="post">
280
 
272
 
273
  <div class="wrap">
274
 
275
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Settings', 'buddypress' ); ?></h1>
276
+ <hr class="wp-header-end">
277
 
278
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( esc_html__( 'Options', 'buddypress' ) ); ?></h2>
279
 
280
  <form action="<?php echo esc_url( $form_action ) ?>" method="post">
281
 
bp-core/admin/bp-core-admin-slugs.php CHANGED
@@ -21,9 +21,10 @@ function bp_core_admin_slugs_settings() {
21
 
22
  <div class="wrap">
23
 
24
- <h1><?php _e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
 
25
 
26
- <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Pages', 'buddypress' ) ); ?></h2>
27
  <form action="" method="post" id="bp-admin-page-form">
28
 
29
  <?php bp_core_admin_slugs_options(); ?>
@@ -143,7 +144,7 @@ function bp_core_admin_slugs_options() {
143
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
144
  ) ); ?>
145
 
146
- <?php if ( !empty( $existing_pages[$name] ) ) : ?>
147
 
148
  <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
149
  <?php _e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
@@ -227,7 +228,7 @@ function bp_core_admin_slugs_options() {
227
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
228
  ) ) ?>
229
 
230
- <?php if ( !empty( $existing_pages[$name] ) ) : ?>
231
 
232
  <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
233
 
21
 
22
  <div class="wrap">
23
 
24
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
25
+ <hr class="wp-header-end">
26
 
27
+ <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( esc_html__( 'Pages', 'buddypress' ) ); ?></h2>
28
  <form action="" method="post" id="bp-admin-page-form">
29
 
30
  <?php bp_core_admin_slugs_options(); ?>
144
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
145
  ) ); ?>
146
 
147
+ <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
148
 
149
  <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
150
  <?php _e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
228
  'selected' => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
229
  ) ) ?>
230
 
231
+ <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
232
 
233
  <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
234
 
bp-core/admin/bp-core-admin-tools.php CHANGED
@@ -19,23 +19,29 @@ function bp_core_admin_tools() {
19
  ?>
20
  <div class="wrap">
21
 
22
- <h1><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
 
23
 
24
- <p><?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' ); ?></p>
 
25
  <p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
26
  </p>
27
- <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
 
29
  <form class="settings" method="post" action="">
30
 
31
  <fieldset>
32
- <legend><?php esc_html_e( 'Repair tools', 'buddypress' ) ?></legend>
33
 
34
- <div class="checkbox">
35
  <?php foreach ( bp_admin_repair_list() as $item ) : ?>
36
- <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>
 
 
 
 
37
  <?php endforeach; ?>
38
- </div>
39
 
40
  <p class="submit">
41
  <input class="button-primary" type="submit" name="bp-tools-submit" value="<?php esc_attr_e( 'Repair Items', 'buddypress' ); ?>" />
@@ -137,6 +143,14 @@ function bp_admin_repair_list() {
137
  __( 'Repopulate site tracking records.', 'buddypress' ),
138
  'bp_admin_repair_blog_records',
139
  );
 
 
 
 
 
 
 
 
140
  }
141
 
142
  // Emails:
@@ -306,6 +320,59 @@ function bp_admin_repair_blog_records() {
306
  return array( 0, sprintf( $statement, $result ) );
307
  }
308
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  /**
310
  * Recalculate the total number of active site members.
311
  *
@@ -354,8 +421,7 @@ function bp_admin_invitations_table() {
354
  bp_core_install_invitations();
355
 
356
  // Check for existence of invitations table.
357
- $bp_prefix = bp_core_get_table_prefix();
358
- $table_name = "{$bp_prefix}bp_invitations";
359
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
360
  if ( ! $wpdb->get_var( $query ) == $table_name ) {
361
  // Early return if table creation failed.
@@ -422,7 +488,7 @@ function bp_admin_tools_feedback( $message, $class = false ) {
422
  return false;
423
  }
424
 
425
- $message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>';
426
  $message = str_replace( "'", "\'", $message );
427
  $lambda = function() use ( $message ) { echo $message; };
428
 
@@ -442,7 +508,8 @@ function bp_admin_tools_feedback( $message, $class = false ) {
442
  function bp_core_admin_available_tools_page() {
443
  ?>
444
  <div class="wrap">
445
- <h1><?php esc_attr_e( 'Tools', 'buddypress' ) ?></h1>
 
446
 
447
  <?php
448
 
19
  ?>
20
  <div class="wrap">
21
 
22
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h1>
23
+ <hr class="wp-header-end">
24
 
25
+ <p><?php esc_html_e( 'BuddyPress keeps track of various relationships between members, groups, and activity items.', 'buddypress' ); ?></p>
26
+ <p><?php esc_html_e( 'Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?></p>
27
  <p><?php esc_html_e( 'Use the tools below to manually recalculate these relationships.', 'buddypress' ); ?>
28
  </p>
29
+ <p class="attention"><?php esc_html_e( 'Some of these tools create substantial database overhead. Avoid running more than one repair job at a time.', 'buddypress' ); ?></p>
30
+
31
+ <h2><?php esc_html_e( 'Activate checkboxe(s) to select the operation(s) to perform', 'buddypress' ); ?></h2>
32
 
33
  <form class="settings" method="post" action="">
34
 
35
  <fieldset>
36
+ <legend class="screen-reader-text"><?php esc_html_e( 'Repair tools', 'buddypress' ); ?></legend>
37
 
 
38
  <?php foreach ( bp_admin_repair_list() as $item ) : ?>
39
+ <p>
40
+ <label for="<?php echo esc_attr( str_replace( '_', '-', $item[0] ) ); ?>">
41
+ <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] ); ?>
42
+ </label>
43
+ </p>
44
  <?php endforeach; ?>
 
45
 
46
  <p class="submit">
47
  <input class="button-primary" type="submit" name="bp-tools-submit" value="<?php esc_attr_e( 'Repair Items', 'buddypress' ); ?>" />
143
  __( 'Repopulate site tracking records.', 'buddypress' ),
144
  'bp_admin_repair_blog_records',
145
  );
146
+
147
+ if ( bp_is_active( 'blogs', 'site-icon' ) ) {
148
+ $repair_list[91] = array(
149
+ 'bp-blog-site-icons',
150
+ __( 'Repair site tracking site icons/blog avatars synchronization.', 'buddypress' ),
151
+ 'bp_admin_repair_blog_site_icons',
152
+ );
153
+ }
154
  }
155
 
156
  // Emails:
320
  return array( 0, sprintf( $statement, $result ) );
321
  }
322
 
323
+ /**
324
+ * Repair site icons/blog avatars synchronization.
325
+ *
326
+ * @since 7.0.0
327
+ *
328
+ * @return array
329
+ */
330
+ function bp_admin_repair_blog_site_icons() {
331
+
332
+ /* translators: %s: the result of the action performed by the repair tool */
333
+ $statement = __( 'Repairing site icons/blog avatars synchronization&hellip; %s', 'buddypress' );
334
+
335
+ // Run function if blogs component is active.
336
+ if ( bp_is_active( 'blogs', 'site-icon' ) ) {
337
+ $blog_ids = get_sites(
338
+ array(
339
+ 'fields' => 'ids',
340
+ 'archived' => 0,
341
+ 'mature' => 0,
342
+ 'spam' => 0,
343
+ 'deleted' => 0,
344
+ )
345
+ );
346
+
347
+ $sizes = array(
348
+ array(
349
+ 'key' => 'site_icon_url_full',
350
+ 'size' => bp_core_avatar_full_width(),
351
+ ),
352
+ array(
353
+ 'key' => 'site_icon_url_thumb',
354
+ 'size' => bp_core_avatar_thumb_width(),
355
+ ),
356
+ );
357
+
358
+ foreach ( $blog_ids as $blog_id ) {
359
+ $site_icon = 0;
360
+
361
+ foreach ( $sizes as $size ) {
362
+ $site_icon = bp_blogs_get_site_icon_url( $blog_id, $size['size'] );
363
+ if ( ! $site_icon ) {
364
+ $site_icon = 0;
365
+ }
366
+
367
+ bp_blogs_update_blogmeta( $blog_id, $size['key'], $site_icon );
368
+ }
369
+ }
370
+ }
371
+
372
+ // All done!
373
+ return array( 0, sprintf( $statement, __( 'Complete!', 'buddypress' ) ) );
374
+ }
375
+
376
  /**
377
  * Recalculate the total number of active site members.
378
  *
421
  bp_core_install_invitations();
422
 
423
  // Check for existence of invitations table.
424
+ $table_name = BP_Invitation_Manager::get_table_name();
 
425
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) );
426
  if ( ! $wpdb->get_var( $query ) == $table_name ) {
427
  // Early return if table creation failed.
488
  return false;
489
  }
490
 
491
+ $message = '<div id="message" class="' . esc_attr( $class ) . ' notice is-dismissible">' . $message . '</div>';
492
  $message = str_replace( "'", "\'", $message );
493
  $lambda = function() use ( $message ) { echo $message; };
494
 
508
  function bp_core_admin_available_tools_page() {
509
  ?>
510
  <div class="wrap">
511
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'Tools', 'buddypress' ) ?></h1>
512
+ <hr class="wp-header-end">
513
 
514
  <?php
515
 
bp-core/admin/bp-core-admin-types.php ADDED
@@ -0,0 +1,298 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Types Admin functions.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage Core
7
+ * @since 7.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ /**
16
+ * Get default values for the taxonomy registered metadata.
17
+ *
18
+ * @since 7.0.0
19
+ *
20
+ * @param string $type_taxonomy The type's taxonomy name.
21
+ * @return array Default values for the taxonomy registered metadata.
22
+ */
23
+ function bp_core_admin_get_type_default_meta_values( $type_taxonomy ) {
24
+ $metadata_schema = bp_get_type_metadata_schema( false, $type_taxonomy );
25
+ $metadata = wp_list_pluck( $metadata_schema, 'type' );
26
+
27
+ // Set default values according to their schema type.
28
+ foreach ( $metadata as $meta_key => $meta_value ) {
29
+ if ( in_array( $meta_value, array( 'boolean', 'integer' ), true ) ) {
30
+ $metadata[ $meta_key ] = 0;
31
+ } else {
32
+ $metadata[ $meta_key ] = '';
33
+ }
34
+ }
35
+
36
+ return $metadata;
37
+ }
38
+
39
+ /**
40
+ * Insert a new type into the database.
41
+ *
42
+ * @since 7.0.0
43
+ *
44
+ * @param array $args {
45
+ * Array of arguments describing the object type.
46
+ *
47
+ * @type string $taxonomy The Type's taxonomy. Required.
48
+ * @type string $bp_type_id Unique string identifier for the member type. Required.
49
+ * @see keys of the array returned by bp_get_type_metadata_schema() for the other arguments.
50
+ * }
51
+ * @return integer|WP_Error The Type's term ID on success. A WP_Error object otherwise.
52
+ */
53
+ function bp_core_admin_insert_type( $args = array() ) {
54
+ $default_args = array(
55
+ 'taxonomy' => '',
56
+ 'bp_type_id' => '',
57
+ );
58
+
59
+ $args = array_map( 'wp_unslash', $args );
60
+ $args = bp_parse_args(
61
+ $args,
62
+ $default_args,
63
+ 'admin_insert_type'
64
+ );
65
+
66
+ if ( ! $args['bp_type_id'] || ! $args['taxonomy'] ) {
67
+ return new WP_Error(
68
+ 'invalid_type_taxonomy',
69
+ __( 'The Type ID value is missing', 'buddypress' ),
70
+ array(
71
+ 'message' => 1,
72
+ )
73
+ );
74
+ }
75
+
76
+ $type_id = sanitize_title( $args['bp_type_id'] );
77
+ $type_taxonomy = sanitize_key( $args['taxonomy'] );
78
+
79
+ /**
80
+ * Filter here to check for an already existing type.
81
+ *
82
+ * @since 7.0.0
83
+ *
84
+ * @param boolean $value True if the type exists. False otherwise.
85
+ * @param string $type_id The Type's ID.
86
+ */
87
+ $type_exists = apply_filters( "{$type_taxonomy}_check_existing_type", false, $type_id );
88
+
89
+ if ( false !== $type_exists ) {
90
+ return new WP_Error(
91
+ 'type_already_exists',
92
+ __( 'The Type already exists', 'buddypress' ),
93
+ array(
94
+ 'message' => 5,
95
+ )
96
+ );
97
+ }
98
+
99
+ // Get defaulte values for metadata.
100
+ $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy );
101
+
102
+ // Validate metadata
103
+ $metas = array_filter( array_intersect_key( $args, $metadata ) );
104
+
105
+ // Insert the Type into the database.
106
+ $type_term_id = bp_insert_term(
107
+ $type_id,
108
+ $type_taxonomy,
109
+ array(
110
+ 'slug' => $type_id,
111
+ 'metas' => $metas,
112
+ )
113
+ );
114
+
115
+ if ( is_wp_error( $type_term_id ) ) {
116
+ $type_term_id->add_data(
117
+ array(
118
+ 'message' => 3,
119
+ )
120
+ );
121
+
122
+ return $type_term_id;
123
+ }
124
+
125
+ /**
126
+ * Hook here to add code once the type has been inserted.
127
+ *
128
+ * @since 7.0.0
129
+ *
130
+ * @param integer $type_term_id The Type's term_ID.
131
+ * @param string $type_taxonomy The Type's taxonomy name.
132
+ * @param string $type_id The Type's ID.
133
+ */
134
+ do_action( 'bp_type_inserted', $type_term_id, $type_taxonomy, $type_id );
135
+
136
+ // Finally return the inserted Type's term ID.
137
+ return $type_term_id;
138
+ }
139
+
140
+ /**
141
+ * Update a type into the database.
142
+ *
143
+ * @since 7.0.0
144
+ *
145
+ * @param array $args {
146
+ * Array of arguments describing the object type.
147
+ *
148
+ * @type string $taxonomy The Type's taxonomy. Required.
149
+ * @type integer $type_term_id The Type's term ID. Required.
150
+ * @see keys of the array returned by bp_get_type_metadata_schema() for the other arguments.
151
+ * }
152
+ * @return boolean|WP_Error True on success. A WP_Error object otherwise.
153
+ */
154
+ function bp_core_admin_update_type( $args = array() ) {
155
+ $default_args = array(
156
+ 'taxonomy' => '',
157
+ 'type_term_id' => 0,
158
+ );
159
+
160
+ $args = array_map( 'wp_unslash', $args );
161
+ $args = bp_parse_args(
162
+ $args,
163
+ $default_args,
164
+ 'admin_update_type'
165
+ );
166
+
167
+ if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) {
168
+ return new WP_Error(
169
+ 'invalid_type_taxonomy',
170
+ __( 'The Term Type ID value is missing', 'buddypress' ),
171
+ array(
172
+ 'message' => 10,
173
+ )
174
+ );
175
+ }
176
+
177
+ $type_term_id = (int) $args['type_term_id'];
178
+ $type_taxonomy = sanitize_key( $args['taxonomy'] );
179
+
180
+ // Get defaulte values for metadata.
181
+ $metadata = bp_core_admin_get_type_default_meta_values( $type_taxonomy );
182
+
183
+ // Merge customs with defaults.
184
+ $metas = wp_parse_args( $args, $metadata );
185
+
186
+ // Validate metadata
187
+ $metas = array_intersect_key( $metas, $metadata );
188
+
189
+ foreach ( $metas as $meta_key => $meta_value ) {
190
+ if ( '' === $meta_value ) {
191
+ delete_term_meta( $type_term_id, $meta_key );
192
+ } else {
193
+ update_term_meta( $type_term_id, $meta_key, $meta_value );
194
+ }
195
+ }
196
+
197
+ /**
198
+ * Hook here to add code once the type has been updated.
199
+ *
200
+ * @since 7.0.0
201
+ *
202
+ * @param integer $type_term_id The Type's term_ID.
203
+ * @param string $type_taxonomy The Type's taxonomy name.
204
+ */
205
+ do_action( 'bp_type_updated', $type_term_id, $type_taxonomy );
206
+
207
+ // Finally informs about the successfull update.
208
+ return true;
209
+ }
210
+
211
+ /**
212
+ * Delete a type from the database.
213
+ *
214
+ * @since 7.0.0
215
+ *
216
+ * @param array $args {
217
+ * Array of arguments describing the object type.
218
+ *
219
+ * @type string $taxonomy The Type's taxonomy. Required.
220
+ * @type integer $type_term_id The Type's term ID. Required.
221
+ * }
222
+ * @return boolean|WP_Error True on success. A WP_Error object otherwise.
223
+ */
224
+ function bp_core_admin_delete_type( $args = array() ) {
225
+ $default_args = array(
226
+ 'taxonomy' => '',
227
+ 'type_term_id' => 0,
228
+ );
229
+
230
+ $args = array_map( 'wp_unslash', $args );
231
+ $args = bp_parse_args(
232
+ $args,
233
+ $default_args,
234
+ 'admin_delete_type'
235
+ );
236
+
237
+ if ( ! $args['type_term_id'] || ! $args['taxonomy'] ) {
238
+ return new WP_Error(
239
+ 'invalid_type_taxonomy',
240
+ __( 'The Term Type ID value is missing', 'buddypress' ),
241
+ array(
242
+ 'message' => 10,
243
+ )
244
+ );
245
+ }
246
+
247
+ $type_term_id = (int) $args['type_term_id'];
248
+ $type_taxonomy = sanitize_key( $args['taxonomy'] );
249
+ $type_term = bp_get_term_by( 'id', $type_term_id, $type_taxonomy );
250
+
251
+ if ( ! $type_term ) {
252
+ return new WP_Error(
253
+ 'type_doesnotexist',
254
+ __( 'The type was not deleted: it does not exist.', 'buddypress' ),
255
+ array(
256
+ 'message' => 6,
257
+ )
258
+ );
259
+ }
260
+
261
+ /** This filter is documented in bp-core/classes/class-bp-admin-types.php */
262
+ $registered_by_code_types = apply_filters( "{$type_taxonomy}_registered_by_code", array() );
263
+
264
+ if ( isset( $registered_by_code_types[ $type_term->name ] ) ) {
265
+ return new WP_Error(
266
+ 'type_register_by_code',
267
+ __( 'This type is registered using code, deactivate the plugin or remove the custom code before trying to delete it again.', 'buddypress' ),
268
+ array(
269
+ 'message' => 7,
270
+ )
271
+ );
272
+ }
273
+
274
+ $deleted = bp_delete_term( $type_term_id, $type_taxonomy );
275
+
276
+ if ( true !== $deleted ) {
277
+ return new WP_Error(
278
+ 'type_not_deleted',
279
+ __( 'There was an error while trying to delete this type.', 'buddypress' ),
280
+ array(
281
+ 'message' => 8,
282
+ )
283
+ );
284
+ }
285
+
286
+ /**
287
+ * Hook here to add code once the type has been deleted.
288
+ *
289
+ * @since 7.0.0
290
+ *
291
+ * @param integer $type_term_id The Type's term_ID.
292
+ * @param string $type_taxonomy The Type's taxonomy name.
293
+ */
294
+ do_action( 'bp_type_deleted', $type_term_id, $type_taxonomy );
295
+
296
+ // Finally informs about the successfull delete.
297
+ return true;
298
+ }
bp-core/admin/css/common-rtl.css CHANGED
@@ -21,8 +21,7 @@ TABLE OF CONTENTS:
21
  3.1 Users List
22
  3.2 Site Notices
23
  4.0 Emails - Edit page
24
- 5.0 Tools - BuddyPress
25
- 6.0 Plugins page
26
  ------------------------------------------------------------------------------*/
27
 
28
  /*------------------------------------------------------------------------------
@@ -523,55 +522,7 @@ body.post-type-bp-email .categorydiv label {
523
  }
524
 
525
  /*------------------------------------------------------------------------------
526
- * 5.0 Tools - BuddyPress
527
- *----------------------------------------------------------------------------*/
528
- .tools_page_bp-tools .wrap {
529
- max-width: 950px;
530
- }
531
-
532
- .tools_page_bp-tools p {
533
- line-height: 2;
534
- }
535
-
536
- .tools_page_bp-tools fieldset {
537
- margin: 2em 0 0;
538
- }
539
-
540
- .tools_page_bp-tools legend {
541
- color: #23282d;
542
- font-size: 1.3em;
543
- font-weight: 600;
544
- margin: 1em 0;
545
- }
546
-
547
- .tools_page_bp-tools label {
548
- clear: right;
549
- display: block;
550
- line-height: 1.5;
551
- margin: 0 0 1em;
552
- vertical-align: middle;
553
- }
554
-
555
- @media screen and (max-width: 782px) {
556
-
557
- .tools_page_bp-tools p {
558
- line-height: 1.5;
559
- }
560
-
561
- .tools_page_bp-tools label {
562
- margin-bottom: 1em;
563
- padding-left: 25px;
564
- text-indent: -33px;
565
- }
566
-
567
- .tools_page_bp-tools .checkbox {
568
- padding: 0 30px 0 0;
569
- }
570
- }
571
-
572
-
573
- /*------------------------------------------------------------------------------
574
- * 6.0 Plugins page
575
  *----------------------------------------------------------------------------*/
576
  #buddypress-update.not-shiny .update-message {
577
  border-right: 0;
21
  3.1 Users List
22
  3.2 Site Notices
23
  4.0 Emails - Edit page
24
+ 5.0 Plugins page
 
25
  ------------------------------------------------------------------------------*/
26
 
27
  /*------------------------------------------------------------------------------
522
  }
523
 
524
  /*------------------------------------------------------------------------------
525
+ * 5.0 Plugins page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  *----------------------------------------------------------------------------*/
527
  #buddypress-update.not-shiny .update-message {
528
  border-right: 0;
bp-core/admin/css/common-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#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.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"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#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:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}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}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}.tools_page_bp-tools .wrap{max-width:950px}.tools_page_bp-tools p{line-height:2}.tools_page_bp-tools fieldset{margin:2em 0 0}.tools_page_bp-tools legend{color:#23282d;font-size:1.3em;font-weight:600;margin:1em 0}.tools_page_bp-tools label{clear:right;display:block;line-height:1.5;margin:0 0 1em;vertical-align:middle}@media screen and (max-width:782px){.tools_page_bp-tools p{line-height:1.5}.tools_page_bp-tools label{margin-bottom:1em;padding-left:25px;text-indent:-33px}.tools_page_bp-tools .checkbox{padding:0 30px 0 0}}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
1
+ .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -5px 0 -15px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-left:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:right;margin:0 0 10px 10px;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-left:20px;margin-right:10px}.bp-about-wrap .bp-about-wrap h1{margin-left:0}}#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.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"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#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:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(-15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}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}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:right;margin-left:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-right:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-right:0;width:100%}.bp-new-notice-panel .button-primary{margin-right:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:right;padding-right:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-right:0;padding-right:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
bp-core/admin/css/common.css CHANGED
@@ -21,8 +21,7 @@ TABLE OF CONTENTS:
21
  3.1 Users List
22
  3.2 Site Notices
23
  4.0 Emails - Edit page
24
- 5.0 Tools - BuddyPress
25
- 6.0 Plugins page
26
  ------------------------------------------------------------------------------*/
27
 
28
  /*------------------------------------------------------------------------------
@@ -523,55 +522,7 @@ body.post-type-bp-email .categorydiv label {
523
  }
524
 
525
  /*------------------------------------------------------------------------------
526
- * 5.0 Tools - BuddyPress
527
- *----------------------------------------------------------------------------*/
528
- .tools_page_bp-tools .wrap {
529
- max-width: 950px;
530
- }
531
-
532
- .tools_page_bp-tools p {
533
- line-height: 2;
534
- }
535
-
536
- .tools_page_bp-tools fieldset {
537
- margin: 2em 0 0;
538
- }
539
-
540
- .tools_page_bp-tools legend {
541
- color: #23282d;
542
- font-size: 1.3em;
543
- font-weight: 600;
544
- margin: 1em 0;
545
- }
546
-
547
- .tools_page_bp-tools label {
548
- clear: left;
549
- display: block;
550
- line-height: 1.5;
551
- margin: 0 0 1em;
552
- vertical-align: middle;
553
- }
554
-
555
- @media screen and (max-width: 782px) {
556
-
557
- .tools_page_bp-tools p {
558
- line-height: 1.5;
559
- }
560
-
561
- .tools_page_bp-tools label {
562
- margin-bottom: 1em;
563
- padding-right: 25px;
564
- text-indent: -33px;
565
- }
566
-
567
- .tools_page_bp-tools .checkbox {
568
- padding: 0 0 0 30px;
569
- }
570
- }
571
-
572
-
573
- /*------------------------------------------------------------------------------
574
- * 6.0 Plugins page
575
  *----------------------------------------------------------------------------*/
576
  #buddypress-update.not-shiny .update-message {
577
  border-left: 0;
21
  3.1 Users List
22
  3.2 Site Notices
23
  4.0 Emails - Edit page
24
+ 5.0 Plugins page
 
25
  ------------------------------------------------------------------------------*/
26
 
27
  /*------------------------------------------------------------------------------
522
  }
523
 
524
  /*------------------------------------------------------------------------------
525
+ * 5.0 Plugins page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  *----------------------------------------------------------------------------*/
527
  #buddypress-update.not-shiny .update-message {
528
  border-left: 0;
bp-core/admin/css/common.min.css CHANGED
@@ -1 +1 @@
1
- .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#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.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"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#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:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}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}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}.tools_page_bp-tools .wrap{max-width:950px}.tools_page_bp-tools p{line-height:2}.tools_page_bp-tools fieldset{margin:2em 0 0}.tools_page_bp-tools legend{color:#23282d;font-size:1.3em;font-weight:600;margin:1em 0}.tools_page_bp-tools label{clear:left;display:block;line-height:1.5;margin:0 0 1em;vertical-align:middle}@media screen and (max-width:782px){.tools_page_bp-tools p{line-height:1.5}.tools_page_bp-tools label{margin-bottom:1em;padding-right:25px;text-indent:-33px}.tools_page_bp-tools .checkbox{padding:0 0 0 30px}}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
1
+ .bp-badge{color:#d84800;display:inline-block;font:400 150px/1 dashicons!important}.bp-badge:before{content:"\f448"}.index_page_bp-about code,.settings_page_bp-credits code{background-color:#e0e0e0;color:#636363;font-size:1em}.bp-about-wrap{position:relative;max-width:1050px;font-size:15px}.bp-about-wrap img{margin:0;max-width:100%;height:auto;vertical-align:middle}.bp-about-wrap p{line-height:1.5;font-size:14px}.bp-about-wrap h2{margin:40px 0 .6em;font-size:2.7em;line-height:1.3;font-weight:300;text-align:center}.bp-about-wrap h3{margin:1.25em 0 .6em;font-size:1.4em;line-height:1.5}.bp-about-wrap code{font-size:14px;font-weight:400}.bp-about-wrap .about-description{margin-top:1.4em;font-weight:400;line-height:1.6;font-size:19px}.bp-about-wrap h3.wp-people-group{margin:2.6em 0 1.33em;padding:0;font-size:16px;line-height:inherit}.bp-about-wrap .wp-people-group{padding:0 5px;margin:0 -15px 0 -5px}.bp-about-wrap .compact{margin-bottom:0}.bp-about-wrap .wp-person{display:inline-block;vertical-align:top;margin-right:10px;padding-bottom:15px;height:70px;width:280px}.bp-about-wrap .compact .wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.bp-about-wrap .wp-person .gravatar{float:left;margin:0 10px 10px 0;padding:1px;width:60px;height:60px}.bp-about-wrap .compact .wp-person .gravatar{width:30px;height:30px}.bp-about-wrap .wp-person .web{margin:6px 0 2px;font-size:16px;font-weight:400;line-height:2;text-decoration:none}.bp-about-wrap .wp-person .title{display:block}.bp-about-wrap p.wp-credits-list a{white-space:nowrap}@media only screen and (max-width:500px){.bp-about-wrap{margin-right:20px;margin-left:10px}.bp-about-wrap .bp-about-wrap h1{margin-right:0}}#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.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"}.settings_page_bp-page-settings .button-secondary .dashicons{position:relative;top:3px}#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:""}.bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-hello-close .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.bp-hello-social .bp-tooltip:after{bottom:120%;margin-bottom:20px;margin-top:0;top:auto;transform:translateX(15%)}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}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}.bp-signups-list table{margin:1em 0}.bp-signups-list .column-fields{font-weight:700}.bp-new-notice-panel{background:#fff;border:1px solid #e5e5e5;box-shadow:0 1px 1px rgba(0,0,0,.04);font-size:13px;line-height:2.1;margin:1.5em 0 3em;overflow:auto;padding:10px 25px 25px;position:relative}.bp-new-notice-panel label{clear:both;float:left;margin-right:3%;width:20%}.bp-new-notice-panel input,.bp-new-notice-panel textarea{clear:none;margin-bottom:1em;width:75%}.bp-new-notice-panel input[type=text]:after,.bp-new-notice-panel textarea:after{clear:both;content:" ";display:table}.bp-new-notice-panel .button-primary{margin-left:23%;width:auto}.bp-notice-about{font-size:1em;margin-bottom:1em}.bp-new-notice{margin-bottom:1em;margin-top:0}.bp-notices-list{margin-bottom:0}@media screen and (max-width:782px){.bp-new-notice-panel{margin-bottom:1.5em}.bp-new-notice-panel input,.bp-new-notice-panel textarea{margin-left:0;width:100%}.bp-new-notice-panel .button-primary{margin-left:0;width:auto}.bp-new-notice-panel .button{max-width:45%;word-wrap:break-word}.bp-notice-about{margin-top:0;margin-bottom:1em}.bp-new-notice{margin-bottom:.5em}}body.post-type-bp-email #excerpt{height:auto}body.post-type-bp-email th#situation{width:20%}body.post-type-bp-email td.column-situation ul{margin:0}body.post-type-bp-email .categorydiv label{display:block;float:left;padding-left:25px;text-indent:-25px}#buddypress-update.not-shiny .update-message{border-left:0;padding-left:36px}#buddypress-update.not-shiny .update-message:before{content:"\f534"}
bp-core/admin/js/types-admin.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function() {
2
+ var bpTypesCustomizeForm = function() {
3
+ if ( document.querySelector( '#addtag input[name="post_type"]' ) ) {
4
+ document.querySelector( '#addtag input[name="post_type"]' ).remove();
5
+ }
6
+
7
+ if ( document.querySelectorAll( '.form-field' ) ) {
8
+ document.querySelectorAll( '.form-field' ).forEach( function( element ) {
9
+ if ( -1 === element.classList.value.indexOf( 'bp-types-form' ) ) {
10
+ element.remove();
11
+ }
12
+ } );
13
+ }
14
+
15
+ if ( document.querySelector( '#bp_type_has_directory' ) ) {
16
+ if ( true === document.querySelector( '#bp_type_has_directory' ).checked ) {
17
+ document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.add( 'bp-set-directory-slug' );
18
+ }
19
+
20
+ document.querySelector( '#bp_type_has_directory' ).addEventListener( 'change', function( event ) {
21
+ if ( true === event.target.checked ) {
22
+ document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.add( 'bp-set-directory-slug' );
23
+ document.querySelector( '#bp_type_directory_slug' ).removeAttribute( 'disabled' );
24
+ } else {
25
+ document.querySelector( '.term-bp_type_directory_slug-wrap' ).classList.remove( 'bp-set-directory-slug' );
26
+ document.querySelector( '#bp_type_directory_slug' ).setAttribute( 'disabled', 'disabled' );
27
+ }
28
+ } );
29
+ }
30
+
31
+ if ( document.querySelector( '#delete-link' ) ) {
32
+ document.querySelector( '#delete-link' ).remove();
33
+ }
34
+ };
35
+
36
+ if ( 'loading' === document.readyState ) {
37
+ document.addEventListener( 'DOMContentLoaded', bpTypesCustomizeForm );
38
+ } else {
39
+ bpTypesCustomizeForm;
40
+ }
41
+ } )();
bp-core/admin/js/types-admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(){var e=function(){document.querySelector('#addtag input[name="post_type"]')&&document.querySelector('#addtag input[name="post_type"]').remove(),document.querySelectorAll(".form-field")&&document.querySelectorAll(".form-field").forEach(function(e){-1===e.classList.value.indexOf("bp-types-form")&&e.remove()}),document.querySelector("#bp_type_has_directory")&&(!0===document.querySelector("#bp_type_has_directory").checked&&document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_has_directory").addEventListener("change",function(e){!0===e.target.checked?(document.querySelector(".term-bp_type_directory_slug-wrap").classList.add("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").removeAttribute("disabled")):(document.querySelector(".term-bp_type_directory_slug-wrap").classList.remove("bp-set-directory-slug"),document.querySelector("#bp_type_directory_slug").setAttribute("disabled","disabled"))})),document.querySelector("#delete-link")&&document.querySelector("#delete-link").remove()};"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",e)}();
bp-core/bp-core-actions.php CHANGED
@@ -82,9 +82,10 @@ add_action( 'bp_init', 'bp_add_rewrite_rules', 30 );
82
  add_action( 'bp_init', 'bp_add_permastructs', 40 );
83
 
84
  /**
85
- * The bp_register_taxonomies hook - Attached to 'bp_init' @ priority 2 above.
86
  */
87
  add_action( 'bp_register_taxonomies', 'bp_register_member_types' );
 
88
 
89
  /**
90
  * Late includes.
82
  add_action( 'bp_init', 'bp_add_permastructs', 40 );
83
 
84
  /**
85
+ * The bp_register_taxonomies hooks - Attached to 'bp_init' @ priority 2 above.
86
  */
87
  add_action( 'bp_register_taxonomies', 'bp_register_member_types' );
88
+ add_action( 'bp_register_taxonomies', 'bp_register_type_metadata', 20 );
89
 
90
  /**
91
  * Late includes.
bp-core/bp-core-blocks.php CHANGED
@@ -19,7 +19,7 @@ defined( 'ABSPATH' ) || exit;
19
  * False otherwise.
20
  */
21
  function bp_support_blocks() {
22
- return function_exists( 'register_block_type' ) && bp_rest_api_is_available();
23
  }
24
 
25
  /**
@@ -36,6 +36,7 @@ function bp_register_block_components() {
36
  'wp-components',
37
  'wp-i18n',
38
  'wp-api-fetch',
 
39
  ),
40
  bp_get_version()
41
  );
19
  * False otherwise.
20
  */
21
  function bp_support_blocks() {
22
+ return bp_is_running_wp( '5.0.0' ) && bp_rest_api_is_available();
23
  }
24
 
25
  /**
36
  'wp-components',
37
  'wp-i18n',
38
  'wp-api-fetch',
39
+ 'wp-url',
40
  ),
41
  bp_get_version()
42
  );
bp-core/bp-core-cache.php CHANGED
@@ -390,3 +390,28 @@ function bp_invitations_reset_cache_incrementor() {
390
  }
391
  add_action( 'bp_invitation_after_save', 'bp_invitations_reset_cache_incrementor' );
392
  add_action( 'bp_invitation_after_delete', 'bp_invitations_reset_cache_incrementor' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  }
391
  add_action( 'bp_invitation_after_save', 'bp_invitations_reset_cache_incrementor' );
392
  add_action( 'bp_invitation_after_delete', 'bp_invitations_reset_cache_incrementor' );
393
+
394
+ /**
395
+ * Add a cache group for Database object types.
396
+ *
397
+ * @since 7.0.0
398
+ */
399
+ function bp_set_object_type_terms_cache_group() {
400
+ wp_cache_add_global_groups( 'bp_object_terms' );
401
+ }
402
+ add_action( 'bp_setup_cache_groups', 'bp_set_object_type_terms_cache_group' );
403
+
404
+ /**
405
+ * Clear the Database object types cache.
406
+ *
407
+ * @since 7.0.0
408
+ *
409
+ * @param int $type_id The Type's term ID.
410
+ * @param string $taxonomy The Type's taxonomy name.
411
+ */
412
+ function bp_clear_object_type_terms_cache( $type_id = 0, $taxonomy = '' ) {
413
+ wp_cache_delete( $taxonomy, 'bp_object_terms' );
414
+ }
415
+ add_action( 'bp_type_inserted', 'bp_clear_object_type_terms_cache' );
416
+ add_action( 'bp_type_updated', 'bp_clear_object_type_terms_cache' );
417
+ add_action( 'bp_type_deleted', 'bp_clear_object_type_terms_cache' );
bp-core/bp-core-caps.php CHANGED
@@ -344,6 +344,49 @@ function bp_user_can( $user_id, $capability, $args = array() ) {
344
  return $retval;
345
  }
346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  /**
348
  * Temporary implementation of 'bp_moderate' cap.
349
  *
@@ -363,6 +406,7 @@ function bp_user_can( $user_id, $capability, $args = array() ) {
363
  * Plugin authors: Please do not use this function; thank you. :)
364
  *
365
  * @since 1.6.0
 
366
  *
367
  * @access private
368
  *
@@ -375,6 +419,7 @@ function bp_user_can( $user_id, $capability, $args = array() ) {
375
  * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant.
376
  */
377
  function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
 
378
 
379
  // Bail if not checking the 'bp_moderate' cap.
380
  if ( 'bp_moderate' !== $cap ) {
@@ -394,9 +439,6 @@ function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $us
394
  // Only users that can 'manage_options' on this site can 'bp_moderate'.
395
  return array( 'manage_options' );
396
  }
397
- add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 );
398
-
399
- /** Deprecated ****************************************************************/
400
 
401
  /**
402
  * Adds BuddyPress-specific user roles.
344
  return $retval;
345
  }
346
 
347
+ /**
348
+ * Adds the `bp_moderate` cap to Roles having the `manage_options` cap when
349
+ * BuddyPress is not active on the network.
350
+ *
351
+ * @since 7.0.0
352
+ *
353
+ * @access private
354
+ *
355
+ * @param WP_Roles $wp_roles The WordPress roles object.
356
+ */
357
+ function _bp_roles_init( WP_Roles $wp_roles ) {
358
+ $roles_list = array();
359
+ $caps_list = wp_list_pluck( $wp_roles->role_objects, 'capabilities' );
360
+
361
+ // Look for roles having the `manage_options` capability set to true.
362
+ $filtered_list = wp_list_filter( $caps_list, array( 'manage_options' => true ) );
363
+
364
+ if ( $filtered_list ) {
365
+ $roles_list = array_keys( $filtered_list );
366
+
367
+ // Loop into roles list to add the `bp_moderate` capability.
368
+ foreach ( $roles_list as $role ) {
369
+ if ( isset( $wp_roles->roles[ $role ] ) ) {
370
+ $wp_roles->roles[ $role ]['capabilities']['bp_moderate'] = true;
371
+ }
372
+
373
+ if ( isset( $wp_roles->role_objects[ $role ] ) ) {
374
+ $wp_roles->role_objects[ $role ]->capabilities['bp_moderate'] = true;
375
+ }
376
+ }
377
+ }
378
+
379
+ // Make sure to remove the `bp_moderate` capability from roles when BuddyPress is network activated.
380
+ if ( bp_is_network_activated() ) {
381
+ foreach ( $roles_list as $role ) {
382
+ unset( $wp_roles->roles[ $role ]['capabilities']['bp_moderate'], $wp_roles->role_objects[ $role ]->capabilities['bp_moderate'] );
383
+ }
384
+ }
385
+ }
386
+ add_action( 'wp_roles_init', '_bp_roles_init', 10, 1 );
387
+
388
+ /** Deprecated ****************************************************************/
389
+
390
  /**
391
  * Temporary implementation of 'bp_moderate' cap.
392
  *
406
  * Plugin authors: Please do not use this function; thank you. :)
407
  *
408
  * @since 1.6.0
409
+ * @deprecated 7.0.0
410
  *
411
  * @access private
412
  *
419
  * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant.
420
  */
421
  function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) {
422
+ _deprecated_function( __FUNCTION__, '7.0.0' );
423
 
424
  // Bail if not checking the 'bp_moderate' cap.
425
  if ( 'bp_moderate' !== $cap ) {
439
  // Only users that can 'manage_options' on this site can 'bp_moderate'.
440
  return array( 'manage_options' );
441
  }
 
 
 
442
 
443
  /**
444
  * Adds BuddyPress-specific user roles.
bp-core/bp-core-catchuri.php CHANGED
@@ -463,7 +463,7 @@ function bp_core_load_template( $templates ) {
463
  * Wiping out the bp-default template allows WordPress to use their special
464
  * embed template, which is what we want.
465
  */
466
- if ( function_exists( 'is_embed' ) && is_embed() ) {
467
  $located_template = '';
468
  }
469
 
463
  * Wiping out the bp-default template allows WordPress to use their special
464
  * embed template, which is what we want.
465
  */
466
+ if ( is_embed() ) {
467
  $located_template = '';
468
  }
469
 
bp-core/bp-core-dependency.php CHANGED
@@ -95,6 +95,21 @@ function bp_register_taxonomies() {
95
  do_action( 'bp_register_taxonomies' );
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Fire the 'bp_register_post_types' action, where plugins should register post types.
100
  *
95
  do_action( 'bp_register_taxonomies' );
96
  }
97
 
98
+ /**
99
+ * Fire the 'bp_register_type_metadata' action, where plugins should register metadata for their custom BuddyPress types.
100
+ *
101
+ * @since 7.0.0
102
+ */
103
+ function bp_register_type_metadata() {
104
+
105
+ /**
106
+ * Fires inside the 'bp_register_type_metadata' function, where plugins should register metadata for their custom BuddyPress types.
107
+ *
108
+ * @since 7.0.0
109
+ */
110
+ do_action( 'bp_register_type_metadata' );
111
+ }
112
+
113
  /**
114
  * Fire the 'bp_register_post_types' action, where plugins should register post types.
115
  *
bp-core/bp-core-filters.php CHANGED
@@ -59,6 +59,9 @@ add_filter( 'bp_email_set_content_html', 'stripslashes', 8 );
59
  add_filter( 'bp_email_set_content_plaintext', 'wp_strip_all_tags', 6 );
60
  add_filter( 'bp_email_set_subject', 'sanitize_text_field', 6 );
61
 
 
 
 
62
  /**
63
  * Template Compatibility.
64
  *
@@ -691,6 +694,16 @@ add_filter( 'document_title_parts', 'bp_modify_document_title_parts', 20, 1 );
691
  */
692
  function bp_setup_nav_menu_item( $menu_item ) {
693
  if ( is_admin() ) {
 
 
 
 
 
 
 
 
 
 
694
  return $menu_item;
695
  }
696
 
@@ -889,6 +902,31 @@ function bp_core_filter_edit_post_link( $edit_link = '', $post_id = 0 ) {
889
  return $edit_link;
890
  }
891
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
892
  /**
893
  * Should BuddyPress load the mentions scripts and related assets, including results to prime the
894
  * mentions suggestions?
59
  add_filter( 'bp_email_set_content_plaintext', 'wp_strip_all_tags', 6 );
60
  add_filter( 'bp_email_set_subject', 'sanitize_text_field', 6 );
61
 
62
+ // Avatars.
63
+ add_filter( 'bp_core_fetch_avatar', 'bp_core_add_loading_lazy_attribute' );
64
+
65
  /**
66
  * Template Compatibility.
67
  *
694
  */
695
  function bp_setup_nav_menu_item( $menu_item ) {
696
  if ( is_admin() ) {
697
+ if ( 'bp_nav_menu_item' === $menu_item->object ) {
698
+ $menu_item->type = 'custom';
699
+ $menu_item->url = $menu_item->guid;
700
+
701
+ if ( ! in_array( array( 'bp-menu', 'bp-'. $menu_item->post_excerpt .'-nav' ), $menu_item->classes ) ) {
702
+ $menu_item->classes[] = 'bp-menu';
703
+ $menu_item->classes[] = 'bp-'. $menu_item->post_excerpt .'-nav';
704
+ }
705
+ }
706
+
707
  return $menu_item;
708
  }
709
 
902
  return $edit_link;
903
  }
904
 
905
+ /**
906
+ * Add 'loading="lazy"' attribute into images and iframes.
907
+ *
908
+ * @since 7.0.0
909
+ *
910
+ * @string $content Content to inject attribute into.
911
+ * @return string
912
+ */
913
+ function bp_core_add_loading_lazy_attribute( $content = '' ) {
914
+ if ( false === strpos( $content, '<img ' ) && false === strpos( $content, '<iframe ' ) ) {
915
+ return $content;
916
+ }
917
+
918
+ $content = str_replace( '<img ', '<img loading="lazy" ', $content );
919
+ $content = str_replace( '<iframe ', '<iframe loading="lazy" ', $content );
920
+
921
+ // WordPress posts need their position absolute removed for lazyloading.
922
+ $find_pos_absolute = ' style="position: absolute; clip: rect(1px, 1px, 1px, 1px);" ';
923
+ if ( false !== strpos( $content, 'data-secret=' ) && false !== strpos( $content, $find_pos_absolute ) ) {
924
+ $content = str_replace( $find_pos_absolute, '', $content );
925
+ }
926
+
927
+ return $content;
928
+ }
929
+
930
  /**
931
  * Should BuddyPress load the mentions scripts and related assets, including results to prime the
932
  * mentions suggestions?
bp-core/bp-core-functions.php CHANGED
@@ -70,6 +70,19 @@ function bp_db_version_raw() {
70
  return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /** Functions *****************************************************************/
74
 
75
  /**
@@ -515,7 +528,7 @@ function bp_core_get_directory_page_ids( $status = 'active' ) {
515
  unset( $page_ids[ $component_name ] );
516
  }
517
 
518
- // 'register' and 'activate' do not have components, but should be whitelisted.
519
  if ( in_array( $component_name, array( 'register', 'activate' ), true ) ) {
520
  continue;
521
  }
@@ -1562,7 +1575,7 @@ add_action( 'wp_head', 'bp_core_record_activity' );
1562
  * @since 1.0.0
1563
  *
1564
  * @param int|string $last_activity_date The date of last activity.
1565
- * @param string $string A sprintf()-able statement of the form 'active %s'.
1566
  * @return string $last_active A string of the form '3 years ago'.
1567
  */
1568
  function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
@@ -1584,7 +1597,7 @@ function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
1584
  *
1585
  * @param string $last_active Last activity string based on time since date given.
1586
  * @param string $last_activity_date The date of last activity.
1587
- * @param string $string A sprintf()-able statement of the form 'active %s'.
1588
  */
1589
  return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
1590
  }
@@ -2580,7 +2593,7 @@ function bp_nav_menu_get_loggedin_pages() {
2580
  'post_author' => 0,
2581
  'post_date' => 0,
2582
  'post_excerpt' => $bp_item['slug'],
2583
- 'post_type' => 'page',
2584
  'post_status' => 'publish',
2585
  'comment_status' => 'closed',
2586
  'guid' => $bp_item['link']
@@ -2655,7 +2668,7 @@ function bp_nav_menu_get_loggedout_pages() {
2655
  'post_author' => 0,
2656
  'post_date' => 0,
2657
  'post_excerpt' => $bp_item['slug'],
2658
- 'post_type' => 'page',
2659
  'post_status' => 'publish',
2660
  'comment_status' => 'closed',
2661
  'guid' => $bp_item['link']
@@ -2936,6 +2949,41 @@ function bp_get_email_post_type_supports() {
2936
 
2937
  /** Taxonomies *****************************************************************/
2938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2939
  /**
2940
  * Output the name of the email type taxonomy.
2941
  *
@@ -2998,6 +3046,233 @@ function bp_get_email_tax_type_labels() {
2998
  ) );
2999
  }
3000
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3001
 
3002
  /** Email *****************************************************************/
3003
 
@@ -3280,7 +3555,7 @@ function bp_email_get_appearance_settings() {
3280
  )
3281
  );
3282
 
3283
- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
3284
  $privacy_policy_url = get_privacy_policy_url();
3285
  if ( $privacy_policy_url ) {
3286
  $footer_text[] = sprintf(
@@ -3400,7 +3675,15 @@ function bp_core_replace_tokens_in_text( $text, $tokens ) {
3400
  * @return array
3401
  */
3402
  function bp_email_get_schema() {
3403
- return array(
 
 
 
 
 
 
 
 
3404
  'activity-comment' => array(
3405
  /* translators: do not remove {} brackets or translate its contents. */
3406
  'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
@@ -3532,7 +3815,7 @@ function bp_email_get_schema() {
3532
  /* translators: do not remove {} brackets or translate its contents. */
3533
  'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
3534
  ),
3535
- );
3536
  }
3537
 
3538
  /**
@@ -3559,7 +3842,7 @@ function bp_email_get_type_schema( $field = 'description' ) {
3559
  'unsubscribe' => array(
3560
  'meta_key' => 'notification_activity_new_reply',
3561
  'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3562
- ),
3563
  );
3564
 
3565
  $activity_comment_author = array(
@@ -3567,7 +3850,7 @@ function bp_email_get_type_schema( $field = 'description' ) {
3567
  'unsubscribe' => array(
3568
  'meta_key' => 'notification_activity_new_reply',
3569
  'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3570
- ),
3571
  );
3572
 
3573
  $activity_at_message = array(
70
  return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0;
71
  }
72
 
73
+ /**
74
+ * Check whether the current version of WP exceeds a given version.
75
+ *
76
+ * @since 7.0.0
77
+ *
78
+ * @param string $version WP version, in "PHP-standardized" format.
79
+ * @param string $compare Optional. Comparison operator. Default '>='.
80
+ * @return bool
81
+ */
82
+ function bp_is_running_wp( $version, $compare = '>=' ) {
83
+ return version_compare( $GLOBALS['wp_version'], $version, $compare );
84
+ }
85
+
86
  /** Functions *****************************************************************/
87
 
88
  /**
528
  unset( $page_ids[ $component_name ] );
529
  }
530
 
531
+ // 'register' and 'activate' do not have components, but are allowed as special cases.
532
  if ( in_array( $component_name, array( 'register', 'activate' ), true ) ) {
533
  continue;
534
  }
1575
  * @since 1.0.0
1576
  *
1577
  * @param int|string $last_activity_date The date of last activity.
1578
+ * @param string $string A sprintf()-able statement of the form 'Active %s'.
1579
  * @return string $last_active A string of the form '3 years ago'.
1580
  */
1581
  function bp_core_get_last_activity( $last_activity_date = '', $string = '' ) {
1597
  *
1598
  * @param string $last_active Last activity string based on time since date given.
1599
  * @param string $last_activity_date The date of last activity.
1600
+ * @param string $string A sprintf()-able statement of the form 'Active %s'.
1601
  */
1602
  return apply_filters( 'bp_core_get_last_activity', $last_active, $last_activity_date, $string );
1603
  }
2593
  'post_author' => 0,
2594
  'post_date' => 0,
2595
  'post_excerpt' => $bp_item['slug'],
2596
+ 'post_type' => 'bp_nav_menu_item',
2597
  'post_status' => 'publish',
2598
  'comment_status' => 'closed',
2599
  'guid' => $bp_item['link']
2668
  'post_author' => 0,
2669
  'post_date' => 0,
2670
  'post_excerpt' => $bp_item['slug'],
2671
+ 'post_type' => 'bp_nav_menu_item',
2672
  'post_status' => 'publish',
2673
  'comment_status' => 'closed',
2674
  'guid' => $bp_item['link']
2949
 
2950
  /** Taxonomies *****************************************************************/
2951
 
2952
+ /**
2953
+ * Returns the BP Taxonomy common arguments.
2954
+ *
2955
+ * @since 7.0.0
2956
+ *
2957
+ * @return array The BP Taxonomy common arguments.
2958
+ */
2959
+ function bp_get_taxonomy_common_args() {
2960
+ return array(
2961
+ 'public' => false,
2962
+ 'show_in_rest' => false,
2963
+ 'query_var' => false,
2964
+ 'rewrite' => false,
2965
+ 'show_in_menu' => false,
2966
+ 'show_tagcloud' => false,
2967
+ 'show_ui' => bp_is_root_blog() && bp_current_user_can( 'bp_moderate' ),
2968
+ );
2969
+ }
2970
+
2971
+ /**
2972
+ * Returns the BP Taxonomy common labels.
2973
+ *
2974
+ * @since 7.0.0
2975
+ *
2976
+ * @return array The BP Taxonomy common labels.
2977
+ */
2978
+ function bp_get_taxonomy_common_labels() {
2979
+ return array(
2980
+ 'bp_type_name' => _x( 'Plural Name', 'BP Type name label', 'buddypress' ),
2981
+ 'bp_type_singular_name' => _x( 'Singular name', 'BP Type singular name label', 'buddypress' ),
2982
+ 'bp_type_has_directory' => _x( 'Has Directory View', 'BP Type has directory checkbox label', 'buddypress' ),
2983
+ 'bp_type_directory_slug' => _x( 'Custom type directory slug', 'BP Type slug label', 'buddypress' ),
2984
+ );
2985
+ }
2986
+
2987
  /**
2988
  * Output the name of the email type taxonomy.
2989
  *
3046
  ) );
3047
  }
3048
 
3049
+ /**
3050
+ * Return arguments used by the email type taxonomy.
3051
+ *
3052
+ * @since 7.0.0
3053
+ *
3054
+ * @return array
3055
+ */
3056
+ function bp_get_email_tax_type_args() {
3057
+
3058
+ /**
3059
+ * Filters emails type taxonomy args.
3060
+ *
3061
+ * @since 7.0.0
3062
+ *
3063
+ * @param array $value Associative array (key => arg).
3064
+ */
3065
+ return apply_filters(
3066
+ 'bp_register_email_tax_type',
3067
+ array_merge(
3068
+ array(
3069
+ 'description' => _x( 'BuddyPress email types', 'email type taxonomy description', 'buddypress' ),
3070
+ 'labels' => bp_get_email_tax_type_labels(),
3071
+ 'meta_box_cb' => 'bp_email_tax_type_metabox',
3072
+ ),
3073
+ bp_get_taxonomy_common_args()
3074
+ )
3075
+ );
3076
+ }
3077
+
3078
+ /**
3079
+ * Returns the default BuddyPress type metadata schema.
3080
+ *
3081
+ * @since 7.0.0
3082
+ *
3083
+ * @param boolean $suppress_filters Whether to suppress filters. Default `false`.
3084
+ * @param string $type_taxonomy Optional. the Type's taxonomy name.
3085
+ * @return array The default BuddyPress type metadata schema.
3086
+ */
3087
+ function bp_get_type_metadata_schema( $suppress_filters = false, $type_taxonomy = '' ) {
3088
+ $schema = array(
3089
+ 'bp_type_singular_name' => array(
3090
+ 'description' => __( 'The name of this type in singular form. ', 'buddypress' ),
3091
+ 'type' => 'string',
3092
+ 'single' => true,
3093
+ 'sanitize_callback' => 'sanitize_text_field',
3094
+ ),
3095
+ 'bp_type_name' => array(
3096
+ 'description' => __( 'The name of this type in plural form.', 'buddypress' ),
3097
+ 'type' => 'string',
3098
+ 'single' => true,
3099
+ 'sanitize_callback' => 'sanitize_text_field',
3100
+ ),
3101
+ 'bp_type_has_directory' => array(
3102
+ 'description' => __( 'Make a list matching this type available on the directory.', 'buddypress' ),
3103
+ 'type' => 'boolean',
3104
+ 'single' => true,
3105
+ 'sanitize_callback' => 'absint',
3106
+ ),
3107
+ 'bp_type_directory_slug' => array(
3108
+ 'label' => __( 'Type slug', 'buddypress' ),
3109
+ 'description' => __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' ),
3110
+ 'type' => 'string',
3111
+ 'single' => true,
3112
+ 'sanitize_callback' => 'sanitize_title',
3113
+ ),
3114
+ );
3115
+
3116
+ if ( true === $suppress_filters ) {
3117
+ return $schema;
3118
+ }
3119
+
3120
+ /**
3121
+ * Filter here to add new meta to the BuddyPress type metadata.
3122
+ *
3123
+ * @since 7.0.0
3124
+ *
3125
+ * @param array $schema Associative array (name => arguments).
3126
+ * @param string $type_taxonomy The Type's taxonomy name.
3127
+ */
3128
+ return apply_filters( 'bp_get_type_metadata_schema', $schema, $type_taxonomy );
3129
+ }
3130
+
3131
+ /**
3132
+ * Registers a meta key for BuddyPress types.
3133
+ *
3134
+ * @since 7.0.0
3135
+ *
3136
+ * @param string $type_tax The BuddyPress type taxonomy.
3137
+ * @param string $meta_key The meta key to register.
3138
+ * @param array $args Data used to describe the meta key when registered. See
3139
+ * {@see register_meta()} for a list of supported arguments.
3140
+ * @return bool True if the meta key was successfully registered, false if not.
3141
+ */
3142
+ function bp_register_type_meta( $type_tax, $meta_key, array $args ) {
3143
+ $taxonomies = wp_list_pluck( bp_get_default_taxonomies(), 'component' );
3144
+
3145
+ if ( ! isset( $taxonomies[ $type_tax ] ) ) {
3146
+ return false;
3147
+ }
3148
+
3149
+ // register_term_meta() was introduced in WP 4.9.8.
3150
+ if ( ! bp_is_running_wp( '4.9.8' ) ) {
3151
+ $args['object_subtype'] = $type_tax;
3152
+
3153
+ return register_meta( 'term', $meta_key, $args );
3154
+ }
3155
+
3156
+ return register_term_meta( $type_tax, $meta_key, $args );
3157
+ }
3158
+
3159
+ /**
3160
+ * Update a list of metadata for a given type ID and a given taxonomy.
3161
+ *
3162
+ * @since 7.0.0
3163
+ *
3164
+ * @param integer $type_id The database ID of the BP Type.
3165
+ * @param string $taxonomy The BP Type taxonomy.
3166
+ * @param array $type_metas An associative array (meta_key=>meta_value).
3167
+ * @return boolean False on failure. True otherwise.
3168
+ */
3169
+ function bp_update_type_metadata( $type_id = 0, $taxonomy = '', $type_metas = array() ) {
3170
+ if ( ! $type_id || ! $taxonomy || ! is_array( $type_metas ) ) {
3171
+ return false;
3172
+ }
3173
+
3174
+ foreach ( $type_metas as $meta_key => $meta_value ) {
3175
+ if ( ! registered_meta_key_exists( 'term', $meta_key, $taxonomy ) ) {
3176
+ continue;
3177
+ }
3178
+
3179
+ update_term_meta( $type_id, $meta_key, $meta_value );
3180
+ }
3181
+
3182
+ return true;
3183
+ }
3184
+
3185
+ /**
3186
+ * Get types for a given BP Taxonomy.
3187
+ *
3188
+ * @since 7.0.0
3189
+ *
3190
+ * @param string $taxonomy The taxonomy to transform terms in types for.
3191
+ * @param array $types Existing types to merge with the types found into the database.
3192
+ * For instance this function is used internally to merge Group/Member
3193
+ * types registered using code with the ones created by the administrator
3194
+ * from the Group/Member types Administration screen. If not provided, only
3195
+ * Types created by the administrator will be returned.
3196
+ * Optional.
3197
+ * @return array The types of the given taxonomy.
3198
+ */
3199
+ function bp_get_taxonomy_types( $taxonomy = '', $types = array() ) {
3200
+ if ( ! $taxonomy ) {
3201
+ return $types;
3202
+ }
3203
+
3204
+ $db_types = wp_cache_get( $taxonomy, 'bp_object_terms' );
3205
+
3206
+ if ( ! $db_types ) {
3207
+ $terms = bp_get_terms(
3208
+ array(
3209
+ 'taxonomy' => $taxonomy,
3210
+ )
3211
+ );
3212
+
3213
+ if ( ! is_array( $terms ) || ! $terms ) {
3214
+ return $types;
3215
+ }
3216
+
3217
+ $type_metadata = array_keys( get_registered_meta_keys( 'term', $taxonomy ) );
3218
+
3219
+ foreach ( $terms as $term ) {
3220
+ $type_name = $term->name;
3221
+ $db_types[ $type_name ] = new stdClass();
3222
+ $db_types[ $type_name ]->db_id = $term->term_id;
3223
+ $db_types[ $type_name ]->labels = array();
3224
+ $db_types[ $type_name ]->name = $type_name;
3225
+
3226
+ if ( $type_metadata ) {
3227
+ foreach ( $type_metadata as $meta_key ) {
3228
+ $type_key = str_replace( 'bp_type_', '', $meta_key );
3229
+ if ( in_array( $type_key, array( 'name', 'singular_name' ), true ) ) {
3230
+ $db_types[ $type_name ]->labels[ $type_key ] = get_term_meta( $term->term_id, $meta_key, true );
3231
+ } else {
3232
+ $db_types[ $type_name ]->{$type_key} = get_term_meta( $term->term_id, $meta_key, true );
3233
+ }
3234
+ }
3235
+
3236
+ if ( ! empty( $db_types[ $type_name ]->has_directory ) && empty( $db_types[ $type_name ]->directory_slug ) ) {
3237
+ $db_types[ $type_name ]->directory_slug = $term->slug;
3238
+ }
3239
+ }
3240
+ }
3241
+
3242
+ wp_cache_set( $taxonomy, $db_types, 'bp_object_terms' );
3243
+ }
3244
+
3245
+ if ( is_array( $db_types ) ) {
3246
+ foreach ( $db_types as $db_type_name => $db_type ) {
3247
+ // Override props of registered by code types if customized by the admun user.
3248
+ if ( isset( $types[ $db_type_name ] ) && isset( $types[ $db_type_name ]->code ) && $types[ $db_type_name ]->code ) {
3249
+ // Merge Labels.
3250
+ if ( $db_type->labels ) {
3251
+ foreach ( $db_type->labels as $key_label => $value_label ) {
3252
+ if ( '' !== $value_label ) {
3253
+ $types[ $db_type_name ]->labels[ $key_label ] = $value_label;
3254
+ }
3255
+ }
3256
+ }
3257
+
3258
+ // Merge other properties.
3259
+ foreach ( get_object_vars( $types[ $db_type_name ] ) as $key_prop => $value_prop ) {
3260
+ if ( 'labels' === $key_prop || 'name' === $key_prop ) {
3261
+ continue;
3262
+ }
3263
+
3264
+ if ( isset( $db_type->{$key_prop} ) && '' !== $db_type->{$key_prop} ) {
3265
+ $types[ $db_type_name ]->{$key_prop} = $db_type->{$key_prop};
3266
+ }
3267
+ }
3268
+
3269
+ unset( $db_types[ $db_type_name ] );
3270
+ }
3271
+ }
3272
+ }
3273
+
3274
+ return array_merge( $types, (array) $db_types );
3275
+ }
3276
 
3277
  /** Email *****************************************************************/
3278
 
3555
  )
3556
  );
3557
 
3558
+ if ( bp_is_running_wp( '4.9.6' ) ) {
3559
  $privacy_policy_url = get_privacy_policy_url();
3560
  if ( $privacy_policy_url ) {
3561
  $footer_text[] = sprintf(
3675
  * @return array
3676
  */
3677
  function bp_email_get_schema() {
3678
+
3679
+ /**
3680
+ * Filters the list of `bp_email_get_schema()` allowing anyone to add/remove emails.
3681
+ *
3682
+ * @since 7.0.0
3683
+ *
3684
+ * @param array $emails The array of emails schema.
3685
+ */
3686
+ return (array) apply_filters( 'bp_email_get_schema', array(
3687
  'activity-comment' => array(
3688
  /* translators: do not remove {} brackets or translate its contents. */
3689
  'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ),
3815
  /* translators: do not remove {} brackets or translate its contents. */
3816
  'post_excerpt' => __( "Your membership request for the group \"{{group.name}}\" has been rejected.\n\nTo request membership again, visit: {{{group.url}}}", 'buddypress' ),
3817
  ),
3818
+ ) );
3819
  }
3820
 
3821
  /**
3842
  'unsubscribe' => array(
3843
  'meta_key' => 'notification_activity_new_reply',
3844
  'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3845
+ ),
3846
  );
3847
 
3848
  $activity_comment_author = array(
3850
  'unsubscribe' => array(
3851
  'meta_key' => 'notification_activity_new_reply',
3852
  'message' => __( 'You will no longer receive emails when someone replies to an update or comment you posted.', 'buddypress' ),
3853
+ ),
3854
  );
3855
 
3856
  $activity_at_message = array(
bp-core/bp-core-moderation.php CHANGED
@@ -141,13 +141,13 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '',
141
  */
142
 
143
  // Get the moderation keys.
144
- $blacklist = trim( get_option( 'moderation_keys' ) );
145
 
146
- // Bail if blacklist is empty.
147
- if ( ! empty( $blacklist ) ) {
148
 
149
  // Get words separated by new lines.
150
- $words = explode( "\n", $blacklist );
151
 
152
  // Loop through words.
153
  foreach ( (array) $words as $word ) {
@@ -187,10 +187,7 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '',
187
  /**
188
  * Check for blocked keys.
189
  *
190
- * @since 1.6.0
191
- * @since 2.6.0 Added $error_type parameter.
192
- *
193
- * @todo Why don't we use wp_check_comment_disallowed_list() for this?
194
  *
195
  * @param int $user_id User ID.
196
  * @param string $title The title of the content.
@@ -198,19 +195,34 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '',
198
  * @param string $error_type The error type to return. Either 'bool' or 'wp_error'.
199
  * @return bool|WP_Error True if test is passed, false if fail.
200
  */
201
- function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) {
202
 
203
  /**
204
  * Filters whether or not to bypass checking for blocked keys.
205
  *
206
  * @since 2.2.0
 
207
  *
208
  * @param bool $value Whether or not to bypass checking. Default false.
209
  * @param int $user_id Topic of reply author ID.
210
  * @param string $title The title of the content.
211
  * @param string $content $the content being posted.
212
  */
213
- if ( apply_filters( 'bp_bypass_check_for_blacklist', false, $user_id, $title, $content ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  return true;
215
  }
216
 
@@ -224,16 +236,19 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '',
224
 
225
  /** Blacklist ************************************************************
226
  */
227
- $disallowed_keys_option_name = 'blacklist_keys';
228
- if ( function_exists( 'wp_check_comment_disallowed_list' ) ) {
229
- $disallowed_keys_option_name = 'disallowed_keys';
230
- }
231
 
232
  // Get the moderation keys.
233
- $blacklist = trim( get_option( $disallowed_keys_option_name ) );
 
 
 
 
 
 
 
234
 
235
- // Bail if blacklist is empty.
236
- if ( empty( $blacklist ) ) {
237
  return true;
238
  }
239
 
@@ -266,7 +281,7 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '',
266
  */
267
 
268
  // Get words separated by new lines.
269
- $words = explode( "\n", $blacklist );
270
 
271
  // Loop through words.
272
  foreach ( (array) $words as $word ) {
@@ -290,7 +305,7 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '',
290
  if ( 'bool' === $error_type ) {
291
  return false;
292
  } else {
293
- return new WP_Error( 'bp_moderation_blacklist_match', _x( 'You have posted an inappropriate word.', 'Comment blacklist', 'buddypress' ) );
294
  }
295
  }
296
  }
141
  */
142
 
143
  // Get the moderation keys.
144
+ $disallowed = trim( get_option( 'moderation_keys' ) );
145
 
146
+ // Bail if list is empty.
147
+ if ( ! empty( $disallowed ) ) {
148
 
149
  // Get words separated by new lines.
150
+ $words = explode( "\n", $disallowed );
151
 
152
  // Loop through words.
153
  foreach ( (array) $words as $word ) {
187
  /**
188
  * Check for blocked keys.
189
  *
190
+ * @since 7.0.0
 
 
 
191
  *
192
  * @param int $user_id User ID.
193
  * @param string $title The title of the content.
195
  * @param string $error_type The error type to return. Either 'bool' or 'wp_error'.
196
  * @return bool|WP_Error True if test is passed, false if fail.
197
  */
198
+ function bp_core_check_for_disallowed_keys( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) {
199
 
200
  /**
201
  * Filters whether or not to bypass checking for blocked keys.
202
  *
203
  * @since 2.2.0
204
+ * @deprecated 7.0.0 Use 'bp_bypass_check_for_disallowed_keys' instead.
205
  *
206
  * @param bool $value Whether or not to bypass checking. Default false.
207
  * @param int $user_id Topic of reply author ID.
208
  * @param string $title The title of the content.
209
  * @param string $content $the content being posted.
210
  */
211
+ if ( apply_filters_deprecated( 'bp_bypass_check_for_blacklist', array( false, $user_id, $title, $content ), '7.0.0', 'bp_bypass_check_for_disallowed_keys' ) ) {
212
+ return true;
213
+ }
214
+
215
+ /**
216
+ * Filters whether or not to bypass checking for blocked keys.
217
+ *
218
+ * @since 7.0.0
219
+ *
220
+ * @param bool $value Whether or not to bypass checking. Default false.
221
+ * @param int $user_id Topic of reply author ID.
222
+ * @param string $title The title of the content.
223
+ * @param string $content $the content being posted.
224
+ */
225
+ if ( apply_filters( 'bp_bypass_check_for_disallowed_keys', false, $user_id, $title, $content ) ) {
226
  return true;
227
  }
228
 
236
 
237
  /** Blacklist ************************************************************
238
  */
 
 
 
 
239
 
240
  // Get the moderation keys.
241
+ $disallowed = get_option( 'disallowed_keys' );
242
+
243
+ // Support for WP < 5.5.
244
+ if ( false === $disallowed ) {
245
+ $disallowed = get_option( 'blacklist_keys' );
246
+ }
247
+
248
+ $disallowed = trim( $disallowed );
249
 
250
+ // Bail if disallowed list is empty.
251
+ if ( empty( $disallowed ) ) {
252
  return true;
253
  }
254
 
281
  */
282
 
283
  // Get words separated by new lines.
284
+ $words = explode( "\n", $disallowed );
285
 
286
  // Loop through words.
287
  foreach ( (array) $words as $word ) {
305
  if ( 'bool' === $error_type ) {
306
  return false;
307
  } else {
308
+ return new WP_Error( 'bp_moderation_disallowed_key_match', _x( 'You have posted an inappropriate word.', 'Comment disallowed key', 'buddypress' ) );
309
  }
310
  }
311
  }
bp-core/bp-core-rest-api.php CHANGED
@@ -56,7 +56,7 @@ function bp_rest_api_is_available() {
56
  *
57
  * @param boolean $value True if the BP REST API is available. False otherwise.
58
  */
59
- return apply_filters( 'bp_rest_api_is_available', function_exists( 'create_initial_rest_routes' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
60
  }
61
 
62
  /**
56
  *
57
  * @param boolean $value True if the BP REST API is available. False otherwise.
58
  */
59
+ return apply_filters( 'bp_rest_api_is_available', bp_is_running_wp( '4.7.0' ) && bp_rest_in_buddypress() ) || bp_rest_is_plugin_active();
60
  }
61
 
62
  /**
bp-core/bp-core-taxonomy.php CHANGED
@@ -14,33 +14,58 @@
14
  // Exit if accessed directly.
15
  defined( 'ABSPATH' ) || exit;
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
  * Register our default taxonomies.
19
  *
20
  * @since 2.2.0
21
  */
22
  function bp_register_default_taxonomies() {
23
- // Member Type.
24
- register_taxonomy( bp_get_member_type_tax_name(), 'user', array(
25
- 'public' => false,
26
- ) );
27
-
28
- // Email type.
29
- register_taxonomy(
30
- bp_get_email_tax_type(),
31
- bp_get_email_post_type(),
32
- apply_filters( 'bp_register_email_tax_type', array(
33
- 'description' => _x( 'BuddyPress email types', 'email type taxonomy description', 'buddypress' ),
34
- 'labels' => bp_get_email_tax_type_labels(),
35
- 'meta_box_cb' => 'bp_email_tax_type_metabox',
36
- 'public' => false,
37
- 'query_var' => false,
38
- 'rewrite' => false,
39
- 'show_in_menu' => false,
40
- 'show_tagcloud' => false,
41
- 'show_ui' => bp_is_root_blog() && bp_current_user_can( 'bp_moderate' ),
42
- ) )
43
- );
44
  }
45
  add_action( 'bp_register_taxonomies', 'bp_register_default_taxonomies' );
46
 
@@ -277,3 +302,201 @@ function bp_get_term_by( $field, $value, $taxonomy = '', $output = OBJECT, $filt
277
 
278
  return $term;
279
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  // Exit if accessed directly.
15
  defined( 'ABSPATH' ) || exit;
16
 
17
+ /**
18
+ * Returns default BuddyPress taxonomies.
19
+ *
20
+ * @since 7.0.0
21
+ *
22
+ * @return array The BuddyPress default taxonomies.
23
+ */
24
+ function bp_get_default_taxonomies() {
25
+ $taxonomies = array(
26
+ // Member Type.
27
+ bp_get_member_type_tax_name() => array(
28
+ 'object' => 'user',
29
+ 'component' => 'members',
30
+ 'args' => bp_get_member_type_tax_args(),
31
+ ),
32
+ // Email type.
33
+ bp_get_email_tax_type() => array(
34
+ 'object' => bp_get_email_post_type(),
35
+ 'component' => 'core',
36
+ 'args' => bp_get_email_tax_type_args(),
37
+ ),
38
+ );
39
+
40
+ /**
41
+ * This filter should only be used by built-in BuddyPress Components.
42
+ *
43
+ * @since 7.0.0
44
+ *
45
+ * @param array $taxonomies The taxonomy arguments used for WordPress registration.
46
+ */
47
+ return apply_filters( 'bp_get_default_taxonomies', $taxonomies );
48
+ }
49
+
50
  /**
51
  * Register our default taxonomies.
52
  *
53
  * @since 2.2.0
54
  */
55
  function bp_register_default_taxonomies() {
56
+ $taxonomies = bp_get_default_taxonomies();
57
+
58
+ foreach ( $taxonomies as $taxonomy_name => $taxonomy_params ) {
59
+ if ( ! isset( $taxonomy_params['object'] ) || ! isset( $taxonomy_params['args'] ) ) {
60
+ continue;
61
+ }
62
+
63
+ register_taxonomy(
64
+ $taxonomy_name,
65
+ $taxonomy_params['object'],
66
+ $taxonomy_params['args']
67
+ );
68
+ }
 
 
 
 
 
 
 
 
69
  }
70
  add_action( 'bp_register_taxonomies', 'bp_register_default_taxonomies' );
71
 
302
 
303
  return $term;
304
  }
305
+
306
+ /**
307
+ * Add a new taxonomy term to the database.
308
+ *
309
+ * @since 7.0.0
310
+ *
311
+ * @param string $term The BP term name to add.
312
+ * @param string $taxonomy The BP taxonomy to which to add the BP term.
313
+ * @param array $args {
314
+ * Optional. Array of arguments for inserting a BP term.
315
+ * @type string $description The term description. Default empty string.
316
+ * @type string $slug The term slug to use. Default empty string.
317
+ * @type array $metas The term metas to add. Default empty array.
318
+ * }
319
+ * @return array|WP_Error An array containing the `term_id` and `term_taxonomy_id`,
320
+ * WP_Error otherwise.
321
+ */
322
+ function bp_insert_term( $term, $taxonomy = '', $args = array() ) {
323
+ if ( ! taxonomy_exists( $taxonomy ) ) {
324
+ return new WP_Error( 'invalid_taxonomy', __( 'Invalid taxonomy.', 'buddypress' ) );
325
+ }
326
+
327
+ $site_id = bp_get_taxonomy_term_site_id( $taxonomy );
328
+
329
+ $switched = false;
330
+ if ( $site_id !== get_current_blog_id() ) {
331
+ switch_to_blog( $site_id );
332
+ bp_register_taxonomies();
333
+ $switched = true;
334
+ }
335
+
336
+ $term_metas = array();
337
+ if ( isset( $args['metas'] ) ) {
338
+ $term_metas = (array) $args['metas'];
339
+ unset( $args['metas'] );
340
+ }
341
+
342
+ /**
343
+ * Fires before a BP Term is added to the database.
344
+ *
345
+ * @since 7.0.0
346
+ *
347
+ * @param string $term The BP term name to add.
348
+ * @param string $taxonomy The BP taxonomy to which to add the term.
349
+ * @param array $args Array of arguments for inserting a BP term.
350
+ */
351
+ do_action( 'bp_before_insert_term', $term, $taxonomy, $args );
352
+
353
+ $tt_id = wp_insert_term( $term, $taxonomy, $args );
354
+
355
+ if ( is_wp_error( $tt_id ) ) {
356
+ return $tt_id;
357
+ }
358
+
359
+ $term_id = reset( $tt_id );
360
+
361
+ if ( $term_metas ) {
362
+ bp_update_type_metadata( $term_id, $taxonomy, $term_metas );
363
+ }
364
+
365
+ if ( $switched ) {
366
+ restore_current_blog();
367
+ }
368
+
369
+ /**
370
+ * Fires when taxonomy terms have been set on BuddyPress objects.
371
+ *
372
+ * @since 7.0.0
373
+ *
374
+ * @param array $tt_ids An array containing the `term_id` and `term_taxonomy_id`.
375
+ * @param string $taxonomy Taxonomy name.
376
+ * @param array $term_metas The term metadata.
377
+ */
378
+ do_action( 'bp_insert_term', $tt_id, $taxonomy, $term_metas );
379
+
380
+ return $tt_id;
381
+ }
382
+
383
+ /**
384
+ * Get taxonomy BP Terms from the database.
385
+ *
386
+ * @since 7.0.0
387
+ *
388
+ * @param array $args {
389
+ * Array of arguments to query BP Terms.
390
+ * @see `get_terms()` for full description of arguments in case of a member type.
391
+ * }
392
+ * @return array The list of terms matching arguments.
393
+ */
394
+ function bp_get_terms( $args = array() ) {
395
+ $args = bp_parse_args(
396
+ $args,
397
+ array(
398
+ 'taxonomy' => '',
399
+ 'number' => '',
400
+ 'hide_empty' => false,
401
+ ),
402
+ 'get_terms'
403
+ );
404
+
405
+ if ( ! $args['taxonomy'] ) {
406
+ return array();
407
+ }
408
+
409
+ $site_id = bp_get_taxonomy_term_site_id( $args['taxonomy'] );
410
+
411
+ $switched = false;
412
+ if ( $site_id !== get_current_blog_id() ) {
413
+ switch_to_blog( $site_id );
414
+ bp_register_taxonomies();
415
+ $switched = true;
416
+ }
417
+
418
+ $terms = get_terms( $args );
419
+
420
+ if ( $switched ) {
421
+ restore_current_blog();
422
+ }
423
+
424
+ /**
425
+ * Filter here to modify the BP Terms found into the database.
426
+ *
427
+ * @since 7.0.0
428
+ *
429
+ * @param array $terms The list of terms matching arguments.
430
+ * @param array $args Array of arguments used to query BP Terms.
431
+ */
432
+ return apply_filters(
433
+ 'bp_get_terms',
434
+ $terms,
435
+ $args
436
+ );
437
+ }
438
+
439
+ /**
440
+ * Deletes a BP Term.
441
+ *
442
+ * @since 7.0.0
443
+ *
444
+ * @param int $term_id The BP Term ID. Required.
445
+ * @param string $taxonomy The BP Taxonomy Name. Required.
446
+ * @return bool|WP_Error True on success, WP_Error on failure.
447
+ */
448
+ function bp_delete_term( $term_id = 0, $taxonomy = '' ) {
449
+ if ( ! $term_id || ! $taxonomy ) {
450
+ return new WP_Error( 'missing_arguments', __( 'Sorry, the term ID and the taxonomy are required arguments.', 'buddypress' ) );
451
+ }
452
+
453
+ $site_id = bp_get_taxonomy_term_site_id( $taxonomy );
454
+
455
+ $switched = false;
456
+ if ( $site_id !== get_current_blog_id() ) {
457
+ switch_to_blog( $site_id );
458
+ bp_register_taxonomies();
459
+ $switched = true;
460
+ }
461
+
462
+ /**
463
+ * Fires before a BP Term is deleted from the database.
464
+ *
465
+ * @since 7.0.0
466
+ *
467
+ * @param int $term_id The BP Term ID.
468
+ * @param string $taxonomy The BP Taxonomy Name.
469
+ */
470
+ do_action( 'bp_before_delete_term', $term_id, $taxonomy );
471
+
472
+ $deleted = wp_delete_term( $term_id, $taxonomy );
473
+
474
+ if ( $switched ) {
475
+ restore_current_blog();
476
+ }
477
+
478
+ if ( is_wp_error( $deleted ) ) {
479
+ return $deleted;
480
+ }
481
+
482
+ if ( false === $deleted ) {
483
+ return new WP_Error( 'inexistant_term', __( 'Sorry, the term does not exist.', 'buddypress' ) );
484
+ }
485
+
486
+ if ( 0 === $deleted ) {
487
+ return new WP_Error( 'default_term', __( 'Sorry, the default term cannot be deleted.', 'buddypress' ) );
488
+ }
489
+
490
+ /**
491
+ * Fires once a BP Term has been deleted from the database.
492
+ *
493
+ * @since 7.0.0
494
+ *
495
+ * @param boolean $deleted True.
496
+ * @param int $term_id The deleted BP Term ID.
497
+ * @param string $taxonomy The BP Taxonomy Name of the deleted BP Term ID.
498
+ */
499
+ do_action( 'bp_delete_term', $deleted, $term_id, $taxonomy );
500
+
501
+ return $deleted;
502
+ }
bp-core/bp-core-template-loader.php CHANGED
@@ -18,14 +18,16 @@ defined( 'ABSPATH' ) || exit;
18
  * Get a BuddyPress template part for display in a theme.
19
  *
20
  * @since 1.7.0
 
21
  *
22
  * @param string $slug Template part slug. Used to generate filenames,
23
  * eg 'friends' for 'friends.php'.
24
  * @param string|null $name Optional. Template part name. Used to generate
25
  * secondary filenames, eg 'personal' for 'activity-personal.php'.
 
26
  * @return false|string Path to located template. See {@link bp_locate_template()}.
27
  */
28
- function bp_get_template_part( $slug, $name = null ) {
29
 
30
  /**
31
  * Fires at the start of bp_get_template_part().
@@ -33,11 +35,13 @@ function bp_get_template_part( $slug, $name = null ) {
33
  * This is a variable hook that is dependent on the slug passed in.
34
  *
35
  * @since 1.7.0
 
36
  *
37
  * @param string $slug Template part slug requested.
38
  * @param string $name Template part name requested.
 
39
  */
40
- do_action( 'get_template_part_' . $slug, $slug, $name );
41
 
42
  // Setup possible parts.
43
  $templates = array();
@@ -50,15 +54,17 @@ function bp_get_template_part( $slug, $name = null ) {
50
  * Filters the template parts to be loaded.
51
  *
52
  * @since 1.7.0
 
53
  *
54
  * @param array $templates Array of templates located.
55
  * @param string $slug Template part slug requested.
56
  * @param string $name Template part name requested.
 
57
  */
58
- $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name );
59
 
60
  // Return the part that is found.
61
- return bp_locate_template( $templates, true, false );
62
  }
63
 
64
  /**
@@ -68,15 +74,17 @@ function bp_get_template_part( $slug, $name = null ) {
68
  * prepended to the slug.
69
  *
70
  * @since 2.6.0
 
71
  *
72
  * @see bp_get_template_part() for full documentation.
73
  *
74
  * @param string $slug Template slug.
75
  * @param string|null $name Template name.
 
76
  * @return false|string
77
  */
78
- function bp_get_asset_template_part( $slug, $name = null ) {
79
- return bp_get_template_part( "assets/{$slug}", $name );
80
  }
81
 
82
  /**
@@ -87,15 +95,17 @@ function bp_get_asset_template_part( $slug, $name = null ) {
87
  * not found in either of those, it looks in the theme-compat folder last.
88
  *
89
  * @since 1.7.0
 
90
  *
91
  * @param string|array $template_names Template file(s) to search for, in order.
92
  * @param bool $load Optional. If true, the template file will be loaded when
93
  * found. If false, the path will be returned. Default: false.
94
  * @param bool $require_once Optional. Whether to require_once or require. Has
95
  * no effect if $load is false. Default: true.
 
96
  * @return string The template filename if one is located.
97
  */
98
- function bp_locate_template( $template_names, $load = false, $require_once = true ) {
99
 
100
  // Bail when there are no templates to locate.
101
  if ( empty( $template_names ) ) {
@@ -140,7 +150,7 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru
140
  * If you want to override a specific template part, please either filter
141
  * 'bp_get_template_part' or add a new location to the template stack.
142
  */
143
- do_action( 'bp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once );
144
 
145
  /**
146
  * Filter here to allow/disallow template loading.
@@ -152,7 +162,7 @@ function bp_locate_template( $template_names, $load = false, $require_once = tru
152
  $load_template = (bool) apply_filters( 'bp_locate_template_and_load', true );
153
 
154
  if ( $load_template && $load && ! empty( $located ) ) {
155
- load_template( $located, $require_once );
156
  }
157
 
158
  return $located;
@@ -320,22 +330,24 @@ function bp_get_template_stack() {
320
  * Put a template part into an output buffer, and return it.
321
  *
322
  * @since 1.7.0
 
323
  *
324
- * @see bp_get_template_part() for a description of $slug and $name params.
325
  *
326
  * @param string $slug See {@link bp_get_template_part()}.
327
  * @param string|null $name See {@link bp_get_template_part()}.
328
  * @param bool $echo If true, template content will be echoed. If false,
329
  * returned. Default: true.
 
330
  * @return string|null If $echo, returns the template content.
331
  */
332
- function bp_buffer_template_part( $slug, $name = null, $echo = true ) {
333
  ob_start();
334
 
335
  // Remove 'bp_replace_the_content' filter to prevent infinite loops.
336
  remove_filter( 'the_content', 'bp_replace_the_content' );
337
 
338
- bp_get_template_part( $slug, $name );
339
 
340
  // Remove 'bp_replace_the_content' filter to prevent infinite loops.
341
  add_filter( 'the_content', 'bp_replace_the_content' );
18
  * Get a BuddyPress template part for display in a theme.
19
  *
20
  * @since 1.7.0
21
+ * @since 7.0.0 Added $args parameter.
22
  *
23
  * @param string $slug Template part slug. Used to generate filenames,
24
  * eg 'friends' for 'friends.php'.
25
  * @param string|null $name Optional. Template part name. Used to generate
26
  * secondary filenames, eg 'personal' for 'activity-personal.php'.
27
+ * @param array $args Optional. Extra args to pass to locate_template().
28
  * @return false|string Path to located template. See {@link bp_locate_template()}.
29
  */
30
+ function bp_get_template_part( $slug, $name = null, $args = array() ) {
31
 
32
  /**
33
  * Fires at the start of bp_get_template_part().
35
  * This is a variable hook that is dependent on the slug passed in.
36
  *
37
  * @since 1.7.0
38
+ * @since 7.0.0 Added $args parameter.
39
  *
40
  * @param string $slug Template part slug requested.
41
  * @param string $name Template part name requested.
42
+ * @param array $args Extra args to pass to locate_template().
43
  */
44
+ do_action( 'get_template_part_' . $slug, $slug, $name, $args );
45
 
46
  // Setup possible parts.
47
  $templates = array();
54
  * Filters the template parts to be loaded.
55
  *
56
  * @since 1.7.0
57
+ * @since 7.0.0 Added $args parameter.
58
  *
59
  * @param array $templates Array of templates located.
60
  * @param string $slug Template part slug requested.
61
  * @param string $name Template part name requested.
62
+ * @param array $args Extra args to pass to locate_template().
63
  */
64
+ $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name, $args );
65
 
66
  // Return the part that is found.
67
+ return bp_locate_template( $templates, true, false, $args );
68
  }
69
 
70
  /**
74
  * prepended to the slug.
75
  *
76
  * @since 2.6.0
77
+ * @since 7.0.0 Added $args parameter.
78
  *
79
  * @see bp_get_template_part() for full documentation.
80
  *
81
  * @param string $slug Template slug.
82
  * @param string|null $name Template name.
83
+ * @param array $args Optional. Extra args to pass to locate_template().
84
  * @return false|string
85
  */
86
+ function bp_get_asset_template_part( $slug, $name = null, $args = array() ) {
87
+ return bp_get_template_part( "assets/{$slug}", $name, $args );
88
  }
89
 
90
  /**
95
  * not found in either of those, it looks in the theme-compat folder last.
96
  *
97
  * @since 1.7.0
98
+ * @since 7.0.0 Added $args parameter.
99
  *
100
  * @param string|array $template_names Template file(s) to search for, in order.
101
  * @param bool $load Optional. If true, the template file will be loaded when
102
  * found. If false, the path will be returned. Default: false.
103
  * @param bool $require_once Optional. Whether to require_once or require. Has
104
  * no effect if $load is false. Default: true.
105
+ * @param array $args Optional. Extra args to pass to locate_template().
106
  * @return string The template filename if one is located.
107
  */
108
+ function bp_locate_template( $template_names, $load = false, $require_once = true, $args = array() ) {
109
 
110
  // Bail when there are no templates to locate.
111
  if ( empty( $template_names ) ) {
150
  * If you want to override a specific template part, please either filter
151
  * 'bp_get_template_part' or add a new location to the template stack.
152
  */
153
+ do_action( 'bp_locate_template', $located, $template_name, $template_names, $template_locations, $load, $require_once, $args );
154
 
155
  /**
156
  * Filter here to allow/disallow template loading.
162
  $load_template = (bool) apply_filters( 'bp_locate_template_and_load', true );
163
 
164
  if ( $load_template && $load && ! empty( $located ) ) {
165
+ load_template( $located, $require_once, $args );
166
  }
167
 
168
  return $located;
330
  * Put a template part into an output buffer, and return it.
331
  *
332
  * @since 1.7.0
333
+ * @since 7.0.0 Added $args parameter.
334
  *
335
+ * @see bp_get_template_part() for a description of $slug, $name and $args params.
336
  *
337
  * @param string $slug See {@link bp_get_template_part()}.
338
  * @param string|null $name See {@link bp_get_template_part()}.
339
  * @param bool $echo If true, template content will be echoed. If false,
340
  * returned. Default: true.
341
+ * @param array $args See {@link bp_get_template_part()}.
342
  * @return string|null If $echo, returns the template content.
343
  */
344
+ function bp_buffer_template_part( $slug, $name = null, $echo = true, $args = array() ) {
345
  ob_start();
346
 
347
  // Remove 'bp_replace_the_content' filter to prevent infinite loops.
348
  remove_filter( 'the_content', 'bp_replace_the_content' );
349
 
350
+ bp_get_template_part( $slug, $name, $args );
351
 
352
  // Remove 'bp_replace_the_content' filter to prevent infinite loops.
353
  add_filter( 'the_content', 'bp_replace_the_content' );
bp-core/bp-core-template.php CHANGED
@@ -988,7 +988,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
988
  *
989
  * @since 1.1.0
990
  *
991
- * @param string $truncate Generated excerpt.
992
  * @param string $original_text Original text provided.
993
  * @param int $length Length of returned string, including ellipsis.
994
  * @param array $options Array of HTML attributes and options.
988
  *
989
  * @since 1.1.0
990
  *
991
+ * @param string $text Generated excerpt.
992
  * @param string $original_text Original text provided.
993
  * @param int $length Length of returned string, including ellipsis.
994
  * @param array $options Array of HTML attributes and options.
bp-core/bp-core-theme-compatibility.php CHANGED
@@ -665,7 +665,7 @@ function bp_theme_compat_reset_post( $args = array() ) {
665
  */
666
  function bp_template_include_theme_compat( $template = '' ) {
667
  // If embed template, bail.
668
- if ( true === function_exists( 'is_embed' ) && is_embed() ) {
669
  return $template;
670
  }
671
 
665
  */
666
  function bp_template_include_theme_compat( $template = '' ) {
667
  // If embed template, bail.
668
+ if ( is_embed() ) {
669
  return $template;
670
  }
671
 
bp-core/bp-core-wpabstraction.php CHANGED
@@ -312,7 +312,7 @@ if ( !function_exists( 'mb_strrpos' ) ) {
312
  * Returns the name of the hook to use once a WordPress Site is inserted into the Database.
313
  *
314
  * WordPress 5.1.0 deprecated the `wpmu_new_blog` action. As BuddyPress is supporting WordPress back
315
- * to 4.8.0, this function makes sure we are using the new hook `wp_initialize_site` when the current
316
  * WordPress version is upper or equal to 5.1.0 and that we keep on using `wpmu_new_blog` for earlier
317
  * versions of WordPress.
318
  *
@@ -405,7 +405,7 @@ add_action( bp_insert_site_hook(), 'bp_insert_site' );
405
  * Returns the name of the hook to use once a WordPress Site is deleted.
406
  *
407
  * WordPress 5.1.0 deprecated the `delete_blog` action. As BuddyPress is supporting WordPress back
408
- * to 4.8.0, this function makes sure we are using the new hook `wp_validate_site_deletion` when the
409
  * current WordPress version is upper or equal to 5.1.0 and that we keep on using `delete_blog` for
410
  * earlier versions of WordPress.
411
  *
@@ -472,3 +472,24 @@ function bp_delete_site( $site_id_or_error, $drop_or_site = false ) {
472
  do_action( 'bp_delete_site', $site_id, $drop );
473
  }
474
  add_action( bp_delete_site_hook(), 'bp_delete_site', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  * Returns the name of the hook to use once a WordPress Site is inserted into the Database.
313
  *
314
  * WordPress 5.1.0 deprecated the `wpmu_new_blog` action. As BuddyPress is supporting WordPress back
315
+ * to 4.9.0, this function makes sure we are using the new hook `wp_initialize_site` when the current
316
  * WordPress version is upper or equal to 5.1.0 and that we keep on using `wpmu_new_blog` for earlier
317
  * versions of WordPress.
318
  *
405
  * Returns the name of the hook to use once a WordPress Site is deleted.
406
  *
407
  * WordPress 5.1.0 deprecated the `delete_blog` action. As BuddyPress is supporting WordPress back
408
+ * to 4.9.0, this function makes sure we are using the new hook `wp_validate_site_deletion` when the
409
  * current WordPress version is upper or equal to 5.1.0 and that we keep on using `delete_blog` for
410
  * earlier versions of WordPress.
411
  *
472
  do_action( 'bp_delete_site', $site_id, $drop );
473
  }
474
  add_action( bp_delete_site_hook(), 'bp_delete_site', 10, 2 );
475
+
476
+ if ( ! function_exists( 'wp_parse_list' ) ) {
477
+ /**
478
+ * Cleans up an array, comma- or space-separated list of scalar values.
479
+ *
480
+ * As BuddyPress supports older WordPress versions than 5.1 (4.9 & 5.0),
481
+ * the BP REST API needs this function to be available.
482
+ *
483
+ * @since 7.0.0
484
+ *
485
+ * @param array|string $list List of values.
486
+ * @return array Sanitized array of values.
487
+ */
488
+ function wp_parse_list( $list ) {
489
+ if ( ! is_array( $list ) ) {
490
+ return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY );
491
+ }
492
+
493
+ return $list;
494
+ }
495
+ }
bp-core/classes/class-bp-admin-types.php ADDED
@@ -0,0 +1,614 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * BuddyPress Types Admin Class.
4
+ *
5
+ * @package BuddyPress
6
+ * @subpackage CoreAdministration
7
+ * @since 7.0.0
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'ABSPATH' ) ) {
12
+ exit;
13
+ }
14
+
15
+ if ( ! class_exists( 'BP_Admin_Types' ) ) :
16
+
17
+ /**
18
+ * Load BuddyPress Types admin area.
19
+ *
20
+ * @since 7.O.0
21
+ */
22
+ class BP_Admin_Types {
23
+ /**
24
+ * Current BuddyPress taxonomy.
25
+ *
26
+ * @since 7.0.0
27
+ * @var string
28
+ */
29
+ public $taxonomy = '';
30
+
31
+ /**
32
+ * All registered BuddyPress taxonomies.
33
+ *
34
+ * @since 7.0.0
35
+ * @var array()
36
+ */
37
+ public $taxonomies = array();
38
+
39
+ /**
40
+ * Current screen ID.
41
+ *
42
+ * @since 7.0.0
43
+ * @var string
44
+ */
45
+ public $screen_id = '';
46
+
47
+ /**
48
+ * The main BuddyPress Types admin loader.
49
+ *
50
+ * @since 7.0.0
51
+ */
52
+ public function __construct() {
53
+ $this->setup_globals();
54
+
55
+ if ( $this->taxonomy && $this->screen_id ) {
56
+ $this->includes();
57
+ $this->setup_hooks();
58
+
59
+ if ( isset( $_POST['action'] ) || isset( $_GET['action'] ) ) {
60
+ if ( isset( $_GET['action'] ) ) {
61
+ $action = wp_unslash( $_GET['action'] );
62
+ } else {
63
+ $action = wp_unslash( $_POST['action'] );
64
+ }
65
+
66
+ $this->handle_action( $action );
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Register BP Types Admin.
73
+ *
74
+ * @since 7.0.0
75
+ *
76
+ * @return BP_Admin_Types
77
+ */
78
+ public static function register_types_admin() {
79
+ if ( ! is_admin() ) {
80
+ return;
81
+ }
82
+
83
+ $bp = buddypress();
84
+
85
+ if ( empty( $bp->core->types_admin ) ) {
86
+ $bp->core->types_admin = new self;
87
+ }
88
+
89
+ return $bp->core->types_admin;
90
+ }
91
+
92
+ /**
93
+ * Set the globals.
94
+ *
95
+ * @since 7.0.0
96
+ */
97
+ private function setup_globals() {
98
+ $current_screen = get_current_screen();
99
+
100
+ if ( isset( $current_screen->taxonomy ) && $current_screen->taxonomy ) {
101
+ $this->taxonomies = bp_get_default_taxonomies();
102
+
103
+ if ( isset( $this->taxonomies[ $current_screen->taxonomy ] ) ) {
104
+ $this->taxonomy = $current_screen->taxonomy;
105
+ $this->screen_id = $current_screen->id;
106
+ }
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Include Admin functions.
112
+ *
113
+ * @since 7.0.0
114
+ */
115
+ private function includes() {
116
+ require plugin_dir_path( dirname( __FILE__ ) ) . 'admin/bp-core-admin-types.php';
117
+ }
118
+
119
+ /**
120
+ * Set hooks.
121
+ *
122
+ * @since 7.0.0
123
+ */
124
+ private function setup_hooks() {
125
+ // Actions.
126
+ add_action( 'admin_head-edit-tags.php', array( $this, 'screen_head' ) );
127
+ add_action( 'admin_head-term.php', array( $this, 'screen_head' ) );
128
+ add_action( 'bp_admin_enqueue_scripts', array( $this, 'screen_scripts' ) );
129
+ add_action( "{$this->taxonomy}_add_form_fields", array( $this, 'add_form_fields' ), 10, 1 );
130
+ add_action( "{$this->taxonomy}_edit_form_fields", array( $this, 'edit_form_fields' ), 10, 2 );
131
+
132
+ // Filters
133
+ add_filter( 'bp_core_admin_register_scripts', array( $this, 'register_scripts' ) );
134
+ add_filter( "manage_{$this->screen_id}_columns", array( $this, 'column_headers' ), 10, 1 );
135
+ add_filter( "manage_{$this->taxonomy}_custom_column", array( $this, 'column_contents' ), 10, 3 );
136
+ add_filter( "{$this->taxonomy}_row_actions", array( $this, 'row_actions' ), 10, 2 );
137
+ add_filter( "bulk_actions-{$this->screen_id}", '__return_empty_array', 10, 1 );
138
+ }
139
+
140
+ /**
141
+ * Handle BP Type actions.
142
+ *
143
+ * @since 7.0.0
144
+ *
145
+ * @param string $action Required. The action to handle ('add-tag', 'editedtag' or 'delete' ).
146
+ */
147
+ private function handle_action( $action ) {
148
+ $referer = wp_get_referer();
149
+
150
+ // Adding a new type into the database.
151
+ if ( 'add-tag' === $action ) {
152
+ check_admin_referer( 'add-tag', '_wpnonce_add-tag' );
153
+
154
+ $result = bp_core_admin_insert_type( $_POST );
155
+
156
+ if ( is_wp_error( $result ) ) {
157
+ $referer = add_query_arg(
158
+ array_merge(
159
+ $result->get_error_data(),
160
+ array(
161
+ 'error' => 1,
162
+ )
163
+ ),
164
+ $referer
165
+ );
166
+
167
+ wp_safe_redirect( $referer );
168
+ exit;
169
+ }
170
+
171
+ wp_safe_redirect( add_query_arg( 'message', 2, $referer ) );
172
+ exit;
173
+
174
+ // Updating an existing type intot the Database.
175
+ } elseif ( 'editedtag' === $action ) {
176
+ $args = $_POST;
177
+ $args['type_term_id'] = 0;
178
+ unset( $args['tag_ID'] );
179
+
180
+ if ( isset( $_POST['tag_ID'] ) ) {
181
+ $args['type_term_id'] = $_POST['tag_ID'];
182
+ }
183
+
184
+ if ( isset( $_POST['taxonomy'] ) ) {
185
+ $args['taxonomy'] = $_POST['taxonomy'];
186
+ }
187
+
188
+ check_admin_referer( 'update-tag_' . $args['type_term_id'] );
189
+
190
+ $result = bp_core_admin_update_type( $args );
191
+
192
+ if ( is_wp_error( $result ) ) {
193
+ $referer = add_query_arg(
194
+ array_merge(
195
+ $result->get_error_data(),
196
+ array(
197
+ 'error' => 1,
198
+ )
199
+ ),
200
+ $referer
201
+ );
202
+
203
+ wp_safe_redirect( $referer );
204
+ exit;
205
+ }
206
+
207
+ wp_safe_redirect( add_query_arg( 'message', 4, $referer ) );
208
+ exit;
209
+
210
+ // Deletes a type.
211
+ } elseif ( 'delete' === $action ) {
212
+ $args = $_GET;
213
+ $args['type_term_id'] = 0;
214
+ unset( $args['tag_ID'] );
215
+
216
+ if ( isset( $_GET['tag_ID'] ) ) {
217
+ $args['type_term_id'] = $_GET['tag_ID'];
218
+ }
219
+
220
+ if ( isset( $_GET['taxonomy'] ) ) {
221
+ $args['taxonomy'] = $_GET['taxonomy'];
222
+ }
223
+
224
+ check_admin_referer( 'delete-tag_' . $args['type_term_id'] );
225
+ $referer = remove_query_arg( array( 'action', 'tag_ID', '_wpnonce' ), $referer );
226
+
227
+ // Delete the type.
228
+ $result = bp_core_admin_delete_type( $args );
229
+
230
+ if ( is_wp_error( $result ) ) {
231
+ $referer = add_query_arg(
232
+ array_merge(
233
+ $result->get_error_data(),
234
+ array(
235
+ 'error' => 1,
236
+ )
237
+ ),
238
+ $referer
239
+ );
240
+
241
+ wp_safe_redirect( $referer );
242
+ exit;
243
+ }
244
+
245
+ wp_safe_redirect( add_query_arg( 'message', 9, $referer ) );
246
+ exit;
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Override the Admin parent file to highlight the right menu.
252
+ *
253
+ * @since 7.0.0
254
+ */
255
+ public function screen_head() {
256
+ global $parent_file;
257
+
258
+ if ( 'members' === $this->taxonomies[ $this->taxonomy ]['component'] ) {
259
+ $parent_file = 'users.php';
260
+ } else {
261
+ $parent_file = 'bp-' . $this->taxonomies[ $this->taxonomy ]['component'];
262
+ }
263
+ }
264
+
265
+ /**
266
+ * Registers script.
267
+ *
268
+ * @since 7.0.0
269
+ */
270
+ public function register_scripts( $scripts = array() ) {
271
+ // Neutralize WordPress Taxonomy scripts.
272
+ wp_dequeue_script( 'admin-tags' );
273
+ wp_dequeue_script( 'inline-edit-tax' );
274
+
275
+ // Adapt some styles.
276
+ wp_add_inline_style(
277
+ 'common',
278
+ '.form-field:not(.bp-types-form), .term-bp_type_directory_slug-wrap:not(.bp-set-directory-slug), .edit-tag-actions #delete-link { display: none; }'
279
+ );
280
+
281
+ // Register the Types admin script.
282
+ return array_merge(
283
+ $scripts,
284
+ array(
285
+ 'bp-admin-types' => array(
286
+ 'file' => sprintf(
287
+ '%1$sadmin/js/types-admin%2$s.js',
288
+ plugin_dir_url( dirname( __FILE__ ) ),
289
+ bp_core_get_minified_asset_suffix()
290
+ ),
291
+ 'dependencies' => array(),
292
+ 'footer' => true,
293
+ ),
294
+ )
295
+ );
296
+ }
297
+
298
+ /**
299
+ * Enqueues script.
300
+ *
301
+ * @since 7.0.0
302
+ */
303
+ public function screen_scripts() {
304
+ wp_enqueue_script( 'bp-admin-types' );
305
+ }
306
+
307
+ /**
308
+ * Outputs the BP type add form.
309
+ *
310
+ * @since 7.0.0
311
+ *
312
+ * @param string $taxonomy The type taxonomy name.
313
+ * @param null|object $type The type object, `null` if not passed to the method.
314
+ */
315
+ public function add_form_fields( $taxonomy = '', $type = null ) {
316
+ $taxonomy_object = get_taxonomy( $taxonomy );
317
+ $labels = get_taxonomy_labels( $taxonomy_object );
318
+
319
+ // Default values for the Type ID field.
320
+ $type_id_label = __( 'Type ID', 'buddypress' );
321
+ $type_id_desc = __( 'Enter a lower-case string without spaces or special characters (used internally to identify the type).', 'buddypress' );
322
+
323
+ if ( isset( $labels->bp_type_id_label ) && $labels->bp_type_id_label ) {
324
+ $type_id_label = $labels->bp_type_id_label;
325
+ }
326
+
327
+ if ( isset( $labels->bp_type_id_description ) && $labels->bp_type_id_description ) {
328
+ $type_id_desc = $labels->bp_type_id_description;
329
+ }
330
+
331
+ // Outputs the Type ID field.
332
+ if ( isset( $type->name ) ) {
333
+ printf(
334
+ '<tr class="form-field bp-types-form form-required term-bp_type_id-wrap">
335
+ <th scope="row"><label for="bp_type_id">%1$s</label></th>
336
+ <td>
337
+ <input name="bp_type_id" id="bp_type_id" type="text" value="%2$s" size="40" disabled="disabled">
338
+ </td>
339
+ </tr>',
340
+ esc_html( $type_id_label ),
341
+ esc_attr( $type->name ),
342
+ esc_html( $type_id_desc )
343
+ );
344
+ } else {
345
+ printf(
346
+ '<div class="form-field bp-types-form form-required term-bp_type_id-wrap">
347
+ <label for="bp_type_id">%1$s</label>
348
+ <input name="bp_type_id" id="bp_type_id" type="text" value="" size="40" aria-required="true">
349
+ <p>%2$s</p>
350
+ </div>',
351
+ esc_html( $type_id_label ),
352
+ esc_html( $type_id_desc )
353
+ );
354
+ }
355
+
356
+ // Gets the Type's metadata.
357
+ $metafields = get_registered_meta_keys( 'term', $taxonomy );
358
+
359
+ foreach ( $metafields as $meta_key => $meta_schema ) {
360
+ if ( ! isset( $labels->{ $meta_key } ) || ! $labels->{ $meta_key } ) {
361
+ _doing_it_wrong(
362
+ __METHOD__,
363
+ __( 'Type metadata labels need to be set into the labels argument when registering your taxonomy using the meta key as the label’s key.', 'buddypress' )
364
+ . ' ' .
365
+ sprintf(
366
+ /* translators: %s is the name of the Type meta key */
367
+ __( 'As a result, the form elements for the "%s" meta key cannot be displayed', 'buddypress' ), $meta_key ),
368
+ '7.0.0'
369
+ );
370
+ continue;
371
+ }
372
+
373
+ $type_key = str_replace( 'bp_type_', '', $meta_key );
374
+
375
+ if ( 'string' === $meta_schema['type'] ) {
376
+ if ( isset( $type->name ) ) {
377
+ $type_prop_value = null;
378
+ if ( in_array( $type_key, array( 'name', 'singular_name' ), true ) ) {
379
+ if ( isset( $type->labels[ $type_key ] ) ) {
380
+ $type_prop_value = $type->labels[ $type_key ];
381
+ }
382
+
383
+ } elseif ( isset( $type->{$type_key} ) ) {
384
+ $type_prop_value = $type->{$type_key};
385
+ }
386
+
387
+ printf(
388
+ '<tr class="form-field bp-types-form form-required term-%1$s-wrap">
389
+ <th scope="row"><label for="%1$s">%2$s</label></th>
390
+ <td>
391
+ <input name="%1$s" id="%1$s" type="text" value="%3$s" size="40" aria-required="true">
392
+ <p class="description">%4$s</p>
393
+ </td>
394
+ </tr>',
395
+ esc_attr( $meta_key ),
396
+ esc_html( $labels->{ $meta_key } ),
397
+ esc_attr( $type_prop_value ),
398
+ esc_html( $meta_schema['description'] )
399
+ );
400
+
401
+ } else {
402
+ printf(
403
+ '<div class="form-field bp-types-form form-required term-%1$s-wrap">
404
+ <label for="%1$s">%2$s</label>
405
+ <input name="%1$s" id="%1$s" type="text" value="" size="40">
406
+ <p>%3$s</p>
407
+ </div>',
408
+ esc_attr( $meta_key ),
409
+ esc_html( $labels->{ $meta_key } ),
410
+ esc_html( $meta_schema['description'] )
411
+ );
412
+ }
413
+ } else {
414
+ if ( isset( $type->name ) ) {
415
+ $checked = '';
416
+ if ( isset( $type->{$type_key} ) && true === (bool) $type->{$type_key} ) {
417
+ $checked = ' checked="checked"';
418
+ }
419
+
420
+ printf(
421
+ '<tr class="form-field bp-types-form term-%1$s-wrap">
422
+ <th scope="row"><label for="%1$s">%2$s</label></th>
423
+ <td>
424
+ <input name="%1$s" id="%1$s" type="checkbox" value="1"%3$s> %4$s
425
+ <p class="description">%5$s</p>
426
+ </td>
427
+ </tr>',
428
+ esc_attr( $meta_key ),
429
+ esc_html( $labels->{ $meta_key } ),
430
+ $checked,
431
+ esc_html__( 'Yes', 'buddypress' ),
432
+ esc_html( $meta_schema['description'] )
433
+ );
434
+ } else {
435
+ printf(
436
+ '<div class="form-field bp-types-form term-%1$s-wrap">
437
+ <label for="%1$s">
438
+ <input name="%1$s" id="%1$s" type="checkbox" value="1"> %2$s
439
+ </label>
440
+ <p>%3$s</p>
441
+ </div>',
442
+ esc_attr( $meta_key ),
443
+ esc_html( $labels->{ $meta_key } ),
444
+ esc_html( $meta_schema['description'] )
445
+ );
446
+ }
447
+ }
448
+ }
449
+ }
450
+
451
+ /**
452
+ * Outputs the BP type edit form.
453
+ *
454
+ * @since 7.0.0
455
+ *
456
+ * @param WP_Term $term The term object for the BP Type.
457
+ * @param string $taxonomy The type taxonomy name.
458
+ * @return string HTML Output.
459
+ */
460
+ public function edit_form_fields( $term = null, $taxonomy = '' ) {
461
+ if ( ! isset( $term->name ) || ! $term->name || ! $taxonomy ) {
462
+ return;
463
+ }
464
+
465
+ $type = new stdClass();
466
+ $type->name = $term->name;
467
+ $type->labels = array();
468
+ $metadatas = get_metadata( 'term', $term->term_id );
469
+
470
+ foreach ( $metadatas as $meta_key => $meta_values ) {
471
+ $meta_value = reset( $meta_values );
472
+ $type_key = str_replace( 'bp_type_', '', $meta_key );
473
+
474
+ if ( in_array( $type_key, array( 'name', 'singular_name' ), true ) ) {
475
+ $type->labels[ $type_key ] = $meta_value;
476
+ } else {
477
+ $type->{$type_key} = $meta_value;
478
+ }
479
+ }
480
+
481
+ return $this->add_form_fields( $taxonomy, $type );
482
+ }
483
+
484
+ /**
485
+ * Filters the terms list table column headers to customize them for BuddyPress Types.
486
+ *
487
+ * @since 7.0.0
488
+ *
489
+ * @param array $column_headers The column header labels keyed by column ID.
490
+ * @return array The column header labels keyed by column ID.
491
+ */
492
+ public function column_headers( $column_headers = array() ) {
493
+ if ( isset( $column_headers['name'] ) ) {
494
+ $column_headers['name'] = __( 'Type ID', 'buddypress' );
495
+ }
496
+
497
+ unset( $column_headers['cb'], $column_headers['description'], $column_headers['posts'] );
498
+
499
+ $column_headers['plural_name'] = __( 'Name', 'buddypress' );
500
+ $column_headers['counts'] = _x( 'Count', 'Number/count of types', 'buddypress' );
501
+
502
+ return $column_headers;
503
+ }
504
+
505
+ /**
506
+ * Sets the content for the Plural name & Counts columns.
507
+ *
508
+ * @since 7.0.0
509
+ *
510
+ * @param string $string Blank string.
511
+ * @param string $column_name Name of the column.
512
+ * @param int $type_id The type's term ID.
513
+ * @return string The Type Plural name.
514
+ */
515
+ public function column_contents( $column_content = '', $column_name = '', $type_id = 0 ) {
516
+ if ( 'plural_name' !== $column_name && 'counts' !== $column_name || ! $type_id ) {
517
+ return $column_content;
518
+ }
519
+
520
+ // Set the Plural name column.
521
+ if ( 'plural_name' === $column_name ) {
522
+ $type_plural_name = get_term_meta( $type_id, 'bp_type_name', true );
523
+
524
+ // Plural name meta is not set? Let's check register by code types!
525
+ if ( ! $type_plural_name ) {
526
+ $type_name = get_term_field( 'name', $type_id, $this->taxonomy );
527
+
528
+ /**
529
+ * Filter here to set missing term meta for registered by code types.
530
+ *
531
+ * @see bp_set_registered_by_code_member_type_metadata() for an example of use.
532
+ *
533
+ * @since 7.0.0
534
+ *
535
+ * @param string $value Metadata for the BP Type.
536
+ */
537
+ $metadata = apply_filters( "{$this->taxonomy}_set_registered_by_code_metada", array(), $type_name );
538
+
539
+ if ( isset( $metadata['bp_type_name'] ) ) {
540
+ $type_plural_name = $metadata['bp_type_name'];
541
+ }
542
+ }
543
+
544
+ echo esc_html( $type_plural_name );
545
+
546
+ // Set the Totals column.
547
+ } elseif ( 'counts' === $column_name ) {
548
+ global $parent_file;
549
+ $type = bp_get_term_by( 'id', $type_id, $this->taxonomy );
550
+ if ( 0 === (int) $type->count ) {
551
+ return 0;
552
+ }
553
+
554
+ // Format the count.
555
+ $count = number_format_i18n( $type->count );
556
+
557
+ $args = array(
558
+ str_replace( '_', '-', $this->taxonomy ) => $type->slug,
559
+ );
560
+
561
+ $base_url = $parent_file;
562
+ if ( false === strpos( $parent_file, '.php' ) ) {
563
+ $base_url = add_query_arg( 'page', $parent_file, 'admin.php' );
564
+ }
565
+
566
+ printf(
567
+ '<a href="%1$s">%2$s</a>',
568
+ esc_url( add_query_arg( $args, bp_get_admin_url( $base_url ) ) ),
569
+ esc_html( $count )
570
+ );
571
+ }
572
+ }
573
+
574
+ /**
575
+ * Customizes the Types Admin list table row actions.
576
+ *
577
+ * @since 7.0.0
578
+ *
579
+ * @param array $actions The table row actions.
580
+ * @param WP_Term $type The current BP Type for the row.
581
+ * @return array The table row actions for the current BP type.
582
+ */
583
+ public function row_actions( $actions = array(), $type = null ) {
584
+ if ( ! isset( $type->taxonomy ) || ! $type->taxonomy ) {
585
+ return $actions;
586
+ }
587
+
588
+ /**
589
+ * Filter here to set the types "registered by code".
590
+ *
591
+ * @see bp_get_member_types_registered_by_code() for an example of use.
592
+ *
593
+ * @since 7.0.0
594
+ */
595
+ $registered_by_code_types = apply_filters( "{$type->taxonomy}_registered_by_code", array() );
596
+
597
+ // Types registered by code cannot be deleted as long as the custom registration code exists.
598
+ if ( isset( $registered_by_code_types[ $type->name ] ) ) {
599
+ unset( $actions['delete'] );
600
+ }
601
+
602
+ // Inline edits are disabled for all types.
603
+ unset( $actions['inline hide-if-no-js'] );
604
+
605
+ // Removes the post type query argument for the edit action.
606
+ if ( isset( $actions['edit'] ) ) {
607
+ $actions['edit'] = str_replace( '&#038;post_type=post', '', $actions['edit'] );
608
+ }
609
+
610
+ return $actions;
611
+ }
612
+ }
613
+
614
+ endif;
bp-core/classes/class-bp-admin.php CHANGED
@@ -175,6 +175,9 @@ class BP_Admin {
175
  // BuddyPress Hello.
176
  add_action( 'admin_footer', array( $this, 'about_screen' ) );
177
 
 
 
 
178
  /* Filters ***********************************************************/
179
 
180
  // Add link to settings page.
@@ -559,7 +562,7 @@ class BP_Admin {
559
  */
560
  public function add_privacy_policy_content() {
561
  // Nothing to do if we're running < WP 4.9.6.
562
- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
563
  return;
564
  }
565
 
@@ -653,108 +656,139 @@ class BP_Admin {
653
  <div class="bp-hello-content">
654
  <div id="dynamic-content"></div>
655
  <div id="top-features">
656
- <h2><?php esc_html_e( 'Say hello to the first two BuddyPress blocks!', 'buddypress' ); ?></h2>
657
  <figure class="bp-hello-aligncenter">
658
- <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-blocks.gif' ); ?>" alt="<?php esc_attr_e( 'Gif Animation showing how to insert the BuddyPress Group Block.', 'buddypress' ); ?>" />
659
  </figure>
660
  <p>
661
- <?php esc_html_e( 'BuddyPress 6.0.0 comes with two awesome blocks for your WordPress Editor: the BP Member and BP Group Blocks.', 'buddypress' ); ?>
662
- <?php esc_html_e( 'Available from the BuddyPress blocks category of your WordPress Block menu, these lovely blocks let you insert a rich content block featuring a specific member or group from your community site in a WordPress post or page.', 'buddypress' ); ?>
663
- <br/>
664
  <?php printf(
665
- /* translators: %s is the placeholder for the link to the Advanced section of the BP Blocks development note. */
666
- esc_html__( 'If you\'re an Advanced BuddyPresser and wish to fine tune the BuddyPress blocks for your community site, learn more in %s about the new BP Blocks.', 'buddypress' ),
667
  sprintf(
668
  '<a href="%1$s">%2$s</a>',
669
- esc_url( 'https://bpdevel.wordpress.com/2020/03/30/welcome-to-the-first-buddypress-blocks/#advanced-customizations' ),
670
- esc_html__( 'this section of our development note', 'buddypress' )
 
 
 
 
 
 
 
 
 
 
 
 
 
671
  )
672
  ); ?>
673
  </p>
674
 
675
  <hr class="bp-hello-divider"/>
676
 
677
- <h2><?php esc_html_e( 'The BP REST API is now completed!', 'buddypress' ); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  <figure class="bp-hello-alignright">
679
  <div class="dashicons dashicons-rest-api big"></div>
680
  </figure>
681
  <p>
682
  <?php printf(
683
  /* translators: %s is the placeholder for the link to the BP REST API documentation. */
684
- esc_html__( 'In 5.0.0, we introduced the first endpoints and provided %s for them.', 'buddypress' ),
685
  sprintf(
686
  '<a href="%1$s">%2$s</a>',
687
  esc_url( 'https://developer.buddypress.org/bp-rest-api/' ),
688
- esc_html__( 'reference documentation', 'buddypress' )
 
 
 
 
 
 
 
 
 
 
 
 
689
  )
690
  ); ?>
691
- <?php esc_html_e( 'In 6.0.0, we are adding the 6 remaining endpoints you were waiting for: Blogs, Blog avatar, Friends, Group Cover Image, Member Cover Image and User Signups. You can now build full-featured BuddyPress Apps!', 'buddypress' ); ?>
692
  </p>
693
 
694
  <hr class="bp-hello-divider"/>
695
 
696
- <h2><?php esc_html_e( 'BP Nouveau has been improved', 'buddypress' ); ?></h2>
697
  <p>
698
- <?php esc_html_e( 'Your active theme supports wide layouts? Awesome! BP Nouveau now supports wide (and really, really wide) content areas, too!', 'buddypress' ); ?>
 
 
699
  </p>
700
  <figure class="bp-hello-aligncenter">
701
- <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-nouveau-wide-aligns.png' ); ?>" alt="<?php esc_attr_e( 'Screenshot of the BP Nouveau customizer setting to take advantage of wide layouts', 'buddypress' ); ?>" />
702
  </figure>
703
- <p>
704
- <?php esc_html_e( 'This is the first of the many improvements we are bringing to our default Template Pack. It never looked so beautiful in your theme.', 'buddypress' ); ?>
705
- </p>
706
 
707
  <hr class="bp-hello-divider"/>
708
 
709
- <h2><?php esc_html_e( 'Under the hood', 'buddypress' ); ?></h2>
710
- <figure class="bp-hello-alignright">
711
- <div class="dashicons dashicons-buddicons-buddypress-logo big"></div>
712
  </figure>
713
  <p>
714
- <?php esc_html_e( '6.0.0 includes more than 80 changes to improve your BuddyPress experience as users, as contributors to our code and as contributors to our translations.', 'buddypress' ); ?>
 
715
  </p>
716
  <p>
717
  <?php printf(
718
- /* translators: %s is the placeholder for the link to the Avatar changes development note. */
719
- esc_html__( 'The biggest change moves local avatar management to the Members component. Read more about it in %s.', 'buddypress' ),
720
  sprintf(
721
  '<a href="%1$s">%2$s</a>',
722
- esc_url( 'https://bpdevel.wordpress.com/2020/03/01/the-profile-photo-cover-image-features-belong-to-members/' ),
723
- esc_html__( 'this development note', 'buddypress' )
724
  )
725
  ); ?>
726
  </p>
727
 
728
  <hr class="bp-hello-divider"/>
729
 
730
- <h2><?php esc_html_e( 'We want to hear your voice', 'buddypress' ); ?></h2>
731
- <figure class="bp-hello-alignleft">
732
- <div class="dashicons dashicons-microphone big"></div>
733
- </figure>
734
- <p class="aligncenter">
735
- <strong><?php printf(
736
- /* translators: %s is the placeholder for the link to the 2020 BuddyPress survey. */
737
- esc_html__( 'Take the %s.', 'buddypress' ),
738
- sprintf(
739
- '<a href="%1$s">%2$s</a>',
740
- esc_url( 'https://mercime.survey.fm/2020-buddypress-survey' ),
741
- esc_html__( '2020 BuddyPress Survey', 'buddypress' )
742
- )
743
- ); ?></strong>
744
- </p>
745
  <p>
746
- <?php esc_html_e( 'Knowing how you use BuddyPress and getting your point of view about future BuddyPress development is very important to us.', 'buddypress' ); ?>
747
- <?php esc_html_e( 'Please, take some time to help us decide what\'s best for the BuddyPress project.', 'buddypress' ); ?>
748
  </p>
 
 
 
749
 
750
  <hr class="bp-hello-divider"/>
751
 
752
  <h2><?php echo esc_html( _x( 'Your feedback', 'screen heading', 'buddypress' ) ); ?></h2>
753
  <p>
 
754
  <?php
755
  printf(
756
  /* translators: %s is the placeholder for the link to BuddyPress support forums. */
757
- esc_html__( ' How are you using BuddyPress? Receiving your feedback and suggestions for future versions of BuddyPress genuinely motivates and encourages our contributors. Please %s about this version of BuddyPress on our website. ', 'buddypress' ),
758
  sprintf(
759
  '<a href="%1$s">%2$s</a>',
760
  esc_url( 'https://buddypress.org/support/' ),
@@ -775,10 +809,10 @@ class BP_Admin {
775
  <?php
776
  printf(
777
  /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
778
- _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 42, 'buddypress' ),
779
  '<span class="dashicons dashicons-heart"></span>',
780
  esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
781
- number_format_i18n( 42 )
782
  );
783
  ?>
784
  </p>
@@ -828,7 +862,8 @@ class BP_Admin {
828
 
829
  <div class="wrap bp-about-wrap">
830
 
831
- <h1><?php esc_html_e( 'BuddyPress Settings', 'buddypress' ); ?> </h1>
 
832
 
833
  <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( esc_html__( 'Credits', 'buddypress' ) ); ?></h2>
834
 
@@ -847,33 +882,33 @@ class BP_Admin {
847
  <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
848
  </li>
849
  <li class="wp-person" id="wp-person-djpaul">
850
- <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=120">
851
  Paul Gibbs</a>
852
  <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
853
  </li>
854
- </ul>
855
-
856
- <h3 class="wp-people-group"><?php esc_html_e( 'BuddyPress Team', 'buddypress' ); ?></h3>
857
- <ul class="wp-people-group " id="wp-people-group-core-team">
858
  <li class="wp-person" id="wp-person-r-a-y">
859
  <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=120">
860
  Ray</a>
861
- <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
862
- </li>
863
- <li class="wp-person" id="wp-person-hnla">
864
- <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=120">
865
- Hugo Ashmore</a>
866
- <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
867
  </li>
868
  <li class="wp-person" id="wp-person-imath">
869
  <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=120">
870
  Mathieu Viet</a>
871
- <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
872
  </li>
873
  <li class="wp-person" id="wp-person-mercime">
874
  <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=120">
875
  Mercime</a>
876
- <span class="title"><?php esc_html_e( 'Navigator', 'buddypress' ); ?></span>
 
 
 
 
 
 
 
 
 
877
  </li>
878
  <li class="wp-person" id="wp-person-dcavins">
879
  <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=120">
@@ -937,9 +972,9 @@ class BP_Admin {
937
  ?>
938
  </h3>
939
  <ul class="wp-people-group " id="wp-people-group-noteworthy">
940
- <li class="wp-person" id="wp-person-passoniate">
941
- <a class="web" href="https://profiles.wordpress.org/passoniate/"><img alt="" class="gravatar" src="//gravatar.com/avatar/df262cbc82caecc7302849e8d591b32c?s=120">
942
- Arslan Ahmed</a>
943
  </li>
944
  <li class="wp-person" id="wp-person-iamthewebb">
945
  <a class="web" href="https://profiles.wordpress.org/iamthewebb/"><img alt="" class="gravatar" src="//gravatar.com/avatar/990bac871caf6d6e179b2753226d8f4a?s=120&d=mm">
@@ -961,48 +996,61 @@ class BP_Admin {
961
  ?>
962
  </h3>
963
  <p class="wp-credits-list">
964
- <a href="https://profiles.wordpress.org/oztaser">Adil Oztaser (oztaser)</a>,
965
- <a href="https://profiles.wordpress.org/wpamitkumar">Amit Dudhat (wpamitkumar)</a>,
966
- <a href="https://profiles.wordpress.org/dontdream">Andrea Tarantini (dontdream)</a>,
967
- <a href="https://profiles.wordpress.org/ankitmaru">Ankit Panchal (ankitmaru)</a>,
968
- <a href="https://profiles.wordpress.org/passoniate">Arslan Ahmed (passoniate)</a>,
969
  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
970
  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
971
- <a href="https://profiles.wordpress.org/bhargavbhandari90">Bunty (bhargavbhandari90)</a>,
972
  <a href="https://profiles.wordpress.org/dancaragea/">Dan Caragea (dancaragea)</a>,
973
  <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
974
- <a href="https://profiles.wordpress.org/ocean90">Dominik Schilling (ocean90)</a>,
975
- <a href="https://profiles.wordpress.org/etatus">etatus</a>,
976
- <a href="https://profiles.wordpress.org/fayazgabol">Fayaz Gabol (fayazgabol)</a>,
977
- <a href="https://profiles.wordpress.org/hnla">Hugo Ashmore (hnla)</a>,
978
- <a href="https://profiles.wordpress.org/audrasjb">Jb Audras (audrasjb)</a>,
979
- <a href="https://profiles.wordpress.org/jenfraggle/">Jennifer Burnett (jenfraggle)</a>,
 
 
 
 
 
 
 
 
980
  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
981
- <a href="https://profiles.wordpress.org/greenshady">Justin Tadlock (greenshady)</a>,
982
- <a href="https://profiles.wordpress.org/kashifgabol">Kashif Gabol (kashifgabol)</a>,
983
- <a href="https://profiles.wordpress.org/laudag">laudag</a>,
984
- <a href="https://profiles.wordpress.org/marbaque/">Mario Badilla (marbaque)</a>,
 
 
 
 
 
985
  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
986
- <a href="https://profiles.wordpress.org/mattjones2207">mattjones2207</a>,
987
- <a href="https://profiles.wordpress.org/mercime">mercime</a>,
988
- <a href="https://profiles.wordpress.org/mo3aser">mo3aser</a>,
989
- <a href="https://profiles.wordpress.org/modemlooper">modemlooper</a>,
990
- <a href="https://profiles.wordpress.org/man4toman">Morteza Geransayeh (man4toman)</a>,
991
- <a href="https://profiles.wordpress.org/mukesh27">Mukesh Panchal (mukesh27)</a>,
 
992
  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
993
- <a href="https://profiles.wordpress.org/pooja1210">Pooja N Muchandikar (pooja1210)</a>,
 
 
 
994
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
995
  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
996
- <a href="https://profiles.wordpress.org/santiazpi2">santiazpi2</a>,
997
- <a href="https://profiles.wordpress.org/shanebp">shanebp</a>,
998
- <a href="https://profiles.wordpress.org/sharaz">Sharaz Shahid (sharaz)</a>,
999
- <a href="https://github.com/sjregan">sjregan</a>,
 
1000
  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
1001
- <a href="https://profiles.wordpress.org/karmatosed">Tammie Lister (karmatosed)</a>,
1002
- <a href="https://profiles.wordpress.org/tobifjellner">Tor-Bjorn Fjellner (tobifjellner)</a>,
1003
- <a href="https://profiles.wordpress.org/itowhid06">Towhidul Islam (itowhid06)</a>,
1004
- <a href="https://profiles.wordpress.org/twmcmahan">twmcmahan</a>,
1005
- <a href="https://profiles.wordpress.org/zishanj">Zishan (zishanj)</a>
1006
  </p>
1007
 
1008
  <h3 class="wp-people-group"><?php esc_html_e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
175
  // BuddyPress Hello.
176
  add_action( 'admin_footer', array( $this, 'about_screen' ) );
177
 
178
+ // BuddyPress Types administration.
179
+ add_action( 'load-edit-tags.php', array( 'BP_Admin_Types', 'register_types_admin' ) );
180
+
181
  /* Filters ***********************************************************/
182
 
183
  // Add link to settings page.
562
  */
563
  public function add_privacy_policy_content() {
564
  // Nothing to do if we're running < WP 4.9.6.
565
+ if ( bp_is_running_wp( '4.9.6', '<' ) ) {
566
  return;
567
  }
568
 
656
  <div class="bp-hello-content">
657
  <div id="dynamic-content"></div>
658
  <div id="top-features">
659
+ <h2><?php esc_html_e( 'Manage Member Types and Group Types right from your WordPress Dashboard.', 'buddypress' ); ?></h2>
660
  <figure class="bp-hello-aligncenter">
661
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-types-illustration.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing how to access to the BP Types Admin areas.', 'buddypress' ); ?>" />
662
  </figure>
663
  <p>
664
+ <?php esc_html_e( 'Playing with BP Types just became much easier! The Member Types and Group Types were primarily introduced in BuddyPress as features for advanced users, just like the WordPress Custom Post Type feature.', 'buddypress' ); ?>
 
 
665
  <?php printf(
666
+ /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
667
+ esc_html__( 'Thanks to the two new %s, adding, editing and deleting Member & Group Types has never been so easy!', 'buddypress' ),
668
  sprintf(
669
  '<a href="%1$s">%2$s</a>',
670
+ esc_url( 'https://bpdevel.wordpress.com/2020/09/21/bp-types-admin-ui/' ),
671
+ esc_html__( 'WordPress Administration Screens', 'buddypress' )
672
+ )
673
+ ); ?>
674
+ <?php esc_html_e( 'Now you can set up BP Types using custom code or by simply using the Administration interfaces.', 'buddypress' ); ?>
675
+ </p>
676
+ <h3><?php esc_html_e( 'Multiple Member Type assignment.', 'buddypress' ); ?></h3>
677
+ <p>
678
+ <?php printf(
679
+ /* translators: %s is the placeholder for the link to the BP Types Admin developer note. */
680
+ esc_html__( 'As we were pretty hot on the subject, we also improved Member Types assignment. You can now %s to users from their extended profile in the WordPress Dashboard.', 'buddypress' ),
681
+ sprintf(
682
+ '<a href="%1$s">%2$s</a>',
683
+ esc_url( 'https://bpdevel.wordpress.com/2020/10/26/assigning-multiple-member-types-to-a-user/' ),
684
+ esc_html__( 'add more than one member type', 'buddypress' )
685
  )
686
  ); ?>
687
  </p>
688
 
689
  <hr class="bp-hello-divider"/>
690
 
691
+ <h2><?php esc_html_e( 'The BP Blocks category now includes 5 blocks!', 'buddypress' ); ?></h2>
692
+ <figure class="bp-hello-aligncenter">
693
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-new-blocks.png' ); ?>" alt="<?php esc_attr_e( 'Illustration showing the BuddyPress Blocks category inside the Block Editor Inserter.', 'buddypress' ); ?>" />
694
+ </figure>
695
+ <p>
696
+ <?php esc_html_e( '3 new BP Blocks are now available via your WordPress Editor.', 'buddypress' ); ?>
697
+ <?php esc_html_e( 'From the BuddyPress blocks category of the WordPress Block Inserter, you can pick a BP Block to feature a list of members, a list of groups or embed a public BuddyPress Activity into your post or page.', 'buddypress' ); ?>
698
+ <?php printf(
699
+ /* translators: %s is the placeholder for the link to the BP Blocks developer note. */
700
+ esc_html__( 'Read more about it in this %s.', 'buddypress' ),
701
+ sprintf(
702
+ '<a href="%1$s">%2$s</a>',
703
+ esc_url( 'https://bpdevel.wordpress.com/2020/10/14/three-new-blocks-to-expect-in-buddypress-7-0-0/' ),
704
+ esc_html__( 'development note', 'buddypress' )
705
+ )
706
+ ); ?>
707
+ </p>
708
+
709
+ <hr class="bp-hello-divider"/>
710
+
711
+ <h2><?php esc_html_e( 'Get the best of the BP REST API improvements!', 'buddypress' ); ?></h2>
712
  <figure class="bp-hello-alignright">
713
  <div class="dashicons dashicons-rest-api big"></div>
714
  </figure>
715
  <p>
716
  <?php printf(
717
  /* translators: %s is the placeholder for the link to the BP REST API documentation. */
718
+ esc_html__( 'The %s has been updated according to the latest improvements we’ve brought to the BuddyPress REST API.', 'buddypress' ),
719
  sprintf(
720
  '<a href="%1$s">%2$s</a>',
721
  esc_url( 'https://developer.buddypress.org/bp-rest-api/' ),
722
+ esc_html__( 'Developer documentation', 'buddypress' )
723
+ )
724
+ ); ?>
725
+ </p>
726
+ <p>
727
+ <?php esc_html_e( 'To name two: get the groups the logged in user is a member of, and create a blog when BuddyPress is activated on a network of WordPress sites.', 'buddypress' ); ?>
728
+ <?php printf(
729
+ /* translators: %s is the placeholder for the link to the BP REST API developer note. */
730
+ esc_html__( 'Read this %s to learn about all the others.', 'buddypress' ),
731
+ sprintf(
732
+ '<a href="%1$s">%2$s</a>',
733
+ esc_url( 'https://bpdevel.wordpress.com/2020/11/14/buddypress-rest-api-whats-new-in-7-0-0/' ),
734
+ esc_html__( 'development note', 'buddypress' )
735
  )
736
  ); ?>
 
737
  </p>
738
 
739
  <hr class="bp-hello-divider"/>
740
 
741
+ <h2><?php esc_html_e( 'BP Nouveau is ready for Twenty Twenty-One', 'buddypress' ); ?></h2>
742
  <p>
743
+ <?php esc_html_e( 'You love the latest default WordPress Theme, so do we!', 'buddypress' ); ?>
744
+ <?php esc_html_e( 'It’s important for us to make sure the BP Nouveau template pack looks great in the default themes included in the WordPress package.', 'buddypress' ); ?>
745
+ <?php esc_html_e( 'This is the first of the many improvements we are bringing to our default Template Pack.', 'buddypress' ); ?>
746
  </p>
747
  <figure class="bp-hello-aligncenter">
748
+ <img src="<?php echo esc_url( buddypress()->plugin_url . 'bp-core/images/bp-nouveau-2021.png' ); ?>" alt="<?php esc_attr_e( 'Screenshot of the BuddyPress Members directory', 'buddypress' ); ?>" />
749
  </figure>
 
 
 
750
 
751
  <hr class="bp-hello-divider"/>
752
 
753
+ <h2><?php esc_html_e( 'Improved support for WP CLI.', 'buddypress' ); ?></h2>
754
+ <figure class="bp-hello-alignleft">
755
+ <div class="dashicons dashicons-arrow-right-alt2 big"></div>
756
  </figure>
757
  <p>
758
+ <?php esc_html_e( 'WP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installs, and much more, all without using a web browser.', 'buddypress' ); ?>
759
+ <?php esc_html_e( 'In 7.0.0, you will be able to use new BuddyPress CLI commands to manage BuddyPress Group Meta, BuddyPress Activity Meta, activate or deactivate the BuddyPress signup feature and create BuddyPress-specific testing code for plugins.', 'buddypress' ); ?>
760
  </p>
761
  <p>
762
  <?php printf(
763
+ /* translators: %s is the placeholder for the link to the WP BP CLI developer note. */
764
+ esc_html__( 'Discover more about it from this %s.', 'buddypress' ),
765
  sprintf(
766
  '<a href="%1$s">%2$s</a>',
767
+ esc_url( 'https://bpdevel.wordpress.com/2020/10/09/wp-cli-buddypress-2-0/' ),
768
+ esc_html__( 'developer note', 'buddypress' )
769
  )
770
  ); ?>
771
  </p>
772
 
773
  <hr class="bp-hello-divider"/>
774
 
775
+ <h2><?php esc_html_e( 'Under the hood', 'buddypress' ); ?></h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
776
  <p>
777
+ <?php esc_html_e( '7.0.0 includes more than 65 changes to improve your BuddyPress experience as users, and as contributors to our project; click on the “Changelog” tab to discover them all!', 'buddypress' ); ?>
 
778
  </p>
779
+ <figure class="bp-hello-aligncenter">
780
+ <div class="dashicons dashicons-buddicons-buddypress-logo big"></div>
781
+ </figure>
782
 
783
  <hr class="bp-hello-divider"/>
784
 
785
  <h2><?php echo esc_html( _x( 'Your feedback', 'screen heading', 'buddypress' ) ); ?></h2>
786
  <p>
787
+ <?php esc_html_e( 'How are you using BuddyPress? Receiving your feedback and suggestions for future versions of BuddyPress genuinely motivates and encourages our contributors.', 'buddypress' ); ?>
788
  <?php
789
  printf(
790
  /* translators: %s is the placeholder for the link to BuddyPress support forums. */
791
+ esc_html__( 'Please %s about this version of BuddyPress on our website.', 'buddypress' ),
792
  sprintf(
793
  '<a href="%1$s">%2$s</a>',
794
  esc_url( 'https://buddypress.org/support/' ),
809
  <?php
810
  printf(
811
  /* translators: 1: heart dashicons. 2: BP Credits screen url. 3: number of BuddyPress contributors to this version. */
812
+ _n( 'Built with %1$s by <a href="%2$s">%3$d volunteer</a>.', 'Built with %1$s by <a href="%2$s">%3$d volunteers</a>.', 55, 'buddypress' ),
813
  '<span class="dashicons dashicons-heart"></span>',
814
  esc_url( bp_get_admin_url( 'admin.php?page=bp-credits' ) ),
815
+ number_format_i18n( 55 )
816
  );
817
  ?>
818
  </p>
862
 
863
  <div class="wrap bp-about-wrap">
864
 
865
+ <h1 class="wp-heading-inline"><?php esc_html_e( 'BuddyPress Settings', 'buddypress' ); ?></h1>
866
+ <hr class="wp-header-end">
867
 
868
  <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( esc_html__( 'Credits', 'buddypress' ) ); ?></h2>
869
 
882
  <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
883
  </li>
884
  <li class="wp-person" id="wp-person-djpaul">
885
+ <a class="web" href="https://profiles.wordpress.org/djpaul"><img alt="" class="gravatar" src="https://avatars2.githubusercontent.com/u/1275914?s=120">
886
  Paul Gibbs</a>
887
  <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
888
  </li>
 
 
 
 
889
  <li class="wp-person" id="wp-person-r-a-y">
890
  <a class="web" href="https://profiles.wordpress.org/r-a-y"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=120">
891
  Ray</a>
892
+ <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
 
 
 
 
 
893
  </li>
894
  <li class="wp-person" id="wp-person-imath">
895
  <a class="web" href="https://profiles.wordpress.org/imath"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=120">
896
  Mathieu Viet</a>
897
+ <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
898
  </li>
899
  <li class="wp-person" id="wp-person-mercime">
900
  <a class="web" href="https://profiles.wordpress.org/mercime"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=120">
901
  Mercime</a>
902
+ <span class="title"><?php esc_html_e( 'Lead Developer', 'buddypress' ); ?></span>
903
+ </li>
904
+ </ul>
905
+
906
+ <h3 class="wp-people-group"><?php esc_html_e( 'BuddyPress Team', 'buddypress' ); ?></h3>
907
+ <ul class="wp-people-group " id="wp-people-group-core-team">
908
+ <li class="wp-person" id="wp-person-hnla">
909
+ <a class="web" href="https://profiles.wordpress.org/hnla"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/3860c955aa3f79f13b92826ae47d07fe?s=120">
910
+ Hugo Ashmore</a>
911
+ <span class="title"><?php esc_html_e( 'Core Developer', 'buddypress' ); ?></span>
912
  </li>
913
  <li class="wp-person" id="wp-person-dcavins">
914
  <a class="web" href="https://profiles.wordpress.org/dcavins"><img alt="" class="gravatar" src="//www.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=120">
972
  ?>
973
  </h3>
974
  <ul class="wp-people-group " id="wp-people-group-noteworthy">
975
+ <li class="wp-person" id="wp-person-oztaser">
976
+ <a class="web" href="https://profiles.wordpress.org/oztaser/"><img alt="" class="gravatar" src="//gravatar.com/avatar/06eb4dd13c0113bf826968ae16a13e52?s=120">
977
+ Adil Oztaser</a>
978
  </li>
979
  <li class="wp-person" id="wp-person-iamthewebb">
980
  <a class="web" href="https://profiles.wordpress.org/iamthewebb/"><img alt="" class="gravatar" src="//gravatar.com/avatar/990bac871caf6d6e179b2753226d8f4a?s=120&d=mm">
996
  ?>
997
  </h3>
998
  <p class="wp-credits-list">
999
+ <a href="https://profiles.wordpress.org/oztaser/">Adil Oztaser (oztaser)</a>,
 
 
 
 
1000
  <a href="https://profiles.wordpress.org/boonebgorges/">Boone B Gorges (boonebgorges)</a>,
1001
  <a href="https://profiles.wordpress.org/sbrajesh/">Brajesh Singh (sbrajesh)</a>,
1002
+ <a href="https://profiles.wordpress.org/corsky/">corsky</a>,
1003
  <a href="https://profiles.wordpress.org/dancaragea/">Dan Caragea (dancaragea)</a>,
1004
  <a href="https://profiles.wordpress.org/dcavins/">David Cavins (dcavins)</a>,
1005
+ <a href="https://profiles.wordpress.org/devnik/">devnik</a>,
1006
+ <a href="https://profiles.wordpress.org/dilipbheda/">Dilip Bheda</a>,
1007
+ <a href="https://profiles.wordpress.org/dd32/">Dion Hulse (dd32)</a>,
1008
+ <a href="https://profiles.wordpress.org/dragoeco/">dragoeco</a>,
1009
+ <a href="https://profiles.wordpress.org/kebbet/">Erik Betshammar (kebbet)</a>,
1010
+ <a href="https://profiles.wordpress.org/etatus/">etatus</a>,
1011
+ <a href="https://github.com/ExoGeek/">Didier Saintes (ExoGeek)</a>,
1012
+ <a href="https://profiles.wordpress.org/f2010525/">诗语 (f2010525)</a>,
1013
+ <a href="https://profiles.wordpress.org/mamaduka/">George Mamadashvili</a>,
1014
+ <a href="https://profiles.wordpress.org/mociofiletto/">Giuseppe (mociofiletto)</a>,
1015
+ <a href="https://profiles.wordpress.org/hareesh-pillai/">Hareesh</a>,
1016
+ <a href="https://profiles.wordpress.org/iamthewebb/">iamthewebb</a>,
1017
+ <a href="https://profiles.wordpress.org/nobnob/">Javier Esteban (nobnob)</a>,
1018
+ <a href="https://profiles.wordpress.org/audrasjb/">Jb Audras (audrasjb)</a>,
1019
  <a href="https://profiles.wordpress.org/johnjamesjacoby/">John James Jacoby (johnjamesjacoby)</a>,
1020
+ <a href="https://profiles.wordpress.org/joost-abrahams/">Joost Abrahams (joost-abrahams)</a>,
1021
+ <a href="https://profiles.wordpress.org/k3690/">k3690</a>,
1022
+ <a href="https://profiles.wordpress.org/knutsp/">Knut Sparhell (knutsp)</a>,
1023
+ <a href="https://profiles.wordpress.org/laxman-prajapati/">Laxman Prajapati</a>,
1024
+ <a href="https://profiles.wordpress.org/lidialab/">Lidia Pellizzaro (lidialab)</a>,
1025
+ <a href="https://profiles.wordpress.org/marbaque/">marbaque</a>,
1026
+ <a href="https://github.com/geckse/">Marcel Claus (geckse)</a>,
1027
+ <a href="https://profiles.wordpress.org/marioshtika/">marioshtika</a>,
1028
+ <a href="https://profiles.wordpress.org/markscottrobson/">Mark Robson (markscottrobson)</a>,
1029
  <a href="https://profiles.wordpress.org/imath/">Mathieu Viet (imath)</a>,
1030
+ <a href="https://profiles.wordpress.org/mercime/">mercime</a>,
1031
+ <a href="https://profiles.wordpress.org/immeet94/">Meet Makadia</a>,
1032
+ <a href="https://profiles.wordpress.org/tw2113/">Michael Beckwith</a>,
1033
+ <a href="https://profiles.wordpress.org/man4toman/">Morteza Geransayeh (man4toman)</a>,
1034
+ <a href="https://profiles.wordpress.org/morenolq/">morenolq</a>,
1035
+ <a href="https://profiles.wordpress.org/n33d/">N33D</a>,
1036
+ <a href="https://profiles.wordpress.org/oddev56/">oddev56</a>,
1037
  <a href="https://profiles.wordpress.org/DJPaul/">Paul Gibbs (DJPaul)</a>,
1038
+ <a href="https://profiles.wordpress.org/walbo/">Petter Walbø Johnsgård (walbo)</a>,
1039
+ <a href="https://profiles.wordpress.org/psmits1567/">Peter Smits (psmits1567)</a>,
1040
+ <a href="https://profiles.wordpress.org/pooja1210/">Pooja N Muchandikar (pooja1210)</a>,
1041
+ <a href="https://profiles.wordpress.org/raruto/">Raruto</a>,
1042
  <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>,
1043
  <a href="https://profiles.wordpress.org/espellcaste/">Renato Alves (espellcaste)</a>,
1044
+ <a href="https://profiles.wordpress.org/scipi/">scipi</a>,
1045
+ <a href="https://profiles.wordpress.org/scottopolis/">Scott Bolinger (scottopolis)</a>,
1046
+ <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>,
1047
+ <a href="https://profiles.wordpress.org/shawfactor/">shawfactor</a>,
1048
+ <a href="https://profiles.wordpress.org/sjregan/">sjregan</a>,
1049
  <a href="https://profiles.wordpress.org/netweb/">Stephen Edgar (netweb)</a>,
1050
+ <a href="https://profiles.wordpress.org/tharsheblows/">tharsheblows</a>,
1051
+ <a href="https://profiles.wordpress.org/tobifjellner/">Tor-Bjorn Fjellner (tobifjellner)</a>,
1052
+ <a href="https://profiles.wordpress.org/vapvarun/">Varun Dubey (vapvarun)</a>,
1053
+ <a href="https://profiles.wordpress.org/podporawebu/">wp24.cz (podporawebu)</a>.
 
1054
  </p>
1055
 
1056
  <h3 class="wp-people-group"><?php esc_html_e( 'With our thanks to these Open Source projects', 'buddypress' ); ?></h3>
bp-core/classes/class-bp-core-notification.php CHANGED
@@ -24,14 +24,14 @@ class BP_Core_Notification {
24
  *
25
  * @var int
26
  */
27
- public $id;
28
 
29
  /**
30
  * The ID to which the notification relates to within the component.
31
  *
32
  * @var int
33
  */
34
- public $item_id;
35
 
36
  /**
37
  * The secondary ID to which the notification relates to within the component.
@@ -45,35 +45,35 @@ class BP_Core_Notification {
45
  *
46
  * @var int
47
  */
48
- public $user_id;
49
 
50
  /**
51
  * The name of the component that the notification is for.
52
  *
53
  * @var string
54
  */
55
- public $component_name;
56
 
57
  /**
58
  * The action within the component which the notification is related to.
59
  *
60
  * @var string
61
  */
62
- public $component_action;
63
 
64
  /**
65
  * The date the notification was created.
66
  *
67
  * @var string
68
  */
69
- public $date_notified;
70
 
71
  /**
72
  * Is the notification new or has it already been read.
73
  *
74
  * @var boolean
75
  */
76
- public $is_new;
77
 
78
  /** Public Methods ********************************************************/
79
 
@@ -83,10 +83,14 @@ class BP_Core_Notification {
83
  * @param int $id ID for the notification.
84
  */
85
  public function __construct( $id = 0 ) {
86
- if ( !empty( $id ) ) {
87
- $this->id = $id;
88
- $this->populate();
 
89
  }
 
 
 
90
  }
91
 
92
  /**
@@ -102,16 +106,21 @@ class BP_Core_Notification {
102
  $bp = buddypress();
103
 
104
  // Update.
105
- if ( !empty( $this->id ) ) {
106
- $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 );
 
107
 
108
  // Save.
109
  } else {
110
- $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 );
 
111
  }
112
 
113
- if ( !$result = $wpdb->query( $sql ) )
 
 
114
  return false;
 
115
 
116
  $this->id = $wpdb->insert_id;
117
 
@@ -130,14 +139,18 @@ class BP_Core_Notification {
130
 
131
  $bp = buddypress();
132
 
133
- if ( $notification = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE id = %d", $this->id ) ) ) {
134
- $this->item_id = $notification->item_id;
135
- $this->secondary_item_id = $notification->secondary_item_id;
136
- $this->user_id = $notification->user_id;
137
- $this->component_name = $notification->component_name;
138
- $this->component_action = $notification->component_action;
139
- $this->date_notified = $notification->date_notified;
140
- $this->is_new = $notification->is_new;
 
 
 
 
141
  }
142
  }
143
 
@@ -150,12 +163,16 @@ class BP_Core_Notification {
150
  * @param int $notification_id Notification ID to check for.
151
  * @return string
152
  */
153
- public static function check_access( $user_id, $notification_id ) {
154
  global $wpdb;
155
 
156
  $bp = buddypress();
157
 
158
- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
 
 
 
 
159
  }
160
 
161
  /**
@@ -178,7 +195,11 @@ class BP_Core_Notification {
178
  ? ' AND is_new = 1 '
179
  : '';
180
 
181
- return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) );
 
 
 
 
182
  }
183
 
184
  /**
@@ -198,7 +219,11 @@ class BP_Core_Notification {
198
 
199
  $bp = buddypress();
200
 
201
- return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
 
 
 
 
202
  }
203
 
204
  /**
@@ -212,20 +237,24 @@ class BP_Core_Notification {
212
  * @param int $item_id The item ID of the notifications we wish to delete.
213
  * @param string $component_name The name of the component that the notifications we wish to delete.
214
  * @param string $component_action The action of the component that the notifications we wish to delete.
215
- * @param int|bool $secondary_item_id (optional) The secondary item id of the notifications that we wish to
216
  * use to delete.
217
  * @return mixed
218
  */
219
- public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = false ) {
220
  global $wpdb;
221
 
222
  $bp = buddypress();
223
 
224
- $secondary_item_sql = !empty( $secondary_item_id )
225
  ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id )
226
  : '';
227
 
228
- return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}", $user_id, $item_id, $component_name, $component_action ) );
 
 
 
 
229
  }
230
 
231
  /**
@@ -245,7 +274,11 @@ class BP_Core_Notification {
245
 
246
  $bp = buddypress();
247
 
248
- return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s AND component_action = %s", $user_id, $component_name, $component_action ) );
 
 
 
 
249
  }
250
 
251
  /**
@@ -256,27 +289,29 @@ class BP_Core_Notification {
256
  *
257
  * @static
258
  *
259
- * @param string $item_id The item id that they notifications are to be for.
260
  * @param string $component_name The component that the notifications are to be from.
261
  * @param string $component_action The action that the notifications are to be from.
262
- * @param string $secondary_item_id Optional secondary item id that the notifications are to have.
263
  * @return mixed
264
  */
265
- public static function delete_all_by_type( $item_id, $component_name, $component_action, $secondary_item_id ) {
266
  global $wpdb;
267
 
268
- if ( $component_action )
269
- $component_action_sql = $wpdb->prepare( "AND component_action = %s", $component_action );
270
- else
271
- $component_action_sql = '';
272
 
273
- if ( $secondary_item_id )
274
- $secondary_item_sql = $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id );
275
- else
276
- $secondary_item_sql = '';
277
 
278
  $bp = buddypress();
279
 
280
- return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->core->table_name_notifications} WHERE item_id = %d AND component_name = %s {$component_action_sql} {$secondary_item_sql}", $item_id, $component_name ) );
 
 
 
 
281
  }
282
  }
24
  *
25
  * @var int
26
  */
27
+ public $id = 0;
28
 
29
  /**
30
  * The ID to which the notification relates to within the component.
31
  *
32
  * @var int
33
  */
34
+ public $item_id = 0;
35
 
36
  /**
37
  * The secondary ID to which the notification relates to within the component.
45
  *
46
  * @var int
47
  */
48
+ public $user_id = 0;
49
 
50
  /**
51
  * The name of the component that the notification is for.
52
  *
53
  * @var string
54
  */
55
+ public $component_name = '';
56
 
57
  /**
58
  * The action within the component which the notification is related to.
59
  *
60
  * @var string
61
  */
62
+ public $component_action = '';
63
 
64
  /**
65
  * The date the notification was created.
66
  *
67
  * @var string
68
  */
69
+ public $date_notified = '';
70
 
71
  /**
72
  * Is the notification new or has it already been read.
73
  *
74
  * @var boolean
75
  */
76
+ public $is_new = false;
77
 
78
  /** Public Methods ********************************************************/
79
 
83
  * @param int $id ID for the notification.
84
  */
85
  public function __construct( $id = 0 ) {
86
+
87
+ // Bail if no ID
88
+ if ( empty( $id ) ) {
89
+ return;
90
  }
91
+
92
+ $this->id = absint( $id );
93
+ $this->populate();
94
  }
95
 
96
  /**
106
  $bp = buddypress();
107
 
108
  // Update.
109
+ if ( ! empty( $this->id ) ) {
110
+ $query = "UPDATE {$bp->notifications->table_name} 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";
111
+ $sql = $wpdb->prepare( $query, $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new, $this->id );
112
 
113
  // Save.
114
  } else {
115
+ $query = "INSERT INTO {$bp->notifications->table_name} ( item_id, secondary_item_id, user_id, component_name, component_action, date_notified, is_new ) VALUES ( %d, %d, %d, %s, %s, %s, %d )";
116
+ $sql = $wpdb->prepare( $query, $this->item_id, $this->secondary_item_id, $this->user_id, $this->component_name, $this->component_action, $this->date_notified, $this->is_new );
117
  }
118
 
119
+ $result = $wpdb->query( $sql );
120
+
121
+ if ( empty( $result ) || is_wp_error( $result ) ) {
122
  return false;
123
+ }
124
 
125
  $this->id = $wpdb->insert_id;
126
 
139
 
140
  $bp = buddypress();
141
 
142
+ $query = "SELECT * FROM {$bp->notifications->table_name} WHERE id = %d";
143
+ $prepare = $wpdb->prepare( $query, $this->id );
144
+ $result = $wpdb->get_row( $prepare );
145
+
146
+ if ( ! empty( $result ) ) {
147
+ $this->item_id = $result->item_id;
148
+ $this->secondary_item_id = $result->secondary_item_id;
149
+ $this->user_id = $result->user_id;
150
+ $this->component_name = $result->component_name;
151
+ $this->component_action = $result->component_action;
152
+ $this->date_notified = $result->date_notified;
153
+ $this->is_new = $result->is_new;
154
  }
155
  }
156
 
163
  * @param int $notification_id Notification ID to check for.
164
  * @return string
165
  */
166
+ public static function check_access( $user_id = 0, $notification_id = 0 ) {
167
  global $wpdb;
168
 
169
  $bp = buddypress();
170
 
171
+ $query = "SELECT COUNT(id) FROM {$bp->notifications->table_name} WHERE id = %d AND user_id = %d";
172
+ $prepare = $wpdb->prepare( $query, $notification_id, $user_id );
173
+ $result = $wpdb->get_var( $prepare );
174
+
175
+ return $result;
176
  }
177
 
178
  /**
195
  ? ' AND is_new = 1 '
196
  : '';
197
 
198
+ $query = "SELECT * FROM {$bp->notifications->table_name} WHERE user_id = %d {$is_new}";
199
+ $prepare = $wpdb->prepare( $query, $user_id );
200
+ $result = $wpdb->get_results( $prepare );
201
+
202
+ return $result;
203
  }
204
 
205
  /**
219
 
220
  $bp = buddypress();
221
 
222
+ $query = "DELETE FROM {$bp->notifications->table_name} WHERE user_id = %d AND component_name = %s AND component_action = %s";
223
+ $prepare = $wpdb->prepare( $query, $user_id, $component_name, $component_action );
224
+ $result = $wpdb->query( $prepare );
225
+
226
+ return $result;
227
  }
228
 
229
  /**
237
  * @param int $item_id The item ID of the notifications we wish to delete.
238
  * @param string $component_name The name of the component that the notifications we wish to delete.
239
  * @param string $component_action The action of the component that the notifications we wish to delete.
240
+ * @param int $secondary_item_id (optional) The secondary item id of the notifications that we wish to
241
  * use to delete.
242
  * @return mixed
243
  */
244
+ public static function delete_for_user_by_item_id( $user_id, $item_id, $component_name, $component_action, $secondary_item_id = 0 ) {
245
  global $wpdb;
246
 
247
  $bp = buddypress();
248
 
249
+ $secondary_item_sql = ! empty( $secondary_item_id )
250
  ? $wpdb->prepare( " AND secondary_item_id = %d", $secondary_item_id )
251
  : '';
252
 
253
+ $query = "DELETE FROM {$bp->notifications->table_name} WHERE user_id = %d AND item_id = %d AND component_name = %s AND component_action = %s{$secondary_item_sql}";
254
+ $prepare = $wpdb->prepare( $query, $user_id, $item_id, $component_name, $component_action );
255
+ $result = $wpdb->query( $prepare );
256
+
257
+ return $result;
258
  }
259
 
260
  /**
274
 
275
  $bp = buddypress();
276
 
277
+ $query = "DELETE FROM {$bp->notifications->table_name} WHERE item_id = %d AND component_name = %s AND component_action = %s";
278
+ $prepare = $wpdb->prepare( $query, $user_id, $component_name, $component_action );
279
+ $result = $wpdb->query( $prepare );
280
+
281
+ return $result;
282
  }
283
 
284
  /**
289
  *
290
  * @static
291
  *
292
+ * @param int $item_id The item id that they notifications are to be for.
293
  * @param string $component_name The component that the notifications are to be from.
294
  * @param string $component_action The action that the notifications are to be from.
295
+ * @param int $secondary_item_id Optional secondary item id that the notifications are to have.
296
  * @return mixed
297
  */
298
+ public static function delete_all_by_type( $item_id, $component_name, $component_action = '', $secondary_item_id = 0 ) {
299
  global $wpdb;
300
 
301
+ $component_action_sql = ! empty( $component_action )
302
+ ? $wpdb->prepare( "AND component_action = %s", $component_action )
303
+ : '';
 
304
 
305
+ $secondary_item_sql = ! empty( $secondary_item_id )
306
+ ? $wpdb->prepare( "AND secondary_item_id = %d", $secondary_item_id )
307
+ : '';
 
308
 
309
  $bp = buddypress();
310
 
311
+ $query = "DELETE FROM {$bp->notifications->table_name} WHERE item_id = %d AND component_name = %s {$component_action_sql} {$secondary_item_sql}";
312
+ $prepare = $wpdb->prepare( $query, $item_id, $component_name );
313
+ $result = $wpdb->query( $prepare );
314
+
315
+ return $result;
316
  }
317
  }
bp-core/classes/class-bp-core-user.php CHANGED
@@ -205,7 +205,7 @@ class BP_Core_User {
205
  );
206
 
207
  /* translators: %s: human time diff of the last time the user was active on the site. */
208
- $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), _x( 'active %s', 'last time the user was active', 'buddypress' ) );
209
  }
210
 
211
  /**
@@ -760,11 +760,12 @@ class BP_Core_User {
760
 
761
  // Fetch the user's last_activity.
762
  if ( 'active' != $type ) {
763
- $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' ) ) );
764
  for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
765
  foreach ( (array) $user_activity as $activity ) {
766
- if ( $activity->id == $paged_users[$i]->id )
767
- $paged_users[$i]->last_activity = $activity->last_activity;
 
768
  }
769
  }
770
  }
205
  );
206
 
207
  /* translators: %s: human time diff of the last time the user was active on the site. */
208
+ $this->last_active = bp_core_get_last_activity( bp_get_user_last_activity( $this->id ), _x( 'Active %s', 'last time the user was active', 'buddypress' ) );
209
  }
210
 
211
  /**
760
 
761
  // Fetch the user's last_activity.
762
  if ( 'active' != $type ) {
763
+ $user_activity = self::get_last_activity( $user_ids );
764
  for ( $i = 0, $count = count( $paged_users ); $i < $count; ++$i ) {
765
  foreach ( (array) $user_activity as $activity ) {
766
+ if ( ! empty( $activity['user_id'] ) && (int) $activity['user_id'] === (int) $paged_users[$i]->id ) {
767
+ $paged_users[$i]->last_activity = $activity['date_recorded'];
768
+ }
769
  }
770
  }
771
  }
bp-core/classes/class-bp-core.php CHANGED
@@ -35,6 +35,31 @@ class BP_Core extends BP_Component {
35
  $this->bootstrap();
36
  }
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /**
39
  * Populate the global data needed before BuddyPress can continue.
40
  *
@@ -249,10 +274,6 @@ class BP_Core extends BP_Component {
249
  */
250
  $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', $bp->grav_default->user );
251
 
252
- // Notifications table. Included here for legacy purposes. Use
253
- // bp-notifications instead.
254
- $bp->core->table_name_notifications = $bp->table_prefix . 'bp_notifications';
255
-
256
  // Backward compatibility for plugins modifying the legacy bp_nav and bp_options_nav global properties.
257
  $bp->bp_nav = new BP_Core_BP_Nav_BackCompat();
258
  $bp->bp_options_nav = new BP_Core_BP_Options_Nav_BackCompat();
35
  $this->bootstrap();
36
  }
37
 
38
+ /**
39
+ * Magic getter.
40
+ *
41
+ * This exists specifically for supporting deprecated object vars.
42
+ *
43
+ * @since 7.0.0
44
+ *
45
+ * @param string $key
46
+ * @return mixed
47
+ */
48
+ public function __get( $key = '' ) {
49
+
50
+ // Backwards compatibility for the original Notifications table var
51
+ if ( 'table_name_notifications' === $key ) {
52
+ return bp_is_active( 'notifications' )
53
+ ? buddypress()->notifications->table_name
54
+ : buddypress()->table_prefix . 'bp_notifications';
55
+ }
56
+
57
+ // Return object var if set, else null
58
+ return isset( $this->{$key} )
59
+ ? $this->{$key}
60
+ : null;
61
+ }
62
+
63
  /**
64
  * Populate the global data needed before BuddyPress can continue.
65
  *
274
  */
275
  $bp->grav_default->blog = apply_filters( 'bp_blog_gravatar_default', $bp->grav_default->user );
276
 
 
 
 
 
277
  // Backward compatibility for plugins modifying the legacy bp_nav and bp_options_nav global properties.
278
  $bp->bp_nav = new BP_Core_BP_Nav_BackCompat();
279
  $bp->bp_options_nav = new BP_Core_BP_Options_Nav_BackCompat();
bp-core/classes/class-bp-embed.php CHANGED
@@ -117,14 +117,9 @@ class BP_Embed extends WP_Embed {
117
  */
118
  $id = apply_filters( 'embed_post_id', 0 );
119
 
120
- $unfiltered_html = current_user_can( 'unfiltered_html' );
121
- $default_discovery = false;
122
-
123
  // Since 4.4, WordPress is now an oEmbed provider.
124
- if ( function_exists( 'wp_oembed_register_route' ) ) {
125
- $unfiltered_html = true;
126
- $default_discovery = true;
127
- }
128
 
129
  /**
130
  * Filters whether or not oEmbed discovery is on.
117
  */
118
  $id = apply_filters( 'embed_post_id', 0 );
119
 
 
 
 
120
  // Since 4.4, WordPress is now an oEmbed provider.
121
+ $unfiltered_html = true;
122
+ $default_discovery = true;
 
 
123
 
124
  /**
125
  * Filters whether or not oEmbed discovery is on.
bp-core/classes/class-bp-invitation-manager.php CHANGED
@@ -50,7 +50,7 @@ abstract class BP_Invitation_Manager {
50
  * @return string
51
  */
52
  public static function get_table_name() {
53
- return buddypress()->table_prefix . 'bp_invitations';
54
  }
55
 
56
  /** Create ********************************************************************/
50
  * @return string
51
  */
52
  public static function get_table_name() {
53
+ return buddypress()->members->table_name_invitations;
54
  }
55
 
56
  /** Create ********************************************************************/
bp-core/classes/class-bp-rest-components-endpoint.php CHANGED
@@ -198,7 +198,7 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
198
  'bp_rest_component_nonexistent',
199
  __( 'Sorry, this component does not exist.', 'buddypress' ),
200
  array(
201
- 'status' => 500,
202
  )
203
  );
204
  }
@@ -209,7 +209,7 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
209
  'bp_rest_component_already_active',
210
  __( 'Sorry, this component is already active.', 'buddypress' ),
211
  array(
212
- 'status' => 500,
213
  )
214
  );
215
  }
@@ -221,7 +221,7 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
221
  'bp_rest_component_inactive',
222
  __( 'Sorry, this component is not active.', 'buddypress' ),
223
  array(
224
- 'status' => 500,
225
  )
226
  );
227
  }
@@ -231,7 +231,7 @@ class BP_REST_Components_Endpoint extends WP_REST_Controller {
231
  'bp_rest_required_component',
232
  __( 'Sorry, you cannot deactivate a required component.', 'buddypress' ),
233
  array(
234
- 'status' => 500,
235
  )
236
  );
237
  }
198
  'bp_rest_component_nonexistent',
199
  __( 'Sorry, this component does not exist.', 'buddypress' ),
200
  array(
201
+ 'status' => 404,
202
  )
203
  );
204
  }
209
  'bp_rest_component_already_active',
210
  __( 'Sorry, this component is already active.', 'buddypress' ),
211
  array(
212
+ 'status' => 400,
213
  )
214
  );
215
  }
221
  'bp_rest_component_inactive',
222
  __( 'Sorry, this component is not active.', 'buddypress' ),
223
  array(
224
+ 'status' => 400,
225
  )
226
  );
227
  }
231
  'bp_rest_required_component',
232
  __( 'Sorry, you cannot deactivate a required component.', 'buddypress' ),
233
  array(
234
+ 'status' => 400,
235
  )
236
  );
237
  }
bp-core/classes/class-bp-user-query.php CHANGED
@@ -573,10 +573,12 @@ class BP_User_Query {
573
 
574
  ), $this ) );
575
 
576
- // We calculate total_users using a standalone query, except
577
- // when a whitelist of user_ids is passed to the constructor.
578
- // This clause covers the latter situation, and ensures that
579
- // pagination works when querying by $user_ids.
 
 
580
  if ( empty( $this->total_users ) ) {
581
  $this->total_users = count( $wp_user_query->results );
582
  }
573
 
574
  ), $this ) );
575
 
576
+ /*
577
+ * We calculate total_users using a standalone query, except
578
+ * when a list of specific user_ids is passed to the constructor.
579
+ * This clause covers the latter situation, and ensures that
580
+ * pagination works when querying by $user_ids.
581
+ */
582
  if ( empty( $this->total_users ) ) {
583
  $this->total_users = count( $wp_user_query->results );
584
  }
bp-core/classes/class-bp-walker-nav-menu-checklist.php CHANGED
@@ -5,11 +5,15 @@
5
  * @package BuddyPress
6
  * @subpackage Core
7
  * @since 1.9.0
 
 
8
  */
9
 
10
  // Exit if accessed directly.
11
  defined( 'ABSPATH' ) || exit;
12
 
 
 
13
  /**
14
  * Create a set of BuddyPress-specific links for use in the Menus admin UI.
15
  *
@@ -17,17 +21,21 @@ defined( 'ABSPATH' ) || exit;
17
  * to require an actual post type or taxonomy, and to force certain CSS classes.
18
  *
19
  * @since 1.9.0
 
20
  */
21
  class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
22
 
23
  /**
24
  * Constructor.
25
  *
 
 
26
  * @see Walker_Nav_Menu::__construct() for a description of parameters.
27
  *
28
  * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}.
29
  */
30
  public function __construct( $fields = false ) {
 
31
  if ( $fields ) {
32
  $this->db_fields = $fields;
33
  }
@@ -36,6 +44,8 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
36
  /**
37
  * Create the markup to start a tree level.
38
  *
 
 
39
  * @see Walker_Nav_Menu::start_lvl() for description of parameters.
40
  *
41
  * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
@@ -43,6 +53,7 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
43
  * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
44
  */
45
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
 
46
  $indent = str_repeat( "\t", $depth );
47
  $output .= "\n$indent<ul class='children'>\n";
48
  }
@@ -50,6 +61,8 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
50
  /**
51
  * Create the markup to end a tree level.
52
  *
 
 
53
  * @see Walker_Nav_Menu::end_lvl() for description of parameters.
54
  *
55
  * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
@@ -57,6 +70,7 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
57
  * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
58
  */
59
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
 
60
  $indent = str_repeat( "\t", $depth );
61
  $output .= "\n$indent</ul>";
62
  }
@@ -64,6 +78,8 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
64
  /**
65
  * Create the markup to start an element.
66
  *
 
 
67
  * @see Walker::start_el() for description of parameters.
68
  *
69
  * @param string $output Passed by reference. Used to append additional
@@ -74,6 +90,7 @@ class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
74
  * @param int $id See {@Walker::start_el()}.
75
  */
76
  function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
 
77
  global $_nav_menu_placeholder;
78
 
79
  $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
5
  * @package BuddyPress
6
  * @subpackage Core
7
  * @since 1.9.0
8
+ * @deprecated 7.0.0 This file is no longer used as of the improved way to generate BuddyPress Member's nav menu items in #8291.
9
+ * @todo Remove this file as it is no longer used.
10
  */
11
 
12
  // Exit if accessed directly.
13
  defined( 'ABSPATH' ) || exit;
14
 
15
+ _deprecated_file( basename( __FILE__ ), '7.0.0' );
16
+
17
  /**
18
  * Create a set of BuddyPress-specific links for use in the Menus admin UI.
19
  *
21
  * to require an actual post type or taxonomy, and to force certain CSS classes.
22
  *
23
  * @since 1.9.0
24
+ * @deprecated 7.0.0 This class is no longer used as of the improved way to generate BuddyPress Member's nav menu items in #8291.
25
  */
26
  class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
27
 
28
  /**
29
  * Constructor.
30
  *
31
+ * @deprecated 7.0.0
32
+ *
33
  * @see Walker_Nav_Menu::__construct() for a description of parameters.
34
  *
35
  * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}.
36
  */
37
  public function __construct( $fields = false ) {
38
+ _deprecated_function( __METHOD__, '7.0.0' );
39
  if ( $fields ) {
40
  $this->db_fields = $fields;
41
  }
44
  /**
45
  * Create the markup to start a tree level.
46
  *
47
+ * @deprecated 7.0.0
48
+ *
49
  * @see Walker_Nav_Menu::start_lvl() for description of parameters.
50
  *
51
  * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
53
  * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
54
  */
55
  public function start_lvl( &$output, $depth = 0, $args = array() ) {
56
+ _deprecated_function( __METHOD__, '7.0.0' );
57
  $indent = str_repeat( "\t", $depth );
58
  $output .= "\n$indent<ul class='children'>\n";
59
  }
61
  /**
62
  * Create the markup to end a tree level.
63
  *
64
+ * @deprecated 7.0.0
65
+ *
66
  * @see Walker_Nav_Menu::end_lvl() for description of parameters.
67
  *
68
  * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
70
  * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
71
  */
72
  public function end_lvl( &$output, $depth = 0, $args = array() ) {
73
+ _deprecated_function( __METHOD__, '7.0.0' );
74
  $indent = str_repeat( "\t", $depth );
75
  $output .= "\n$indent</ul>";
76
  }
78
  /**
79
  * Create the markup to start an element.
80
  *
81
+ * @deprecated 7.0.0
82
+ *
83
  * @see Walker::start_el() for description of parameters.
84
  *
85
  * @param string $output Passed by reference. Used to append additional
90
  * @param int $id See {@Walker::start_el()}.
91
  */
92
  function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
93
+ _deprecated_function( __METHOD__, '7.0.0' );
94
  global $_nav_menu_placeholder;
95
 
96
  $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
bp-core/classes/trait-attachments.php CHANGED
@@ -53,6 +53,7 @@ trait BP_REST_Attachments {
53
  ),
54
  array(
55
  'status' => 500,
 
56
  )
57
  );
58
  }
@@ -73,6 +74,7 @@ trait BP_REST_Attachments {
73
  __( 'The BuddyPress attachments uploads directory is not set.', 'buddypress' ),
74
  array(
75
  'status' => 500,
 
76
  )
77
  );
78
  }
@@ -81,12 +83,13 @@ trait BP_REST_Attachments {
81
  $cover_dir = $bp_attachments_uploads_dir['basedir'] . $cover_subdir;
82
 
83
  // If upload path doesn't exist, stop.
84
- if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
85
  return new WP_Error(
86
  "bp_rest_attachments_{$this->object}_cover_upload_error",
87
  __( 'The cover image directory is not valid.', 'buddypress' ),
88
  array(
89
  'status' => 500,
 
90
  )
91
  );
92
  }
@@ -107,6 +110,7 @@ trait BP_REST_Attachments {
107
  __( 'There was a problem uploading the cover image.', 'buddypress' ),
108
  array(
109
  'status' => 500,
 
110
  )
111
  );
112
  }
@@ -126,7 +130,10 @@ trait BP_REST_Attachments {
126
  (int) $cover_dimensions['height']
127
  ),
128
  array(
129
- 'status' => 500,
 
 
 
130
  )
131
  );
132
  }
@@ -178,6 +185,7 @@ trait BP_REST_Attachments {
178
  ),
179
  array(
180
  'status' => 500,
 
181
  )
182
  );
183
  }
@@ -190,16 +198,22 @@ trait BP_REST_Attachments {
190
 
191
  // If the uploaded image is smaller than the "full" dimensions, throw a warning.
192
  if ( $avatar_attachment->is_too_small( $image_file ) ) {
 
 
 
193
  return new WP_Error(
194
  "bp_rest_attachments_{$this->object}_avatar_error",
195
  sprintf(
196
  /* translators: %1$s and %2$s is replaced with the correct sizes. */
197
  __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %1$s x %2$s pixels.', 'buddypress' ),
198
- bp_core_avatar_full_width(),
199
- bp_core_avatar_full_height()
200
  ),
201
  array(
202
- 'status' => 500,
 
 
 
203
  )
204
  );
205
  }
@@ -281,6 +295,7 @@ trait BP_REST_Attachments {
281
  ),
282
  array(
283
  'status' => 500,
 
284
  )
285
  );
286
  }
53
  ),
54
  array(
55
  'status' => 500,
56
+ 'reason' => 'upload_error',
57
  )
58
  );
59
  }
74
  __( 'The BuddyPress attachments uploads directory is not set.', 'buddypress' ),
75
  array(
76
  'status' => 500,
77
+ 'reason' => 'attachments_upload_dir',
78
  )
79
  );
80
  }
83
  $cover_dir = $bp_attachments_uploads_dir['basedir'] . $cover_subdir;
84
 
85
  // If upload path doesn't exist, stop.
86
+ if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
87
  return new WP_Error(
88
  "bp_rest_attachments_{$this->object}_cover_upload_error",
89
  __( 'The cover image directory is not valid.', 'buddypress' ),
90
  array(
91
  'status' => 500,
92
+ 'reason' => 'cover_image_dir',
93
  )
94
  );
95
  }
110
  __( 'There was a problem uploading the cover image.', 'buddypress' ),
111
  array(
112
  'status' => 500,
113
+ 'reason' => 'unknown',
114
  )
115
  );
116
  }
130
  (int) $cover_dimensions['height']
131
  ),
132
  array(
133
+ 'status' => 400,
134
+ 'reason' => 'image_too_small',
135
+ 'min_width' => (int) $cover_dimensions['width'],
136
+ 'min_height' => (int) $cover_dimensions['height'],
137
  )
138
  );
139
  }
185
  ),
186
  array(
187
  'status' => 500,
188
+ 'reason' => 'upload_error',
189
  )
190
  );
191
  }
198
 
199
  // If the uploaded image is smaller than the "full" dimensions, throw a warning.
200
  if ( $avatar_attachment->is_too_small( $image_file ) ) {
201
+ $full_width = bp_core_avatar_full_width();
202
+ $full_height = bp_core_avatar_full_height();
203
+
204
  return new WP_Error(
205
  "bp_rest_attachments_{$this->object}_avatar_error",
206
  sprintf(
207
  /* translators: %1$s and %2$s is replaced with the correct sizes. */
208
  __( 'You have selected an image that is smaller than recommended. For best results, upload a picture larger than %1$s x %2$s pixels.', 'buddypress' ),
209
+ $full_width,
210
+ $full_height
211
  ),
212
  array(
213
+ 'status' => 400,
214
+ 'reason' => 'image_too_small',
215
+ 'min_width' => $full_width,
216
+ 'min_height' => $full_height,
217
  )
218
  );
219
  }
295
  ),
296
  array(
297
  'status' => 500,
298
+ 'reason' => 'resize_error',
299
  )
300
  );
301
  }
bp-core/deprecated/7.0.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deprecated functions.
5
+ *
6
+ * @deprecated 7.0.0
7
+ */
8
+
9
+ // Exit if accessed directly.
10
+ defined( 'ABSPATH' ) || exit;
11
+
12
+ /**
13
+ * Mark the posted activity as spam, if it contains disallowed keywords.
14
+ *
15
+ * Use bp_activity_check_disallowed_keys() instead.
16
+ *
17
+ * @since 1.6.0
18
+ * @deprecated 7.0.0
19
+ *
20
+ * @param BP_Activity_Activity $activity The activity object to check.
21
+ */
22
+ function bp_activity_check_blacklist_keys( $activity ) {
23
+ _deprecated_function( __FUNCTION__, '7.0.0', 'bp_activity_check_disallowed_keys()' );
24
+ return bp_activity_check_disallowed_keys( $activity );
25
+ }
26
+
27
+ /**
28
+ * Check for blocked keys.
29
+ *
30
+ * Use bp_core_check_for_disallowed_keys() instead.
31
+ *
32
+ * @since 1.6.0
33
+ * @since 2.6.0 Added $error_type parameter.
34
+ * @deprecated 7.0.0
35
+ *
36
+ * @param int $user_id User ID.
37
+ * @param string $title The title of the content.
38
+ * @param string $content The content being posted.
39
+ * @param string $error_type The error type to return. Either 'bool' or 'wp_error'.
40
+ * @return bool|WP_Error True if test is passed, false if fail.
41
+ */
42
+ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) {
43
+ _deprecated_function( __FUNCTION__, '7.0.0', 'bp_core_check_for_disallowed_keys()' );
44
+ return bp_core_check_for_disallowed_keys( $user_id, $title, $content, $error_type );
45
+ }
bp-core/images/bp-blocks.gif DELETED
Binary file
bp-core/images/bp-new-blocks.png ADDED
Binary file
bp-core/images/bp-nouveau-2021.png ADDED
Binary file
bp-core/images/bp-nouveau-wide-aligns.png DELETED
Binary file
bp-core/images/bp-types-illustration.png ADDED
Binary file
bp-core/images/mystery-blog-50.png ADDED
Binary file
bp-core/images/mystery-blog.png ADDED
Binary file
bp-core/js/block-components.js CHANGED
@@ -15,7 +15,7 @@ function t(o,e){return module.exports=t=Object.setPrototypeOf||function(t,o){ret
15
  },{}],"RISo":[function(require,module,exports) {
16
  var e=require("./setPrototypeOf");function r(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&e(r,t)}module.exports=r;
17
  },{"./setPrototypeOf":"zqo5"}],"W80x":[function(require,module,exports) {
18
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("@babel/runtime/helpers/classCallCheck")),t=o(require("@babel/runtime/helpers/createClass")),r=o(require("@babel/runtime/helpers/assertThisInitialized")),a=o(require("@babel/runtime/helpers/possibleConstructorReturn")),s=o(require("@babel/runtime/helpers/getPrototypeOf")),n=o(require("@babel/runtime/helpers/inherits"));function o(e){return e&&e.__esModule?e:{default:e}}function u(e){return function(){var t,r=(0,s.default)(e);if(l()){var n=(0,s.default)(this).constructor;t=Reflect.construct(r,arguments,n)}else t=r.apply(this,arguments);return(0,a.default)(this,t)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}var i=wp.element,c=i.Component,m=i.Fragment,p=i.createElement,h=wp.components.Popover,f=wp,d=f.apiFetch,b=wp.i18n.__,_=function(a){(0,n.default)(o,a);var s=u(o);function o(){var t;return(0,e.default)(this,o),(t=s.apply(this,arguments)).state={search:"",items:[],error:""},t.searchItemName=t.searchItemName.bind((0,r.default)(t)),t.selectItemName=t.selectItemName.bind((0,r.default)(t)),t}return(0,t.default)(o,[{key:"searchItemName",value:function(e){var t=this,r=this.state.search,a=this.props,s=a.component,n=a.objectStatus;this.setState({search:e}),e.length<r.length&&this.setState({items:[]});var o="/buddypress/v1/"+s;e&&(o+="?search="+encodeURIComponent(e)),n&&(o+="&status="+n),d({path:o}).then(function(e){t.setState({items:e})},function(e){t.setState({error:e.message})})}},{key:"selectItemName",value:function(e,t){var r=this.props.onSelectItem;return e.preventDefault(),this.setState({search:"",items:[],error:""}),r({itemID:t})}},{key:"render",value:function(){var e,t=this,r=this.state,a=r.search,s=r.items,n=this.props,o=n.ariaLabel,u=n.placeholder,l=n.useAvatar;return o||(o=b("Item's name","buddypress")),u||(u=b("Enter Item's name here…","buddypress")),s.length&&(e=s.map(function(e){return p("button",{type:"button",key:"editor-autocompleters__item-item-"+e.id,role:"option","aria-selected":"true",className:"components-button components-autocomplete__result editor-autocompleters__user",onClick:function(r){return t.selectItemName(r,e.id)}},l&&p("img",{key:"avatar",className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls.thumb}),p("span",{key:"name",className:"editor-autocompleters__user-name"},e.name),e.mention_name&&p("span",{key:"slug",className:"editor-autocompleters__user-slug"},e.mention_name))})),p(m,null,p("input",{type:"text",value:a,className:"components-placeholder__input","aria-label":o,placeholder:u,onChange:function(e){return t.searchItemName(e.target.value)}}),0!==s.length&&p(h,{className:"components-autocomplete__popover",focusOnMount:!1,position:"bottom left"},p("div",{className:"components-autocomplete__results"},e)))}}]),o}(c),v=_;exports.default=v;
19
  },{"@babel/runtime/helpers/classCallCheck":"IC7x","@babel/runtime/helpers/createClass":"WiqS","@babel/runtime/helpers/assertThisInitialized":"NS7G","@babel/runtime/helpers/possibleConstructorReturn":"oXYo","@babel/runtime/helpers/getPrototypeOf":"goD2","@babel/runtime/helpers/inherits":"RISo"}],"iA92":[function(require,module,exports) {
20
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./autocompleter"));function t(e){return e&&e.__esModule?e:{default:e}}var r={AutoCompleter:e.default};exports.default=r;
21
  },{"./autocompleter":"W80x"}],"Ee8M":[function(require,module,exports) {
15
  },{}],"RISo":[function(require,module,exports) {
16
  var e=require("./setPrototypeOf");function r(r,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),t&&e(r,t)}module.exports=r;
17
  },{"./setPrototypeOf":"zqo5"}],"W80x":[function(require,module,exports) {
18
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("@babel/runtime/helpers/classCallCheck")),t=o(require("@babel/runtime/helpers/createClass")),r=o(require("@babel/runtime/helpers/assertThisInitialized")),a=o(require("@babel/runtime/helpers/possibleConstructorReturn")),s=o(require("@babel/runtime/helpers/getPrototypeOf")),n=o(require("@babel/runtime/helpers/inherits"));function o(e){return e&&e.__esModule?e:{default:e}}function u(e){var t=l();return function(){var r,n=(0,s.default)(e);if(t){var o=(0,s.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,a.default)(this,r)}}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}var i=wp,c=i.apiFetch,m=i.components.Popover,p=i.element,h=p.Component,f=p.Fragment,d=p.createElement,b=i.i18n.__,v=i.url.addQueryArgs,_=function(a){(0,n.default)(o,a);var s=u(o);function o(){var t;return(0,e.default)(this,o),(t=s.apply(this,arguments)).state={search:"",items:[],error:""},t.searchItemName=t.searchItemName.bind((0,r.default)(t)),t.selectItemName=t.selectItemName.bind((0,r.default)(t)),t}return(0,t.default)(o,[{key:"searchItemName",value:function(e){var t=this,r=this.state.search,a=this.props,s=a.component,n=a.objectQueryArgs;this.setState({search:e}),e.length<r.length&&this.setState({items:[]});var o="/buddypress/v1/"+s,u={};e&&(u.search=encodeURIComponent(e)),n&&(u=Object.assign(u,n)),c({path:v(o,u)}).then(function(e){t.setState({items:e})},function(e){t.setState({error:e.message})})}},{key:"selectItemName",value:function(e,t){var r=this.props.onSelectItem;return e.preventDefault(),this.setState({search:"",items:[],error:""}),r({itemID:t})}},{key:"render",value:function(){var e,t=this,r=this.state,a=r.search,s=r.items,n=this.props,o=n.ariaLabel,u=n.placeholder,l=n.useAvatar,i=n.slugValue;return o||(o=b("Item's name","buddypress")),u||(u=b("Enter Item's name here…","buddypress")),s.length&&(e=s.map(function(e){return d("button",{type:"button",key:"editor-autocompleters__item-item-"+e.id,role:"option","aria-selected":"true",className:"components-button components-autocomplete__result editor-autocompleters__user",onClick:function(r){return t.selectItemName(r,e.id)}},l&&d("img",{key:"avatar",className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls.thumb}),d("span",{key:"name",className:"editor-autocompleters__user-name"},e.name),i&&null!==i(e)&&d("span",{key:"slug",className:"editor-autocompleters__user-slug"},i(e)))})),d(f,null,d("input",{type:"text",value:a,className:"components-placeholder__input","aria-label":o,placeholder:u,onChange:function(e){return t.searchItemName(e.target.value)}}),0!==s.length&&d(m,{className:"components-autocomplete__popover",focusOnMount:!1,position:"bottom left"},d("div",{className:"components-autocomplete__results"},e)))}}]),o}(h),y=_;exports.default=y;
19
  },{"@babel/runtime/helpers/classCallCheck":"IC7x","@babel/runtime/helpers/createClass":"WiqS","@babel/runtime/helpers/assertThisInitialized":"NS7G","@babel/runtime/helpers/possibleConstructorReturn":"oXYo","@babel/runtime/helpers/getPrototypeOf":"goD2","@babel/runtime/helpers/inherits":"RISo"}],"iA92":[function(require,module,exports) {
20
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./autocompleter"));function t(e){return e&&e.__esModule?e:{default:e}}var r={AutoCompleter:e.default};exports.default=r;
21
  },{"./autocompleter":"W80x"}],"Ee8M":[function(require,module,exports) {
bp-core/js/block-components.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../../../../node_modules/@babel/runtime/helpers/createClass.js","../../../../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../node_modules/@babel/runtime/helpers/typeof.js","../../../../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/inherits.js","components/autocompleter.js","components/index.js","block-components.js"],"names":["AutoCompleter","wp","element","Component","Fragment","createElement","Popover","components","apiFetch","__","i18n","arguments","state","search","items","error","searchItemName","bind","selectItemName","value","props","component","objectStatus","setState","length","path","encodeURIComponent","then","message","event","itemID","onSelectItem","preventDefault","itemsList","ariaLabel","placeholder","useAvatar","map","item","id","avatar_urls","thumb","name","mention_name","target"],"mappings":";AAAA,SAAA,EAAA,EAAA,GACA,KAAA,aAAA,GACA,MAAA,IAAA,UAAA,qCAIA,OAAA,QAAA;;ACNA,SAAA,EAAA,EAAA,GACA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CACA,IAAA,EAAA,EAAA,GACA,EAAA,WAAA,EAAA,aAAA,EACA,EAAA,cAAA,EACA,UAAA,IAAA,EAAA,UAAA,GACA,OAAA,eAAA,EAAA,EAAA,IAAA,IAIA,SAAA,EAAA,EAAA,EAAA,GAGA,OAFA,GAAA,EAAA,EAAA,UAAA,GACA,GAAA,EAAA,EAAA,GACA,EAGA,OAAA,QAAA;;AChBA,SAAA,EAAA,GACA,QAAA,IAAA,EACA,MAAA,IAAA,eAAA,6DAGA,OAAA,EAGA,OAAA,QAAA;;ACRA,SAAA,EAAA,GAaA,MAVA,mBAAA,QAAA,iBAAA,OAAA,SACA,OAAA,QAAA,EAAA,SAAA,GACA,cAAA,GAGA,OAAA,QAAA,EAAA,SAAA,GACA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,GAIA,EAAA,GAGA,OAAA,QAAA;;AChBA,IAAA,EAAA,QAAA,qBAEA,EAAA,QAAA,2BAEA,SAAA,EAAA,EAAA,GACA,OAAA,GAAA,WAAA,EAAA,IAAA,mBAAA,EAIA,EAAA,GAHA,EAMA,OAAA,QAAA;;ACZA,SAAA,EAAA,GAIA,OAHA,OAAA,QAAA,EAAA,OAAA,eAAA,OAAA,eAAA,SAAA,GACA,OAAA,EAAA,WAAA,OAAA,eAAA,IAEA,EAAA,GAGA,OAAA,QAAA;;ACPA,SAAA,EAAA,EAAA,GAMA,OALA,OAAA,QAAA,EAAA,OAAA,gBAAA,SAAA,EAAA,GAEA,OADA,EAAA,UAAA,EACA,GAGA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACTA,IAAA,EAAA,QAAA,oBAEA,SAAA,EAAA,EAAA,GACA,GAAA,mBAAA,GAAA,OAAA,EACA,MAAA,IAAA,UAAA,sDAGA,EAAA,UAAA,OAAA,OAAA,GAAA,EAAA,UAAA,CACA,YAAA,CACA,MAAA,EACA,UAAA,EACA,cAAA,KAGA,GAAA,EAAA,EAAA,GAGA,OAAA,QAAA;;AC0GeA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,uCAAAA,EAAAA,EAAAA,QAAAA,iDAAAA,EAAAA,EAAAA,QAAAA,qDAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,oCAAAA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GAAAA,SAAAA,EAAAA,GAAAA,OAAAA,WAAAA,IAAAA,EAAAA,GAAAA,EAAAA,EAAAA,SAAAA,GAAAA,GAAAA,IAAAA,CAAAA,IAAAA,GAAAA,EAAAA,EAAAA,SAAAA,MAAAA,YAAAA,EAAAA,QAAAA,UAAAA,EAAAA,UAAAA,QAAAA,EAAAA,EAAAA,MAAAA,KAAAA,WAAAA,OAAAA,EAAAA,EAAAA,SAAAA,KAAAA,IAAAA,SAAAA,IAAAA,GAAAA,oBAAAA,UAAAA,QAAAA,UAAAA,OAAAA,EAAAA,GAAAA,QAAAA,UAAAA,KAAAA,OAAAA,EAAAA,GAAAA,mBAAAA,MAAAA,OAAAA,EAAAA,IAAAA,OAAAA,KAAAA,UAAAA,SAAAA,KAAAA,QAAAA,UAAAA,KAAAA,GAAAA,gBAAAA,EAAAA,MAAAA,GAAAA,OAAAA,GAxHgCC,IAAAA,EAAAA,GAAGC,QAA1CC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,SAAUC,EAAAA,EAAAA,cACrBC,EAAYL,GAAGM,WAAfD,QACaL,EAAAA,GAAbO,EAAAA,EAAAA,SACAC,EAAOR,GAAGS,KAAVD,GAEFT,EAAAA,SAAAA,IAmHSA,EAAAA,EAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,EAAAA,GAlHA,SAAA,IAAA,IAAA,EAAA,OAAA,EAAA,EAAA,SAAA,KAAA,IACHW,EAAAA,EAAAA,MAAAA,KAAAA,YAELC,MAAQ,CACZC,OAAQ,GACRC,MAAO,GACPC,MAAO,IAGHC,EAAAA,eAAiB,EAAKA,eAAeC,MAA1C,EAAA,EAAA,SAAA,IACKC,EAAAA,eAAiB,EAAKA,eAAeD,MAA1C,EAAA,EAAA,SAAA,IAVa,EAkHAjB,OAAAA,EAAAA,EAAAA,SAAAA,EAAAA,CAAAA,CAAAA,IAAAA,iBArGEmB,MAAAA,SAAAA,GAAQ,IAAA,EAAA,KACfN,EAAW,KAAKD,MAAhBC,OAC4B,EAAA,KAAKO,MAAjCC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,aACdC,KAAAA,SAAU,CAAEV,OAAQM,IAEpBA,EAAMK,OAASX,EAAOW,QACrBD,KAAAA,SAAU,CAAET,MAAO,KAGrBW,IAAAA,EAAM,kBAAoBJ,EAEzBF,IACJM,GAAQ,WAAaC,mBAAoBP,IAGrCG,IACJG,GAAQ,WAAaH,GAGtBd,EAAU,CAAEiB,KAAOA,IAASE,KAAM,SAAAb,GACjC,EAAKS,SAAU,CAAET,MAAOA,KACtB,SAAAC,GACF,EAAKQ,SAAU,CAAER,MAAOA,EAAMa,cA+ElB5B,CAAAA,IAAAA,iBA3EE6B,MAAAA,SAAAA,EAAOC,GACdC,IAAAA,EAAiB,KAAKX,MAAtBW,aASDA,OARPF,EAAMG,iBAEDT,KAAAA,SAAU,CACdV,OAAQ,GACRC,MAAO,GACPC,MAAO,KAGDgB,EAAc,CAAED,OAAQA,MAiElB9B,CAAAA,IAAAA,SA9DL,MAAA,WAAA,IAGJiC,EAHI,EAAA,KACkB,EAAA,KAAKrB,MAAvBC,EAAAA,EAAAA,OAAQC,EAAAA,EAAAA,MAC4B,EAAA,KAAKM,MAA3Cc,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,UAmC7B,OAhCMF,IACNA,EAAYzB,EAAI,cAAgB,eAG1B0B,IACNA,EAAc1B,EAAI,0BAA4B,eAG1CK,EAAMU,SACVS,EAAYnB,EAAMuB,IAAK,SAAEC,GAEvB,OAAA,EAAA,SAAA,CACC,KAAK,SAAS,IAAM,oCAAsCA,EAAKC,GAC/D,KAAK,SACS,gBAAA,OACd,UAAU,gFACV,QAAU,SAAEV,GAAW,OAAA,EAAKX,eAAgBW,EAAOS,EAAKC,MAEtDH,GACD,EAAA,MAAA,CAAK,IAAI,SAAS,UAAU,qCAAqC,IAAI,GAAG,IAAME,EAAKE,YAAYC,QAEhG,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCH,EAAKI,MAEnEJ,EAAKK,cACN,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCL,EAAKK,kBAQzE,EAAC,EACA,KAAA,EAAA,QAAA,CACC,KAAK,OACL,MAAQ9B,EACR,UAAU,gCACGqB,aAAAA,EACb,YAAcC,EACd,SAAW,SAAEN,GAAW,OAAA,EAAKb,eAAgBa,EAAMe,OAAOzB,UAEzD,IAAML,EAAMU,QACb,EAAC,EAAD,CACC,UAAU,mCACV,cAAe,EACf,SAAS,eAET,EAAA,MAAA,CAAK,UAAU,oCACZS,SASMjC,EAnHTA,CAAsBG,GAmHbH,EAAAA,EAAAA,QAAAA,QAAAA;;ACxHA,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,aAAA,EAFf,IAAA,EAAA,EAAA,QAAA,oBAEe,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAA,IAAA,EAAA,CACdA,cAAAA,EAAAA,SADc,QAAA,QAAA;;ACHf,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,OAAA,eAAA,QAAA,kBAAA,CAAA,YAAA,EAAA,IAAA,WAAA,OAAA,EAAA,WAAA,IAAA,EAAA,EAAA,QAAA,iBAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA","file":"block-components.js","sourceRoot":"../../../src/js/bp-core/js/block-components","sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","/**\n * WordPress dependencies.\n */\nconst { Component, Fragment, createElement } = wp.element;\nconst { Popover } = wp.components;\nconst { apiFetch } = wp;\nconst { __ } = wp.i18n;\n\nclass AutoCompleter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t};\n\n\t\tthis.searchItemName = this.searchItemName.bind( this );\n\t\tthis.selectItemName = this.selectItemName.bind( this );\n\t}\n\n\tsearchItemName( value ) {\n\t\tconst { search } = this.state;\n\t\tconst { component, objectStatus } = this.props;\n\t\tthis.setState( { search: value } );\n\n\t\tif ( value.length < search.length ) {\n\t\t\tthis.setState( { items: [] } );\n\t\t}\n\n\t\tlet path= '/buddypress/v1/' + component;\n\n\t\tif ( value ) {\n\t\t\tpath += '?search=' + encodeURIComponent( value );\n\t\t}\n\n\t\tif ( objectStatus ) {\n\t\t\tpath += '&status=' + objectStatus;\n\t\t}\n\n\t\tapiFetch( { path: path } ).then( items => {\n\t\t\tthis.setState( { items: items } );\n\t\t}, error => {\n\t\t\tthis.setState( { error: error.message } );\n\t\t} );\n\t}\n\n\tselectItemName( event, itemID ) {\n\t\tconst { onSelectItem } = this.props;\n\t\tevent.preventDefault();\n\n\t\tthis.setState( {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t} );\n\n\t\treturn onSelectItem( { itemID: itemID } );\n\t}\n\n\trender() {\n\t\tconst { search, items } = this.state;\n\t\tlet { ariaLabel, placeholder, useAvatar } = this.props;\n\t\tlet itemsList;\n\n\t\tif ( ! ariaLabel ) {\n\t\t\tariaLabel = __( 'Item\\'s name', 'buddypress' );\n\t\t}\n\n\t\tif ( ! placeholder ) {\n\t\t\tplaceholder = __( 'Enter Item\\'s name here…', 'buddypress' );\n\t\t}\n\n\t\tif ( items.length ) {\n\t\t\titemsList = items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\" key={ 'editor-autocompleters__item-item-' + item.id }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected=\"true\"\n\t\t\t\t\t\tclassName=\"components-button components-autocomplete__result editor-autocompleters__user\"\n\t\t\t\t\t\tonClick={ ( event ) => this.selectItemName( event, item.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ useAvatar && (\n\t\t\t\t\t\t\t<img key=\"avatar\" className=\"editor-autocompleters__user-avatar\" alt=\"\" src={ item.avatar_urls.thumb } />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<span key=\"name\" className=\"editor-autocompleters__user-name\">{ item.name }</span>\n\n\t\t\t\t\t\t{ item.mention_name && (\n\t\t\t\t\t\t\t<span key=\"slug\" className=\"editor-autocompleters__user-slug\">{ item.mention_name }</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tvalue={ search }\n\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => this.searchItemName( event.target.value ) }\n\t\t\t\t/>\n\t\t\t\t{ 0 !== items.length &&\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\t\tposition=\"bottom left\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"components-autocomplete__results\">\n\t\t\t\t\t\t\t{ itemsList }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t);\n\t}\n}\n\nexport default AutoCompleter;\n","// Components\nimport AutoCompleter from './autocompleter'\n\nexport default {\n\tAutoCompleter\n};\n","export { default as blockComponents } from './components';\n"]}
1
+ {"version":3,"sources":["../../../../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../../../../node_modules/@babel/runtime/helpers/createClass.js","../../../../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../../../../node_modules/@babel/runtime/helpers/typeof.js","../../../../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../../../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../../../../node_modules/@babel/runtime/helpers/inherits.js","components/autocompleter.js","components/index.js","block-components.js"],"names":["AutoCompleter","wp","apiFetch","Popover","components","element","Component","Fragment","createElement","__","i18n","addQueryArgs","url","arguments","state","search","items","error","searchItemName","bind","selectItemName","value","props","component","objectQueryArgs","setState","length","path","queryArgs","encodeURIComponent","Object","assign","then","message","event","itemID","onSelectItem","preventDefault","itemsList","ariaLabel","placeholder","useAvatar","slugValue","map","item","id","avatar_urls","thumb","name","target"],"mappings":";AAAA,SAAA,EAAA,EAAA,GACA,KAAA,aAAA,GACA,MAAA,IAAA,UAAA,qCAIA,OAAA,QAAA;;ACNA,SAAA,EAAA,EAAA,GACA,IAAA,IAAA,EAAA,EAAA,EAAA,EAAA,OAAA,IAAA,CACA,IAAA,EAAA,EAAA,GACA,EAAA,WAAA,EAAA,aAAA,EACA,EAAA,cAAA,EACA,UAAA,IAAA,EAAA,UAAA,GACA,OAAA,eAAA,EAAA,EAAA,IAAA,IAIA,SAAA,EAAA,EAAA,EAAA,GAGA,OAFA,GAAA,EAAA,EAAA,UAAA,GACA,GAAA,EAAA,EAAA,GACA,EAGA,OAAA,QAAA;;AChBA,SAAA,EAAA,GACA,QAAA,IAAA,EACA,MAAA,IAAA,eAAA,6DAGA,OAAA,EAGA,OAAA,QAAA;;ACRA,SAAA,EAAA,GAaA,MAVA,mBAAA,QAAA,iBAAA,OAAA,SACA,OAAA,QAAA,EAAA,SAAA,GACA,cAAA,GAGA,OAAA,QAAA,EAAA,SAAA,GACA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,GAIA,EAAA,GAGA,OAAA,QAAA;;AChBA,IAAA,EAAA,QAAA,qBAEA,EAAA,QAAA,2BAEA,SAAA,EAAA,EAAA,GACA,OAAA,GAAA,WAAA,EAAA,IAAA,mBAAA,EAIA,EAAA,GAHA,EAMA,OAAA,QAAA;;ACZA,SAAA,EAAA,GAIA,OAHA,OAAA,QAAA,EAAA,OAAA,eAAA,OAAA,eAAA,SAAA,GACA,OAAA,EAAA,WAAA,OAAA,eAAA,IAEA,EAAA,GAGA,OAAA,QAAA;;ACPA,SAAA,EAAA,EAAA,GAMA,OALA,OAAA,QAAA,EAAA,OAAA,gBAAA,SAAA,EAAA,GAEA,OADA,EAAA,UAAA,EACA,GAGA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACTA,IAAA,EAAA,QAAA,oBAEA,SAAA,EAAA,EAAA,GACA,GAAA,mBAAA,GAAA,OAAA,EACA,MAAA,IAAA,UAAA,sDAGA,EAAA,UAAA,OAAA,OAAA,GAAA,EAAA,UAAA,CACA,YAAA,CACA,MAAA,EACA,UAAA,EACA,cAAA,KAGA,GAAA,EAAA,EAAA,GAGA,OAAA,QAAA;;ACyHeA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,uCAAAA,EAAAA,EAAAA,QAAAA,iDAAAA,EAAAA,EAAAA,QAAAA,qDAAAA,EAAAA,EAAAA,QAAAA,0CAAAA,EAAAA,EAAAA,QAAAA,oCAAAA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,IAAAA,OAAAA,WAAAA,IAAAA,EAAAA,GAAAA,EAAAA,EAAAA,SAAAA,GAAAA,GAAAA,EAAAA,CAAAA,IAAAA,GAAAA,EAAAA,EAAAA,SAAAA,MAAAA,YAAAA,EAAAA,QAAAA,UAAAA,EAAAA,UAAAA,QAAAA,EAAAA,EAAAA,MAAAA,KAAAA,WAAAA,OAAAA,EAAAA,EAAAA,SAAAA,KAAAA,IAAAA,SAAAA,IAAAA,GAAAA,oBAAAA,UAAAA,QAAAA,UAAAA,OAAAA,EAAAA,GAAAA,QAAAA,UAAAA,KAAAA,OAAAA,EAAAA,GAAAA,mBAAAA,MAAAA,OAAAA,EAAAA,IAAAA,OAAAA,KAAAA,UAAAA,SAAAA,KAAAA,QAAAA,UAAAA,KAAAA,GAAAA,gBAAAA,EAAAA,MAAAA,GAAAA,OAAAA,GAvHXC,IAAAA,EAAAA,GAfHC,EAAAA,EAAAA,SAECC,EADDC,EAAAA,WACCD,QAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAGAC,EADDC,EAAAA,KACCD,GAGAE,EADDC,EAAAA,IACCD,aAIIX,EAAAA,SAAAA,IAqHSA,EAAAA,EAAAA,SAAAA,EAAAA,GAAAA,IAAAA,EAAAA,EAAAA,GApHA,SAAA,IAAA,IAAA,EAAA,OAAA,EAAA,EAAA,SAAA,KAAA,IACHa,EAAAA,EAAAA,MAAAA,KAAAA,YAELC,MAAQ,CACZC,OAAQ,GACRC,MAAO,GACPC,MAAO,IAGHC,EAAAA,eAAiB,EAAKA,eAAeC,MAA1C,EAAA,EAAA,SAAA,IACKC,EAAAA,eAAiB,EAAKA,eAAeD,MAA1C,EAAA,EAAA,SAAA,IAVa,EAoHAnB,OAAAA,EAAAA,EAAAA,SAAAA,EAAAA,CAAAA,CAAAA,IAAAA,iBAvGEqB,MAAAA,SAAAA,GAAQ,IAAA,EAAA,KACfN,EAAW,KAAKD,MAAhBC,OAC+B,EAAA,KAAKO,MAApCC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,gBACdC,KAAAA,SAAU,CAAEV,OAAQM,IAEpBA,EAAMK,OAASX,EAAOW,QACrBD,KAAAA,SAAU,CAAET,MAAO,KAGrBW,IAAAA,EAAM,kBAAoBJ,EAC1BK,EAAY,GAEXP,IACJO,EAAUb,OAASc,mBAAoBR,IAGnCG,IACJI,EAAYE,OAAOC,OAAQH,EAAWJ,IAGvCtB,EAAU,CAAEyB,KAAOhB,EAAcgB,EAAMC,KAAgBI,KAAM,SAAAhB,GAC5D,EAAKS,SAAU,CAAET,MAAOA,KACtB,SAAAC,GACF,EAAKQ,SAAU,CAAER,MAAOA,EAAMgB,cAgFlBjC,CAAAA,IAAAA,iBA5EEkC,MAAAA,SAAAA,EAAOC,GACdC,IAAAA,EAAiB,KAAKd,MAAtBc,aASDA,OARPF,EAAMG,iBAEDZ,KAAAA,SAAU,CACdV,OAAQ,GACRC,MAAO,GACPC,MAAO,KAGDmB,EAAc,CAAED,OAAQA,MAkElBnC,CAAAA,IAAAA,SA/DL,MAAA,WAAA,IAGJsC,EAHI,EAAA,KACkB,EAAA,KAAKxB,MAAvBC,EAAAA,EAAAA,OAAQC,EAAAA,EAAAA,MACuC,EAAA,KAAKM,MAAtDiB,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,UAoCxC,OAjCMH,IACNA,EAAY9B,EAAI,cAAgB,eAG1B+B,IACNA,EAAc/B,EAAI,0BAA4B,eAG1CO,EAAMU,SACVY,EAAYtB,EAAM2B,IAAK,SAAEC,GAEvB,OAAA,EAAA,SAAA,CACC,KAAK,SAAS,IAAM,oCAAsCA,EAAKC,GAC/D,KAAK,SACS,gBAAA,OACd,UAAU,gFACV,QAAU,SAAEX,GAAW,OAAA,EAAKd,eAAgBc,EAAOU,EAAKC,MAEtDJ,GACD,EAAA,MAAA,CAAK,IAAI,SAAS,UAAU,qCAAqC,IAAI,GAAG,IAAMG,EAAKE,YAAYC,QAGhG,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCH,EAAKI,MAEnEN,GAAa,OAASA,EAAWE,IAClC,EAAA,OAAA,CAAM,IAAI,OAAO,UAAU,oCAAqCF,EAAWE,QAQ/E,EAAC,EACA,KAAA,EAAA,QAAA,CACC,KAAK,OACL,MAAQ7B,EACR,UAAU,gCACGwB,aAAAA,EACb,YAAcC,EACd,SAAW,SAAEN,GAAW,OAAA,EAAKhB,eAAgBgB,EAAMe,OAAO5B,UAEzD,IAAML,EAAMU,QACb,EAAC,EAAD,CACC,UAAU,mCACV,cAAe,EACf,SAAS,eAET,EAAA,MAAA,CAAK,UAAU,oCACZY,SASMtC,EArHTA,CAAsBM,GAqHbN,EAAAA,EAAAA,QAAAA,QAAAA;;ACvIA,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,aAAA,EAFf,IAAA,EAAA,EAAA,QAAA,oBAEe,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAA,IAAA,EAAA,CACdA,cAAAA,EAAAA,SADc,QAAA,QAAA;;ACHf,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,OAAA,eAAA,QAAA,kBAAA,CAAA,YAAA,EAAA,IAAA,WAAA,OAAA,EAAA,WAAA,IAAA,EAAA,EAAA,QAAA,iBAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA","file":"block-components.js","sourceRoot":"../../../src/js/bp-core/js/block-components","sourcesContent":["function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","/**\n * WordPress dependencies.\n */\nconst {\n\tapiFetch,\n\tcomponents: {\n\t\tPopover,\n\t},\n\telement: {\n\t\tComponent,\n\t\tFragment,\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n\turl: {\n\t\taddQueryArgs,\n\t},\n} = wp;\n\nclass AutoCompleter extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t};\n\n\t\tthis.searchItemName = this.searchItemName.bind( this );\n\t\tthis.selectItemName = this.selectItemName.bind( this );\n\t}\n\n\tsearchItemName( value ) {\n\t\tconst { search } = this.state;\n\t\tconst { component, objectQueryArgs } = this.props;\n\t\tthis.setState( { search: value } );\n\n\t\tif ( value.length < search.length ) {\n\t\t\tthis.setState( { items: [] } );\n\t\t}\n\n\t\tlet path= '/buddypress/v1/' + component;\n\t\tlet queryArgs = {};\n\n\t\tif ( value ) {\n\t\t\tqueryArgs.search = encodeURIComponent( value );\n\t\t}\n\n\t\tif ( objectQueryArgs ) {\n\t\t\tqueryArgs = Object.assign( queryArgs, objectQueryArgs );\n\t\t}\n\n\t\tapiFetch( { path: addQueryArgs( path, queryArgs ) } ).then( items => {\n\t\t\tthis.setState( { items: items } );\n\t\t}, error => {\n\t\t\tthis.setState( { error: error.message } );\n\t\t} );\n\t}\n\n\tselectItemName( event, itemID ) {\n\t\tconst { onSelectItem } = this.props;\n\t\tevent.preventDefault();\n\n\t\tthis.setState( {\n\t\t\tsearch: '',\n\t\t\titems: [],\n\t\t\terror: '',\n\t\t} );\n\n\t\treturn onSelectItem( { itemID: itemID } );\n\t}\n\n\trender() {\n\t\tconst { search, items } = this.state;\n\t\tlet { ariaLabel, placeholder, useAvatar, slugValue } = this.props;\n\t\tlet itemsList;\n\n\t\tif ( ! ariaLabel ) {\n\t\t\tariaLabel = __( 'Item\\'s name', 'buddypress' );\n\t\t}\n\n\t\tif ( ! placeholder ) {\n\t\t\tplaceholder = __( 'Enter Item\\'s name here…', 'buddypress' );\n\t\t}\n\n\t\tif ( items.length ) {\n\t\t\titemsList = items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\" key={ 'editor-autocompleters__item-item-' + item.id }\n\t\t\t\t\t\trole=\"option\"\n\t\t\t\t\t\taria-selected=\"true\"\n\t\t\t\t\t\tclassName=\"components-button components-autocomplete__result editor-autocompleters__user\"\n\t\t\t\t\t\tonClick={ ( event ) => this.selectItemName( event, item.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ useAvatar && (\n\t\t\t\t\t\t\t<img key=\"avatar\" className=\"editor-autocompleters__user-avatar\" alt=\"\" src={ item.avatar_urls.thumb } />\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<span key=\"name\" className=\"editor-autocompleters__user-name\">{ item.name }</span>\n\n\t\t\t\t\t\t{ slugValue && null !== slugValue( item ) && (\n\t\t\t\t\t\t\t<span key=\"slug\" className=\"editor-autocompleters__user-slug\">{ slugValue( item ) }</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</button>\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Fragment>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tvalue={ search }\n\t\t\t\t\tclassName=\"components-placeholder__input\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tonChange={ ( event ) => this.searchItemName( event.target.value ) }\n\t\t\t\t/>\n\t\t\t\t{ 0 !== items.length &&\n\t\t\t\t\t<Popover\n\t\t\t\t\t\tclassName=\"components-autocomplete__popover\"\n\t\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\t\tposition=\"bottom left\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"components-autocomplete__results\">\n\t\t\t\t\t\t\t{ itemsList }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Popover>\n\t\t\t\t}\n\t\t\t</Fragment>\n\t\t);\n\t}\n}\n\nexport default AutoCompleter;\n","// Components\nimport AutoCompleter from './autocompleter'\n\nexport default {\n\tAutoCompleter\n};\n","export { default as blockComponents } from './components';\n"]}
bp-friends/classes/class-bp-rest-friends-endpoint.php CHANGED
@@ -131,7 +131,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
131
  'bp_rest_friends_get_items_user_failed',
132
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
133
  array(
134
- 'status' => 500,
135
  )
136
  );
137
  }
@@ -304,7 +304,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
304
  'bp_rest_friends_create_item_failed',
305
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
306
  array(
307
- 'status' => 500,
308
  )
309
  );
310
  }
@@ -328,7 +328,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
328
  'bp_rest_friends_create_item_failed',
329
  __( 'You are not allowed to perform this action.', 'buddypress' ),
330
  array(
331
- 'status' => 500,
332
  )
333
  );
334
  }
@@ -426,7 +426,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
426
  'bp_rest_friends_update_item_failed',
427
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
428
  array(
429
- 'status' => 500,
430
  )
431
  );
432
  }
@@ -521,7 +521,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
521
  'bp_rest_friends_delete_item_failed',
522
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
523
  array(
524
- 'status' => 500,
525
  )
526
  );
527
  }
@@ -707,7 +707,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
707
  * @return BP_Friends_Friendship
708
  */
709
  public function get_friendship_object( $friendship_id ) {
710
- return new BP_Friends_Friendship( $friendship_id );
711
  }
712
 
713
  /**
@@ -719,7 +719,7 @@ class BP_REST_Friends_Endpoint extends WP_REST_Controller {
719
  * @return array Endpoint arguments.
720
  */
721
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
722
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
723
  $context = 'view';
724
 
725
  $args['id']['required'] = true;
131
  'bp_rest_friends_get_items_user_failed',
132
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
133
  array(
134
+ 'status' => 404,
135
  )
136
  );
137
  }
304
  'bp_rest_friends_create_item_failed',
305
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
306
  array(
307
+ 'status' => 404,
308
  )
309
  );
310
  }
328
  'bp_rest_friends_create_item_failed',
329
  __( 'You are not allowed to perform this action.', 'buddypress' ),
330
  array(
331
+ 'status' => 403,
332
  )
333
  );
334
  }
426
  'bp_rest_friends_update_item_failed',
427
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
428
  array(
429
+ 'status' => 404,
430
  )
431
  );
432
  }
521
  'bp_rest_friends_delete_item_failed',
522
  __( 'There was a problem confirming if user is valid.', 'buddypress' ),
523
  array(
524
+ 'status' => 404,
525
  )
526
  );
527
  }
707
  * @return BP_Friends_Friendship
708
  */
709
  public function get_friendship_object( $friendship_id ) {
710
+ return new BP_Friends_Friendship( (int) $friendship_id );
711
  }
712
 
713
  /**
719
  * @return array Endpoint arguments.
720
  */
721
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
722
+ $args = parent::get_endpoint_args_for_item_schema( $method );
723
  $context = 'view';
724
 
725
  $args['id']['required'] = true;
bp-groups/bp-groups-admin.php CHANGED
@@ -14,11 +14,14 @@
14
  defined( 'ABSPATH' ) || exit;
15
 
16
  // Include WP's list table class.
17
- if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
 
 
18
 
19
  // The per_page screen option. Has to be hooked in extremely early.
20
- if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] )
21
  add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 );
 
22
 
23
  /**
24
  * Register the Groups component admin screen.
@@ -42,6 +45,63 @@ function bp_groups_add_admin_menu() {
42
  }
43
  add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' );
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Add groups component to custom menus array.
47
  *
@@ -582,31 +642,17 @@ function bp_groups_admin_edit() {
582
  do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?>
583
 
584
  <div class="wrap">
585
- <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
586
-
587
- <h1 class="wp-heading-inline"><?php _e( 'Edit Group', 'buddypress' ); ?></h1>
588
-
589
- <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
590
- <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
591
- <?php endif; ?>
592
-
593
- <hr class="wp-header-end">
594
-
595
- <?php else : ?>
596
-
597
- <h1><?php _e( 'Edit Group', 'buddypress' ); ?>
598
-
599
- <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
600
- <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
601
- <?php endif; ?>
602
-
603
- </h1>
604
 
 
 
605
  <?php endif; ?>
606
 
 
 
607
  <?php // If the user has just made a change to an group, display the status messages. ?>
608
  <?php if ( !empty( $messages ) ) : ?>
609
- <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "</p><p>", $messages ); ?></p></div>
610
  <?php endif; ?>
611
 
612
  <?php if ( $group->id ) : ?>
@@ -711,7 +757,9 @@ function bp_groups_admin_delete() {
711
  $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?>
712
 
713
  <div class="wrap">
714
- <h1><?php _e( 'Delete Groups', 'buddypress' ) ?></h1>
 
 
715
  <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p>
716
 
717
  <ul class="bp-group-delete-list">
@@ -769,39 +817,22 @@ function bp_groups_admin_index() {
769
  do_action( 'bp_groups_admin_index', $messages ); ?>
770
 
771
  <div class="wrap">
772
- <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
773
 
774
- <h1 class="wp-heading-inline"><?php _e( 'Groups', 'buddypress' ); ?></h1>
775
 
776
- <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
777
- <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
778
- <?php endif; ?>
779
-
780
- <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
781
- <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
782
- <?php endif; ?>
783
-
784
- <hr class="wp-header-end">
785
-
786
- <?php else : ?>
787
-
788
- <h1>
789
- <?php _e( 'Groups', 'buddypress' ); ?>
790
-
791
- <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
792
- <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
793
- <?php endif; ?>
794
-
795
- <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
796
- <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
797
- <?php endif; ?>
798
- </h1>
799
 
 
 
800
  <?php endif; ?>
801
 
 
 
802
  <?php // If the user has just made a change to an group, display the status messages. ?>
803
  <?php if ( !empty( $messages ) ) : ?>
804
- <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
805
  <?php endif; ?>
806
 
807
  <?php // Display each group on its own row. ?>
@@ -1351,24 +1382,21 @@ function bp_groups_admin_process_group_type_bulk_changes( $doaction ) {
1351
  $group_id = (int) $group_id;
1352
 
1353
  // Get the old group type to check against.
1354
- $group_type = bp_groups_get_group_type( $group_id );
1355
-
1356
- if ( 'remove_group_type' === $new_type ) {
1357
- // Remove the current group type, if there's one to remove.
1358
- if ( $group_type ) {
1359
- $removed = bp_groups_remove_group_type( $group_id, $group_type );
1360
- if ( false === $removed || is_wp_error( $removed ) ) {
1361
- $error = true;
1362
- }
1363
- }
1364
- } else {
1365
- // Set the new group type.
1366
- if ( $new_type !== $group_type ) {
1367
- $set = bp_groups_set_group_type( $group_id, $new_type );
1368
- if ( false === $set || is_wp_error( $set ) ) {
1369
- $error = true;
1370
- }
1371
  }
 
1372
  }
1373
  }
1374
  }
@@ -1408,3 +1436,51 @@ function bp_groups_admin_groups_type_change_notice() {
1408
  }
1409
  }
1410
  add_action( bp_core_admin_hook(), 'bp_groups_admin_groups_type_change_notice' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  defined( 'ABSPATH' ) || exit;
15
 
16
  // Include WP's list table class.
17
+ if ( ! class_exists( 'WP_List_Table' ) ) {
18
+ require ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
19
+ }
20
 
21
  // The per_page screen option. Has to be hooked in extremely early.
22
+ if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] ) {
23
  add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 );
24
+ }
25
 
26
  /**
27
  * Register the Groups component admin screen.
45
  }
46
  add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' );
47
 
48
+ /**
49
+ * Redirects the user on the Goups network admin screen when BuddyPress is network activated.
50
+ *
51
+ * @since 7.0.0
52
+ */
53
+ function bp_group_site_admin_network_admin_redirect() {
54
+ wp_safe_redirect( add_query_arg( 'page', 'bp-groups', network_admin_url( 'admin.php' ) ) );
55
+ exit();
56
+ }
57
+
58
+ /**
59
+ * Create Groups submenu to manage BuddyPress types.
60
+ *
61
+ * @since 7.0.0
62
+ */
63
+ function bp_groups_admin_types_menu() {
64
+ if ( ! bp_is_root_blog() ) {
65
+ return;
66
+ }
67
+
68
+ if ( bp_is_network_activated() && is_network_admin() ) {
69
+ // Adds a 'bp-groups' submenu to go to the root blog Group types screen.
70
+ $group_type_admin_url = add_query_arg( 'taxonomy', 'bp_group_type', get_admin_url( bp_get_root_blog_id(), 'edit-tags.php' ) );
71
+ add_submenu_page(
72
+ 'bp-groups',
73
+ __( 'Group Types', 'buddypress' ),
74
+ __( 'Group Types', 'buddypress' ),
75
+ 'bp_moderate',
76
+ esc_url( $group_type_admin_url )
77
+ );
78
+ } elseif ( ! is_network_admin() ) {
79
+ if ( bp_is_network_activated() ) {
80
+ // Adds a 'bp-groups' menu to the root blog menu.
81
+ $redirect_hook = add_menu_page(
82
+ _x( 'Groups', 'Admin Groups page title', 'buddypress' ),
83
+ _x( 'Groups', 'Admin Groups menu', 'buddypress' ),
84
+ 'bp_moderate',
85
+ 'bp-groups',
86
+ '__return_empty_string',
87
+ 'div'
88
+ );
89
+
90
+ add_action( "load-{$redirect_hook}", 'bp_group_site_admin_network_admin_redirect' );
91
+ }
92
+
93
+ // Add the submenu to manage Group Types.
94
+ add_submenu_page(
95
+ 'bp-groups',
96
+ __( 'Group Types', 'buddypress' ),
97
+ __( 'Group Types', 'buddypress' ),
98
+ 'bp_moderate',
99
+ basename( add_query_arg( 'taxonomy', 'bp_group_type', bp_get_admin_url( 'edit-tags.php' ) ) )
100
+ );
101
+ }
102
+ }
103
+ add_action( 'bp_admin_menu', 'bp_groups_admin_types_menu' );
104
+
105
  /**
106
  * Add groups component to custom menus array.
107
  *
642
  do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?>
643
 
644
  <div class="wrap">
645
+ <h1 class="wp-heading-inline"><?php _e( 'Edit Group', 'buddypress' ); ?></h1>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
 
647
+ <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
648
+ <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
649
  <?php endif; ?>
650
 
651
+ <hr class="wp-header-end">
652
+
653
  <?php // If the user has just made a change to an group, display the status messages. ?>
654
  <?php if ( !empty( $messages ) ) : ?>
655
+ <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "</p><p>", $messages ); ?></p></div>
656
  <?php endif; ?>
657
 
658
  <?php if ( $group->id ) : ?>
757
  $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?>
758
 
759
  <div class="wrap">
760
+ <h1 class="wp-heading-inline"><?php _e( 'Delete Groups', 'buddypress' ) ?></h1>
761
+ <hr class="wp-header-end">
762
+
763
  <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p>
764
 
765
  <ul class="bp-group-delete-list">
817
  do_action( 'bp_groups_admin_index', $messages ); ?>
818
 
819
  <div class="wrap">
 
820
 
821
+ <h1 class="wp-heading-inline"><?php _e( 'Groups', 'buddypress' ); ?></h1>
822
 
823
+ <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?>
824
+ <a class="page-title-action" href="<?php echo trailingslashit( bp_get_groups_directory_permalink() . 'create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a>
825
+ <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
 
827
+ <?php if ( !empty( $_REQUEST['s'] ) ) : ?>
828
+ <span class="subtitle"><?php printf( __( 'Search results for &#8220;%s&#8221;', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span>
829
  <?php endif; ?>
830
 
831
+ <hr class="wp-header-end">
832
+
833
  <?php // If the user has just made a change to an group, display the status messages. ?>
834
  <?php if ( !empty( $messages ) ) : ?>
835
+ <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?> notice is-dismissible"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div>
836
  <?php endif; ?>
837
 
838
  <?php // Display each group on its own row. ?>
1382
  $group_id = (int) $group_id;
1383
 
1384
  // Get the old group type to check against.
1385
+ $current_types = bp_groups_get_group_type( $group_id, false );
1386
+
1387
+ if ( $current_types && 'remove_group_type' === $new_type ) {
1388
+ $group_types = array();
1389
+ } elseif ( ! $current_types || 1 !== count( $current_types ) || $new_type !== $current_types[0] ) {
1390
+ $group_types = array( $new_type );
1391
+ }
1392
+
1393
+ // Set the new group type.
1394
+ if ( isset( $group_types ) ) {
1395
+ $set = bp_groups_set_group_type( $group_id, $group_types );
1396
+ if ( false === $set || is_wp_error( $set ) ) {
1397
+ $error = true;
 
 
 
 
1398
  }
1399
+ unset( $group_types );
1400
  }
1401
  }
1402
  }
1436
  }
1437
  }
1438
  add_action( bp_core_admin_hook(), 'bp_groups_admin_groups_type_change_notice' );
1439
+
1440
+ /**
1441
+ * Checks whether a group type already exists.
1442
+ *
1443
+ * @since 7.0.0
1444
+ *
1445
+ * @param boolean $exists True if the group type already exists. False otherwise.
1446
+ * @param string $type_id The group type identifier.
1447
+ * @return boolean True if the group type already exists. False otherwise.
1448
+ */
1449
+ function bp_groups_type_admin_type_exists( $exists = false, $type_id = '' ) {
1450
+ if ( ! $type_id ) {
1451
+ return $exists;
1452
+ }
1453
+
1454
+ return ! is_null( bp_groups_get_group_type_object( $type_id ) );
1455
+ }
1456
+ add_filter( bp_get_group_type_tax_name() . '_check_existing_type', 'bp_groups_type_admin_type_exists', 1, 2 );
1457
+
1458
+ /**
1459
+ * Set the feedback messages for the Group Types Admin actions.
1460
+ *
1461
+ * @since 7.0.0
1462
+ *
1463
+ * @param array $messages The feedback messages.
1464
+ * @return array The feedback messages including the ones for the Group Types Admin actions.
1465
+ */
1466
+ function bp_groups_type_admin_updated_messages( $messages = array() ) {
1467
+ $type_taxonomy = bp_get_group_type_tax_name();
1468
+
1469
+ $messages[ $type_taxonomy ] = array(
1470
+ 0 => '',
1471
+ 1 => __( 'Please define the Group Type ID field.', 'buddypress' ),
1472
+ 2 => __( 'Group type successfully added.', 'buddypress' ),
1473
+ 3 => __( 'Sorry, there was an error and the Group type wasn’t added.', 'buddypress' ),
1474
+ // The following one needs to be != 5.
1475
+ 4 => __( 'Group type successfully updated.', 'buddypress' ),
1476
+ 5 => __( 'Sorry, this Group type already exists.', 'buddypress' ),
1477
+ 6 => __( 'Sorry, the Group type was not deleted: it does not exist.', 'buddypress' ),
1478
+ 7 => __( 'Sorry, This Group type is registered using code, deactivate the plugin or remove the custom code before trying to delete it again.', 'buddypress' ),
1479
+ 8 => __( 'Sorry, there was an error while trying to delete this Group type.', 'buddypress' ),
1480
+ 9 => __( 'Group type successfully deleted.', 'buddypress' ),
1481
+ 10 => __( 'Group type could not be updated due to missing required information.', 'buddypress' ),
1482
+ );
1483
+
1484
+ return $messages;
1485
+ }
1486
+ add_filter( 'term_updated_messages', 'bp_groups_type_admin_updated_messages' );
bp-groups/bp-groups-blocks.php CHANGED
@@ -110,12 +110,12 @@ function bp_groups_render_group_block( $attributes = array() ) {
110
  $avatar_container = sprintf(
111
  '<div class="item-header-avatar">
112
  <a href="%1$s">
113
- <img src="%2$s" alt="%3$s" class="avatar">
114
  </a>
115
  </div>',
116
  esc_url( $group_link ),
117
  esc_url( $avatar ),
118
- // Translators: %s is the group's name.
119
  sprintf( esc_html__( 'Group Profile photo of %s', 'buddypress' ), $group_name )
120
  );
121
  }
@@ -201,3 +201,135 @@ function bp_groups_render_group_block( $attributes = array() ) {
201
  */
202
  return apply_filters( 'bp_groups_render_group_block_output', $output, $group, $params );
203
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  $avatar_container = sprintf(
111
  '<div class="item-header-avatar">
112
  <a href="%1$s">
113
+ <img loading="lazy" src="%2$s" alt="%3$s" class="avatar">
114
  </a>
115
  </div>',
116
  esc_url( $group_link ),
117
  esc_url( $avatar ),
118
+ /* Translators: %s is the group's name. */
119
  sprintf( esc_html__( 'Group Profile photo of %s', 'buddypress' ), $group_name )
120
  );
121
  }
201
  */
202
  return apply_filters( 'bp_groups_render_group_block_output', $output, $group, $params );
203
  }
204
+
205
+ /**
206
+ * Callback function to render the BP Groups Block.
207
+ *
208
+ * @since 7.0.0
209
+ *
210
+ * @param array $attributes The block attributes.
211
+ * @return string HTML output.
212
+ */
213
+ function bp_groups_render_groups_block( $attributes = array() ) {
214
+ $bp = buddypress();
215
+
216
+ $block_args = wp_parse_args(
217
+ $attributes,
218
+ array(
219
+ 'itemIDs' => array(),
220
+ 'avatarSize' => 'full',
221
+ 'displayGroupName' => true,
222
+ 'extraInfo' => 'none',
223
+ 'layoutPreference' => 'list',
224
+ 'columns' => '2',
225
+ )
226
+ );
227
+
228
+ $group_ids = wp_parse_id_list( $block_args['itemIDs'] );
229
+ if ( ! array_filter( $group_ids ) ) {
230
+ return '';
231
+ }
232
+
233
+ $container_classes = sprintf( 'bp-block-groups avatar-%s', $block_args['avatarSize'] );
234
+ if ( 'grid' === $block_args['layoutPreference'] ) {
235
+ $container_classes .= sprintf( ' is-grid columns-%d', (int) $block_args['columns'] );
236
+ }
237
+
238
+ $query = groups_get_groups(
239
+ array(
240
+ 'include' => $group_ids,
241
+ )
242
+ );
243
+
244
+ // Initialize the output and the groups.
245
+ $output = '';
246
+ $groups = $query['groups'];
247
+
248
+ foreach ( $groups as $group ) {
249
+ $has_description = false;
250
+ $group_item_classes = 'group-content';
251
+
252
+ if ( 'list' === $block_args['layoutPreference'] && 'description' === $block_args['extraInfo'] && isset( $group->description ) && $group->description ) {
253
+ $has_description = true;
254
+ $group_item_classes = 'group-content has-description';
255
+ }
256
+
257
+ $output .= sprintf( '<div class="%s">', $group_item_classes );
258
+
259
+ // Get Member link.
260
+ $group_link = bp_get_group_permalink( $group );
261
+
262
+ // Set the Avatar output.
263
+ if ( $bp->avatar && $bp->avatar->show_avatars && ! bp_disable_group_avatar_uploads() && 'none' !== $block_args['avatarSize'] ) {
264
+ $output .= sprintf(
265
+ '<div class="item-header-avatar">
266
+ <a href="%1$s">
267
+ <img class="avatar" alt="%2$s" src="%3$s" />
268
+ </a>
269
+ </div>',
270
+ esc_url( $group_link ),
271
+ /* Translators: %s is the group's name. */
272
+ sprintf( esc_attr__( 'Group Profile photo of %s', 'buddypress' ), $group->display_name ),
273
+ esc_url(
274
+ bp_core_fetch_avatar(
275
+ array(
276
+ 'item_id' => $group->id,
277
+ 'object' => 'group',
278
+ 'type' => $block_args['avatarSize'],
279
+ 'html' => false,
280
+ )
281
+ )
282
+ )
283
+ );
284
+ }
285
+
286
+ $output .= '<div class="group-description">';
287
+
288
+ if ( $block_args['displayGroupName'] ) {
289
+ $output .= sprintf(
290
+ '<strong><a href="%1$s">%2$s</a></strong>',
291
+ esc_url( $group_link ),
292
+ esc_html( $group->name )
293
+ );
294
+ }
295
+
296
+ // Add the latest activity the group posted.
297
+ if ( $has_description && $group->description ) {
298
+ $output .= sprintf(
299
+ '<div class="group-description-content">%s</div>',
300
+ bp_get_group_description( $group )
301
+ );
302
+ } elseif ( 'active' === $block_args['extraInfo'] ) {
303
+ $output .= sprintf(
304
+ '<time datetime="%1$s">%2$s</time>',
305
+ esc_attr( bp_core_get_iso8601_date( $group->last_activity ) ),
306
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
307
+ sprintf( esc_html__( 'Active %s', 'buddypress' ), bp_get_group_last_active( $group ) )
308
+ );
309
+ } elseif ( 'popular' === $block_args['extraInfo'] ) {
310
+ $total_member_count = $group->total_member_count;
311
+
312
+ $output .= sprintf(
313
+ '<div class="group-meta">%s</div>',
314
+ /* translators: %d: the number of group members. */
315
+ esc_html( sprintf( _n( '%d member', '%d members', $total_member_count, 'buddypress' ), $total_member_count ) )
316
+ );
317
+ }
318
+
319
+ $output .= '</div></div>';
320
+ }
321
+
322
+ // Set the final output.
323
+ $output = sprintf( '<div class="%1$s">%2$s</div>', $container_classes, $output );
324
+
325
+ /**
326
+ * Filter here to edit the output of the groups block.
327
+ *
328
+ * @since 7.0.0
329
+ *
330
+ * @param string $output The HTML output of the block.
331
+ * @param array $block_args The block arguments.
332
+ * @param array $groups The list of BP_Groups_Group objects.
333
+ */
334
+ return apply_filters( 'bp_groups_render_groups_block_output', $output, $block_args, $groups );
335
+ }
bp-groups/bp-groups-cssjs.php CHANGED
@@ -50,7 +50,7 @@ function bp_groups_get_group_manage_members_script_data( $group_id = 0 ) {
50
  );
51
 
52
  $preloaded_members = array();
53
- if ( function_exists( 'rest_preload_api_request' ) ) {
54
  $preloaded_members = rest_preload_api_request( '', $path );
55
  }
56
 
50
  );
51
 
52
  $preloaded_members = array();
53
+ if ( bp_is_running_wp( '5.0.0' ) ) {
54
  $preloaded_members = rest_preload_api_request( '', $path );
55
  }
56
 
bp-groups/bp-groups-filters.php CHANGED
@@ -53,9 +53,7 @@ add_filter( 'groups_group_name_before_save', 'trim' );
53
  add_filter( 'groups_group_description_before_save', 'trim' );
54
 
55
  // Support emoji.
56
- if ( function_exists( 'wp_encode_emoji' ) ) {
57
- add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' );
58
- }
59
 
60
  // Escape output of new group creation details.
61
  add_filter( 'bp_get_new_group_name', 'esc_attr' );
53
  add_filter( 'groups_group_description_before_save', 'trim' );
54
 
55
  // Support emoji.
56
+ add_filter( 'groups_group_description_before_save', 'wp_encode_emoji' );
 
 
57
 
58
  // Escape output of new group creation details.
59
  add_filter( 'bp_get_new_group_name', 'esc_attr' );
bp-groups/bp-groups-functions.php CHANGED
@@ -415,7 +415,7 @@ function groups_delete_group( $group_id ) {
415
  }
416
 
417
  /**
418
- * Check a group status (eg 'private') against the whitelist of registered statuses.
419
  *
420
  * @since 1.1.0
421
  *
@@ -1415,9 +1415,8 @@ function groups_get_invites_for_user( $user_id = 0, $limit = false, $page = fals
1415
  'per_page' => $limit,
1416
  'page' => $page,
1417
  );
1418
- $groups = groups_get_groups( $args );
1419
 
1420
- return array( 'groups' => $groups['groups'], 'total' => groups_get_invite_count_for_user( $user_id ) );
1421
  }
1422
 
1423
  /**
@@ -1433,7 +1432,8 @@ function groups_get_invite_count_for_user( $user_id = 0 ) {
1433
  $user_id = bp_loggedin_user_id();
1434
  }
1435
 
1436
- return count( groups_get_invited_to_group_ids( $user_id ) );
 
1437
  }
1438
 
1439
  /**
@@ -2463,6 +2463,138 @@ add_action( 'bp_groups_delete_group', 'bp_groups_update_orphaned_groups_on_group
2463
 
2464
  /** Group Types ***************************************************************/
2465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2466
  /**
2467
  * Fire the 'bp_groups_register_group_types' action.
2468
  *
@@ -2478,6 +2610,63 @@ function bp_groups_register_group_types() {
2478
  }
2479
  add_action( 'bp_register_taxonomies', 'bp_groups_register_group_types' );
2480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2481
  /**
2482
  * Register a group type.
2483
  *
@@ -2525,6 +2714,8 @@ function bp_groups_register_group_type( $group_type, $args = array() ) {
2525
  'description' => '',
2526
  'create_screen_checked' => false,
2527
  'labels' => array(),
 
 
2528
  ), 'register_group_type' );
2529
 
2530
  $group_type = sanitize_key( $group_type );
@@ -2615,6 +2806,11 @@ function bp_groups_register_group_type( $group_type, $args = array() ) {
2615
  function bp_groups_get_group_types( $args = array(), $output = 'names', $operator = 'and' ) {
2616
  $types = buddypress()->groups->types;
2617
 
 
 
 
 
 
2618
  $types = wp_filter_object_list( $types, $args, $operator );
2619
 
2620
  /**
@@ -2656,6 +2852,78 @@ function bp_groups_get_group_type_object( $group_type ) {
2656
  return $types[ $group_type ];
2657
  }
2658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2659
  /**
2660
  * Set type for a group.
2661
  *
@@ -2685,7 +2953,7 @@ function bp_groups_set_group_type( $group_id, $group_type, $append = false ) {
2685
  }
2686
  }
2687
 
2688
- $retval = bp_set_object_terms( $group_id, $group_type, 'bp_group_type', $append );
2689
 
2690
  // Bust the cache if the type has been updated.
2691
  if ( ! is_wp_error( $retval ) ) {
@@ -2710,18 +2978,21 @@ function bp_groups_set_group_type( $group_id, $group_type, $append = false ) {
2710
  * Get type for a group.
2711
  *
2712
  * @since 2.6.0
 
2713
  *
2714
  * @param int $group_id ID of the group.
2715
  * @param bool $single Optional. Whether to return a single type string. If multiple types are found
2716
  * for the group, the oldest one will be returned. Default: true.
 
 
2717
  * @return string|array|bool On success, returns a single group type (if `$single` is true) or an array of group
2718
  * types (if `$single` is false). Returns false on failure.
2719
  */
2720
- function bp_groups_get_group_type( $group_id, $single = true ) {
2721
  $types = wp_cache_get( $group_id, 'bp_groups_group_type' );
2722
 
2723
  if ( false === $types ) {
2724
- $raw_types = bp_get_object_terms( $group_id, 'bp_group_type' );
2725
 
2726
  if ( ! is_wp_error( $raw_types ) ) {
2727
  $types = array();
@@ -2737,6 +3008,12 @@ function bp_groups_get_group_type( $group_id, $single = true ) {
2737
  }
2738
  }
2739
 
 
 
 
 
 
 
2740
  $type = false;
2741
  if ( ! empty( $types ) ) {
2742
  if ( $single ) {
@@ -2778,7 +3055,7 @@ function bp_groups_remove_group_type( $group_id, $group_type ) {
2778
  return false;
2779
  }
2780
 
2781
- $deleted = bp_remove_object_terms( $group_id, $group_type, 'bp_group_type' );
2782
 
2783
  // Bust the case, if the type has been removed.
2784
  if ( ! is_wp_error( $deleted ) ) {
415
  }
416
 
417
  /**
418
+ * Check a group status (eg 'private') against the list of registered statuses.
419
  *
420
  * @since 1.1.0
421
  *
1415
  'per_page' => $limit,
1416
  'page' => $page,
1417
  );
 
1418
 
1419
+ return groups_get_groups( $args );
1420
  }
1421
 
1422
  /**
1432
  $user_id = bp_loggedin_user_id();
1433
  }
1434
 
1435
+ $invites = groups_get_invites_for_user( $user_id );
1436
+ return $invites['total'];
1437
  }
1438
 
1439
  /**
2463
 
2464
  /** Group Types ***************************************************************/
2465
 
2466
+ /**
2467
+ * Output the slug of the Group type taxonomy.
2468
+ *
2469
+ * @since 7.0.0
2470
+ */
2471
+ function bp_group_type_tax_name() {
2472
+ echo bp_get_group_type_tax_name();
2473
+ }
2474
+
2475
+ /**
2476
+ * Return the slug of the Group type taxonomy.
2477
+ *
2478
+ * @since 7.0.0
2479
+ *
2480
+ * @return string The unique Group taxonomy slug.
2481
+ */
2482
+ function bp_get_group_type_tax_name() {
2483
+ /**
2484
+ * Filters the slug of the Group type taxonomy.
2485
+ *
2486
+ * @since 7.0.0
2487
+ *
2488
+ * @param string $value Group type taxonomy slug.
2489
+ */
2490
+ return apply_filters( 'bp_get_group_type_tax_name', 'bp_group_type' );
2491
+ }
2492
+
2493
+ /**
2494
+ * Returns labels used by the Group type taxonomy.
2495
+ *
2496
+ * @since 7.0.0
2497
+ *
2498
+ * @return array
2499
+ */
2500
+ function bp_get_group_type_tax_labels() {
2501
+
2502
+ /**
2503
+ * Filters Group type taxonomy labels.
2504
+ *
2505
+ * @since 7.0.0
2506
+ *
2507
+ * @param array $value Associative array (name => label).
2508
+ */
2509
+ return apply_filters(
2510
+ 'bp_get_group_type_tax_labels',
2511
+ array(
2512
+
2513
+ // General labels
2514
+ 'name' => _x( 'Group Types', 'Group type taxonomy name', 'buddypress' ),
2515
+ 'singular_name' => _x( 'Group Type', 'Group type taxonomy singular name', 'buddypress' ),
2516
+ 'search_items' => _x( 'Search Group Types', 'Group type taxonomy search items label', 'buddypress' ),
2517
+ 'popular_items' => _x( 'Popular Group Types', 'Group type taxonomy popular items label', 'buddypress' ),
2518
+ 'all_items' => _x( 'All Group Types', 'Group type taxonomy all items label', 'buddypress' ),
2519
+ 'parent_item' => _x( 'Parent Group Type', 'Group type taxonomy parent item label', 'buddypress' ),
2520
+ 'parent_item_colon' => _x( 'Parent Group Type:', 'Group type taxonomy parent item label', 'buddypress' ),
2521
+ 'edit_item' => _x( 'Edit Group Type', 'Group type taxonomy edit item label', 'buddypress' ),
2522
+ 'view_item' => _x( 'View Group Type', 'Group type taxonomy view item label', 'buddypress' ),
2523
+ 'update_item' => _x( 'Update Group Type', 'Group type taxonomy update item label', 'buddypress' ),
2524
+ 'add_new_item' => _x( 'Add New Group Type', 'Group type taxonomy add new item label', 'buddypress' ),
2525
+ 'new_item_name' => _x( 'New Group Type Name', 'Group type taxonomy new item name label', 'buddypress' ),
2526
+ 'separate_items_with_commas' => _x( 'Separate group types with commas', 'Group type taxonomy separate items with commas label', 'buddypress' ),
2527
+ 'add_or_remove_items' => _x( 'Add or remove group types', 'Group type taxonomy add or remove items label', 'buddypress' ),
2528
+ 'choose_from_most_used' => _x( 'Choose from the most used group types', 'Group type taxonomy choose from most used label', 'buddypress' ),
2529
+ 'not_found' => _x( 'No group types found.', 'Group type taxonomy not found label', 'buddypress' ),
2530
+ 'no_terms' => _x( 'No group types', 'Group type taxonomy no terms label', 'buddypress' ),
2531
+ 'items_list_navigation' => _x( 'Group Types list navigation', 'Group type taxonomy items list navigation label', 'buddypress' ),
2532
+ 'items_list' => _x( 'Group Types list', 'Group type taxonomy items list label', 'buddypress' ),
2533
+
2534
+ /* translators: Tab heading when selecting from the most used terms. */
2535
+ 'most_used' => _x( 'Most Used', 'Group type taxonomy most used items label', 'buddypress' ),
2536
+ 'back_to_items' => _x( '&larr; Back to Group Types', 'Group type taxonomy back to items label', 'buddypress' ),
2537
+
2538
+ // Specific to BuddyPress.
2539
+ 'bp_type_id_label' => _x( 'Group Type ID', 'BP Member type ID label', 'buddypress' ),
2540
+ 'bp_type_id_description' => _x( 'Lower-case string, no spaces or special characters. Used to identify the group type.', 'BP Group type ID description', 'buddypress' ),
2541
+ 'bp_type_show_in_create_screen' => _x( 'Show on Group Creation', 'BP Group type show in create screen', 'buddypress' ),
2542
+ 'bp_type_show_in_list' => _x( 'Show on Group', 'BP Group type show in list', 'buddypress' ),
2543
+ )
2544
+ );
2545
+ }
2546
+
2547
+ /**
2548
+ * Returns arguments used by the Group type taxonomy.
2549
+ *
2550
+ * @since 7.0.0
2551
+ *
2552
+ * @return array
2553
+ */
2554
+ function bp_get_group_type_tax_args() {
2555
+
2556
+ /**
2557
+ * Filters Group type taxonomy args.
2558
+ *
2559
+ * @since 7.0.0
2560
+ *
2561
+ * @param array $value Associative array (key => arg).
2562
+ */
2563
+ return apply_filters(
2564
+ 'bp_get_group_type_tax_args',
2565
+ array_merge(
2566
+ array(
2567
+ 'description' => _x( 'BuddyPress Group Types', 'Group type taxonomy description', 'buddypress' ),
2568
+ 'labels' => array_merge( bp_get_group_type_tax_labels(), bp_get_taxonomy_common_labels() ),
2569
+ ),
2570
+ bp_get_taxonomy_common_args()
2571
+ )
2572
+ );
2573
+ }
2574
+
2575
+ /**
2576
+ * Register the Group Types taxonomy.
2577
+ *
2578
+ * @since 7.0.0
2579
+ *
2580
+ * @param array $taxonomies BuddyPress default taxonomies.
2581
+ * @return array BuddyPress default taxonomies.
2582
+ */
2583
+ function bp_groups_register_group_type_taxonomy( $taxonomies = array() ) {
2584
+ return array_merge(
2585
+ $taxonomies,
2586
+ array(
2587
+ // Group Type.
2588
+ bp_get_group_type_tax_name() => array(
2589
+ 'object' => 'bp_group',
2590
+ 'component' => 'groups',
2591
+ 'args' => bp_get_group_type_tax_args(),
2592
+ ),
2593
+ )
2594
+ );
2595
+ }
2596
+ add_filter( 'bp_get_default_taxonomies', 'bp_groups_register_group_type_taxonomy', 1 );
2597
+
2598
  /**
2599
  * Fire the 'bp_groups_register_group_types' action.
2600
  *
2610
  }
2611
  add_action( 'bp_register_taxonomies', 'bp_groups_register_group_types' );
2612
 
2613
+ /**
2614
+ * Extend generic Type metadata schema to match Group Type needs.
2615
+ *
2616
+ * @since 7.0.0
2617
+ *
2618
+ * @param array $schema The generic Type metadata schema.
2619
+ * @param string $taxonomy The taxonomy name the schema applies to.
2620
+ * @return array The Group Type metadata schema.
2621
+ */
2622
+ function bp_get_group_type_metadata_schema( $schema = array(), $taxonomy = '' ) {
2623
+ if ( bp_get_group_type_tax_name() === $taxonomy ) {
2624
+
2625
+ // Directory
2626
+ if ( isset( $schema['bp_type_has_directory']['description'] ) ) {
2627
+ $schema['bp_type_has_directory']['description'] = __( 'Make a list of groups matching this type available on the groups directory.', 'buddypress' );
2628
+ }
2629
+
2630
+ // Slug
2631
+ if ( isset( $schema['bp_type_directory_slug']['description'] ) ) {
2632
+ $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' );
2633
+ }
2634
+
2635
+ // Create
2636
+ $schema['bp_type_show_in_create_screen'] = array(
2637
+ 'description' => __( 'Show during group creation, and when a group admin is on the group&rsquo;s settings page.', 'buddypress' ),
2638
+ 'type' => 'boolean',
2639
+ 'single' => true,
2640
+ 'sanitize_callback' => 'absint',
2641
+ );
2642
+
2643
+ // List
2644
+ $schema['bp_type_show_in_list'] = array(
2645
+ 'description' => __( 'Show where group types may be listed, like in the group header.', 'buddypress' ),
2646
+ 'type' => 'boolean',
2647
+ 'single' => true,
2648
+ 'sanitize_callback' => 'absint',
2649
+ );
2650
+ }
2651
+
2652
+ return $schema;
2653
+ }
2654
+ add_filter( 'bp_get_type_metadata_schema', 'bp_get_group_type_metadata_schema', 1, 2 );
2655
+
2656
+ /**
2657
+ * Registers the Group type metadata.
2658
+ *
2659
+ * @since 7.0.0
2660
+ */
2661
+ function bp_register_group_type_metadata() {
2662
+ $type_taxonomy = bp_get_group_type_tax_name();
2663
+
2664
+ foreach ( bp_get_type_metadata_schema( false, $type_taxonomy ) as $meta_key => $meta_args ) {
2665
+ bp_register_type_meta( $type_taxonomy, $meta_key, $meta_args );
2666
+ }
2667
+ }
2668
+ add_action( 'bp_register_type_metadata', 'bp_register_group_type_metadata', 11 );
2669
+
2670
  /**
2671
  * Register a group type.
2672
  *
2714
  'description' => '',
2715
  'create_screen_checked' => false,
2716
  'labels' => array(),
2717
+ 'code' => true,
2718
+ 'db_id' => 0,
2719
  ), 'register_group_type' );
2720
 
2721
  $group_type = sanitize_key( $group_type );
2806
  function bp_groups_get_group_types( $args = array(), $output = 'names', $operator = 'and' ) {
2807
  $types = buddypress()->groups->types;
2808
 
2809
+ // Merge with types available into the database.
2810
+ if ( ! isset( $args['code'] ) || true !== $args['code'] ) {
2811
+ $types = bp_get_taxonomy_types( bp_get_group_type_tax_name(), $types );
2812
+ }
2813
+
2814
  $types = wp_filter_object_list( $types, $args, $operator );
2815
 
2816
  /**
2852
  return $types[ $group_type ];
2853
  }
2854
 
2855
+ /**
2856
+ * Only gets the group types registered by code.
2857
+ *
2858
+ * @since 7.0.0
2859
+ *
2860
+ * @return array The group types registered by code.
2861
+ */
2862
+ function bp_get_group_types_registered_by_code() {
2863
+ return bp_groups_get_group_types(
2864
+ array(
2865
+ 'code' => true,
2866
+ ),
2867
+ 'objects'
2868
+ );
2869
+ }
2870
+ add_filter( bp_get_group_type_tax_name() . '_registered_by_code', 'bp_get_group_types_registered_by_code' );
2871
+
2872
+ /**
2873
+ * Generates missing metadata for a type registered by code.
2874
+ *
2875
+ * @since 7.0.0
2876
+ *
2877
+ * @return array The group type metadata.
2878
+ */
2879
+ function bp_set_registered_by_code_group_type_metadata( $metadata = array(), $type = '' ) {
2880
+ $group_type = bp_groups_get_group_type_object( $type );
2881
+
2882
+ foreach ( get_object_vars( $group_type ) as $object_key => $object_value ) {
2883
+ if ( 'labels' === $object_key ) {
2884
+ foreach ( $object_value as $label_key => $label_value ) {
2885
+ $metadata[ 'bp_type_' . $label_key ] = $label_value;
2886
+ }
2887
+ } elseif ( ! in_array( $object_key, array( 'name', 'code', 'db_id' ), true ) ) {
2888
+ $metadata[ 'bp_type_' . $object_key ] = $object_value;
2889
+ }
2890
+ }
2891
+
2892
+ /**
2893
+ * Save metadata into database to avoid generating metadata
2894
+ * each time a type is listed into the Types Admin screen.
2895
+ */
2896
+ if ( isset( $group_type->db_id ) && $group_type->db_id ) {
2897
+ bp_update_type_metadata( $group_type->db_id, bp_get_group_type_tax_name(), $metadata );
2898
+ }
2899
+
2900
+ return $metadata;
2901
+ }
2902
+ add_filter( bp_get_group_type_tax_name() . '_set_registered_by_code_metada', 'bp_set_registered_by_code_group_type_metadata', 10, 2 );
2903
+
2904
+ /**
2905
+ * Insert group types registered by code not yet saved into the database as WP Terms.
2906
+ *
2907
+ * @since 7.0.0
2908
+ */
2909
+ function bp_insert_group_types_registered_by_code() {
2910
+ $all_types = bp_groups_get_group_types( array(), 'objects' );
2911
+ $unsaved_types = wp_filter_object_list( $all_types, array( 'db_id' => 0 ), 'and', 'name' );
2912
+
2913
+ if ( $unsaved_types ) {
2914
+ foreach ( $unsaved_types as $type_name ) {
2915
+ bp_insert_term(
2916
+ $type_name,
2917
+ bp_get_group_type_tax_name(),
2918
+ array(
2919
+ 'slug' => $type_name,
2920
+ )
2921
+ );
2922
+ }
2923
+ }
2924
+ }
2925
+ add_action( bp_get_group_type_tax_name() . '_add_form', 'bp_insert_group_types_registered_by_code', 1 );
2926
+
2927
  /**
2928
  * Set type for a group.
2929
  *
2953
  }
2954
  }
2955
 
2956
+ $retval = bp_set_object_terms( $group_id, $group_type, bp_get_group_type_tax_name(), $append );
2957
 
2958
  // Bust the cache if the type has been updated.
2959
  if ( ! is_wp_error( $retval ) ) {
2978
  * Get type for a group.
2979
  *
2980
  * @since 2.6.0
2981
+ * @since 7.0.0 Adds the `$use_db` parameter.
2982
  *
2983
  * @param int $group_id ID of the group.
2984
  * @param bool $single Optional. Whether to return a single type string. If multiple types are found
2985
  * for the group, the oldest one will be returned. Default: true.
2986
+ * @param bool $use_db Optional. Whether to request all group types or only the ones registered by code.
2987
+ * Default: true.
2988
  * @return string|array|bool On success, returns a single group type (if `$single` is true) or an array of group
2989
  * types (if `$single` is false). Returns false on failure.
2990
  */
2991
+ function bp_groups_get_group_type( $group_id, $single = true, $use_db = true ) {
2992
  $types = wp_cache_get( $group_id, 'bp_groups_group_type' );
2993
 
2994
  if ( false === $types ) {
2995
+ $raw_types = bp_get_object_terms( $group_id, bp_get_group_type_tax_name() );
2996
 
2997
  if ( ! is_wp_error( $raw_types ) ) {
2998
  $types = array();
3008
  }
3009
  }
3010
 
3011
+ if ( false === $use_db && $types ) {
3012
+ $registred_by_code = bp_get_group_types_registered_by_code();
3013
+ $ctype_names = wp_list_pluck( $registred_by_code, 'name' );
3014
+ $types = array_intersect( $types, $ctype_names );
3015
+ }
3016
+
3017
  $type = false;
3018
  if ( ! empty( $types ) ) {
3019
  if ( $single ) {
3055
  return false;
3056
  }
3057
 
3058
+ $deleted = bp_remove_object_terms( $group_id, $group_type, bp_get_group_type_tax_name() );
3059
 
3060
  // Bust the case, if the type has been removed.
3061
  if ( ! is_wp_error( $deleted ) ) {
bp-groups/bp-groups-template.php CHANGED
@@ -190,7 +190,26 @@ function bp_group_type_directory_link( $group_type = '' ) {
190
  return '';
191
  }
192
 
193
- return sprintf( '<a href="%s">%s</a>', esc_url( bp_get_group_type_directory_permalink( $group_type ) ), bp_groups_get_group_type_object( $group_type )->labels['name'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  }
195
 
196
  /**
@@ -206,19 +225,23 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
206
  * Return a comma-delimited list of group types.
207
  *
208
  * @since 2.7.0
 
 
 
209
  *
210
  * @param int $group_id Group ID. Defaults to current group ID if on a group page.
211
  * @param array|string $r {
212
  * Array of parameters. All items are optional.
213
- * @type string $parent_element Element to wrap around the list. Defaults to 'p'.
214
- * @type array $parent_attr Element attributes for parent element. Defaults to
215
- * array( 'class' => 'bp-group-type-list' ).
216
- * @type string $label Label to add before the list. Defaults to 'Group Types:'.
217
- * @type string $label_element Element to wrap around the label. Defaults to 'strong'.
218
- * @type array $label_attr Element attributes for label element. Defaults to array().
219
- * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If
220
- * 'false', only shows group types with the 'show_in_list' parameter set to
221
- * true. See bp_groups_register_group_type() for more info.
 
222
  * }
223
  * @return string
224
  */
@@ -227,16 +250,40 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
227
  $group_id = bp_get_current_group_id();
228
  }
229
 
230
- $r = bp_parse_args( $r, array(
231
- 'parent_element' => 'p',
232
- 'parent_attr' => array(
233
- 'class' => 'bp-group-type-list',
 
 
 
 
 
 
 
 
 
234
  ),
235
- 'label' => __( 'Group Types:', 'buddypress' ),
236
- 'label_element' => 'strong',
237
- 'label_attr' => array(),
238
- 'show_all' => false,
239
- ), 'group_type_list' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
 
241
  $retval = '';
242
 
@@ -250,12 +297,19 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
250
  }
251
 
252
  $before = $after = $label = '';
 
 
 
 
 
 
 
253
 
254
  // Render parent element.
255
  if ( ! empty( $r['parent_element'] ) ) {
256
  $parent_elem = new BP_Core_HTML_Element( array(
257
  'element' => $r['parent_element'],
258
- 'attr' => $r['parent_attr']
259
  ) );
260
 
261
  // Set before and after.
@@ -268,17 +322,31 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
268
  $label = new BP_Core_HTML_Element( array(
269
  'element' => $r['label_element'],
270
  'attr' => $r['label_attr'],
271
- 'inner_html' => esc_html( $r['label'] )
272
  ) );
273
  $label = $label->contents() . ' ';
274
 
275
  // No element, just the label.
276
- } else {
277
- $label = esc_html( $r['label'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  }
279
 
280
  // Comma-delimit each type into the group type directory link.
281
- $label .= implode( ', ', array_map( 'bp_get_group_type_directory_link', $types ) );
282
 
283
  // Retval time!
284
  $retval = $before . $label . $after;
@@ -293,6 +361,7 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
293
  * @since 1.0.0
294
  * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters.
295
  * @since 2.7.0 Added `$update_admin_cache` parameter.
 
296
  *
297
  * @param array|string $args {
298
  * Array of parameters. All items are optional.
@@ -319,6 +388,7 @@ function bp_group_type_list( $group_id = 0, $r = array() ) {
319
  * @type array|string $group_type__in Array or comma-separated list of group types to limit results to.
320
  * @type array|string $group_type__not_in Array or comma-separated list of group types that will be
321
  * excluded from results.
 
322
  * @type array $meta_query An array of meta_query conditions.
323
  * See {@link WP_Meta_Query::queries} for description.
324
  * @type array|string $include Array or comma-separated list of group IDs. Results will be limited
@@ -372,6 +442,16 @@ function bp_has_groups( $args = '' ) {
372
  }
373
  }
374
 
 
 
 
 
 
 
 
 
 
 
375
  // Default search string (too soon to escape here).
376
  $search_query_arg = bp_core_get_component_search_query_arg( 'groups' );
377
  if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) {
@@ -398,6 +478,7 @@ function bp_has_groups( $args = '' ) {
398
  'group_type' => $group_type,
399
  'group_type__in' => '',
400
  'group_type__not_in' => '',
 
401
  'meta_query' => false,
402
  'include' => false,
403
  'exclude' => false,
@@ -422,6 +503,7 @@ function bp_has_groups( $args = '' ) {
422
  'group_type' => $r['group_type'],
423
  'group_type__in' => $r['group_type__in'],
424
  'group_type__not_in' => $r['group_type__not_in'],
 
425
  'meta_query' => $r['meta_query'],
426
  'include' => $r['include'],
427
  'exclude' => $r['exclude'],
@@ -2003,21 +2085,29 @@ function bp_group_total_members( $group = false ) {
2003
  * Output the "x members" count string for a group.
2004
  *
2005
  * @since 1.2.0
 
 
 
2006
  */
2007
- function bp_group_member_count() {
2008
- echo bp_get_group_member_count();
2009
  }
2010
  /**
2011
  * Generate the "x members" count string for a group.
2012
  *
2013
  * @since 1.2.0
2014
  *
 
 
 
2015
  * @return string
2016
  */
2017
- function bp_get_group_member_count() {
2018
  global $groups_template;
2019
 
2020
- if ( isset( $groups_template->group->total_member_count ) ) {
 
 
2021
  $count = (int) $groups_template->group->total_member_count;
2022
  } else {
2023
  $count = 0;
190
  return '';
191
  }
192
 
193
+ $group_type_object = bp_groups_get_group_type_object( $group_type );
194
+
195
+ if ( ! isset( $group_type_object->labels['name'] ) ) {
196
+ return '';
197
+ }
198
+
199
+ $group_type_text = $group_type_object->labels['name'];
200
+ if ( isset( $group_type_object->labels['singular_name'] ) && $group_type_object->labels['singular_name'] ) {
201
+ $group_type_text = $group_type_object->labels['singular_name'];
202
+ }
203
+
204
+ if ( empty( $group_type_object->has_directory ) ) {
205
+ return esc_html( $group_type_text );
206
+ }
207
+
208
+ return sprintf(
209
+ '<a href="%s">%s</a>',
210
+ esc_url( bp_get_group_type_directory_permalink( $group_type ) ),
211
+ esc_html( $group_type_text )
212
+ );
213
  }
214
 
215
  /**
225
  * Return a comma-delimited list of group types.
226
  *
227
  * @since 2.7.0
228
+ * @since 7.0.0 The `$r['label']` argument now also accept an array containing the
229
+ * plural & singular labels to use according to the Group's number of
230
+ * group types it is assigned to.
231
  *
232
  * @param int $group_id Group ID. Defaults to current group ID if on a group page.
233
  * @param array|string $r {
234
  * Array of parameters. All items are optional.
235
+ * @type string $parent_element Element to wrap around the list. Defaults to 'p'.
236
+ * @type array $parent_attr Element attributes for parent element. Defaults to
237
+ * array( 'class' => 'bp-group-type-list' ).
238
+ * @type string|array $label Plural and singular labels to add before the list. Defaults to
239
+ * array( 'plural' => 'Group Types:', 'singular' => 'Group Type:' ).
240
+ * @type string $label_element Element to wrap around the label. Defaults to 'strong'.
241
+ * @type array $label_attr Element attributes for label element. Defaults to array().
242
+ * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If
243
+ * 'false', only shows group types with the 'show_in_list' parameter set to
244
+ * true. See bp_groups_register_group_type() for more info.
245
  * }
246
  * @return string
247
  */
250
  $group_id = bp_get_current_group_id();
251
  }
252
 
253
+ $r = bp_parse_args(
254
+ $r,
255
+ array(
256
+ 'parent_element' => 'p',
257
+ 'parent_attr' => array(
258
+ 'class' => 'bp-group-type-list',
259
+ ),
260
+ 'label' => array(),
261
+ 'label_element' => 'strong',
262
+ 'label_attr' => array(),
263
+ 'show_all' => false,
264
+ 'list_element' => '',
265
+ 'list_element_attr' => array(),
266
  ),
267
+ 'group_type_list'
268
+ );
269
+
270
+ // Should the label be output?
271
+ $has_label = ! empty( $r['label'] );
272
+
273
+ // Ensure backward compatibility in case developers are still using a string.
274
+ if ( ! is_array( $r['label'] ) ) {
275
+ $r['label'] = array(
276
+ 'plural' => __( 'Group Types:', 'buddypress' ),
277
+ );
278
+ }
279
+
280
+ $labels = wp_parse_args(
281
+ $r['label'],
282
+ array(
283
+ 'plural' => __( 'Group Types:', 'buddypress' ),
284
+ 'singular' => __( 'Group Type:', 'buddypress' ),
285
+ )
286
+ );
287
 
288
  $retval = '';
289
 
297
  }
298
 
299
  $before = $after = $label = '';
300
+ $count = count( $types );
301
+
302
+ if ( 1 === $count ) {
303
+ $label_text = $labels['singular'];
304
+ } else {
305
+ $label_text = $labels['plural'];
306
+ }
307
 
308
  // Render parent element.
309
  if ( ! empty( $r['parent_element'] ) ) {
310
  $parent_elem = new BP_Core_HTML_Element( array(
311
  'element' => $r['parent_element'],
312
+ 'attr' => $r['parent_attr'],
313
  ) );
314
 
315
  // Set before and after.
322
  $label = new BP_Core_HTML_Element( array(
323
  'element' => $r['label_element'],
324
  'attr' => $r['label_attr'],
325
+ 'inner_html' => esc_html( $label_text ),
326
  ) );
327
  $label = $label->contents() . ' ';
328
 
329
  // No element, just the label.
330
+ } elseif ( $has_label ) {
331
+ $label = esc_html( $label_text );
332
+ }
333
+
334
+ // The list of types.
335
+ $list = implode( ', ', array_map( 'bp_get_group_type_directory_link', $types ) );
336
+
337
+ // Render the list of types element.
338
+ if ( ! empty( $r['list_element'] ) ) {
339
+ $list_element = new BP_Core_HTML_Element( array(
340
+ 'element' => $r['list_element'],
341
+ 'attr' => $r['list_element_attr'],
342
+ 'inner_html' => $list,
343
+ ) );
344
+
345
+ $list = $list_element->contents();
346
  }
347
 
348
  // Comma-delimit each type into the group type directory link.
349
+ $label .= $list;
350
 
351
  // Retval time!
352
  $retval = $before . $label . $after;
361
  * @since 1.0.0
362
  * @since 2.6.0 Added `$group_type`, `$group_type__in`, and `$group_type__not_in` parameters.
363
  * @since 2.7.0 Added `$update_admin_cache` parameter.
364
+ * @since 7.0.0 Added `$status` parameter.
365
  *
366
  * @param array|string $args {
367
  * Array of parameters. All items are optional.
388
  * @type array|string $group_type__in Array or comma-separated list of group types to limit results to.
389
  * @type array|string $group_type__not_in Array or comma-separated list of group types that will be
390
  * excluded from results.
391
+ * @type array|string $status Array or comma-separated list of group statuses to limit results to.
392
  * @type array $meta_query An array of meta_query conditions.
393
  * See {@link WP_Meta_Query::queries} for description.
394
  * @type array|string $include Array or comma-separated list of group IDs. Results will be limited
442
  }
443
  }
444
 
445
+ $status = array();
446
+ if ( ! empty( $_GET['status'] ) ) {
447
+ if ( is_array( $_GET['status'] ) ) {
448
+ $status = $_GET['status'];
449
+ } else {
450
+ // Can be a comma-separated list.
451
+ $status = explode( ',', $_GET['status'] );
452
+ }
453
+ }
454
+
455
  // Default search string (too soon to escape here).
456
  $search_query_arg = bp_core_get_component_search_query_arg( 'groups' );
457
  if ( ! empty( $_REQUEST[ $search_query_arg ] ) ) {
478
  'group_type' => $group_type,
479
  'group_type__in' => '',
480
  'group_type__not_in' => '',
481
+ 'status' => $status,
482
  'meta_query' => false,
483
  'include' => false,
484
  'exclude' => false,
503
  'group_type' => $r['group_type'],
504
  'group_type__in' => $r['group_type__in'],
505
  'group_type__not_in' => $r['group_type__not_in'],
506
+ 'status' => $r['status'],
507
  'meta_query' => $r['meta_query'],
508
  'include' => $r['include'],
509
  'exclude' => $r['exclude'],
2085
  * Output the "x members" count string for a group.
2086
  *
2087
  * @since 1.2.0
2088
+ * @since 7.0.0 Adds the `$group` optional parameter.
2089
+ *
2090
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
2091
  */
2092
+ function bp_group_member_count( $group = false ) {
2093
+ echo bp_get_group_member_count( $group );
2094
  }
2095
  /**
2096
  * Generate the "x members" count string for a group.
2097
  *
2098
  * @since 1.2.0
2099
  *
2100
+ * @since 7.0.0 Adds the `$group` optional parameter.
2101
+ *
2102
+ * @param object|bool $group Optional. Group object. Default: current group in loop.
2103
  * @return string
2104
  */
2105
+ function bp_get_group_member_count( $group = false ) {
2106
  global $groups_template;
2107
 
2108
+ if ( isset( $group->total_member_count ) ) {
2109
+ $count = (int) $group->total_member_count;
2110
+ } elseif ( isset( $groups_template->group->total_member_count ) ) {
2111
  $count = (int) $groups_template->group->total_member_count;
2112
  } else {
2113
  $count = 0;
bp-groups/bp-groups-widgets.php CHANGED
@@ -76,8 +76,8 @@ function groups_ajax_widget_groups_list() {
76
  <?php else : ?>
77
  <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
78
  <?php
79
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
80
- printf( _x( 'active %s', 'last time the group was active', 'buddypress' ), bp_get_group_last_active() );
81
  ?>
82
  </span>
83
  <?php endif; ?>
76
  <?php else : ?>
77
  <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
78
  <?php
79
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
80
+ printf( _x( 'Active %s', 'last time the group was active', 'buddypress' ), bp_get_group_last_active() );
81
  ?>
82
  </span>
83
  <?php endif; ?>
bp-groups/classes/class-bp-groups-component.php CHANGED
@@ -892,7 +892,7 @@ class BP_Groups_Component extends BP_Component {
892
  ) );
893
 
894
  if ( empty( $bp->bp_options_avatar ) ) {
895
- $bp->bp_options_avatar = '<img src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Profile Photo', 'buddypress' ) . '" class="avatar" />';
896
  }
897
  }
898
  }
@@ -924,12 +924,12 @@ class BP_Groups_Component extends BP_Component {
924
  * Set up taxonomies.
925
  *
926
  * @since 2.6.0
 
927
  */
928
  public function register_taxonomies() {
929
- // Group Type.
930
- register_taxonomy( 'bp_group_type', 'bp_group', array(
931
- 'public' => false,
932
- ) );
933
  }
934
 
935
  /**
@@ -1010,6 +1010,57 @@ class BP_Groups_Component extends BP_Component {
1010
  ),
1011
  ),
1012
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1013
  )
1014
  );
1015
  }
892
  ) );
893
 
894
  if ( empty( $bp->bp_options_avatar ) ) {
895
+ $bp->bp_options_avatar = '<img loading="lazy" src="' . esc_url( bp_core_avatar_default_thumb() ) . '" alt="' . esc_attr__( 'No Group Profile Photo', 'buddypress' ) . '" class="avatar" />';
896
  }
897
  }
898
  }
924
  * Set up taxonomies.
925
  *
926
  * @since 2.6.0
927
+ * @since 7.0.0 The Group Type taxonomy is registered using the `bp_groups_register_group_type_taxonomy()` function.
928
  */
929
  public function register_taxonomies() {
930
+
931
+ // Just let BP Component fire 'bp_groups_register_taxonomies'.
932
+ return parent::register_taxonomies();
 
933
  }
934
 
935
  /**
1010
  ),
1011
  ),
1012
  ),
1013
+ 'bp/groups' => array(
1014
+ 'name' => 'bp/groups',
1015
+ 'editor_script' => 'bp-groups-block',
1016
+ 'editor_script_url' => plugins_url( 'js/blocks/groups.js', dirname( __FILE__ ) ),
1017
+ 'editor_script_deps' => array(
1018
+ 'wp-blocks',
1019
+ 'wp-element',
1020
+ 'wp-components',
1021
+ 'wp-i18n',
1022
+ 'wp-compose',
1023
+ 'wp-data',
1024
+ 'wp-api-fetch',
1025
+ 'wp-url',
1026
+ 'wp-block-editor',
1027
+ 'bp-block-components',
1028
+ 'lodash',
1029
+ ),
1030
+ 'style' => 'bp-groups-block',
1031
+ 'style_url' => plugins_url( 'css/blocks/groups.css', dirname( __FILE__ ) ),
1032
+ 'attributes' => array(
1033
+ 'itemIDs' => array(
1034
+ 'type' => 'array',
1035
+ 'items' => array(
1036
+ 'type' => 'integer',
1037
+ ),
1038
+ ),
1039
+ 'avatarSize' => array(
1040
+ 'type' => 'string',
1041
+ 'default' => 'full',
1042
+ ),
1043
+ 'displayGroupName' => array(
1044
+ 'type' => 'boolean',
1045
+ 'default' => true,
1046
+ ),
1047
+ 'extraInfo' => array(
1048
+ 'type' => 'string',
1049
+ 'default' => 'none',
1050
+ 'enum' => array( 'description', 'popular', 'active', 'none' ),
1051
+ ),
1052
+ 'layoutPreference' => array(
1053
+ 'type' => 'string',
1054
+ 'default' => 'list',
1055
+ 'enum' => array( 'list', 'grid' ),
1056
+ ),
1057
+ 'columns' => array(
1058
+ 'type' => 'number',
1059
+ 'default' => 2,
1060
+ ),
1061
+ ),
1062
+ 'render_callback' => 'bp_groups_render_groups_block',
1063
+ ),
1064
  )
1065
  );
1066
  }
bp-groups/classes/class-bp-groups-group.php CHANGED
@@ -1746,14 +1746,14 @@ class BP_Groups_Group {
1746
 
1747
  $tax_query = new WP_Tax_Query( array(
1748
  array(
1749
- 'taxonomy' => 'bp_group_type',
1750
  'field' => 'name',
1751
  'operator' => $operator,
1752
  'terms' => $types,
1753
  ),
1754
  ) );
1755
 
1756
- $site_id = bp_get_taxonomy_term_site_id( 'bp_group_type' );
1757
  $switched = false;
1758
  if ( $site_id !== get_current_blog_id() ) {
1759
  switch_to_blog( $site_id );
1746
 
1747
  $tax_query = new WP_Tax_Query( array(
1748
  array(
1749
+ 'taxonomy' => bp_get_group_type_tax_name(),
1750
  'field' => 'name',
1751
  'operator' => $operator,
1752
  'terms' => $types,
1753
  ),
1754
  ) );
1755
 
1756
+ $site_id = bp_get_taxonomy_term_site_id( bp_get_group_type_tax_name() );
1757
  $switched = false;
1758
  if ( $site_id !== get_current_blog_id() ) {
1759
  switch_to_blog( $site_id );
bp-groups/classes/class-bp-groups-invite-template.php CHANGED
@@ -275,8 +275,8 @@ class BP_Groups_Invite_Template {
275
  $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login );
276
  $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}'>{$this->invite->user->fullname}</a>";
277
 
278
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
279
- $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'active %s', 'buddypress' ) );
280
 
281
  if ( bp_is_active( 'groups' ) ) {
282
  $total_groups = BP_Groups_Member::total_group_count( $user_id );
275
  $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login );
276
  $this->invite->user->user_link = "<a href='{$this->invite->user->user_url}'>{$this->invite->user->fullname}</a>";
277
 
278
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
279
+ $this->invite->user->last_active = bp_core_get_last_activity( $this->invite->user->last_activity, __( 'Active %s', 'buddypress' ) );
280
 
281
  if ( bp_is_active( 'groups' ) ) {
282
  $total_groups = BP_Groups_Member::total_group_count( $user_id );
bp-groups/classes/class-bp-groups-template.php CHANGED
@@ -171,6 +171,7 @@ class BP_Groups_Template {
171
  'group_type' => '',
172
  'group_type__in' => '',
173
  'group_type__not_in' => '',
 
174
  'meta_query' => false,
175
  'update_meta_cache' => true,
176
  'update_admin_cache' => false,
@@ -224,6 +225,7 @@ class BP_Groups_Template {
224
  'group_type' => $group_type,
225
  'group_type__in' => $group_type__in,
226
  'group_type__not_in' => $group_type__not_in,
 
227
  'include' => $include,
228
  'exclude' => $exclude,
229
  'parent_id' => $parent_id,
171
  'group_type' => '',
172
  'group_type__in' => '',
173
  'group_type__not_in' => '',
174
+ 'status' => array(),
175
  'meta_query' => false,
176
  'update_meta_cache' => true,
177
  'update_admin_cache' => false,
225
  'group_type' => $group_type,
226
  'group_type__in' => $group_type__in,
227
  'group_type__not_in' => $group_type__not_in,
228
+ 'status' => $status,
229
  'include' => $include,
230
  'exclude' => $exclude,
231
  'parent_id' => $parent_id,
bp-groups/classes/class-bp-groups-widget.php CHANGED
@@ -149,8 +149,8 @@ class BP_Groups_Widget extends WP_Widget {
149
  } elseif ( 'popular' == $instance['group_default'] ) {
150
  bp_group_member_count();
151
  } else {
152
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
153
- printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
154
  }
155
  ?>
156
  </span>
149
  } elseif ( 'popular' == $instance['group_default'] ) {
150
  bp_group_member_count();
151
  } else {
152
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
153
+ printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
154
  }
155
  ?>
156
  </span>
bp-groups/classes/class-bp-rest-group-invites-endpoint.php CHANGED
@@ -256,7 +256,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
256
  'bp_rest_group_invites_cannot_get_items',
257
  __( 'Sorry, you are not allowed to fetch group invitations with those arguments.', 'buddypress' ),
258
  array(
259
- 'status' => 500,
260
  )
261
  );
262
  }
@@ -350,7 +350,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
350
  'bp_rest_group_invites_cannot_get_item',
351
  __( 'Sorry, you are not allowed to fetch an invitation.', 'buddypress' ),
352
  array(
353
- 'status' => 500,
354
  )
355
  );
356
  }
@@ -481,7 +481,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
481
  'bp_rest_group_invite_cannot_create_item',
482
  __( 'Sorry, you are not allowed to create the invitation as requested.', 'buddypress' ),
483
  array(
484
- 'status' => 500,
485
  )
486
  );
487
  }
@@ -587,7 +587,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
587
  'bp_rest_group_invite_cannot_update_item',
588
  __( 'Sorry, you are not allowed to accept the invitation as requested.', 'buddypress' ),
589
  array(
590
- 'status' => 500,
591
  )
592
  );
593
  }
@@ -714,7 +714,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
714
  'bp_rest_group_invite_cannot_delete_item',
715
  __( 'Sorry, you are not allowed to delete the invitation as requested.', 'buddypress' ),
716
  array(
717
- 'status' => 500,
718
  )
719
  );
720
  }
@@ -832,7 +832,6 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
832
  * @since 5.0.0
833
  *
834
  * @param int $invite_id The ID of the invitation you wish to fetch.
835
- *
836
  * @return BP_Invitation|bool $invite Invitation if found, false otherwise.
837
  */
838
  public function fetch_single_invite( $invite_id = 0 ) {
@@ -853,7 +852,7 @@ class BP_REST_Group_Invites_Endpoint extends WP_REST_Controller {
853
  * @return array Endpoint arguments.
854
  */
855
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
856
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
857
  $key = 'get_item';
858
 
859
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
256
  'bp_rest_group_invites_cannot_get_items',
257
  __( 'Sorry, you are not allowed to fetch group invitations with those arguments.', 'buddypress' ),
258
  array(
259
+ 'status' => rest_authorization_required_code(),
260
  )
261
  );
262
  }
350
  'bp_rest_group_invites_cannot_get_item',
351
  __( 'Sorry, you are not allowed to fetch an invitation.', 'buddypress' ),
352
  array(
353
+ 'status' => rest_authorization_required_code(),
354
  )
355
  );
356
  }
481
  'bp_rest_group_invite_cannot_create_item',
482
  __( 'Sorry, you are not allowed to create the invitation as requested.', 'buddypress' ),
483
  array(
484
+ 'status' => rest_authorization_required_code(),
485
  )
486
  );
487
  }
587
  'bp_rest_group_invite_cannot_update_item',
588
  __( 'Sorry, you are not allowed to accept the invitation as requested.', 'buddypress' ),
589
  array(
590
+ 'status' => rest_authorization_required_code(),
591
  )
592
  );
593
  }
714
  'bp_rest_group_invite_cannot_delete_item',
715
  __( 'Sorry, you are not allowed to delete the invitation as requested.', 'buddypress' ),
716
  array(
717
+ 'status' => rest_authorization_required_code(),
718
  )
719
  );
720
  }
832
  * @since 5.0.0
833
  *
834
  * @param int $invite_id The ID of the invitation you wish to fetch.
 
835
  * @return BP_Invitation|bool $invite Invitation if found, false otherwise.
836
  */
837
  public function fetch_single_invite( $invite_id = 0 ) {
852
  * @return array Endpoint arguments.
853
  */
854
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
855
+ $args = parent::get_endpoint_args_for_item_schema( $method );
856
  $key = 'get_item';
857
 
858
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
bp-groups/classes/class-bp-rest-group-membership-endpoint.php CHANGED
@@ -688,7 +688,7 @@ class BP_REST_Group_Membership_Endpoint extends WP_REST_Controller {
688
  public function prepare_item_for_response( $group_member, $request ) {
689
  $user = bp_rest_get_user( $group_member->user_id );
690
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
691
- $member_data = $this->members_endpoint->user_data( $user, $context );
692
 
693
  // Merge both info.
694
  $data = array_merge(
688
  public function prepare_item_for_response( $group_member, $request ) {
689
  $user = bp_rest_get_user( $group_member->user_id );
690
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
691
+ $member_data = $this->members_endpoint->user_data( $user, $context, $request );
692
 
693
  // Merge both info.
694
  $data = array_merge(
bp-groups/classes/class-bp-rest-group-membership-request-endpoint.php CHANGED
@@ -231,7 +231,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
231
  'bp_rest_group_membership_requests_cannot_get_items',
232
  __( 'Sorry, you are not allowed to view membership requests.', 'buddypress' ),
233
  array(
234
- 'status' => 500,
235
  )
236
  );
237
  }
@@ -318,7 +318,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
318
  'bp_rest_group_membership_requests_cannot_get_item',
319
  __( 'Sorry, you are not allowed to view a membership request.', 'buddypress' ),
320
  array(
321
- 'status' => 500,
322
  )
323
  );
324
  }
@@ -461,7 +461,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
461
  'bp_rest_group_membership_requests_cannot_create_item',
462
  __( 'User may not extend requests on behalf of another user.', 'buddypress' ),
463
  array(
464
- 'status' => 500,
465
  )
466
  );
467
  }
@@ -567,7 +567,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
567
  'bp_rest_group_member_request_cannot_update_item',
568
  __( 'User is not allowed to approve membership requests to this group.', 'buddypress' ),
569
  array(
570
- 'status' => 500,
571
  )
572
  );
573
  }
@@ -694,7 +694,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
694
  'bp_rest_group_membership_requests_cannot_delete_item',
695
  __( 'User is not allowed to delete this membership request.', 'buddypress' ),
696
  array(
697
- 'status' => 500,
698
  )
699
  );
700
  }
@@ -816,7 +816,7 @@ class BP_REST_Group_Membership_Request_Endpoint extends WP_REST_Controller {
816
  * @return array Endpoint arguments.
817
  */
818
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
819
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
820
  $key = 'get_item';
821
 
822
  if ( WP_REST_Server::CREATABLE === $method ) {
231
  'bp_rest_group_membership_requests_cannot_get_items',
232
  __( 'Sorry, you are not allowed to view membership requests.', 'buddypress' ),
233
  array(
234
+ 'status' => rest_authorization_required_code(),
235
  )
236
  );
237
  }
318
  'bp_rest_group_membership_requests_cannot_get_item',
319
  __( 'Sorry, you are not allowed to view a membership request.', 'buddypress' ),
320
  array(
321
+ 'status' => rest_authorization_required_code(),
322
  )
323
  );
324
  }
461
  'bp_rest_group_membership_requests_cannot_create_item',
462
  __( 'User may not extend requests on behalf of another user.', 'buddypress' ),
463
  array(
464
+ 'status' => rest_authorization_required_code(),
465
  )
466
  );
467
  }
567
  'bp_rest_group_member_request_cannot_update_item',
568
  __( 'User is not allowed to approve membership requests to this group.', 'buddypress' ),
569
  array(
570
+ 'status' => rest_authorization_required_code(),
571
  )
572
  );
573
  }
694
  'bp_rest_group_membership_requests_cannot_delete_item',
695
  __( 'User is not allowed to delete this membership request.', 'buddypress' ),
696
  array(
697
+ 'status' => rest_authorization_required_code(),
698
  )
699
  );
700
  }
816
  * @return array Endpoint arguments.
817
  */
818
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
819
+ $args = parent::get_endpoint_args_for_item_schema( $method );
820
  $key = 'get_item';
821
 
822
  if ( WP_REST_Server::CREATABLE === $method ) {
bp-groups/classes/class-bp-rest-groups-endpoint.php CHANGED
@@ -66,11 +66,19 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
66
  'callback' => array( $this, 'get_item' ),
67
  'permission_callback' => array( $this, 'get_item_permissions_check' ),
68
  'args' => array(
69
- 'context' => $this->get_context_param(
70
  array(
71
  'default' => 'view',
72
  )
73
  ),
 
 
 
 
 
 
 
 
74
  ),
75
  ),
76
  array(
@@ -87,6 +95,29 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
87
  'schema' => array( $this, 'get_item_schema' ),
88
  )
89
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  /**
@@ -120,6 +151,15 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
120
  $args['parent_id'] = null;
121
  }
122
 
 
 
 
 
 
 
 
 
 
123
  /**
124
  * Filter the query arguments for the request.
125
  *
@@ -173,16 +213,6 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
173
  public function get_items_permissions_check( $request ) {
174
  $retval = true;
175
 
176
- if ( ! $this->can_see_hidden_groups( $request ) ) {
177
- $retval = new WP_Error(
178
- 'bp_rest_authorization_required',
179
- __( 'Sorry, you cannot view hidden groups.', 'buddypress' ),
180
- array(
181
- 'status' => rest_authorization_required_code(),
182
- )
183
- );
184
- }
185
-
186
  /**
187
  * Filter the groups `get_items` permissions check.
188
  *
@@ -289,7 +319,7 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
289
  'bp_rest_create_group_empty_name',
290
  __( 'Please, enter the name of group.', 'buddypress' ),
291
  array(
292
- 'status' => 500,
293
  )
294
  );
295
  }
@@ -583,6 +613,112 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
583
  return apply_filters( 'bp_rest_groups_delete_item_permissions_check', $retval, $request );
584
  }
585
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  /**
587
  * Prepares group data for return as an object.
588
  *
@@ -612,6 +748,7 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
612
  'mods' => array(),
613
  'total_member_count' => null,
614
  'last_activity' => null,
 
615
  );
616
 
617
  // Get item schema.
@@ -646,11 +783,15 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
646
 
647
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
648
 
649
- // If this is the 'edit' context, fill in more details--similar to "populate_extras".
650
- if ( 'edit' === $context ) {
651
- $data['total_member_count'] = groups_get_groupmeta( $item->id, 'total_member_count' );
652
- $data['last_activity'] = bp_rest_prepare_date_response( groups_get_groupmeta( $item->id, 'last_activity' ) );
 
 
653
 
 
 
654
  // Add admins and moderators to their respective arrays.
655
  $admin_mods = groups_get_group_members(
656
  array(
@@ -712,12 +853,17 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
712
  * @return stdClass|WP_Error
713
  */
714
  protected function prepare_item_for_database( $request ) {
715
- $prepared_group = new stdClass();
716
- $schema = $this->get_item_schema();
717
- $group = $this->get_group_object( $request );
 
 
 
 
 
718
 
719
  // Group ID.
720
- if ( ! empty( $schema['properties']['id'] ) && ! empty( $group->id ) ) {
721
  $prepared_group->group_id = $group->id;
722
  }
723
 
@@ -725,10 +871,6 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
725
  if ( ! empty( $schema['properties']['creator_id'] ) && isset( $request['creator_id'] ) ) {
726
  $prepared_group->creator_id = (int) $request['creator_id'];
727
 
728
- // Fallback on the existing creator id in case of an update.
729
- } elseif ( isset( $group->creator_id ) && $group->creator_id ) {
730
- $prepared_group->creator_id = (int) $group->creator_id;
731
-
732
  // Fallback on the current user otherwise.
733
  } else {
734
  $prepared_group->creator_id = bp_loggedin_user_id();
@@ -781,12 +923,22 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
781
 
782
  // Update group type(s).
783
  if ( isset( $prepared_group->group_id ) && isset( $request['types'] ) ) {
 
 
784
 
785
- // Append on update. Add on creation.
786
- $append = WP_REST_Server::EDITABLE === $request->get_method();
 
 
 
 
 
 
 
787
 
788
- // Add/Append group type(s).
789
- bp_groups_set_group_type( $prepared_group->group_id, $request['types'], $append );
 
790
  }
791
 
792
  /**
@@ -837,43 +989,34 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
837
  }
838
 
839
  /**
840
- * Can a user see a group?
841
  *
842
  * @since 5.0.0
843
  *
844
- * @param BP_Groups_Group $group Group object.
845
  * @return bool
846
  */
847
- protected function can_see( $group ) {
848
-
849
- // If it is not a hidden/private group, user can see it.
850
- if ( 'public' === $group->status ) {
851
- return true;
852
- }
853
-
854
- // Moderators.
855
- if ( bp_current_user_can( 'bp_moderate' ) ) {
856
- return true;
857
- }
858
-
859
- // User is a member of the group.
860
- if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {
861
- return true;
862
- }
863
-
864
- return false;
865
  }
866
 
867
  /**
868
- * See if user can delete or update a group.
869
  *
870
  * @since 5.0.0
871
  *
872
- * @param BP_Groups_Group $group Group item.
873
  * @return bool
874
  */
875
- protected function can_user_delete_or_update( $group ) {
876
- return ( bp_current_user_can( 'bp_moderate' ) || bp_loggedin_user_id() === $group->creator_id );
 
 
 
 
 
 
 
877
  }
878
 
879
  /**
@@ -885,20 +1028,15 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
885
  * @return bool
886
  */
887
  protected function can_see_hidden_groups( $request ) {
888
- if ( $request['show_hidden'] ) {
889
-
890
- if ( bp_current_user_can( 'bp_moderate' ) ) {
891
- return true;
892
- }
893
-
894
- if ( is_user_logged_in() && isset( $request['user_id'] ) && absint( $request['user_id'] ) === bp_loggedin_user_id() ) {
895
- return true;
896
- }
897
-
898
- return false;
899
  }
900
 
901
- return true;
 
 
 
 
902
  }
903
 
904
  /**
@@ -936,7 +1074,7 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
936
  * @return array Endpoint arguments.
937
  */
938
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
939
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
940
  $key = 'get_item';
941
 
942
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
@@ -945,19 +1083,34 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
945
 
946
  // Add group types.
947
  $args['types'] = array(
948
- 'description' => __( 'Set type(s) for a group.', 'buddypress' ),
949
- 'type' => 'array',
950
  'enum' => bp_groups_get_group_types(),
951
  'sanitize_callback' => 'bp_rest_sanitize_group_types',
952
  'validate_callback' => 'bp_rest_validate_group_types',
953
- 'items' => array(
954
- 'type' => 'string',
955
- ),
956
  );
957
 
958
  if ( WP_REST_Server::EDITABLE === $method ) {
959
  $key = 'update_item';
960
  unset( $args['slug'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
961
  }
962
  } elseif ( WP_REST_Server::DELETABLE === $method ) {
963
  $key = 'delete_item';
@@ -1102,18 +1255,24 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
1102
  ),
1103
  ),
1104
  'total_member_count' => array(
1105
- 'context' => array( 'edit' ),
1106
  'description' => __( 'Count of all Group members.', 'buddypress' ),
1107
  'readonly' => true,
1108
  'type' => 'integer',
1109
  ),
1110
  'last_activity' => array(
1111
- 'context' => array( 'edit' ),
1112
  'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
1113
  'type' => 'string',
1114
  'readonly' => true,
1115
  'format' => 'date-time',
1116
  ),
 
 
 
 
 
 
1117
  ),
1118
  );
1119
 
@@ -1273,6 +1432,14 @@ class BP_REST_Groups_Endpoint extends WP_REST_Controller {
1273
  'validate_callback' => 'rest_validate_request_arg',
1274
  );
1275
 
 
 
 
 
 
 
 
 
1276
  /**
1277
  * Filters the collection query params.
1278
  *
66
  'callback' => array( $this, 'get_item' ),
67
  'permission_callback' => array( $this, 'get_item_permissions_check' ),
68
  'args' => array(
69
+ 'context' => $this->get_context_param(
70
  array(
71
  'default' => 'view',
72
  )
73
  ),
74
+ 'populate_extras' => array(
75
+ 'description' => __( 'Whether to fetch extra BP data about the returned group.', 'buddypress' ),
76
+ 'context' => array( 'view', 'edit' ),
77
+ 'default' => false,
78
+ 'type' => 'boolean',
79
+ 'sanitize_callback' => 'rest_sanitize_boolean',
80
+ 'validate_callback' => 'rest_validate_request_arg',
81
+ ),
82
  ),
83
  ),
84
  array(
95
  'schema' => array( $this, 'get_item_schema' ),
96
  )
97
  );
98
+
99
+ register_rest_route(
100
+ $this->namespace,
101
+ '/' . $this->rest_base . '/me',
102
+ array(
103
+ 'args' => array(
104
+ 'max' => array(
105
+ 'description' => __( 'The maximum amount of groups the user is member of to return. Defaults to all groups.', 'buddypress' ),
106
+ 'type' => 'integer',
107
+ 'default' => 0,
108
+ ),
109
+ ),
110
+ array(
111
+ 'methods' => WP_REST_Server::READABLE,
112
+ 'callback' => array( $this, 'get_current_user_groups' ),
113
+ 'permission_callback' => array( $this, 'get_current_user_groups_permissions_check' ),
114
+ 'args' => array(
115
+ 'context' => $this->get_context_param( array( 'default' => 'view' ) ),
116
+ ),
117
+ ),
118
+ 'schema' => array( $this, 'get_item_schema' ),
119
+ )
120
+ );
121
  }
122
 
123
  /**
151
  $args['parent_id'] = null;
152
  }
153
 
154
+ // See if the user can see hidden groups.
155
+ if ( isset( $request['show_hidden'] ) && true === (bool) $request['show_hidden'] && ! $this->can_see_hidden_groups( $request ) ) {
156
+ $args['show_hidden'] = false;
157
+ }
158
+
159
+ if ( true === $request->get_param( 'populate_extras' ) ) {
160
+ $args['update_meta_cache'] = true;
161
+ }
162
+
163
  /**
164
  * Filter the query arguments for the request.
165
  *
213
  public function get_items_permissions_check( $request ) {
214
  $retval = true;
215
 
 
 
 
 
 
 
 
 
 
 
216
  /**
217
  * Filter the groups `get_items` permissions check.
218
  *
319
  'bp_rest_create_group_empty_name',
320
  __( 'Please, enter the name of group.', 'buddypress' ),
321
  array(
322
+ 'status' => 400,
323
  )
324
  );
325
  }
613
  return apply_filters( 'bp_rest_groups_delete_item_permissions_check', $retval, $request );
614
  }
615
 
616
+ /**
617
+ * Retrieves the current user groups.
618
+ *
619
+ * @since 7.0.0
620
+ *
621
+ * @param WP_REST_Request $request Full details about the request.
622
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
623
+ */
624
+ public function get_current_user_groups( $request ) {
625
+ $current_user_id = get_current_user_id();
626
+ $max = $request->get_param( 'max' );
627
+
628
+ if ( empty( $current_user_id ) ) {
629
+ return new WP_Error(
630
+ 'bp_rest_group_invalid_user_id',
631
+ __( 'Invalid user ID.', 'buddypress' ),
632
+ array(
633
+ 'status' => 404,
634
+ )
635
+ );
636
+ }
637
+
638
+ $per_page = -1;
639
+ if ( $max ) {
640
+ $per_page = (int) $max;
641
+ }
642
+
643
+ /**
644
+ * Filter the query arguments for the request.
645
+ *
646
+ * @since 7.0.0
647
+ *
648
+ * @param array $args Key value array of query var to query value.
649
+ * @param WP_REST_Request $request The request sent to the API.
650
+ */
651
+ $args = apply_filters(
652
+ 'bp_rest_groups_get_current_user_groups_query_args',
653
+ array(
654
+ 'user_id' => $current_user_id,
655
+ 'per_page' => $per_page,
656
+ 'page' => 1,
657
+ 'show_hidden' => true,
658
+ 'update_admin_cache' => false,
659
+ 'update_meta_cache' => false,
660
+ ),
661
+ $request
662
+ );
663
+
664
+ // Actually, query it.
665
+ $groups = groups_get_groups( $args );
666
+
667
+ $retval = array();
668
+ foreach ( $groups['groups'] as $group ) {
669
+ $retval[] = $this->prepare_response_for_collection(
670
+ $this->prepare_item_for_response( $group, $request )
671
+ );
672
+ }
673
+
674
+ $response = rest_ensure_response( $retval );
675
+
676
+ /**
677
+ * Fires after the user's list of groups is fetched via the REST API.
678
+ *
679
+ * @since 7.0.0
680
+ *
681
+ * @param array $groups Fetched groups.
682
+ * @param WP_REST_Response $response The response data.
683
+ * @param WP_REST_Request $request The request sent to the API.
684
+ */
685
+ do_action( 'bp_rest_groups_get_current_user_groups', $groups, $response, $request );
686
+
687
+ return $response;
688
+ }
689
+
690
+ /**
691
+ * Check if a given request has access to fetch the user's groups.
692
+ *
693
+ * @since 7.0.0
694
+ *
695
+ * @param WP_REST_Request $request Full details about the request.
696
+ * @return bool|WP_Error
697
+ */
698
+ public function get_current_user_groups_permissions_check( $request ) {
699
+ $retval = true;
700
+
701
+ if ( ! is_user_logged_in() ) {
702
+ $retval = new WP_Error(
703
+ 'bp_rest_authorization_required',
704
+ __( 'Sorry, you need to be logged in to view your groups.', 'buddypress' ),
705
+ array(
706
+ 'status' => rest_authorization_required_code(),
707
+ )
708
+ );
709
+ }
710
+
711
+ /**
712
+ * Filter the groups `get_current_user_groups` permissions check.
713
+ *
714
+ * @since 7.0.0
715
+ *
716
+ * @param bool|WP_Error $retval Returned value.
717
+ * @param WP_REST_Request $request The request sent to the API.
718
+ */
719
+ return apply_filters( 'bp_rest_groups_get_current_user_groups_permissions_check', $retval, $request );
720
+ }
721
+
722
  /**
723
  * Prepares group data for return as an object.
724
  *
748
  'mods' => array(),
749
  'total_member_count' => null,
750
  'last_activity' => null,
751
+ 'last_activity_diff' => null,
752
  );
753
 
754
  // Get item schema.
783
 
784
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
785
 
786
+ // If this is the 'edit' context or 'populate_extras' has been requested.
787
+ if ( 'edit' === $context || true === $request->get_param( 'populate_extras' ) ) {
788
+ $data['total_member_count'] = (int) $item->total_member_count;
789
+ $data['last_activity'] = bp_rest_prepare_date_response( $item->last_activity );
790
+ $data['last_activity_diff'] = bp_get_group_last_active( $item );
791
+ }
792
 
793
+ // If this is the 'edit' context, get more data about the group.
794
+ if ( 'edit' === $context ) {
795
  // Add admins and moderators to their respective arrays.
796
  $admin_mods = groups_get_group_members(
797
  array(
853
  * @return stdClass|WP_Error
854
  */
855
  protected function prepare_item_for_database( $request ) {
856
+ $schema = $this->get_item_schema();
857
+ $group = $this->get_group_object( $request );
858
+
859
+ if ( isset( $group->id ) && $group->id ) {
860
+ $prepared_group = $group;
861
+ } else {
862
+ $prepared_group = new stdClass();
863
+ }
864
 
865
  // Group ID.
866
+ if ( ! empty( $group->id ) ) {
867
  $prepared_group->group_id = $group->id;
868
  }
869
 
871
  if ( ! empty( $schema['properties']['creator_id'] ) && isset( $request['creator_id'] ) ) {
872
  $prepared_group->creator_id = (int) $request['creator_id'];
873
 
 
 
 
 
874
  // Fallback on the current user otherwise.
875
  } else {
876
  $prepared_group->creator_id = bp_loggedin_user_id();
923
 
924
  // Update group type(s).
925
  if ( isset( $prepared_group->group_id ) && isset( $request['types'] ) ) {
926
+ bp_groups_set_group_type( $prepared_group->group_id, $request['types'], false );
927
+ }
928
 
929
+ // Remove group type(s).
930
+ if ( isset( $prepared_group->group_id ) && isset( $request['remove_types'] ) ) {
931
+ array_map(
932
+ function( $type ) use ( $prepared_group ) {
933
+ bp_groups_remove_group_type( $prepared_group->group_id, $type );
934
+ },
935
+ $request['remove_types']
936
+ );
937
+ }
938
 
939
+ // Append group type(s).
940
+ if ( isset( $prepared_group->group_id ) && isset( $request['append_types'] ) ) {
941
+ bp_groups_set_group_type( $prepared_group->group_id, $request['append_types'], true );
942
  }
943
 
944
  /**
989
  }
990
 
991
  /**
992
+ * See if user can delete or update a group.
993
  *
994
  * @since 5.0.0
995
  *
996
+ * @param BP_Groups_Group $group Group item.
997
  * @return bool
998
  */
999
+ protected function can_user_delete_or_update( $group ) {
1000
+ return ( bp_current_user_can( 'bp_moderate' ) || bp_loggedin_user_id() === $group->creator_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1001
  }
1002
 
1003
  /**
1004
+ * Can a user see a group?
1005
  *
1006
  * @since 5.0.0
1007
  *
1008
+ * @param BP_Groups_Group $group Group object.
1009
  * @return bool
1010
  */
1011
+ protected function can_see( $group ) {
1012
+
1013
+ // If it is not a hidden group, user can see it.
1014
+ if ( 'hidden' !== $group->status ) {
1015
+ return true;
1016
+ }
1017
+
1018
+ // Check for moderators or if user is a member of the group.
1019
+ return ( bp_current_user_can( 'bp_moderate' ) || groups_is_user_member( bp_loggedin_user_id(), $group->id ) );
1020
  }
1021
 
1022
  /**
1028
  * @return bool
1029
  */
1030
  protected function can_see_hidden_groups( $request ) {
1031
+ if ( bp_current_user_can( 'bp_moderate' ) ) {
1032
+ return true;
 
 
 
 
 
 
 
 
 
1033
  }
1034
 
1035
+ return (
1036
+ is_user_logged_in()
1037
+ && isset( $request['user_id'] )
1038
+ && absint( $request['user_id'] ) === bp_loggedin_user_id()
1039
+ );
1040
  }
1041
 
1042
  /**
1074
  * @return array Endpoint arguments.
1075
  */
1076
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
1077
+ $args = parent::get_endpoint_args_for_item_schema( $method );
1078
  $key = 'get_item';
1079
 
1080
  if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) {
1083
 
1084
  // Add group types.
1085
  $args['types'] = array(
1086
+ 'description' => __( 'Assign one or more type to a group. To assign more than one type, use a comma separated list of types.', 'buddypress' ),
1087
+ 'type' => 'string',
1088
  'enum' => bp_groups_get_group_types(),
1089
  'sanitize_callback' => 'bp_rest_sanitize_group_types',
1090
  'validate_callback' => 'bp_rest_validate_group_types',
 
 
 
1091
  );
1092
 
1093
  if ( WP_REST_Server::EDITABLE === $method ) {
1094
  $key = 'update_item';
1095
  unset( $args['slug'] );
1096
+
1097
+ // Append group types.
1098
+ $args['append_types'] = array(
1099
+ 'description' => __( 'Append one or more type to a group. To append more than one type, use a comma separated list of types.', 'buddypress' ),
1100
+ 'type' => 'string',
1101
+ 'enum' => bp_groups_get_group_types(),
1102
+ 'sanitize_callback' => 'bp_rest_sanitize_group_types',
1103
+ 'validate_callback' => 'bp_rest_validate_group_types',
1104
+ );
1105
+
1106
+ // Remove group types.
1107
+ $args['remove_types'] = array(
1108
+ 'description' => __( 'Remove one or more type of a group. To remove more than one type, use a comma separated list of types.', 'buddypress' ),
1109
+ 'type' => 'string',
1110
+ 'enum' => bp_groups_get_group_types(),
1111
+ 'sanitize_callback' => 'bp_rest_sanitize_group_types',
1112
+ 'validate_callback' => 'bp_rest_validate_group_types',
1113
+ );
1114
  }
1115
  } elseif ( WP_REST_Server::DELETABLE === $method ) {
1116
  $key = 'delete_item';
1255
  ),
1256
  ),
1257
  'total_member_count' => array(
1258
+ 'context' => array( 'view', 'edit' ),
1259
  'description' => __( 'Count of all Group members.', 'buddypress' ),
1260
  'readonly' => true,
1261
  'type' => 'integer',
1262
  ),
1263
  'last_activity' => array(
1264
+ 'context' => array( 'view', 'edit' ),
1265
  'description' => __( "The date the Group was last active, in the site's timezone.", 'buddypress' ),
1266
  'type' => 'string',
1267
  'readonly' => true,
1268
  'format' => 'date-time',
1269
  ),
1270
+ 'last_activity_diff' => array(
1271
+ 'context' => array( 'view', 'edit' ),
1272
+ 'description' => __( "The human diff time the Group was last active, in the site's timezone.", 'buddypress' ),
1273
+ 'type' => 'string',
1274
+ 'readonly' => true,
1275
+ ),
1276
  ),
1277
  );
1278
 
1432
  'validate_callback' => 'rest_validate_request_arg',
1433
  );
1434
 
1435
+ $params['populate_extras'] = array(
1436
+ 'description' => __( 'Whether to fetch extra BP data about the returned groups.', 'buddypress' ),
1437
+ 'default' => false,
1438
+ 'type' => 'boolean',
1439
+ 'sanitize_callback' => 'rest_sanitize_boolean',
1440
+ 'validate_callback' => 'rest_validate_request_arg',
1441
+ );
1442
+
1443
  /**
1444
  * Filters the collection query params.
1445
  *
bp-groups/css/blocks/group-rtl.css CHANGED
@@ -1,4 +1,11 @@
1
  /* CSS for the bp/group block */
 
 
 
 
 
 
 
2
  .bp-block-group {
3
  position: relative;
4
  }
@@ -7,24 +14,38 @@
7
  display: flex;
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  .bp-block-group.has-cover .group-content,
11
  .bp-block-group.has-cover .item-header-avatar,
12
  .bp-block-group.has-cover .group-description {
13
  z-index: 2;
14
  }
15
 
16
- .bp-block-group .group-description {
17
- width: 100%;
18
  }
19
 
20
  .bp-block-group.has-cover .group-description {
21
  padding-top: 75px;
22
  }
23
 
24
- .bp-block-group.avatar-full .group-description {
25
- padding-right: 35px;
26
- }
27
-
28
  .bp-block-group.has-cover .bp-group-cover-image {
29
  background-color: #c5c5c5;
30
  background-position: center top;
@@ -55,30 +76,38 @@
55
  min-height: 200px;
56
  }
57
 
58
- .bp-block-group.avatar-full {
59
- min-height: 150px;
60
  }
61
 
62
- .bp-block-group.avatar-full.has-cover {
63
- min-height: 300px;
64
  }
65
 
66
  .bp-block-group.avatar-full .item-header-avatar {
67
  width: 180px;
68
  }
69
 
70
- .bp-block-group.has-cover.avatar-full .item-header-avatar {
 
 
 
 
 
 
 
 
71
  width: 200px;
72
  }
73
 
74
- .bp-block-group.has-cover.avatar-full img.avatar {
75
  border: solid 2px #fff;
76
  background: rgba(255, 255, 255, 0.8);
77
  margin-right: 20px;
78
  }
79
 
80
- .bp-block-group.has-cover .group-content {
81
- padding-top: 75px;
82
  }
83
 
84
  .bp-block-group.avatar-thumb .item-header-avatar img.avatar {
@@ -90,28 +119,10 @@
90
  align-items: center;
91
  }
92
 
93
- .bp-block-group .group-description-content {
94
- width: 100%;
95
- margin-bottom: 18px;
96
- }
97
-
98
- .bp-block-group.avatar-thumb .item-header-avatar {
99
- width: 70px;
100
- }
101
-
102
  .bp-block-group.avatar-thumb.has-cover .item-header-avatar {
103
  padding-top: 75px;
104
  }
105
 
106
- .bp-block-group .bp-profile-button {
107
- width: 100%;
108
- overflow: hidden;
109
- }
110
-
111
- .bp-block-group .bp-profile-button a.button {
112
- margin: 18px 0 0;
113
- }
114
-
115
  .bp-block-group.has-description .bp-profile-button a.button {
116
  display: block;
117
  float: left;
1
  /* CSS for the bp/group block */
2
+ [data-type="bp/group"] input.components-placeholder__input {
3
+ flex: 1 1 auto;
4
+ border-radius: 2px;
5
+ border: 1px solid #757575;
6
+ padding: 6px 8px;
7
+ }
8
+
9
  .bp-block-group {
10
  position: relative;
11
  }
14
  display: flex;
15
  }
16
 
17
+ .bp-block-group .group-description {
18
+ width: 100%;
19
+ }
20
+
21
+ .bp-block-group .group-description-content {
22
+ width: 100%;
23
+ margin-bottom: 18px;
24
+ }
25
+
26
+ .bp-block-group .bp-profile-button {
27
+ width: 100%;
28
+ overflow: hidden;
29
+ }
30
+
31
+ .bp-block-group .bp-profile-button a.button {
32
+ margin: 18px 0 0;
33
+ }
34
+
35
  .bp-block-group.has-cover .group-content,
36
  .bp-block-group.has-cover .item-header-avatar,
37
  .bp-block-group.has-cover .group-description {
38
  z-index: 2;
39
  }
40
 
41
+ .bp-block-group.has-cover .group-content {
42
+ padding-top: 75px;
43
  }
44
 
45
  .bp-block-group.has-cover .group-description {
46
  padding-top: 75px;
47
  }
48
 
 
 
 
 
49
  .bp-block-group.has-cover .bp-group-cover-image {
50
  background-color: #c5c5c5;
51
  background-position: center top;
76
  min-height: 200px;
77
  }
78
 
79
+ .bp-block-group.avatar-none.has-cover .item-header-avatar {
80
+ padding-top: 75px;
81
  }
82
 
83
+ .bp-block-group.avatar-full {
84
+ min-height: 150px;
85
  }
86
 
87
  .bp-block-group.avatar-full .item-header-avatar {
88
  width: 180px;
89
  }
90
 
91
+ .bp-block-group.avatar-full .group-description {
92
+ padding-right: 35px;
93
+ }
94
+
95
+ .bp-block-group.avatar-full.has-cover {
96
+ min-height: 300px;
97
+ }
98
+
99
+ .bp-block-group.avatar-full.has-cover .item-header-avatar {
100
  width: 200px;
101
  }
102
 
103
+ .bp-block-group.avatar-full.has-cover img.avatar {
104
  border: solid 2px #fff;
105
  background: rgba(255, 255, 255, 0.8);
106
  margin-right: 20px;
107
  }
108
 
109
+ .bp-block-group.avatar-thumb .item-header-avatar {
110
+ width: 70px;
111
  }
112
 
113
  .bp-block-group.avatar-thumb .item-header-avatar img.avatar {
119
  align-items: center;
120
  }
121
 
 
 
 
 
 
 
 
 
 
122
  .bp-block-group.avatar-thumb.has-cover .item-header-avatar {
123
  padding-top: 75px;
124
  }
125
 
 
 
 
 
 
 
 
 
 
126
  .bp-block-group.has-description .bp-profile-button a.button {
127
  display: block;
128
  float: left;
bp-groups/css/blocks/group-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .bp-block-group{position:relative}.bp-block-group .group-content{display:flex}.bp-block-group.has-cover .group-content,.bp-block-group.has-cover .group-description,.bp-block-group.has-cover .item-header-avatar{z-index:2}.bp-block-group .group-description{width:100%}.bp-block-group.has-cover .group-description{padding-top:75px}.bp-block-group.avatar-full .group-description{padding-right:35px}.bp-block-group.has-cover .bp-group-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;height:150px}.bp-block-group img.avatar{width:auto;height:auto}.bp-block-group.avatar-none .item-header-avatar{display:none}.bp-block-group.avatar-none.has-cover{min-height:200px}.bp-block-group.avatar-full{min-height:150px}.bp-block-group.avatar-full.has-cover{min-height:300px}.bp-block-group.avatar-full .item-header-avatar{width:180px}.bp-block-group.has-cover.avatar-full .item-header-avatar{width:200px}.bp-block-group.has-cover.avatar-full img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-right:20px}.bp-block-group.has-cover .group-content{padding-top:75px}.bp-block-group.avatar-thumb .item-header-avatar img.avatar{margin-top:15px}.bp-block-group.avatar-thumb:not(.has-description) .group-content{min-height:50px;align-items:center}.bp-block-group .group-description-content{width:100%;margin-bottom:18px}.bp-block-group.avatar-thumb .item-header-avatar{width:70px}.bp-block-group.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-group .bp-profile-button{width:100%;overflow:hidden}.bp-block-group .bp-profile-button a.button{margin:18px 0 0}.bp-block-group.has-description .bp-profile-button a.button{display:block;float:left}
1
+ [data-type="bp/group"] input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}.bp-block-group{position:relative}.bp-block-group .group-content{display:flex}.bp-block-group .group-description{width:100%}.bp-block-group .group-description-content{width:100%;margin-bottom:18px}.bp-block-group .bp-profile-button{width:100%;overflow:hidden}.bp-block-group .bp-profile-button a.button{margin:18px 0 0}.bp-block-group.has-cover .group-content,.bp-block-group.has-cover .group-description,.bp-block-group.has-cover .item-header-avatar{z-index:2}.bp-block-group.has-cover .group-content{padding-top:75px}.bp-block-group.has-cover .group-description{padding-top:75px}.bp-block-group.has-cover .bp-group-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;height:150px}.bp-block-group img.avatar{width:auto;height:auto}.bp-block-group.avatar-none .item-header-avatar{display:none}.bp-block-group.avatar-none.has-cover{min-height:200px}.bp-block-group.avatar-none.has-cover .item-header-avatar{padding-top:75px}.bp-block-group.avatar-full{min-height:150px}.bp-block-group.avatar-full .item-header-avatar{width:180px}.bp-block-group.avatar-full .group-description{padding-right:35px}.bp-block-group.avatar-full.has-cover{min-height:300px}.bp-block-group.avatar-full.has-cover .item-header-avatar{width:200px}.bp-block-group.avatar-full.has-cover img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-right:20px}.bp-block-group.avatar-thumb .item-header-avatar{width:70px}.bp-block-group.avatar-thumb .item-header-avatar img.avatar{margin-top:15px}.bp-block-group.avatar-thumb:not(.has-description) .group-content{min-height:50px;align-items:center}.bp-block-group.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-group.has-description .bp-profile-button a.button{display:block;float:left}
bp-groups/css/blocks/group.css CHANGED
@@ -1,4 +1,11 @@
1
  /* CSS for the bp/group block */
 
 
 
 
 
 
 
2
  .bp-block-group {
3
  position: relative;
4
  }
@@ -7,24 +14,38 @@
7
  display: flex;
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  .bp-block-group.has-cover .group-content,
11
  .bp-block-group.has-cover .item-header-avatar,
12
  .bp-block-group.has-cover .group-description {
13
  z-index: 2;
14
  }
15
 
16
- .bp-block-group .group-description {
17
- width: 100%;
18
  }
19
 
20
  .bp-block-group.has-cover .group-description {
21
  padding-top: 75px;
22
  }
23
 
24
- .bp-block-group.avatar-full .group-description {
25
- padding-left: 35px;
26
- }
27
-
28
  .bp-block-group.has-cover .bp-group-cover-image {
29
  background-color: #c5c5c5;
30
  background-position: center top;
@@ -55,30 +76,38 @@
55
  min-height: 200px;
56
  }
57
 
58
- .bp-block-group.avatar-full {
59
- min-height: 150px;
60
  }
61
 
62
- .bp-block-group.avatar-full.has-cover {
63
- min-height: 300px;
64
  }
65
 
66
  .bp-block-group.avatar-full .item-header-avatar {
67
  width: 180px;
68
  }
69
 
70
- .bp-block-group.has-cover.avatar-full .item-header-avatar {
 
 
 
 
 
 
 
 
71
  width: 200px;
72
  }
73
 
74
- .bp-block-group.has-cover.avatar-full img.avatar {
75
  border: solid 2px #fff;
76
  background: rgba(255, 255, 255, 0.8);
77
  margin-left: 20px;
78
  }
79
 
80
- .bp-block-group.has-cover .group-content {
81
- padding-top: 75px;
82
  }
83
 
84
  .bp-block-group.avatar-thumb .item-header-avatar img.avatar {
@@ -90,28 +119,10 @@
90
  align-items: center;
91
  }
92
 
93
- .bp-block-group .group-description-content {
94
- width: 100%;
95
- margin-bottom: 18px;
96
- }
97
-
98
- .bp-block-group.avatar-thumb .item-header-avatar {
99
- width: 70px;
100
- }
101
-
102
  .bp-block-group.avatar-thumb.has-cover .item-header-avatar {
103
  padding-top: 75px;
104
  }
105
 
106
- .bp-block-group .bp-profile-button {
107
- width: 100%;
108
- overflow: hidden;
109
- }
110
-
111
- .bp-block-group .bp-profile-button a.button {
112
- margin: 18px 0 0;
113
- }
114
-
115
  .bp-block-group.has-description .bp-profile-button a.button {
116
  display: block;
117
  float: right;
1
  /* CSS for the bp/group block */
2
+ [data-type="bp/group"] input.components-placeholder__input {
3
+ flex: 1 1 auto;
4
+ border-radius: 2px;
5
+ border: 1px solid #757575;
6
+ padding: 6px 8px;
7
+ }
8
+
9
  .bp-block-group {
10
  position: relative;
11
  }
14
  display: flex;
15
  }
16
 
17
+ .bp-block-group .group-description {
18
+ width: 100%;
19
+ }
20
+
21
+ .bp-block-group .group-description-content {
22
+ width: 100%;
23
+ margin-bottom: 18px;
24
+ }
25
+
26
+ .bp-block-group .bp-profile-button {
27
+ width: 100%;
28
+ overflow: hidden;
29
+ }
30
+
31
+ .bp-block-group .bp-profile-button a.button {
32
+ margin: 18px 0 0;
33
+ }
34
+
35
  .bp-block-group.has-cover .group-content,
36
  .bp-block-group.has-cover .item-header-avatar,
37
  .bp-block-group.has-cover .group-description {
38
  z-index: 2;
39
  }
40
 
41
+ .bp-block-group.has-cover .group-content {
42
+ padding-top: 75px;
43
  }
44
 
45
  .bp-block-group.has-cover .group-description {
46
  padding-top: 75px;
47
  }
48
 
 
 
 
 
49
  .bp-block-group.has-cover .bp-group-cover-image {
50
  background-color: #c5c5c5;
51
  background-position: center top;
76
  min-height: 200px;
77
  }
78
 
79
+ .bp-block-group.avatar-none.has-cover .item-header-avatar {
80
+ padding-top: 75px;
81
  }
82
 
83
+ .bp-block-group.avatar-full {
84
+ min-height: 150px;
85
  }
86
 
87
  .bp-block-group.avatar-full .item-header-avatar {
88
  width: 180px;
89
  }
90
 
91
+ .bp-block-group.avatar-full .group-description {
92
+ padding-left: 35px;
93
+ }
94
+
95
+ .bp-block-group.avatar-full.has-cover {
96
+ min-height: 300px;
97
+ }
98
+
99
+ .bp-block-group.avatar-full.has-cover .item-header-avatar {
100
  width: 200px;
101
  }
102
 
103
+ .bp-block-group.avatar-full.has-cover img.avatar {
104
  border: solid 2px #fff;
105
  background: rgba(255, 255, 255, 0.8);
106
  margin-left: 20px;
107
  }
108
 
109
+ .bp-block-group.avatar-thumb .item-header-avatar {
110
+ width: 70px;
111
  }
112
 
113
  .bp-block-group.avatar-thumb .item-header-avatar img.avatar {
119
  align-items: center;
120
  }
121
 
 
 
 
 
 
 
 
 
 
122
  .bp-block-group.avatar-thumb.has-cover .item-header-avatar {
123
  padding-top: 75px;
124
  }
125
 
 
 
 
 
 
 
 
 
 
126
  .bp-block-group.has-description .bp-profile-button a.button {
127
  display: block;
128
  float: right;
bp-groups/css/blocks/group.min.css CHANGED
@@ -1 +1 @@
1
- .bp-block-group{position:relative}.bp-block-group .group-content{display:flex}.bp-block-group.has-cover .group-content,.bp-block-group.has-cover .group-description,.bp-block-group.has-cover .item-header-avatar{z-index:2}.bp-block-group .group-description{width:100%}.bp-block-group.has-cover .group-description{padding-top:75px}.bp-block-group.avatar-full .group-description{padding-left:35px}.bp-block-group.has-cover .bp-group-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;height:150px}.bp-block-group img.avatar{width:auto;height:auto}.bp-block-group.avatar-none .item-header-avatar{display:none}.bp-block-group.avatar-none.has-cover{min-height:200px}.bp-block-group.avatar-full{min-height:150px}.bp-block-group.avatar-full.has-cover{min-height:300px}.bp-block-group.avatar-full .item-header-avatar{width:180px}.bp-block-group.has-cover.avatar-full .item-header-avatar{width:200px}.bp-block-group.has-cover.avatar-full img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-left:20px}.bp-block-group.has-cover .group-content{padding-top:75px}.bp-block-group.avatar-thumb .item-header-avatar img.avatar{margin-top:15px}.bp-block-group.avatar-thumb:not(.has-description) .group-content{min-height:50px;align-items:center}.bp-block-group .group-description-content{width:100%;margin-bottom:18px}.bp-block-group.avatar-thumb .item-header-avatar{width:70px}.bp-block-group.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-group .bp-profile-button{width:100%;overflow:hidden}.bp-block-group .bp-profile-button a.button{margin:18px 0 0}.bp-block-group.has-description .bp-profile-button a.button{display:block;float:right}
1
+ [data-type="bp/group"] input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}.bp-block-group{position:relative}.bp-block-group .group-content{display:flex}.bp-block-group .group-description{width:100%}.bp-block-group .group-description-content{width:100%;margin-bottom:18px}.bp-block-group .bp-profile-button{width:100%;overflow:hidden}.bp-block-group .bp-profile-button a.button{margin:18px 0 0}.bp-block-group.has-cover .group-content,.bp-block-group.has-cover .group-description,.bp-block-group.has-cover .item-header-avatar{z-index:2}.bp-block-group.has-cover .group-content{padding-top:75px}.bp-block-group.has-cover .group-description{padding-top:75px}.bp-block-group.has-cover .bp-group-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;height:150px}.bp-block-group img.avatar{width:auto;height:auto}.bp-block-group.avatar-none .item-header-avatar{display:none}.bp-block-group.avatar-none.has-cover{min-height:200px}.bp-block-group.avatar-none.has-cover .item-header-avatar{padding-top:75px}.bp-block-group.avatar-full{min-height:150px}.bp-block-group.avatar-full .item-header-avatar{width:180px}.bp-block-group.avatar-full .group-description{padding-left:35px}.bp-block-group.avatar-full.has-cover{min-height:300px}.bp-block-group.avatar-full.has-cover .item-header-avatar{width:200px}.bp-block-group.avatar-full.has-cover img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-left:20px}.bp-block-group.avatar-thumb .item-header-avatar{width:70px}.bp-block-group.avatar-thumb .item-header-avatar img.avatar{margin-top:15px}.bp-block-group.avatar-thumb:not(.has-description) .group-content{min-height:50px;align-items:center}.bp-block-group.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-group.has-description .bp-profile-button a.button{display:block;float:right}
bp-groups/css/blocks/groups-rtl.css ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/groups"] .components-placeholder.is-appender {
3
+ min-height: 0;
4
+ }
5
+
6
+ [data-type="bp/groups"] .components-placeholder.is-appender .components-placeholder__label:empty {
7
+ display: none;
8
+ }
9
+
10
+ [data-type="bp/groups"] .components-placeholder input.components-placeholder__input {
11
+ flex: 1 1 auto;
12
+ border-radius: 2px;
13
+ border: 1px solid #757575;
14
+ padding: 6px 8px;
15
+ }
16
+
17
+ [data-type="bp/groups"].avatar-none .group-description {
18
+ width: calc(100% - 44px);
19
+ }
20
+
21
+ [data-type="bp/groups"].avatar-full .group-description {
22
+ width: calc(100% - 224px);
23
+ }
24
+
25
+ [data-type="bp/groups"].avatar-thumb .group-description {
26
+ width: calc(100% - 114px);
27
+ }
28
+
29
+ [data-type="bp/groups"] .group-content {
30
+ position: relative;
31
+ }
32
+
33
+ [data-type="bp/groups"] .group-content .is-right {
34
+ position: absolute;
35
+ top: 2px;
36
+ left: 2px;
37
+ }
38
+
39
+ [data-type="bp/groups"] .columns-2 .group-content .group-description,
40
+ [data-type="bp/groups"] .columns-3 .group-content .group-description,
41
+ [data-type="bp/groups"] .columns-4 .group-content .group-description {
42
+ padding-right: 44px;
43
+ width: calc(100% - 44px);
44
+ }
45
+
46
+ [data-type="bp/groups"] .columns-3 .is-right {
47
+ left: -10px;
48
+ }
49
+
50
+ [data-type="bp/groups"] .columns-4 .is-right {
51
+ left: -50px;
52
+ }
53
+
54
+ .bp-block-groups.is-grid {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ padding: 0;
58
+ }
59
+
60
+ .bp-block-groups.is-grid .group-content {
61
+ margin: 0 0 1.25em 1.25em;
62
+ width: 100%;
63
+ }
64
+
65
+ @media (min-width: 600px) {
66
+ .bp-block-groups.columns-2 .group-content {
67
+ width: calc((100% / 2) - 1.25em + (1.25em / 2));
68
+ }
69
+ .bp-block-groups.columns-2 .group-content:nth-child(2n) {
70
+ margin-left: 0;
71
+ }
72
+ .bp-block-groups.columns-3 .group-content {
73
+ width: calc((100% / 3) - 1.25em + (1.25em / 3));
74
+ }
75
+ .bp-block-groups.columns-3 .group-content:nth-child(3n) {
76
+ margin-left: 0;
77
+ }
78
+ .bp-block-groups.columns-4 .group-content {
79
+ width: calc((100% / 4) - 1.25em + (1.25em / 4));
80
+ }
81
+ .bp-block-groups.columns-4 .group-content:nth-child(4n) {
82
+ margin-left: 0;
83
+ }
84
+ }
85
+
86
+ .bp-block-groups .group-content {
87
+ display: flex;
88
+ flex-direction: column;
89
+ padding-bottom: 1em;
90
+ text-align: center;
91
+ }
92
+
93
+ .bp-block-groups .group-content .item-header-avatar,
94
+ .bp-block-groups .group-content .group-description {
95
+ width: 100%;
96
+ }
97
+
98
+ .bp-block-groups .group-content .item-header-avatar {
99
+ margin: 0 auto;
100
+ }
101
+
102
+ .bp-block-groups .group-content .item-header-avatar img.avatar {
103
+ display: inline-block;
104
+ }
105
+
106
+ @media (min-width: 600px) {
107
+ .bp-block-groups .group-content {
108
+ flex-direction: row;
109
+ text-align: right;
110
+ }
111
+ .bp-block-groups .group-content .item-header-avatar,
112
+ .bp-block-groups .group-content .group-description {
113
+ width: auto;
114
+ }
115
+ .bp-block-groups .group-content .item-header-avatar {
116
+ margin: 0;
117
+ }
118
+ }
119
+
120
+ .bp-block-groups .group-content time {
121
+ display: block;
122
+ font-size: 80%;
123
+ color: #767676;
124
+ }
125
+
126
+ .bp-block-groups.avatar-none .item-header-avatar {
127
+ display: none;
128
+ }
129
+
130
+ .bp-block-groups.avatar-full {
131
+ min-height: 190px;
132
+ }
133
+
134
+ .bp-block-groups.avatar-full .item-header-avatar {
135
+ width: 180px;
136
+ }
137
+
138
+ .bp-block-groups.avatar-thumb .group-content {
139
+ min-height: 80px;
140
+ }
141
+
142
+ .bp-block-groups.avatar-thumb .item-header-avatar {
143
+ width: 70px;
144
+ }
145
+
146
+ .bp-block-groups.columns-2 .group-content,
147
+ .bp-block-groups.columns-3 .group-content,
148
+ .bp-block-groups.columns-4 .group-content {
149
+ display: block;
150
+ text-align: center;
151
+ }
152
+
153
+ .bp-block-groups.columns-2 .group-content .item-header-avatar,
154
+ .bp-block-groups.columns-3 .group-content .item-header-avatar,
155
+ .bp-block-groups.columns-4 .group-content .item-header-avatar {
156
+ margin: 0 auto;
157
+ }
158
+
159
+ .bp-block-groups img.avatar {
160
+ width: auto;
161
+ height: auto;
162
+ max-width: -webkit-fit-content;
163
+ max-width: fit-content;
164
+ }
165
+
166
+ .bp-block-groups .member-content.has-description {
167
+ align-items: center;
168
+ }
169
+
170
+ .bp-block-groups .member-content.has-description .item-header-avatar {
171
+ padding-left: 1em;
172
+ }
173
+
174
+ .bp-block-groups .member-content.has-description .group-description-content {
175
+ margin-bottom: 0;
176
+ text-align: right;
177
+ }
bp-groups/css/blocks/groups-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [data-type="bp/groups"] .components-placeholder.is-appender{min-height:0}[data-type="bp/groups"] .components-placeholder.is-appender .components-placeholder__label:empty{display:none}[data-type="bp/groups"] .components-placeholder input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}[data-type="bp/groups"].avatar-none .group-description{width:calc(100% - 44px)}[data-type="bp/groups"].avatar-full .group-description{width:calc(100% - 224px)}[data-type="bp/groups"].avatar-thumb .group-description{width:calc(100% - 114px)}[data-type="bp/groups"] .group-content{position:relative}[data-type="bp/groups"] .group-content .is-right{position:absolute;top:2px;left:2px}[data-type="bp/groups"] .columns-2 .group-content .group-description,[data-type="bp/groups"] .columns-3 .group-content .group-description,[data-type="bp/groups"] .columns-4 .group-content .group-description{padding-right:44px;width:calc(100% - 44px)}[data-type="bp/groups"] .columns-3 .is-right{left:-10px}[data-type="bp/groups"] .columns-4 .is-right{left:-50px}.bp-block-groups.is-grid{display:flex;flex-wrap:wrap;padding:0}.bp-block-groups.is-grid .group-content{margin:0 0 1.25em 1.25em;width:100%}@media (min-width:600px){.bp-block-groups.columns-2 .group-content{width:calc((100% / 2) - 1.25em + (1.25em / 2))}.bp-block-groups.columns-2 .group-content:nth-child(2n){margin-left:0}.bp-block-groups.columns-3 .group-content{width:calc((100% / 3) - 1.25em + (1.25em / 3))}.bp-block-groups.columns-3 .group-content:nth-child(3n){margin-left:0}.bp-block-groups.columns-4 .group-content{width:calc((100% / 4) - 1.25em + (1.25em / 4))}.bp-block-groups.columns-4 .group-content:nth-child(4n){margin-left:0}}.bp-block-groups .group-content{display:flex;flex-direction:column;padding-bottom:1em;text-align:center}.bp-block-groups .group-content .group-description,.bp-block-groups .group-content .item-header-avatar{width:100%}.bp-block-groups .group-content .item-header-avatar{margin:0 auto}.bp-block-groups .group-content .item-header-avatar img.avatar{display:inline-block}@media (min-width:600px){.bp-block-groups .group-content{flex-direction:row;text-align:right}.bp-block-groups .group-content .group-description,.bp-block-groups .group-content .item-header-avatar{width:auto}.bp-block-groups .group-content .item-header-avatar{margin:0}}.bp-block-groups .group-content time{display:block;font-size:80%;color:#767676}.bp-block-groups.avatar-none .item-header-avatar{display:none}.bp-block-groups.avatar-full{min-height:190px}.bp-block-groups.avatar-full .item-header-avatar{width:180px}.bp-block-groups.avatar-thumb .group-content{min-height:80px}.bp-block-groups.avatar-thumb .item-header-avatar{width:70px}.bp-block-groups.columns-2 .group-content,.bp-block-groups.columns-3 .group-content,.bp-block-groups.columns-4 .group-content{display:block;text-align:center}.bp-block-groups.columns-2 .group-content .item-header-avatar,.bp-block-groups.columns-3 .group-content .item-header-avatar,.bp-block-groups.columns-4 .group-content .item-header-avatar{margin:0 auto}.bp-block-groups img.avatar{width:auto;height:auto;max-width:-webkit-fit-content;max-width:fit-content}.bp-block-groups .member-content.has-description{align-items:center}.bp-block-groups .member-content.has-description .item-header-avatar{padding-left:1em}.bp-block-groups .member-content.has-description .group-description-content{margin-bottom:0;text-align:right}
bp-groups/css/blocks/groups.css ADDED
@@ -0,0 +1,177 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/groups"] .components-placeholder.is-appender {
3
+ min-height: 0;
4
+ }
5
+
6
+ [data-type="bp/groups"] .components-placeholder.is-appender .components-placeholder__label:empty {
7
+ display: none;
8
+ }
9
+
10
+ [data-type="bp/groups"] .components-placeholder input.components-placeholder__input {
11
+ flex: 1 1 auto;
12
+ border-radius: 2px;
13
+ border: 1px solid #757575;
14
+ padding: 6px 8px;
15
+ }
16
+
17
+ [data-type="bp/groups"].avatar-none .group-description {
18
+ width: calc(100% - 44px);
19
+ }
20
+
21
+ [data-type="bp/groups"].avatar-full .group-description {
22
+ width: calc(100% - 224px);
23
+ }
24
+
25
+ [data-type="bp/groups"].avatar-thumb .group-description {
26
+ width: calc(100% - 114px);
27
+ }
28
+
29
+ [data-type="bp/groups"] .group-content {
30
+ position: relative;
31
+ }
32
+
33
+ [data-type="bp/groups"] .group-content .is-right {
34
+ position: absolute;
35
+ top: 2px;
36
+ right: 2px;
37
+ }
38
+
39
+ [data-type="bp/groups"] .columns-2 .group-content .group-description,
40
+ [data-type="bp/groups"] .columns-3 .group-content .group-description,
41
+ [data-type="bp/groups"] .columns-4 .group-content .group-description {
42
+ padding-left: 44px;
43
+ width: calc(100% - 44px);
44
+ }
45
+
46
+ [data-type="bp/groups"] .columns-3 .is-right {
47
+ right: -10px;
48
+ }
49
+
50
+ [data-type="bp/groups"] .columns-4 .is-right {
51
+ right: -50px;
52
+ }
53
+
54
+ .bp-block-groups.is-grid {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ padding: 0;
58
+ }
59
+
60
+ .bp-block-groups.is-grid .group-content {
61
+ margin: 0 1.25em 1.25em 0;
62
+ width: 100%;
63
+ }
64
+
65
+ @media (min-width: 600px) {
66
+ .bp-block-groups.columns-2 .group-content {
67
+ width: calc((100% / 2) - 1.25em + (1.25em / 2));
68
+ }
69
+ .bp-block-groups.columns-2 .group-content:nth-child(2n) {
70
+ margin-right: 0;
71
+ }
72
+ .bp-block-groups.columns-3 .group-content {
73
+ width: calc((100% / 3) - 1.25em + (1.25em / 3));
74
+ }
75
+ .bp-block-groups.columns-3 .group-content:nth-child(3n) {
76
+ margin-right: 0;
77
+ }
78
+ .bp-block-groups.columns-4 .group-content {
79
+ width: calc((100% / 4) - 1.25em + (1.25em / 4));
80
+ }
81
+ .bp-block-groups.columns-4 .group-content:nth-child(4n) {
82
+ margin-right: 0;
83
+ }
84
+ }
85
+
86
+ .bp-block-groups .group-content {
87
+ display: flex;
88
+ flex-direction: column;
89
+ padding-bottom: 1em;
90
+ text-align: center;
91
+ }
92
+
93
+ .bp-block-groups .group-content .item-header-avatar,
94
+ .bp-block-groups .group-content .group-description {
95
+ width: 100%;
96
+ }
97
+
98
+ .bp-block-groups .group-content .item-header-avatar {
99
+ margin: 0 auto;
100
+ }
101
+
102
+ .bp-block-groups .group-content .item-header-avatar img.avatar {
103
+ display: inline-block;
104
+ }
105
+
106
+ @media (min-width: 600px) {
107
+ .bp-block-groups .group-content {
108
+ flex-direction: row;
109
+ text-align: left;
110
+ }
111
+ .bp-block-groups .group-content .item-header-avatar,
112
+ .bp-block-groups .group-content .group-description {
113
+ width: auto;
114
+ }
115
+ .bp-block-groups .group-content .item-header-avatar {
116
+ margin: 0;
117
+ }
118
+ }
119
+
120
+ .bp-block-groups .group-content time {
121
+ display: block;
122
+ font-size: 80%;
123
+ color: #767676;
124
+ }
125
+
126
+ .bp-block-groups.avatar-none .item-header-avatar {
127
+ display: none;
128
+ }
129
+
130
+ .bp-block-groups.avatar-full {
131
+ min-height: 190px;
132
+ }
133
+
134
+ .bp-block-groups.avatar-full .item-header-avatar {
135
+ width: 180px;
136
+ }
137
+
138
+ .bp-block-groups.avatar-thumb .group-content {
139
+ min-height: 80px;
140
+ }
141
+
142
+ .bp-block-groups.avatar-thumb .item-header-avatar {
143
+ width: 70px;
144
+ }
145
+
146
+ .bp-block-groups.columns-2 .group-content,
147
+ .bp-block-groups.columns-3 .group-content,
148
+ .bp-block-groups.columns-4 .group-content {
149
+ display: block;
150
+ text-align: center;
151
+ }
152
+
153
+ .bp-block-groups.columns-2 .group-content .item-header-avatar,
154
+ .bp-block-groups.columns-3 .group-content .item-header-avatar,
155
+ .bp-block-groups.columns-4 .group-content .item-header-avatar {
156
+ margin: 0 auto;
157
+ }
158
+
159
+ .bp-block-groups img.avatar {
160
+ width: auto;
161
+ height: auto;
162
+ max-width: -webkit-fit-content;
163
+ max-width: fit-content;
164
+ }
165
+
166
+ .bp-block-groups .member-content.has-description {
167
+ align-items: center;
168
+ }
169
+
170
+ .bp-block-groups .member-content.has-description .item-header-avatar {
171
+ padding-right: 1em;
172
+ }
173
+
174
+ .bp-block-groups .member-content.has-description .group-description-content {
175
+ margin-bottom: 0;
176
+ text-align: left;
177
+ }
bp-groups/css/blocks/groups.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [data-type="bp/groups"] .components-placeholder.is-appender{min-height:0}[data-type="bp/groups"] .components-placeholder.is-appender .components-placeholder__label:empty{display:none}[data-type="bp/groups"] .components-placeholder input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}[data-type="bp/groups"].avatar-none .group-description{width:calc(100% - 44px)}[data-type="bp/groups"].avatar-full .group-description{width:calc(100% - 224px)}[data-type="bp/groups"].avatar-thumb .group-description{width:calc(100% - 114px)}[data-type="bp/groups"] .group-content{position:relative}[data-type="bp/groups"] .group-content .is-right{position:absolute;top:2px;right:2px}[data-type="bp/groups"] .columns-2 .group-content .group-description,[data-type="bp/groups"] .columns-3 .group-content .group-description,[data-type="bp/groups"] .columns-4 .group-content .group-description{padding-left:44px;width:calc(100% - 44px)}[data-type="bp/groups"] .columns-3 .is-right{right:-10px}[data-type="bp/groups"] .columns-4 .is-right{right:-50px}.bp-block-groups.is-grid{display:flex;flex-wrap:wrap;padding:0}.bp-block-groups.is-grid .group-content{margin:0 1.25em 1.25em 0;width:100%}@media (min-width:600px){.bp-block-groups.columns-2 .group-content{width:calc((100% / 2) - 1.25em + (1.25em / 2))}.bp-block-groups.columns-2 .group-content:nth-child(2n){margin-right:0}.bp-block-groups.columns-3 .group-content{width:calc((100% / 3) - 1.25em + (1.25em / 3))}.bp-block-groups.columns-3 .group-content:nth-child(3n){margin-right:0}.bp-block-groups.columns-4 .group-content{width:calc((100% / 4) - 1.25em + (1.25em / 4))}.bp-block-groups.columns-4 .group-content:nth-child(4n){margin-right:0}}.bp-block-groups .group-content{display:flex;flex-direction:column;padding-bottom:1em;text-align:center}.bp-block-groups .group-content .group-description,.bp-block-groups .group-content .item-header-avatar{width:100%}.bp-block-groups .group-content .item-header-avatar{margin:0 auto}.bp-block-groups .group-content .item-header-avatar img.avatar{display:inline-block}@media (min-width:600px){.bp-block-groups .group-content{flex-direction:row;text-align:left}.bp-block-groups .group-content .group-description,.bp-block-groups .group-content .item-header-avatar{width:auto}.bp-block-groups .group-content .item-header-avatar{margin:0}}.bp-block-groups .group-content time{display:block;font-size:80%;color:#767676}.bp-block-groups.avatar-none .item-header-avatar{display:none}.bp-block-groups.avatar-full{min-height:190px}.bp-block-groups.avatar-full .item-header-avatar{width:180px}.bp-block-groups.avatar-thumb .group-content{min-height:80px}.bp-block-groups.avatar-thumb .item-header-avatar{width:70px}.bp-block-groups.columns-2 .group-content,.bp-block-groups.columns-3 .group-content,.bp-block-groups.columns-4 .group-content{display:block;text-align:center}.bp-block-groups.columns-2 .group-content .item-header-avatar,.bp-block-groups.columns-3 .group-content .item-header-avatar,.bp-block-groups.columns-4 .group-content .item-header-avatar{margin:0 auto}.bp-block-groups img.avatar{width:auto;height:auto;max-width:-webkit-fit-content;max-width:fit-content}.bp-block-groups .member-content.has-description{align-items:center}.bp-block-groups .member-content.has-description .item-header-avatar{padding-right:1em}.bp-block-groups .member-content.has-description .group-description-content{margin-bottom:0;text-align:left}
bp-groups/js/blocks/group.js CHANGED
@@ -1,4 +1,8 @@
1
- parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"pvse":[function(require,module,exports) {
2
- var e=wp.blocks.registerBlockType,t=wp.element,o=t.createElement,r=t.Fragment,s=wp.components,n=s.Placeholder,l=s.Disabled,a=s.PanelBody,p=s.SelectControl,i=s.ToggleControl,u=s.Toolbar,d=s.ToolbarButton,b=wp.blockEditor,c=b.InspectorControls,g=b.BlockControls,y=wp.data.withSelect,h=wp.compose.compose,m=wp.editor.ServerSideRender,v=wp.i18n.__,f=bp.blockComponents.AutoCompleter,C=[{label:v("None","buddypress"),value:"none"},{label:v("Thumb","buddypress"),value:"thumb"},{label:v("Full","buddypress"),value:"full"}],S=function(e){var t=e.attributes,s=e.setAttributes,b=e.bpSettings,y=b.isAvatarEnabled,h=b.isCoverImageEnabled,S=t.avatarSize,I=t.displayDescription,k=t.displayActionButton,w=t.displayCoverImage;return t.itemID?o(r,null,o(g,null,o(u,null,o(d,{icon:"edit",title:v("Select another group","buddypress"),onClick:function(){s({itemID:0})}}))),o(c,null,o(a,{title:v("Settings","buddypress"),initialOpen:!0},o(i,{label:v("Display Group's home button","buddypress"),checked:!!k,onChange:function(){s({displayActionButton:!k})},help:v(k?"Include a link to the group's home page under their name.":"Toggle to display a link to the group's home page under their name.","buddypress")}),o(i,{label:v("Display group's description","buddypress"),checked:!!I,onChange:function(){s({displayDescription:!I})},help:v(I?"Include the group's description under their name.":"Toggle to display the group's description under their name.","buddypress")}),y&&o(p,{label:v("Avatar size","buddypress"),value:S,options:C,help:v('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){s({avatarSize:e})}}),h&&o(i,{label:v("Display Cover Image","buddypress"),checked:!!w,onChange:function(){s({displayCoverImage:!w})},help:v(w?"Include the group's cover image over their name.":"Toggle to display the group's cover image over their name.","buddypress")}))),o(l,null,o(m,{block:"bp/group",attributes:t}))):o(n,{icon:"buddicons-groups",label:v("BuddyPress Group","buddypress"),instructions:v("Start typing the name of the group you want to feature into this post.","buddypress")},o(f,{component:"groups",objectStatus:"public",ariaLabel:v("Group's name","buddypress"),placeholder:v("Enter Group's name here…","buddypress"),onSelectItem:s,useAvatar:y}))},I=h([y(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.groups||{}}})])(S);e("bp/group",{title:v("Group","buddypress"),description:v("BuddyPress Group.","buddypress"),icon:"buddicons-groups",category:"buddypress",attributes:{itemID:{type:"integer",default:0},avatarSize:{type:"string",default:"full"},displayDescription:{type:"boolean",default:!0},displayActionButton:{type:"boolean",default:!0},displayCoverImage:{type:"boolean",default:!0}},edit:I});
3
- },{}]},{},["pvse"], null)
 
 
 
 
4
  //# sourceMappingURL=/bp-groups/js/blocks/group.js.map
1
+ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"atl5":[function(require,module,exports) {
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GROUP_STATI=exports.AVATAR_SIZES=void 0;var e=wp,s=e.i18n.__,d=[{label:s("None","buddypress"),value:"none"},{label:s("Thumb","buddypress"),value:"thumb"},{label:s("Full","buddypress"),value:"full"}];exports.AVATAR_SIZES=d;var r={public:s("Public","buddypress"),private:s("Private","buddypress"),hidden:s("Hidden","buddypress")};exports.GROUP_STATI=r;
3
+ },{}],"cCC3":[function(require,module,exports) {
4
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=wp,o=t.blockEditor,r=o.InspectorControls,n=o.BlockControls,s=t.components,a=s.Placeholder,i=s.Disabled,l=s.PanelBody,u=s.SelectControl,d=s.ToggleControl,p=s.Toolbar,c=s.ToolbarButton,g=t.compose.compose,b=t.data.withSelect,h=t.editor.ServerSideRender,y=t.element,m=y.Fragment,v=y.createElement,S=t.i18n.__,C=bp.blockComponents.AutoCompleter,I=function(t){return t&&t.status&&e.GROUP_STATI[t.status]?e.GROUP_STATI[t.status]:null},f=function(t){var o=t.attributes,s=t.setAttributes,g=t.bpSettings,b=g.isAvatarEnabled,y=g.isCoverImageEnabled,f=o.avatarSize,A=o.displayDescription,T=o.displayActionButton,k=o.displayCoverImage;return o.itemID?v(m,null,v(n,null,v(p,null,v(c,{icon:"edit",title:S("Select another group","buddypress"),onClick:function(){s({itemID:0})}}))),v(r,null,v(l,{title:S("Settings","buddypress"),initialOpen:!0},v(d,{label:S("Display Group's home button","buddypress"),checked:!!T,onChange:function(){s({displayActionButton:!T})},help:S(T?"Include a link to the group's home page under their name.":"Toggle to display a link to the group's home page under their name.","buddypress")}),v(d,{label:S("Display group's description","buddypress"),checked:!!A,onChange:function(){s({displayDescription:!A})},help:S(A?"Include the group's description under their name.":"Toggle to display the group's description under their name.","buddypress")}),b&&v(u,{label:S("Avatar size","buddypress"),value:f,options:e.AVATAR_SIZES,help:S('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){s({avatarSize:e})}}),y&&v(d,{label:S("Display Cover Image","buddypress"),checked:!!k,onChange:function(){s({displayCoverImage:!k})},help:S(k?"Include the group's cover image over their name.":"Toggle to display the group's cover image over their name.","buddypress")}))),v(i,null,v(h,{block:"bp/group",attributes:o}))):v(a,{icon:"buddicons-groups",label:S("BuddyPress Group","buddypress"),instructions:S("Start typing the name of the group you want to feature into this post.","buddypress")},v(C,{component:"groups",objectQueryArgs:{show_hidden:!1},slugValue:I,ariaLabel:S("Group's name","buddypress"),placeholder:S("Enter Group's name here…","buddypress"),onSelectItem:s,useAvatar:b}))},A=g([b(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.groups||{}}})])(f),T=A;exports.default=T;
5
+ },{"./constants":"atl5"}],"pvse":[function(require,module,exports) {
6
+ "use strict";var e=t(require("./group/edit"));function t(e){return e&&e.__esModule?e:{default:e}}var r=wp,u=r.blocks.registerBlockType,d=r.i18n.__;u("bp/group",{title:d("Group","buddypress"),description:d("BuddyPress Group.","buddypress"),icon:"buddicons-groups",category:"buddypress",attributes:{itemID:{type:"integer",default:0},avatarSize:{type:"string",default:"full"},displayDescription:{type:"boolean",default:!0},displayActionButton:{type:"boolean",default:!0},displayCoverImage:{type:"boolean",default:!0}},edit:e.default});
7
+ },{"./group/edit":"cCC3"}]},{},["pvse"], null)
8
  //# sourceMappingURL=/bp-groups/js/blocks/group.js.map
bp-groups/js/blocks/group.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["bp-groups/js/blocks/group.js"],"names":["registerBlockType","wp","blocks","element","createElement","Fragment","components","Placeholder","Disabled","PanelBody","SelectControl","ToggleControl","Toolbar","ToolbarButton","blockEditor","InspectorControls","BlockControls","withSelect","data","compose","ServerSideRender","editor","__","i18n","AutoCompleter","bp","blockComponents","AVATAR_SIZES","label","value","editGroup","attributes","setAttributes","bpSettings","isAvatarEnabled","isCoverImageEnabled","avatarSize","displayDescription","displayActionButton","displayCoverImage","itemID","option","editGroupBlock","select","getEditorSettings","groups","title","description","icon","category","type","default","edit"],"mappings":";AAGQA,IAAAA,EAAsBC,GAAGC,OAAzBF,kBAC4BC,EAAAA,GAAGE,QAA/BC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,SAC4EJ,EAAAA,GAAGK,WAA9FC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,SAAUC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,QAASC,EAAAA,EAAAA,cACpCZ,EAAAA,GAAGa,YAAxCC,EAAAA,EAAAA,kBAAmBC,EAAAA,EAAAA,cACnBC,EAAehB,GAAGiB,KAAlBD,WACAE,EAAYlB,GAAGkB,QAAfA,QACAC,EAAqBnB,GAAGoB,OAAxBD,iBACAE,EAAOrB,GAAGsB,KAAVD,GAKAE,EAAkBC,GAAGC,gBAArBF,cAEFG,EAAe,CACpB,CACCC,MAAON,EAAI,OAAQ,cACnBO,MAAO,QAER,CACCD,MAAON,EAAI,QAAS,cACpBO,MAAO,SAER,CACCD,MAAON,EAAI,OAAQ,cACnBO,MAAO,SAIHC,EAAY,SAAiD,GAA7CC,IAAAA,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WACxCC,EAAyCD,EAAzCC,gBAAiBC,EAAwBF,EAAxBE,oBACjBC,EAA2EL,EAA3EK,WAAYC,EAA+DN,EAA/DM,mBAAoBC,EAA2CP,EAA3CO,oBAAqBC,EAAsBR,EAAtBQ,kBAExD,OAAER,EAAWS,OAoBjB,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAK,OACL,MAAQlB,EAAI,uBAAwB,cACpC,QAAU,WACTU,EAAe,CAAEQ,OAAQ,SAK7B,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQlB,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,8BAAgC,cAC5C,UAAagB,EACb,SAAW,WACVN,EAAe,CAAEM,qBAAuBA,KAEzC,KAEIhB,EADHgB,EACO,4DACA,sEAD8D,gBAKvE,EAAC,EAAD,CACC,MAAQhB,EAAI,8BAAgC,cAC5C,UAAae,EACb,SAAW,WACVL,EAAe,CAAEK,oBAAsBA,KAExC,KAEIf,EADHe,EACO,oDACA,8DADsD,gBAK7DH,GACD,EAAC,EAAD,CACC,MAAQZ,EAAI,cAAe,cAC3B,MAAQc,EACR,QAAUT,EACV,KAAOL,EAAI,uCAAwC,cACnD,SAAW,SAAEmB,GACZT,EAAe,CAAEI,WAAYK,OAK9BN,GACD,EAAC,EAAD,CACC,MAAQb,EAAI,sBAAuB,cACnC,UAAaiB,EACb,SAAW,WACVP,EAAe,CAAEO,mBAAqBA,KAEvC,KAEIjB,EADHiB,EACO,mDACA,6DADqD,kBAOjE,EAAC,EACA,KAAA,EAAC,EAAD,CAAkB,MAAM,WAAW,WAAaR,MAvFjD,EAAC,EAAD,CACC,KAAK,mBACL,MAAQT,EAAI,mBAAoB,cAChC,aAAeA,EAAI,yEAA0E,eAE7F,EAAC,EAAD,CACC,UAAU,SACV,aAAa,SACb,UAAYA,EAAI,eAAiB,cACjC,YAAcA,EAAI,2BAA6B,cAC/C,aAAeU,EACf,UAAYE,MAkFXQ,EAAiBvB,EAAS,CAC/BF,EAAY,SAAE0B,GAEN,MAAA,CACNV,WAFsBU,EAAQ,eAAgBC,oBAEnBnB,GAAGoB,QAAU,OAJpB1B,CAOlBW,GAEL9B,EAAmB,WAAY,CAC9B8C,MAAOxB,EAAI,QAAS,cAEpByB,YAAazB,EAAI,oBAAqB,cAEtC0B,KAAM,mBAENC,SAAU,aAEVlB,WAAY,CACXS,OAAQ,CACPU,KAAM,UACNC,QAAS,GAEVf,WAAY,CACXc,KAAM,SACNC,QAAS,QAEVd,mBAAoB,CACnBa,KAAM,UACNC,SAAS,GAEVb,oBAAqB,CACpBY,KAAM,UACNC,SAAS,GAEVZ,kBAAmB,CAClBW,KAAM,UACNC,SAAS,IAIXC,KAAMV","file":"group.js","sourceRoot":"../src/js","sourcesContent":["/**\n * WordPress dependencies.\n */\nconst { registerBlockType } = wp.blocks;\nconst { createElement, Fragment } = wp.element;\nconst { Placeholder, Disabled, PanelBody, SelectControl, ToggleControl, Toolbar, ToolbarButton } = wp.components;\nconst { InspectorControls, BlockControls } = wp.blockEditor;\nconst { withSelect } = wp.data;\nconst { compose } = wp.compose;\nconst { ServerSideRender } = wp.editor;\nconst { __ } = wp.i18n;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\nconst AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n\nconst editGroup = ( { attributes, setAttributes, bpSettings } ) => {\n\tconst { isAvatarEnabled, isCoverImageEnabled } = bpSettings;\n\tconst { avatarSize, displayDescription, displayActionButton, displayCoverImage } = attributes;\n\n\tif ( ! attributes.itemID ) {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon=\"buddicons-groups\"\n\t\t\t\tlabel={ __( 'BuddyPress Group', 'buddypress' ) }\n\t\t\t\tinstructions={ __( 'Start typing the name of the group you want to feature into this post.', 'buddypress' ) }\n\t\t\t>\n\t\t\t\t<AutoCompleter\n\t\t\t\t\tcomponent=\"groups\"\n\t\t\t\t\tobjectStatus=\"public\"\n\t\t\t\t\tariaLabel={ __( 'Group\\'s name', 'buddypress' ) }\n\t\t\t\t\tplaceholder={ __( 'Enter Group\\'s name here…', 'buddypress' ) }\n\t\t\t\t\tonSelectItem={ setAttributes }\n\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t/>\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<Toolbar>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\t\ttitle={ __( 'Select another group', 'buddypress' ) }\n\t\t\t\t\t\tonClick={ () =>{\n\t\t\t\t\t\t\tsetAttributes( { itemID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Toolbar>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display Group\\'s home button', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayActionButton }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayActionButton: ! displayActionButton } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayActionButton\n\t\t\t\t\t\t\t\t? __( 'Include a link to the group\\'s home page under their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display a link to the group\\'s home page under their name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display group\\'s description', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayDescription }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayDescription: ! displayDescription } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayDescription\n\t\t\t\t\t\t\t\t? __( 'Include the group\\'s description under their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display the group\\'s description under their name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isCoverImageEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Cover Image', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayCoverImage }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayCoverImage: ! displayCoverImage } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayCoverImage\n\t\t\t\t\t\t\t\t\t? __( 'Include the group\\'s cover image over their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the group\\'s cover image over their name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<Disabled>\n\t\t\t\t<ServerSideRender block=\"bp/group\" attributes={ attributes } />\n\t\t\t</Disabled>\n\t\t</Fragment>\n\t);\n};\n\nconst editGroupBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.groups || {},\n\t\t};\n\t} ),\n] )( editGroup );\n\nregisterBlockType( 'bp/group', {\n\ttitle: __( 'Group', 'buddypress' ),\n\n\tdescription: __( 'BuddyPress Group.', 'buddypress' ),\n\n\ticon: 'buddicons-groups',\n\n\tcategory: 'buddypress',\n\n\tattributes: {\n\t\titemID: {\n\t\t\ttype: 'integer',\n\t\t\tdefault: 0,\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayDescription: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayActionButton: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayCoverImage: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tedit: editGroupBlock,\n} );\n"]}
1
+ {"version":3,"sources":["bp-groups/js/blocks/group/constants.js","bp-groups/js/blocks/group/edit.js","bp-groups/js/blocks/group.js"],"names":["wp","__","i18n","AVATAR_SIZES","label","value","GROUP_STATI","public","private","hidden","editGroupBlock","blockEditor","InspectorControls","BlockControls","components","Placeholder","Disabled","PanelBody","SelectControl","ToggleControl","Toolbar","ToolbarButton","compose","withSelect","data","ServerSideRender","editor","element","Fragment","createElement","AutoCompleter","bp","blockComponents","getSlugValue","item","status","editGroup","attributes","setAttributes","bpSettings","isAvatarEnabled","isCoverImageEnabled","avatarSize","displayDescription","displayActionButton","displayCoverImage","itemID","option","select","getEditorSettings","groups","registerBlockType","blocks","title","description","icon","category","type","default","edit"],"mappings":";AAkCO,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,YAAA,QAAA,kBAAA,EA3BHA,IAAAA,EAAAA,GAFFC,EADDC,EAAAA,KACCD,GASWE,EAAe,CAC3B,CACCC,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,QAAS,cACpBI,MAAO,SAER,CACCD,MAAOH,EAAI,OAAQ,cACnBI,MAAO,SASF,QAAA,aAAA,EAAA,IAAMC,EAAc,CAC1BC,OAAQN,EAAI,SAAU,cACtBO,QAASP,EAAI,UAAW,cACxBQ,OAAQR,EAAI,SAAU,eAHhB,QAAA,YAAA;;ACgIQS,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAvHf,IAAA,EAAA,QAAA,eAVIV,EAAAA,GA7BHW,EAAAA,EAAAA,YACCC,EAAAA,EAAAA,kBACAC,EAAAA,EAAAA,cAEDC,EAAAA,EAAAA,WACCC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,cAGAC,EADDA,EAAAA,QACCA,QAGAC,EADDC,EAAAA,KACCD,WAGAE,EADDC,EAAAA,OACCD,iBAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAGA5B,EADDC,EAAAA,KACCD,GAOM6B,EAAkBC,GAAGC,gBAArBF,cAOFG,EAAe,SAAEC,GACjBA,OAAAA,GAAQA,EAAKC,QAAU7B,EAAa4B,YAAAA,EAAKC,QACtC7B,EAAa4B,YAAAA,EAAKC,QAGnB,MAGFC,EAAY,SAAiD,GAA7CC,IAAAA,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WACxCC,EAAyCD,EAAzCC,gBAAiBC,EAAwBF,EAAxBE,oBACjBC,EAA2EL,EAA3EK,WAAYC,EAA+DN,EAA/DM,mBAAoBC,EAA2CP,EAA3CO,oBAAqBC,EAAsBR,EAAtBQ,kBAExD,OAAER,EAAWS,OAqBjB,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAK,OACL,MAAQ7C,EAAI,uBAAwB,cACpC,QAAU,WACTqC,EAAe,CAAEQ,OAAQ,SAK7B,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQ7C,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,8BAAgC,cAC5C,UAAa2C,EACb,SAAW,WACVN,EAAe,CAAEM,qBAAuBA,KAEzC,KAEI3C,EADH2C,EACO,4DACA,sEAD8D,gBAKvE,EAAC,EAAD,CACC,MAAQ3C,EAAI,8BAAgC,cAC5C,UAAa0C,EACb,SAAW,WACVL,EAAe,CAAEK,oBAAsBA,KAExC,KAEI1C,EADH0C,EACO,oDACA,8DADsD,gBAK7DH,GACD,EAAC,EAAD,CACC,MAAQvC,EAAI,cAAe,cAC3B,MAAQyC,EACR,QAAUvC,EAHX,aAIC,KAAOF,EAAI,uCAAwC,cACnD,SAAW,SAAE8C,GACZT,EAAe,CAAEI,WAAYK,OAK9BN,GACD,EAAC,EAAD,CACC,MAAQxC,EAAI,sBAAuB,cACnC,UAAa4C,EACb,SAAW,WACVP,EAAe,CAAEO,mBAAqBA,KAEvC,KAEI5C,EADH4C,EACO,mDACA,6DADqD,kBAOjE,EAAC,EACA,KAAA,EAAC,EAAD,CAAkB,MAAM,WAAW,WAAaR,MAxFjD,EAAC,EAAD,CACC,KAAK,mBACL,MAAQpC,EAAI,mBAAoB,cAChC,aAAeA,EAAI,yEAA0E,eAE7F,EAAC,EAAD,CACC,UAAU,SACV,gBAAkB,CAAiB,aAAA,GACnC,UAAYgC,EACZ,UAAYhC,EAAI,eAAiB,cACjC,YAAcA,EAAI,2BAA6B,cAC/C,aAAeqC,EACf,UAAYE,MAkFX9B,EAAiBY,EAAS,CAC/BC,EAAY,SAAEyB,GAEN,MAAA,CACNT,WAFsBS,EAAQ,eAAgBC,oBAEnBlB,GAAGmB,QAAU,OAJpB5B,CAOlBc,GAEU1B,EAAAA,EAAAA,QAAAA,QAAAA;;ACjJf,aAFA,IAAA,EAAA,EAAA,QAAA,iBAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAPIV,IAAAA,EAAAA,GALFmD,EADDC,EAAAA,OACCD,kBAGAlD,EADDC,EAAAA,KACCD,GASFkD,EAAmB,WAAY,CAC9BE,MAAOpD,EAAI,QAAS,cACpBqD,YAAarD,EAAI,oBAAqB,cACtCsD,KAAM,mBACNC,SAAU,aACVnB,WAAY,CACXS,OAAQ,CACPW,KAAM,UACNC,QAAS,GAEVhB,WAAY,CACXe,KAAM,SACNC,QAAS,QAEVf,mBAAoB,CACnBc,KAAM,UACNC,SAAS,GAEVd,oBAAqB,CACpBa,KAAM,UACNC,SAAS,GAEVb,kBAAmB,CAClBY,KAAM,UACNC,SAAS,IAGXC,KAAMjD,EAAAA","file":"group.js","sourceRoot":"../src/js","sourcesContent":["/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Avatar sizes.\n *\n * @type {Array}\n */\nexport const AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n\n/**\n * Group stati.\n *\n * @type {Object}\n */\nexport const GROUP_STATI = {\n\tpublic: __( 'Public', 'buddypress' ),\n\tprivate: __( 'Private', 'buddypress' ),\n\thidden: __( 'Hidden', 'buddypress' ),\n};\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblockEditor: {\n\t\tInspectorControls,\n\t\tBlockControls,\n\t},\n\tcomponents: {\n\t\tPlaceholder,\n\t\tDisabled,\n\t\tPanelBody,\n\t\tSelectControl,\n\t\tToggleControl,\n\t\tToolbar,\n\t\tToolbarButton,\n\t},\n\tcompose: {\n\t\tcompose,\n\t},\n\tdata: {\n\t\twithSelect,\n\t},\n\teditor: {\n\t\tServerSideRender,\n\t},\n\telement: {\n\t\tFragment,\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\n/**\n * Internal dependencies.\n */\nimport { AVATAR_SIZES, GROUP_STATI } from './constants';\n\nconst getSlugValue = ( item ) => {\n\tif ( item && item.status && GROUP_STATI[ item.status ] ) {\n\t\treturn GROUP_STATI[ item.status ];\n\t}\n\n\treturn null;\n}\n\nconst editGroup = ( { attributes, setAttributes, bpSettings } ) => {\n\tconst { isAvatarEnabled, isCoverImageEnabled } = bpSettings;\n\tconst { avatarSize, displayDescription, displayActionButton, displayCoverImage } = attributes;\n\n\tif ( ! attributes.itemID ) {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon=\"buddicons-groups\"\n\t\t\t\tlabel={ __( 'BuddyPress Group', 'buddypress' ) }\n\t\t\t\tinstructions={ __( 'Start typing the name of the group you want to feature into this post.', 'buddypress' ) }\n\t\t\t>\n\t\t\t\t<AutoCompleter\n\t\t\t\t\tcomponent=\"groups\"\n\t\t\t\t\tobjectQueryArgs={ { 'show_hidden': false } }\n\t\t\t\t\tslugValue={ getSlugValue }\n\t\t\t\t\tariaLabel={ __( 'Group\\'s name', 'buddypress' ) }\n\t\t\t\t\tplaceholder={ __( 'Enter Group\\'s name here…', 'buddypress' ) }\n\t\t\t\t\tonSelectItem={ setAttributes }\n\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t/>\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<Toolbar>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\t\ttitle={ __( 'Select another group', 'buddypress' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( { itemID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Toolbar>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display Group\\'s home button', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayActionButton }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayActionButton: ! displayActionButton } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayActionButton\n\t\t\t\t\t\t\t\t? __( 'Include a link to the group\\'s home page under their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display a link to the group\\'s home page under their name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display group\\'s description', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayDescription }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayDescription: ! displayDescription } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayDescription\n\t\t\t\t\t\t\t\t? __( 'Include the group\\'s description under their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display the group\\'s description under their name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isCoverImageEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Cover Image', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayCoverImage }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayCoverImage: ! displayCoverImage } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayCoverImage\n\t\t\t\t\t\t\t\t\t? __( 'Include the group\\'s cover image over their name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the group\\'s cover image over their name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<Disabled>\n\t\t\t\t<ServerSideRender block=\"bp/group\" attributes={ attributes } />\n\t\t\t</Disabled>\n\t\t</Fragment>\n\t);\n};\n\nconst editGroupBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.groups || {},\n\t\t};\n\t} ),\n] )( editGroup );\n\nexport default editGroupBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblocks: {\n\t\tregisterBlockType,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport editGroupBlock from './group/edit';\n\nregisterBlockType( 'bp/group', {\n\ttitle: __( 'Group', 'buddypress' ),\n\tdescription: __( 'BuddyPress Group.', 'buddypress' ),\n\ticon: 'buddicons-groups',\n\tcategory: 'buddypress',\n\tattributes: {\n\t\titemID: {\n\t\t\ttype: 'integer',\n\t\t\tdefault: 0,\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayDescription: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayActionButton: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayCoverImage: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tedit: editGroupBlock,\n} );\n"]}
bp-groups/js/blocks/groups.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"LGpM":[function(require,module,exports) {
2
+ function n(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,l=new Array(r);e<r;e++)l[e]=n[e];return l}module.exports=n;
3
+ },{}],"o3SL":[function(require,module,exports) {
4
+ var r=require("./arrayLikeToArray");function a(a){if(Array.isArray(a))return r(a)}module.exports=a;
5
+ },{"./arrayLikeToArray":"LGpM"}],"lZpU":[function(require,module,exports) {
6
+ function e(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}module.exports=e;
7
+ },{}],"Vzqv":[function(require,module,exports) {
8
+ var r=require("./arrayLikeToArray");function t(t,e){if(t){if("string"==typeof t)return r(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(t,e):void 0}}module.exports=t;
9
+ },{"./arrayLikeToArray":"LGpM"}],"NCaH":[function(require,module,exports) {
10
+ function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e;
11
+ },{}],"I9dH":[function(require,module,exports) {
12
+ var r=require("./arrayWithoutHoles"),e=require("./iterableToArray"),u=require("./unsupportedIterableToArray"),a=require("./nonIterableSpread");function o(o){return r(o)||e(o)||u(o)||a()}module.exports=o;
13
+ },{"./arrayWithoutHoles":"o3SL","./iterableToArray":"lZpU","./unsupportedIterableToArray":"Vzqv","./nonIterableSpread":"NCaH"}],"dEOc":[function(require,module,exports) {
14
+ function r(r){if(Array.isArray(r))return r}module.exports=r;
15
+ },{}],"RonT":[function(require,module,exports) {
16
+ function r(r,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var e=[],n=!0,o=!1,l=void 0;try{for(var i,u=r[Symbol.iterator]();!(n=(i=u.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(a){o=!0,l=a}finally{try{n||null==u.return||u.return()}finally{if(o)throw l}}return e}}module.exports=r;
17
+ },{}],"sa4T":[function(require,module,exports) {
18
+ function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e;
19
+ },{}],"xkYc":[function(require,module,exports) {
20
+ var r=require("./arrayWithHoles"),e=require("./iterableToArrayLimit"),t=require("./unsupportedIterableToArray"),i=require("./nonIterableRest");function u(u,a){return r(u)||e(u,a)||t(u,a)||i()}module.exports=u;
21
+ },{"./arrayWithHoles":"dEOc","./iterableToArrayLimit":"RonT","./unsupportedIterableToArray":"Vzqv","./nonIterableRest":"sa4T"}],"jS06":[function(require,module,exports) {
22
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EXTRA_INFO=exports.GROUP_STATI=exports.AVATAR_SIZES=void 0;var e=wp,s=e.i18n.__,r=[{label:s("None","buddypress"),value:"none"},{label:s("Thumb","buddypress"),value:"thumb"},{label:s("Full","buddypress"),value:"full"}];exports.AVATAR_SIZES=r;var u={public:s("Public","buddypress"),private:s("Private","buddypress"),hidden:s("Hidden","buddypress")};exports.GROUP_STATI=u;var l=[{label:s("None","buddypress"),value:"none"},{label:s("Group's description","buddypress"),value:"description"},{label:s("Last time the group was active","buddypress"),value:"active"},{label:s("Amount of group members","buddypress"),value:"popular"}];exports.EXTRA_INFO=l;
23
+ },{}],"Ccmh":[function(require,module,exports) {
24
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("@babel/runtime/helpers/toConsumableArray")),t=n(require("@babel/runtime/helpers/slicedToArray")),r=require("./constants");function n(e){return e&&e.__esModule?e:{default:e}}var o=wp,s=o.blockEditor,a=s.InspectorControls,i=s.BlockControls,l=o.components,u=l.Placeholder,d=l.PanelBody,c=l.SelectControl,p=l.ToggleControl,m=l.Button,b=l.Dashicon,g=l.Tooltip,f=l.ToolbarGroup,v=l.RangeControl,y=o.compose.compose,h=o.data.withSelect,_=o.element,A=_.createElement,S=_.Fragment,C=_.useState,I=o.i18n,x=I.__,N=I.sprintf,k=I._n,T=o.apiFetch,G=o.url.addQueryArgs,P=bp.blockComponents.AutoCompleter,O=lodash,E=O.reject,R=O.remove,w=O.sortBy,D=function(e){return e&&e.status&&r.GROUP_STATI[e.status]?r.GROUP_STATI[e.status]:null},B=function(n){var o,s=n.attributes,l=n.setAttributes,y=n.isSelected,h=n.bpSettings.isAvatarEnabled,_=s.itemIDs,I=s.avatarSize,O=s.displayGroupName,B=s.extraInfo,q=s.layoutPreference,F=s.columns,j=0!==_.length,z=C([]),L=(0,t.default)(z,2),M=L[0],Q=L[1],U=[{icon:"text",title:x("List view","buddypress"),onClick:function(){return l({layoutPreference:"list"})},isActive:"list"===q},{icon:"screenoptions",title:x("Grid view","buddypress"),onClick:function(){return l({layoutPreference:"grid"})},isActive:"grid"===q}],V="bp-block-groups avatar-"+I,X=r.EXTRA_INFO;"grid"===q&&(V+=" is-grid columns-"+F,X=r.EXTRA_INFO.filter(function(e){return"description"!==e.value}));return j&&_.length!==M.length&&T({path:G("/buddypress/v1/groups",{populate_extras:!0,include:_})}).then(function(e){Q(w(e,[function(e){return _.indexOf(e.id)}]))}),M.length&&(o=M.map(function(e){var t=!1,r="group-content";return"list"===q&&"description"===B&&e.description&&e.description.rendered&&(t=!0,r="group-content has-description"),A("div",{key:"bp-group-"+e.id,className:r},y&&A(g,{text:x("Remove group","buddypress")},A(m,{className:"is-right",onClick:function(){var t;(t=e.id)&&-1!==_.indexOf(t)&&(Q(E(M,["id",t])),l({itemIDs:R(_,function(e){return e!==t})}))},label:x("Remove group","buddypress")},A(b,{icon:"no"}))),h&&"none"!==I&&A("div",{className:"item-header-avatar"},A("a",{href:e.link,target:"_blank"},A("img",{key:"avatar-"+e.id,className:"avatar",alt:N(x("Profile photo of %s","buddypress"),e.name),src:e.avatar_urls[I]}))),A("div",{className:"group-description"},O&&A("strong",null,A("a",{href:e.link,target:"_blank"},e.name)),t&&A("div",{className:"group-description-content",dangerouslySetInnerHTML:{__html:e.description.rendered}}),"active"===B&&e.last_activity&&e.last_activity_diff&&A("time",{dateTime:e.last_activity},N(x("Active %s","buddypress"),e.last_activity_diff)),"popular"===B&&e.total_member_count&&A("div",{className:"group-meta"},N(k("%1$d member","%1$d members",e.total_member_count,"buddypress"),e.total_member_count))))})),A(S,null,A(a,null,A(d,{title:x("Settings","buddypress"),initialOpen:!0},A(p,{label:x("Display the group's name","buddypress"),checked:!!O,onChange:function(){l({displayGroupName:!O})},help:x(O?"Include the group's name.":"Toggle to include group's name.","buddypress")}),h&&A(c,{label:x("Avatar size","buddypress"),value:I,options:r.AVATAR_SIZES,help:x('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){l({avatarSize:e})}}),A(c,{label:x("Group extra information","buddypress"),value:B,options:X,help:x('Select "None" to show no extra information.',"buddypress"),onChange:function(e){l({extraInfo:e})}}),"grid"===q&&A(v,{label:x("Columns","buddypress"),value:F,onChange:function(e){return l({columns:e})},min:2,max:4,required:!0}))),A(i,null,A(f,{controls:U})),j&&A("div",{className:V},o),(y||0===_.length)&&A(u,{icon:j?"":"groups",label:j?"":x("BuddyPress Groups","buddypress"),instructions:x("Start typing the name of the group you want to add to the groups list.","buddypress"),className:0!==_.length?"is-appender":"is-large"},A(P,{component:"groups",objectQueryArgs:{show_hidden:!1,exclude:_},slugValue:D,ariaLabel:x("Group's name","buddypress"),placeholder:x("Enter Group's name here…","buddypress"),onSelectItem:function(t){var r=t.itemID;r&&-1===_.indexOf(r)&&l({itemIDs:[].concat((0,e.default)(_),[parseInt(r,10)])})},useAvatar:h})))},q=y([h(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.groups||{}}})])(B),F=q;exports.default=F;
25
+ },{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"xkYc","./constants":"jS06"}],"jcTh":[function(require,module,exports) {
26
+ "use strict";var e=t(require("./groups/edit"));function t(e){return e&&e.__esModule?e:{default:e}}var r=wp,s=r.blocks.registerBlockType,u=r.i18n.__;s("bp/groups",{title:u("Groups","buddypress"),description:u("BuddyPress Groups.","buddypress"),icon:"buddicons-groups",category:"buddypress",attributes:{itemIDs:{type:"array",items:{type:"integer"},default:[]},avatarSize:{type:"string",default:"full"},displayGroupName:{type:"boolean",default:!0},extraInfo:{type:"string",default:"none"},layoutPreference:{type:"string",default:"list"},columns:{type:"number",default:2}},edit:e.default});
27
+ },{"./groups/edit":"Ccmh"}]},{},["jcTh"], null)
28
+ //# sourceMappingURL=/bp-groups/js/blocks/groups.js.map
bp-groups/js/blocks/groups.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","bp-groups/js/blocks/groups/constants.js","bp-groups/js/blocks/groups/edit.js","bp-groups/js/blocks/groups.js"],"names":["wp","__","i18n","AVATAR_SIZES","label","value","GROUP_STATI","public","private","hidden","EXTRA_INFO","editGroupsBlock","blockEditor","InspectorControls","BlockControls","components","Placeholder","PanelBody","SelectControl","ToggleControl","Button","Dashicon","Tooltip","ToolbarGroup","RangeControl","compose","withSelect","data","element","createElement","Fragment","useState","sprintf","_n","apiFetch","addQueryArgs","url","AutoCompleter","bp","blockComponents","lodash","reject","remove","sortBy","getSlugValue","item","status","editGroups","attributes","groupsList","setAttributes","isSelected","isAvatarEnabled","bpSettings","itemIDs","avatarSize","displayGroupName","extraInfo","layoutPreference","columns","hasGroups","length","groups","setGroups","layoutControls","icon","title","onClick","isActive","containerClasses","extraInfoOptions","filter","extra","path","populate_extras","include","then","items","indexOf","id","map","group","hasDescription","groupItemClasses","description","rendered","itemID","link","name","avatar_urls","__html","last_activity","last_activity_diff","total_member_count","option","exclude","parseInt","select","getEditorSettings","registerBlockType","blocks","category","type","default","edit"],"mappings":";AAAA,SAAA,EAAA,EAAA,IACA,MAAA,GAAA,EAAA,EAAA,UAAA,EAAA,EAAA,QAEA,IAAA,IAAA,EAAA,EAAA,EAAA,IAAA,MAAA,GAAA,EAAA,EAAA,IACA,EAAA,GAAA,EAAA,GAGA,OAAA,EAGA,OAAA,QAAA;;ACVA,IAAA,EAAA,QAAA,sBAEA,SAAA,EAAA,GACA,GAAA,MAAA,QAAA,GAAA,OAAA,EAAA,GAGA,OAAA,QAAA;;ACNA,SAAA,EAAA,GACA,GAAA,oBAAA,QAAA,OAAA,YAAA,OAAA,GAAA,OAAA,MAAA,KAAA,GAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,sBAEA,SAAA,EAAA,EAAA,GACA,GAAA,EAAA,CACA,GAAA,iBAAA,EAAA,OAAA,EAAA,EAAA,GACA,IAAA,EAAA,OAAA,UAAA,SAAA,KAAA,GAAA,MAAA,GAAA,GAEA,MADA,WAAA,GAAA,EAAA,cAAA,EAAA,EAAA,YAAA,MACA,QAAA,GAAA,QAAA,EAAA,MAAA,KAAA,GACA,cAAA,GAAA,2CAAA,KAAA,GAAA,EAAA,EAAA,QAAA,GAGA,OAAA,QAAA;;ACXA,SAAA,IACA,MAAA,IAAA,UAAA,wIAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,uBAEA,EAAA,QAAA,qBAEA,EAAA,QAAA,gCAEA,EAAA,QAAA,uBAEA,SAAA,EAAA,GACA,OAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,IAGA,OAAA,QAAA;;ACZA,SAAA,EAAA,GACA,GAAA,MAAA,QAAA,GAAA,OAAA,EAGA,OAAA,QAAA;;ACJA,SAAA,EAAA,EAAA,GACA,GAAA,oBAAA,QAAA,OAAA,YAAA,OAAA,GAAA,CACA,IAAA,EAAA,GACA,GAAA,EACA,GAAA,EACA,OAAA,EAEA,IACA,IAAA,IAAA,EAAA,EAAA,EAAA,OAAA,cAAA,GAAA,EAAA,EAAA,QAAA,QACA,EAAA,KAAA,EAAA,QAEA,GAAA,EAAA,SAAA,GAHA,GAAA,IAKA,MAAA,GACA,GAAA,EACA,EAAA,EACA,QACA,IACA,GAAA,MAAA,EAAA,QAAA,EAAA,SACA,QACA,GAAA,EAAA,MAAA,GAIA,OAAA,GAGA,OAAA,QAAA;;AC3BA,SAAA,IACA,MAAA,IAAA,UAAA,6IAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,oBAEA,EAAA,QAAA,0BAEA,EAAA,QAAA,gCAEA,EAAA,QAAA,qBAEA,SAAA,EAAA,EAAA,GACA,OAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,IAAA,IAGA,OAAA,QAAA;;ACiCO,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,WAAA,QAAA,YAAA,QAAA,kBAAA,EAtCHA,IAAAA,EAAAA,GAFFC,EADDC,EAAAA,KACCD,GASWE,EAAe,CAC3B,CACCC,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,QAAS,cACpBI,MAAO,SAER,CACCD,MAAOH,EAAI,OAAQ,cACnBI,MAAO,SAoBF,QAAA,aAAA,EAXA,IAAMC,EAAc,CAC1BC,OAAQN,EAAI,SAAU,cACtBO,QAASP,EAAI,UAAW,cACxBQ,OAAQR,EAAI,SAAU,eAQhB,QAAA,YAAA,EAAA,IAAMS,EAAa,CACzB,CACCN,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,sBAAwB,cACnCI,MAAO,eAER,CACCD,MAAOH,EAAI,iCAAkC,cAC7CI,MAAO,UAER,CACCD,MAAOH,EAAI,0BAA2B,cACtCI,MAAO,YAfF,QAAA,WAAA;;ACqQQM,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,6CAAAA,EAAAA,EAAAA,QAAAA,yCAjQf,EAAA,QAAA,eAiQeA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GA3QXX,IAAAA,EAAAA,GAnCHY,EAAAA,EAAAA,YACCC,EAAAA,EAAAA,kBACAC,EAAAA,EAAAA,cAEDC,EAAAA,EAAAA,WACCC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,aAGAC,EADDA,EAAAA,QACCA,QAGAC,EADDC,EAAAA,KACCD,WAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,SAED7B,EAAAA,EAAAA,KACCD,EAAAA,EAAAA,GACA+B,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,GAEDC,EAAAA,EAAAA,SAECC,EADDC,EAAAA,IACCD,aAOME,EAAkBC,GAAGC,gBAArBF,cAcJG,EAAAA,OAHHC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,OAGKC,EAAe,SAAEC,GACjBA,OAAAA,GAAQA,EAAKC,QAAUxC,EAAauC,YAAAA,EAAKC,QACtCxC,EAAauC,YAAAA,EAAKC,QAGnB,MAGFC,EAAa,SAA6D,GAAzDC,IA4BlBC,EA5BkBD,EAAAA,EAAAA,WAAYE,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WAEhDC,EAF4DC,EAAAA,WAE5DD,gBAGAE,EAMGN,EANHM,QACAC,EAKGP,EALHO,WACAC,EAIGR,EAJHQ,iBACAC,EAGGT,EAHHS,UACAC,EAEGV,EAFHU,iBACAC,EACGX,EADHW,QAEKC,EAAY,IAAMN,EAAQO,OACF9B,EAAAA,EAAU,IAbuC,GAAA,EAAA,EAAA,SAAA,EAAA,GAavE+B,EAbuE,EAAA,GAa/DC,EAb+D,EAAA,GAczEC,EAAiB,CACtB,CACCC,KAAM,OACNC,MAAOjE,EAAI,YAAa,cACxBkE,QAAS,WAAMjB,OAAAA,EAAe,CAAEQ,iBAAkB,UAClDU,SAA+B,SAArBV,GAEX,CACCO,KAAM,gBACNC,MAAOjE,EAAI,YAAa,cACxBkE,QAAS,WAAMjB,OAAAA,EAAe,CAAEQ,iBAAkB,UAClDU,SAA+B,SAArBV,IAIRW,EAAmB,0BAA4Bd,EAC/Ce,EAAmB5D,EAAvB,WAE0B,SAArBgD,IACJW,GAAoB,oBAAsBV,EAC1CW,EAAmB5D,EAAW6D,WAAAA,OAAQ,SAAEC,GAChC,MAAA,gBAAkBA,EAAMnE,SA4GhC,OAvFIuD,GAAaN,EAAQO,SAAWC,EAAOD,QAC3C3B,EAAU,CACTuC,KAAMtC,EAAuC,wBAAA,CAAEuC,iBAAiB,EAAMC,QAASrB,MAC5EsB,KAAM,SAAAC,GACTd,EACCpB,EAAQkC,EAAO,CAAE,SAAEhC,GACXS,OAAAA,EAAQwB,QAASjC,EAAKkC,UAM5BjB,EAAOD,SACXZ,EAAaa,EAAOkB,IAAK,SAAEC,GACtBC,IAAAA,GAAiB,EACjBC,EAAmB,gBAQtB,MANyB,SAArBzB,GAA+B,gBAAkBD,GAAawB,EAAMG,aAAeH,EAAMG,YAAYC,WACzGH,GAAiB,EACjBC,EAAmB,iCAInB,EAAA,MAAA,CAAK,IAAM,YAAcF,EAAMF,GAAK,UAAYI,GAC7ChC,GACD,EAAC,EAAD,CAAS,KAAOlD,EAAI,eAAgB,eACnC,EAAC,EAAD,CACC,UAAU,WACV,QAAU,WArCO,IAAEqF,GAAAA,EAqCYL,EAAMF,MApC3B,IAAMzB,EAAQwB,QAASQ,KACtCvB,EAAWtB,EAAQqB,EAAQ,CAAC,KAAMwB,KAClCpC,EAAe,CACdI,QAASZ,EAAQY,EAAS,SAAEjD,GAAoBA,OAAAA,IAAUiF,QAkCtD,MAAQrF,EAAI,eAAgB,eAE5B,EAAC,EAAD,CAAU,KAAK,SAIhBmD,GAAmB,SAAWG,GAC/B,EAAA,MAAA,CAAK,UAAU,sBACd,EAAA,IAAA,CAAG,KAAO0B,EAAMM,KAAO,OAAO,UAC7B,EAAA,MAAA,CACC,IAAM,UAAYN,EAAMF,GACxB,UAAU,SACV,IAAM/C,EAAS/B,EAAI,sBAAuB,cAAgBgF,EAAMO,MAChE,IAAMP,EAAMQ,YAAalC,OAK7B,EAAA,MAAA,CAAK,UAAU,qBACZC,GACD,EACC,SAAA,KAAA,EAAA,IAAA,CAAG,KAAOyB,EAAMM,KAAO,OAAO,UAC3BN,EAAMO,OAKTN,GACD,EAAA,MAAA,CAAK,UAAU,4BAA4B,wBAA0B,CAAEQ,OAAQT,EAAMG,YAAYC,YAGhG,WAAa5B,GAAawB,EAAMU,eAAiBV,EAAMW,oBACxD,EAAA,OAAA,CAAM,SAAWX,EAAMU,eACpB3D,EAAS/B,EAAI,YAAa,cAAgBgF,EAAMW,qBAIlD,YAAcnC,GAAawB,EAAMY,oBAClC,EAAA,MAAA,CAAK,UAAU,cACX7D,EAEFC,EACC,cACA,eACAgD,EAAMY,mBACN,cAEDZ,EAAMY,0BAWb,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQ5F,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,2BAA6B,cACzC,UAAauD,EACb,SAAW,WACVN,EAAe,CAAEM,kBAAoBA,KAEtC,KAEIvD,EADHuD,EACO,4BACA,kCAD8B,gBAKrCJ,GACD,EAAC,EAAD,CACC,MAAQnD,EAAI,cAAe,cAC3B,MAAQsD,EACR,QAAUpD,EAHX,aAIC,KAAOF,EAAI,uCAAwC,cACnD,SAAW,SAAE6F,GACZ5C,EAAe,CAAEK,WAAYuC,OAKhC,EAAC,EAAD,CACC,MAAQ7F,EAAI,0BAA2B,cACvC,MAAQwD,EACR,QAAUa,EACV,KAAOrE,EAAI,8CAA+C,cAC1D,SAAW,SAAE6F,GACZ5C,EAAe,CAAEO,UAAWqC,OAIP,SAArBpC,GACD,EAAC,EAAD,CACC,MAAQzD,EAAI,UAAW,cACvB,MAAQ0D,EACR,SAAW,SAAEtD,GACZ6C,OAAAA,EAAe,CAAES,QAAStD,KAE3B,IAAM,EACN,IAAM,EACN,UAAQ,MAMZ,EAAC,EACA,KAAA,EAAC,EAAD,CAAc,SAAW2D,KAGxBJ,GACD,EAAA,MAAA,CAAK,UAAYS,GACdpB,IAIAE,GAAc,IAAMG,EAAQO,SAC/B,EAAC,EAAD,CACC,KAAOD,EAAY,GAAK,SACxB,MAAQA,EAAY,GAAK3D,EAAI,oBAAqB,cAClD,aAAeA,EAAI,yEAA0E,cAC7F,UAAY,IAAMqD,EAAQO,OAAS,cAAgB,YAEnD,EAAC,EAAD,CACC,UAAU,SACV,gBAAkB,CAAiB,aAAA,EAAOkC,QAASzC,GACnD,UAAYV,EACZ,UAAY3C,EAAI,eAAiB,cACjC,YAAcA,EAAI,2BAA6B,cAC/C,aApLmB,SAAkB,GAAdqF,IAAAA,EAAAA,EAAAA,OACtBA,IAAW,IAAMhC,EAAQwB,QAASQ,IACtCpC,EAAe,CACdI,QAAaA,GAAAA,QAAAA,EAAAA,EAAAA,SAAAA,GAAS0C,CAAAA,SAAUV,EAAQ,SAkLtC,UAAYlC,OAQZzC,EAAkBc,EAAS,CAChCC,EAAY,SAAEuE,GAGN,MAAA,CACN5C,WAHsB4C,EAAQ,eAAgBC,oBAGnB5D,GAAGwB,QAAU,OALnBrC,CAQnBsB,GAEUpC,EAAAA,EAAAA,QAAAA,QAAAA;;ACjSf,aAFA,IAAA,EAAA,EAAA,QAAA,kBAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAPIX,IAAAA,EAAAA,GALAmG,EADFC,EAAAA,OACED,kBAGAlG,EADFC,EAAAA,KACED,GASJkG,EAAmB,YAAa,CAC/BjC,MAAOjE,EAAI,SAAU,cACrBmF,YAAanF,EAAI,qBAAsB,cACvCgE,KAAM,mBACNoC,SAAU,aACVrD,WAAY,CACXM,QAAS,CACRgD,KAAM,QACNzB,MAAO,CACNyB,KAAM,WAEPC,QAAS,IAEVhD,WAAY,CACX+C,KAAM,SACNC,QAAS,QAEV/C,iBAAkB,CACjB8C,KAAM,UACNC,SAAS,GAEV9C,UAAW,CACV6C,KAAM,SACNC,QAAS,QAEV7C,iBAAkB,CACjB4C,KAAM,SACNC,QAAS,QAEV5C,QAAS,CACR2C,KAAM,SACNC,QAAS,IAGXC,KAAM7F,EAAAA","file":"groups.js","sourceRoot":"../src/js","sourcesContent":["function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Avatar sizes.\n *\n * @type {Array}\n */\nexport const AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n\n/**\n * Group stati.\n *\n * @type {Object}\n */\nexport const GROUP_STATI = {\n\tpublic: __( 'Public', 'buddypress' ),\n\tprivate: __( 'Private', 'buddypress' ),\n\thidden: __( 'Hidden', 'buddypress' ),\n};\n\n/**\n * Group Extra data.\n *\n * @type {Array}\n */\nexport const EXTRA_INFO = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Group\\'s description', 'buddypress' ),\n\t\tvalue: 'description',\n\t},\n\t{\n\t\tlabel: __( 'Last time the group was active', 'buddypress' ),\n\t\tvalue: 'active',\n\t},\n\t{\n\t\tlabel: __( 'Amount of group members', 'buddypress' ),\n\t\tvalue: 'popular',\n\t},\n];\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblockEditor: {\n\t\tInspectorControls,\n\t\tBlockControls,\n\t},\n\tcomponents: {\n\t\tPlaceholder,\n\t\tPanelBody,\n\t\tSelectControl,\n\t\tToggleControl,\n\t\tButton,\n\t\tDashicon,\n\t\tTooltip,\n\t\tToolbarGroup,\n\t\tRangeControl,\n\t},\n\tcompose: {\n\t\tcompose,\n\t},\n\tdata: {\n\t\twithSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t\t_n,\n\t},\n\tapiFetch,\n\turl: {\n\t\taddQueryArgs,\n\t},\n} = wp;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\n/**\n * Internal dependencies.\n */\nimport { AVATAR_SIZES, EXTRA_INFO, GROUP_STATI } from './constants';\n\n/**\n * External dependencies.\n */\nconst {\n\treject,\n\tremove,\n\tsortBy,\n} = lodash;\n\nconst getSlugValue = ( item ) => {\n\tif ( item && item.status && GROUP_STATI[ item.status ] ) {\n\t\treturn GROUP_STATI[ item.status ];\n\t}\n\n\treturn null;\n}\n\nconst editGroups = ( { attributes, setAttributes, isSelected, bpSettings } ) => {\n\tconst {\n\t\tisAvatarEnabled,\n\t} = bpSettings;\n\tconst {\n\t\titemIDs,\n\t\tavatarSize,\n\t\tdisplayGroupName,\n\t\textraInfo,\n\t\tlayoutPreference,\n\t\tcolumns,\n\t} = attributes;\n\tconst hasGroups = 0 !== itemIDs.length;\n\tconst [ groups, setGroups ] = useState( [] );\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: 'text',\n\t\t\ttitle: __( 'List view', 'buddypress' ),\n\t\t\tonClick: () => setAttributes( { layoutPreference: 'list' } ),\n\t\t\tisActive: layoutPreference === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: 'screenoptions',\n\t\t\ttitle: __( 'Grid view', 'buddypress' ),\n\t\t\tonClick: () => setAttributes( { layoutPreference: 'grid' } ),\n\t\t\tisActive: layoutPreference === 'grid',\n\t\t},\n\t];\n\tlet groupsList;\n\tlet containerClasses = 'bp-block-groups avatar-' + avatarSize;\n\tlet extraInfoOptions = EXTRA_INFO;\n\n\tif ( layoutPreference === 'grid' ) {\n\t\tcontainerClasses += ' is-grid columns-' + columns;\n\t\textraInfoOptions = EXTRA_INFO.filter( ( extra ) => {\n\t\t\treturn 'description' !== extra.value;\n\t\t} );\n\t}\n\n\tconst onSelectedGroup = ( { itemID } ) => {\n\t\tif ( itemID && -1 === itemIDs.indexOf( itemID ) ) {\n\t\t\tsetAttributes( {\n\t\t\t\titemIDs: [...itemIDs, parseInt( itemID, 10 ) ]\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst onRemoveGroup = ( ( itemID ) => {\n\t\tif ( itemID && -1 !== itemIDs.indexOf( itemID ) ) {\n\t\t\tsetGroups( reject( groups, ['id', itemID ] ) );\n\t\t\tsetAttributes( {\n\t\t\t\titemIDs: remove( itemIDs, ( value ) => { return value !== itemID } )\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( hasGroups && itemIDs.length !== groups.length ) {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( `/buddypress/v1/groups`, { populate_extras: true, include: itemIDs } ),\n\t\t} ).then( items => {\n\t\t\tsetGroups(\n\t\t\t\tsortBy( items, [ ( item ) => {\n\t\t\t\t\treturn itemIDs.indexOf( item.id );\n\t\t\t\t} ] )\n\t\t\t);\n\t\t} )\n\t}\n\n\tif ( groups.length ) {\n\t\tgroupsList = groups.map( ( group ) => {\n\t\t\tlet hasDescription = false;\n\t\t\tlet groupItemClasses = 'group-content';\n\n\t\t\tif ( layoutPreference === 'list' && 'description' === extraInfo && group.description && group.description.rendered ) {\n\t\t\t\thasDescription = true;\n\t\t\t\tgroupItemClasses = 'group-content has-description';\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div key={ 'bp-group-' + group.id } className={ groupItemClasses }>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Tooltip text={ __( 'Remove group', 'buddypress' ) }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"is-right\"\n\t\t\t\t\t\t\t\tonClick={ () => onRemoveGroup( group.id ) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Remove group', 'buddypress' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Dashicon icon=\"no\"/>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isAvatarEnabled && 'none' !== avatarSize && (\n\t\t\t\t\t\t<div className=\"item-header-avatar\">\n\t\t\t\t\t\t\t<a href={ group.link } target=\"_blank\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tkey={ 'avatar-' + group.id }\n\t\t\t\t\t\t\t\t\tclassName=\"avatar\"\n\t\t\t\t\t\t\t\t\talt={ sprintf( __( 'Profile photo of %s', 'buddypress' ), group.name ) }\n\t\t\t\t\t\t\t\t\tsrc={ group.avatar_urls[ avatarSize ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<div className=\"group-description\">\n\t\t\t\t\t\t{ displayGroupName && (\n\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t<a href={ group.link } target=\"_blank\">\n\t\t\t\t\t\t\t\t\t{ group.name }\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ hasDescription && (\n\t\t\t\t\t\t\t<div className=\"group-description-content\" dangerouslySetInnerHTML={ { __html: group.description.rendered } } />\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ 'active' === extraInfo && group.last_activity && group.last_activity_diff && (\n\t\t\t\t\t\t\t<time dateTime={ group.last_activity }>\n\t\t\t\t\t\t\t\t{ sprintf( __( 'Active %s', 'buddypress' ), group.last_activity_diff ) }\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ 'popular' === extraInfo && group.total_member_count && (\n\t\t\t\t\t\t\t<div className=\"group-meta\">\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: 1: number of group memberss. */\n\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t'%1$d member',\n\t\t\t\t\t\t\t\t\t\t'%1$d members',\n\t\t\t\t\t\t\t\t\t\tgroup.total_member_count,\n\t\t\t\t\t\t\t\t\t\t'buddypress'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tgroup.total_member_count\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display the group\\'s name', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayGroupName }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayGroupName: ! displayGroupName } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayGroupName\n\t\t\t\t\t\t\t\t? __( 'Include the group\\'s name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to include group\\'s name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Group extra information', 'buddypress' ) }\n\t\t\t\t\t\tvalue={ extraInfo }\n\t\t\t\t\t\toptions={ extraInfoOptions }\n\t\t\t\t\t\thelp={ __( 'Select \"None\" to show no extra information.', 'buddypress' ) }\n\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\tsetAttributes( { extraInfo: option } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ layoutPreference === 'grid' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Columns', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\tmax={ 4 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t{ hasGroups && (\n\t\t\t\t<div className={ containerClasses }>\n\t\t\t\t\t{ groupsList }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ ( isSelected || 0 === itemIDs.length ) && (\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ hasGroups ? '' : 'groups' }\n\t\t\t\t\tlabel={ hasGroups ? '' : __( 'BuddyPress Groups', 'buddypress' ) }\n\t\t\t\t\tinstructions={ __( 'Start typing the name of the group you want to add to the groups list.', 'buddypress' ) }\n\t\t\t\t\tclassName={ 0 !== itemIDs.length ? 'is-appender' : 'is-large' }\n\t\t\t\t>\n\t\t\t\t\t<AutoCompleter\n\t\t\t\t\t\tcomponent=\"groups\"\n\t\t\t\t\t\tobjectQueryArgs={ { 'show_hidden': false, exclude: itemIDs } }\n\t\t\t\t\t\tslugValue={ getSlugValue }\n\t\t\t\t\t\tariaLabel={ __( 'Group\\'s name', 'buddypress' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Enter Group\\'s name here…', 'buddypress' ) }\n\t\t\t\t\t\tonSelectItem={ onSelectedGroup }\n\t\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t\t/>\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t</Fragment>\n\t);\n};\n\nconst editGroupsBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.groups || {},\n\t\t};\n\t} ),\n] )( editGroups );\n\nexport default editGroupsBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n blocks: {\n registerBlockType,\n },\n i18n: {\n __,\n },\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport editGroupsBlock from './groups/edit';\n\nregisterBlockType( 'bp/groups', {\n\ttitle: __( 'Groups', 'buddypress' ),\n\tdescription: __( 'BuddyPress Groups.', 'buddypress' ),\n\ticon: 'buddicons-groups',\n\tcategory: 'buddypress',\n\tattributes: {\n\t\titemIDs: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\ttype: 'integer',\n\t\t\t},\n\t\t\tdefault: [],\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayGroupName: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\textraInfo: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t\tlayoutPreference: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'list',\n\t\t},\n\t\tcolumns: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 2\n\t\t},\n\t},\n\tedit: editGroupsBlock,\n} );\n"]}
bp-groups/sass/blocks/group.scss ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/group block */
2
+ [data-type="bp/group"] {
3
+
4
+ input.components-placeholder__input {
5
+ flex: 1 1 auto;
6
+ border-radius: 2px;
7
+ border: 1px solid #757575;
8
+ padding: 6px 8px;
9
+ }
10
+ }
11
+
12
+ .bp-block-group {
13
+ position: relative;
14
+
15
+ .group-content {
16
+ display: flex;
17
+ }
18
+
19
+ .group-description {
20
+ width: 100%;
21
+ }
22
+
23
+ .group-description-content {
24
+ width: 100%;
25
+ margin-bottom: 18px;
26
+ }
27
+
28
+ .bp-profile-button {
29
+ width: 100%;
30
+ overflow: hidden;
31
+
32
+ a.button {
33
+ margin: 18px 0 0;
34
+ }
35
+ }
36
+
37
+ &.has-cover {
38
+
39
+ .group-content,
40
+ .item-header-avatar,
41
+ .group-description {
42
+ z-index: 2;
43
+ }
44
+
45
+ .group-content {
46
+ padding-top: 75px;
47
+ }
48
+
49
+ .group-description {
50
+ padding-top: 75px;
51
+ }
52
+
53
+ .bp-group-cover-image {
54
+ background-color: #c5c5c5;
55
+ background-position: center top;
56
+ background-repeat: no-repeat;
57
+ background-size: cover;
58
+ border: 0;
59
+ display: block;
60
+ left: 0;
61
+ margin: 0;
62
+ padding: 0;
63
+ position: absolute;
64
+ top: 0;
65
+ width: 100%;
66
+ z-index: 1;
67
+ height: 150px;
68
+ }
69
+ }
70
+
71
+ img.avatar {
72
+ width: auto;
73
+ height: auto;
74
+ }
75
+
76
+ &.avatar-none {
77
+
78
+ .item-header-avatar {
79
+ display: none;
80
+ }
81
+ }
82
+
83
+ &.avatar-none.has-cover {
84
+ min-height: 200px;
85
+
86
+ .item-header-avatar {
87
+ padding-top: 75px;
88
+ }
89
+ }
90
+
91
+ &.avatar-full {
92
+ min-height: 150px;
93
+
94
+ .item-header-avatar {
95
+ width: 180px;
96
+ }
97
+
98
+ .group-description {
99
+ padding-left: 35px;
100
+ }
101
+ }
102
+
103
+ &.avatar-full.has-cover {
104
+ min-height: 300px;
105
+
106
+ .item-header-avatar {
107
+ width: 200px;
108
+ }
109
+
110
+ img.avatar {
111
+ border: solid 2px #fff;
112
+ background: rgba(255, 255, 255, 0.8);
113
+ margin-left: 20px;
114
+ }
115
+ }
116
+
117
+ &.avatar-thumb {
118
+
119
+ .item-header-avatar {
120
+ width: 70px;
121
+
122
+ img.avatar {
123
+ margin-top: 15px;
124
+ }
125
+ }
126
+ }
127
+
128
+ &.avatar-thumb:not(.has-description) {
129
+
130
+ .group-content {
131
+ min-height: 50px;
132
+ align-items: center;
133
+ }
134
+ }
135
+
136
+ &.avatar-thumb.has-cover {
137
+
138
+ .item-header-avatar {
139
+ padding-top: 75px;
140
+ }
141
+ }
142
+
143
+ &.has-description {
144
+
145
+ .bp-profile-button {
146
+
147
+ a.button {
148
+ display: block;
149
+ float: right;
150
+ }
151
+ }
152
+ }
153
+ }
bp-groups/sass/blocks/groups.scss ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/groups"] {
3
+
4
+ .components-placeholder {
5
+
6
+ &.is-appender {
7
+ min-height: 0;
8
+
9
+ .components-placeholder__label:empty {
10
+ display: none;
11
+ }
12
+ }
13
+
14
+ input.components-placeholder__input {
15
+ flex: 1 1 auto;
16
+ border-radius: 2px;
17
+ border: 1px solid #757575;
18
+ padding: 6px 8px;
19
+ }
20
+ }
21
+
22
+ &.avatar-none {
23
+
24
+ .group-description {
25
+ width: calc(100% - 44px);
26
+ }
27
+ }
28
+
29
+ &.avatar-full {
30
+
31
+ .group-description {
32
+ width: calc(100% - 224px);
33
+ }
34
+ }
35
+
36
+ &.avatar-thumb {
37
+
38
+ .group-description {
39
+ width: calc(100% - 114px);
40
+ }
41
+ }
42
+
43
+ .group-content {
44
+ position: relative;
45
+
46
+ .is-right {
47
+ position: absolute;
48
+ top: 2px;
49
+ right: 2px;
50
+ }
51
+ }
52
+
53
+ .columns-2,
54
+ .columns-3,
55
+ .columns-4 {
56
+
57
+ .group-content {
58
+
59
+ .group-description {
60
+ padding-left: 44px;
61
+ width: calc(100% - 44px);
62
+ }
63
+ }
64
+ }
65
+
66
+ .columns-3 {
67
+
68
+ .is-right {
69
+ right: -10px;
70
+ }
71
+ }
72
+
73
+ .columns-4 {
74
+
75
+ .is-right {
76
+ right: -50px;
77
+ }
78
+ }
79
+ }
80
+
81
+ .bp-block-groups {
82
+
83
+ &.is-grid {
84
+ display: flex;
85
+ flex-wrap: wrap;
86
+ padding: 0;
87
+
88
+ .group-content {
89
+ margin: 0 1.25em 1.25em 0;
90
+ width: 100%;
91
+ }
92
+ }
93
+
94
+ @media (min-width: 600px) {
95
+
96
+ @for $i from 2 through 4 {
97
+ &.columns-#{ $i } .group-content {
98
+ width: calc((100% / #{ $i }) - 1.25em + (1.25em / #{ $i }));
99
+
100
+ &:nth-child( #{ $i }n ) {
101
+ margin-right: 0;
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ .group-content {
108
+ display: flex;
109
+ flex-direction: column;
110
+ padding-bottom: 1em;
111
+ text-align: center;
112
+
113
+ .item-header-avatar,
114
+ .group-description {
115
+ width: 100%;
116
+ }
117
+
118
+ .item-header-avatar {
119
+ margin: 0 auto;
120
+
121
+ img.avatar {
122
+ display: inline-block;
123
+ }
124
+ }
125
+
126
+ @media (min-width: 600px) {
127
+ flex-direction: row;
128
+ text-align: left;
129
+
130
+ .item-header-avatar,
131
+ .group-description {
132
+ width: auto;
133
+ }
134
+
135
+ .item-header-avatar {
136
+ margin: 0;
137
+ }
138
+ }
139
+
140
+ time {
141
+ display: block;
142
+ font-size: 80%;
143
+ color: #767676;
144
+ }
145
+ }
146
+
147
+ &.avatar-none {
148
+
149
+ .item-header-avatar {
150
+ display: none;
151
+ }
152
+ }
153
+
154
+ &.avatar-full {
155
+ min-height: 190px;
156
+
157
+ .item-header-avatar {
158
+ width: 180px;
159
+ }
160
+ }
161
+
162
+ &.avatar-thumb {
163
+
164
+ .group-content {
165
+ min-height: 80px;
166
+ }
167
+
168
+ .item-header-avatar {
169
+ width: 70px;
170
+ }
171
+ }
172
+
173
+ &.columns-2 .group-content,
174
+ &.columns-3 .group-content,
175
+ &.columns-4 .group-content {
176
+ display: block;
177
+ text-align: center;
178
+
179
+ .item-header-avatar {
180
+ margin: 0 auto;
181
+ }
182
+ }
183
+
184
+ img.avatar {
185
+ width: auto;
186
+ height: auto;
187
+ max-width: fit-content;
188
+ }
189
+
190
+ .member-content.has-description {
191
+ align-items: center;
192
+
193
+ .item-header-avatar {
194
+ padding-right: 1em;
195
+ }
196
+
197
+ .group-description-content {
198
+ margin-bottom: 0;
199
+ text-align: left;
200
+ }
201
+ }
202
+ }
bp-groups/screens/single/admin/group-settings.php CHANGED
@@ -26,12 +26,12 @@ function groups_screen_group_admin_settings() {
26
  if ( isset( $_POST['save'] ) ) {
27
  $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
28
 
29
- // Checked against a whitelist for security.
30
  /** This filter is documented in bp-groups/bp-groups-admin.php */
31
  $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
32
  $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
33
 
34
- // Checked against a whitelist for security.
35
  /** This filter is documented in bp-groups/bp-groups-admin.php */
36
  $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
37
  $invite_status = isset( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
26
  if ( isset( $_POST['save'] ) ) {
27
  $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
28
 
29
+ // Checked against a list of allowed statuses for security.
30
  /** This filter is documented in bp-groups/bp-groups-admin.php */
31
  $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
32
  $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public';
33
 
34
+ // Checked against a list of allowed statuses for security.
35
  /** This filter is documented in bp-groups/bp-groups-admin.php */
36
  $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
37
  $invite_status = isset( $_POST['group-invite-status'] ) && in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
bp-loader.php CHANGED
@@ -15,7 +15,7 @@
15
  * Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
16
  * Author: The BuddyPress Community
17
  * Author URI: https://buddypress.org/
18
- * Version: 6.4.0
19
  * Text Domain: buddypress
20
  * Domain Path: /bp-languages/
21
  * License: GPLv2 or later (license.txt)
@@ -58,7 +58,7 @@ function bp_php_requirements_notice() {
58
 
59
  ?>
60
 
61
- <div id="message" class="error notice">
62
  <p><strong><?php esc_html_e( 'Your site does not support BuddyPress.', 'buddypress' ); ?></strong></p>
63
  <?php /* translators: 1: current PHP version, 2: required PHP version */ ?>
64
  <p><?php printf( esc_html__( 'Your site is currently running PHP version %1$s, while BuddyPress requires version %2$s or greater.', 'buddypress' ), esc_html( phpversion() ), esc_html( BP_REQUIRED_PHP_VERSION ) ); ?> <?php printf( __( 'See <a href="%s">the Codex guide</a> for more information.', 'buddypress' ), 'https://codex.buddypress.org/getting-started/buddypress-2-8-will-require-php-5-3/' ); ?></p>
15
  * Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
16
  * Author: The BuddyPress Community
17
  * Author URI: https://buddypress.org/
18
+ * Version: 7.0.0-RC2
19
  * Text Domain: buddypress
20
  * Domain Path: /bp-languages/
21
  * License: GPLv2 or later (license.txt)
58
 
59
  ?>
60
 
61
+ <div id="message" class="error notice is-dismissible">
62
  <p><strong><?php esc_html_e( 'Your site does not support BuddyPress.', 'buddypress' ); ?></strong></p>
63
  <?php /* translators: 1: current PHP version, 2: required PHP version */ ?>
64
  <p><?php printf( esc_html__( 'Your site is currently running PHP version %1$s, while BuddyPress requires version %2$s or greater.', 'buddypress' ), esc_html( phpversion() ), esc_html( BP_REQUIRED_PHP_VERSION ) ); ?> <?php printf( __( 'See <a href="%s">the Codex guide</a> for more information.', 'buddypress' ), 'https://codex.buddypress.org/getting-started/buddypress-2-8-will-require-php-5-3/' ); ?></p>
bp-members/bp-members-admin.php CHANGED
@@ -12,3 +12,85 @@ defined( 'ABSPATH' ) || exit;
12
 
13
  // Load the BP Members admin.
14
  add_action( 'bp_init', array( 'BP_Members_Admin', 'register_members_admin' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  // Load the BP Members admin.
14
  add_action( 'bp_init', array( 'BP_Members_Admin', 'register_members_admin' ) );
15
+
16
+ /**
17
+ * Create Users submenu to manage BuddyPress types.
18
+ *
19
+ * @since 7.0.0
20
+ */
21
+ function bp_members_type_admin_menu() {
22
+ if ( ! bp_is_root_blog() ) {
23
+ return;
24
+ }
25
+
26
+ if ( bp_is_network_activated() && is_network_admin() ) {
27
+ // Adds a users.php submenu to go to the root blog Member types screen.
28
+ $member_type_admin_url = add_query_arg( 'taxonomy', bp_get_member_type_tax_name(), get_admin_url( bp_get_root_blog_id(), 'edit-tags.php' ) );
29
+
30
+ add_submenu_page(
31
+ 'users.php',
32
+ __( 'Member Types', 'buddypress' ),
33
+ __( 'Member Types', 'buddypress' ),
34
+ 'bp_moderate',
35
+ esc_url( $member_type_admin_url )
36
+ );
37
+
38
+ } elseif ( ! is_network_admin() ) {
39
+ add_submenu_page(
40
+ 'users.php',
41
+ __( 'Member Types', 'buddypress' ),
42
+ __( 'Member Types', 'buddypress' ),
43
+ 'bp_moderate',
44
+ basename( add_query_arg( 'taxonomy', bp_get_member_type_tax_name(), bp_get_admin_url( 'edit-tags.php' ) ) )
45
+ );
46
+ }
47
+ }
48
+ add_action( 'bp_admin_menu', 'bp_members_type_admin_menu' );
49
+
50
+ /**
51
+ * Checks whether a member type already exists.
52
+ *
53
+ * @since 7.0.0
54
+ *
55
+ * @param boolean $exists True if the member type already exists. False otherwise.
56
+ * @param string $type_id The member type identifier.
57
+ * @return boolean True if the member type already exists. False otherwise.
58
+ */
59
+ function bp_members_type_admin_type_exists( $exists = false, $type_id = '' ) {
60
+ if ( ! $type_id ) {
61
+ return $exists;
62
+ }
63
+
64
+ return ! is_null( bp_get_member_type_object( $type_id ) );
65
+ }
66
+ add_filter( bp_get_member_type_tax_name() . '_check_existing_type', 'bp_members_type_admin_type_exists', 1, 2 );
67
+
68
+ /**
69
+ * Set the feedback messages for the Member Types Admin actions.
70
+ *
71
+ * @since 7.0.0
72
+ *
73
+ * @param array $messages The feedback messages.
74
+ * @return array The feedback messages including the ones for the Member Types Admin actions.
75
+ */
76
+ function bp_members_type_admin_updated_messages( $messages = array() ) {
77
+ $type_taxonomy = bp_get_member_type_tax_name();
78
+
79
+ $messages[ $type_taxonomy ] = array(
80
+ 0 => '',
81
+ 1 => __( 'Please define the Member Type ID field.', 'buddypress' ),
82
+ 2 => __( 'Member type successfully added.', 'buddypress' ),
83
+ 3 => __( 'Sorry, there was an error and the Member type wasn’t added.', 'buddypress' ),
84
+ // The following one needs to be != 5.
85
+ 4 => __( 'Member type successfully updated.', 'buddypress' ),
86
+ 5 => __( 'Sorry, this Member type already exists.', 'buddypress' ),
87
+ 6 => __( 'Sorry, the Member type was not deleted: it does not exist.', 'buddypress' ),
88
+ 7 => __( 'Sorry, This Member type is registered using code, deactivate the plugin or remove the custom code before trying to delete it again.', 'buddypress' ),
89
+ 8 => __( 'Sorry, there was an error while trying to delete this Member type.', 'buddypress' ),
90
+ 9 => __( 'Member type successfully deleted.', 'buddypress' ),
91
+ 10 => __( 'Member type could not be updated due to missing required information.', 'buddypress' ),
92
+ );
93
+
94
+ return $messages;
95
+ }
96
+ add_filter( 'term_updated_messages', 'bp_members_type_admin_updated_messages' );
bp-members/bp-members-blocks.php CHANGED
@@ -106,7 +106,7 @@ function bp_members_render_member_block( $attributes = array() ) {
106
  $avatar_container = sprintf(
107
  '<div class="item-header-avatar">
108
  <a href="%1$s">
109
- <img src="%2$s" alt="%3$s" class="avatar">
110
  </a>
111
  </div>',
112
  esc_url( $member_link ),
@@ -192,3 +192,166 @@ function bp_members_render_member_block( $attributes = array() ) {
192
  */
193
  return apply_filters( 'bp_members_render_member_block_output', $output, $params );
194
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  $avatar_container = sprintf(
107
  '<div class="item-header-avatar">
108
  <a href="%1$s">
109
+ <img loading="lazy" src="%2$s" alt="%3$s" class="avatar">
110
  </a>
111
  </div>',
112
  esc_url( $member_link ),
192
  */
193
  return apply_filters( 'bp_members_render_member_block_output', $output, $params );
194
  }
195
+
196
+ /**
197
+ * Callback function to render the BP Members Block.
198
+ *
199
+ * @since 7.0.0
200
+ *
201
+ * @param array $attributes The block attributes.
202
+ * @return string HTML output.
203
+ */
204
+ function bp_members_render_members_block( $attributes = array() ) {
205
+ $bp = buddypress();
206
+
207
+ $block_args = wp_parse_args(
208
+ $attributes,
209
+ array(
210
+ 'itemIDs' => array(),
211
+ 'avatarSize' => 'full',
212
+ 'displayMentionSlug' => true,
213
+ 'displayUserName' => true,
214
+ 'extraData' => 'none',
215
+ 'layoutPreference' => 'list',
216
+ 'columns' => '2',
217
+ )
218
+ );
219
+
220
+ $member_ids = wp_parse_id_list( $block_args['itemIDs'] );
221
+ if ( ! array_filter( $member_ids ) ) {
222
+ return '';
223
+ }
224
+
225
+ $container_classes = sprintf( 'bp-block-members avatar-%s', $block_args['avatarSize'] );
226
+ if ( 'grid' === $block_args['layoutPreference'] ) {
227
+ $container_classes .= sprintf( ' is-grid columns-%d', (int) $block_args['columns'] );
228
+ }
229
+
230
+ $query_args = array(
231
+ 'user_ids' => $member_ids,
232
+ );
233
+
234
+ if ( 'none' !== $block_args['extraData'] ) {
235
+ $query_args['populate_extras'] = true;
236
+ }
237
+
238
+ $query = bp_core_get_users( $query_args );
239
+
240
+ // Initialize the output and the members.
241
+ $output = '';
242
+ $members = $query['users'];
243
+
244
+ foreach ( $members as $member ) {
245
+ $has_activity = false;
246
+ $member_item_classes = 'member-content';
247
+
248
+ if ( 'list' === $block_args['layoutPreference'] && 'latest_update' === $block_args['extraData'] && isset( $member->latest_update ) && $member->latest_update ) {
249
+ $has_activity = true;
250
+ $member_item_classes = 'member-content has-activity';
251
+ }
252
+
253
+ $output .= sprintf( '<div class="%s">', $member_item_classes );
254
+
255
+ // Get Member link.
256
+ $member_link = bp_core_get_user_domain( $member->ID );
257
+
258
+ // Set the Avatar output.
259
+ if ( $bp->avatar && $bp->avatar->show_avatars && 'none' !== $block_args['avatarSize'] ) {
260
+ $output .= sprintf(
261
+ '<div class="item-header-avatar">
262
+ <a href="%1$s">
263
+ <img class="avatar" alt="%2$s" src="%3$s" />
264
+ </a>
265
+ </div>',
266
+ esc_url( $member_link ),
267
+ /* translators: %s: member name */
268
+ sprintf( esc_attr__( 'Profile photo of %s', 'buddypress' ), $member->display_name ),
269
+ esc_url(
270
+ bp_core_fetch_avatar(
271
+ array(
272
+ 'item_id' => $member->ID,
273
+ 'object' => 'user',
274
+ 'type' => $block_args['avatarSize'],
275
+ 'html' => false,
276
+ )
277
+ )
278
+ )
279
+ );
280
+ }
281
+
282
+ $output .= '<div class="member-description">';
283
+
284
+ // Add the latest activity the member posted.
285
+ if ( $has_activity ) {
286
+ $activity_content = '';
287
+ $activity_data = maybe_unserialize( $member->latest_update );
288
+
289
+ if ( isset( $activity_data['content'] ) ) {
290
+ $activity_content = apply_filters( 'bp_get_activity_content', $activity_data['content'] );
291
+ }
292
+
293
+ $display_name = '';
294
+ if ( $block_args['displayUserName'] ) {
295
+ $display_name = $member->display_name;
296
+ }
297
+
298
+ $mention_name = '';
299
+ if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() && $block_args['displayMentionSlug'] ) {
300
+ $mention_name = '(@' . $member->user_nicename . ')';
301
+ }
302
+
303
+ $output .= sprintf(
304
+ '<blockquote class="wp-block-quote">
305
+ %1$s
306
+ <cite>
307
+ <span>%2$s</span>
308
+ %3$s
309
+ </cite>
310
+ </blockquote>',
311
+ $activity_content,
312
+ esc_html( $display_name ),
313
+ esc_html( $mention_name )
314
+ );
315
+ } else {
316
+ if ( $block_args['displayUserName'] ) {
317
+ $output .= sprintf(
318
+ '<strong><a href="%1$s">%2$s</a></strong>',
319
+ esc_url( $member_link ),
320
+ esc_html( $member->display_name )
321
+ );
322
+ }
323
+
324
+ if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() && $block_args['displayMentionSlug'] ) {
325
+ $output .= sprintf(
326
+ '<span class="user-nicename">@%s</span>',
327
+ esc_html( $member->user_nicename )
328
+ );
329
+ }
330
+
331
+ if ( 'last_activity' === $block_args['extraData'] ) {
332
+ $output .= sprintf(
333
+ '<time datetime="%1$s">%2$s</time>',
334
+ esc_attr( bp_core_get_iso8601_date( $member->last_activity ) ),
335
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
336
+ sprintf( esc_html__( 'Active %s', 'buddypress' ), bp_core_time_since( $member->last_activity ) )
337
+ );
338
+ }
339
+ }
340
+
341
+ $output .= '</div></div>';
342
+ }
343
+
344
+ // Set the final output.
345
+ $output = sprintf( '<div class="%1$s">%2$s</div>', $container_classes, $output );
346
+
347
+ /**
348
+ * Filter here to edit the output of the members block.
349
+ *
350
+ * @since 7.0.0
351
+ *
352
+ * @param string $output The HTML output of the block.
353
+ * @param array $block_args The block arguments.
354
+ * @param array $members The list of WP_User objects.
355
+ */
356
+ return apply_filters( 'bp_members_render_members_block_output', $output, $block_args, $members );
357
+ }
bp-members/bp-members-functions.php CHANGED
@@ -78,6 +78,7 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 );
78
  * bp_use_legacy_user_query value, returning true.
79
  *
80
  * @since 1.2.0
 
81
  *
82
  * @param array|string $args {
83
  * Array of arguments. All are optional. See {@link BP_User_Query} for
@@ -93,9 +94,12 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 );
93
  * `$member_type` takes precedence over this parameter.
94
  * @type array|string $member_type__not_in Array or comma-separated string of member types to be excluded.
95
  * @type mixed $include Limit results by user IDs. Default: false.
 
96
  * @type int $per_page Results per page. Default: 20.
97
  * @type int $page Page of results. Default: 1.
98
  * @type bool $populate_extras Fetch optional extras. Default: true.
 
 
99
  * @type string|bool $count_total How to do total user count. Default: 'count_query'.
100
  * }
101
  * @return array
@@ -114,14 +118,30 @@ function bp_core_get_users( $args = '' ) {
114
  'member_type__in' => '',
115
  'member_type__not_in' => '',
116
  'include' => false, // Pass comma separated list of user_ids to limit to only these users.
 
117
  'per_page' => 20, // The number of results to return per page.
118
  'page' => 1, // The page to return if limiting per page.
119
  'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update.
 
120
  'count_total' => 'count_query' // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false.
121
  ), 'core_get_users' );
122
 
123
- // For legacy users. Use of BP_Core_User::get_users() is deprecated.
124
- if ( apply_filters( 'bp_use_legacy_user_query', false, __FUNCTION__, $r ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  $retval = BP_Core_User::get_users(
126
  $r['type'],
127
  $r['per_page'],
@@ -1042,6 +1062,8 @@ function bp_is_user_inactive( $user_id = 0 ) {
1042
  * Update a user's last activity.
1043
  *
1044
  * @since 1.9.0
 
 
1045
  *
1046
  * @param int $user_id ID of the user being updated.
1047
  * @param string $time Time of last activity, in 'Y-m-d H:i:s' format.
@@ -1064,14 +1086,23 @@ function bp_update_user_last_activity( $user_id = 0, $time = '' ) {
1064
  $time = bp_core_current_time();
1065
  }
1066
 
1067
- // As of BuddyPress 2.0, last_activity is no longer stored in usermeta.
1068
- // However, we mirror it there for backward compatibility. Do not use!
1069
- // Remove our warning and re-add.
1070
- remove_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10 );
1071
- remove_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10 );
1072
- bp_update_user_meta( $user_id, 'last_activity', $time );
1073
- add_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
1074
- add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 4 );
 
 
 
 
 
 
 
 
 
1075
 
1076
  return BP_Core_User::update_last_activity( $user_id, $time );
1077
  }
@@ -1395,7 +1426,7 @@ function bp_core_boot_spammer( $user ) {
1395
  // The user exists; now do a check to see if the user is a spammer
1396
  // if the user is a spammer, stop them in their tracks!
1397
  if ( is_a( $user, 'WP_User' ) && ( ( is_multisite() && (int) $user->spam ) || 1 == $user->user_status ) ) {
1398
- return new WP_Error( 'invalid_username', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' ) );
1399
  }
1400
 
1401
  // User is good to go!
@@ -1581,7 +1612,7 @@ add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names',
1581
  * Performs the following checks:
1582
  * - Is the email address well-formed?
1583
  * - Is the email address already used?
1584
- * - If there's an email domain blacklist, is the current domain on it?
1585
  * - If there's an email domain whitelest, is the current domain on it?
1586
  *
1587
  * @since 1.6.2
@@ -1698,7 +1729,7 @@ function bp_core_validate_user_signup( $user_name, $user_email ) {
1698
  $errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
1699
  }
1700
 
1701
- // User name can't be on the blacklist.
1702
  $illegal_names = get_site_option( 'illegal_names' );
1703
  if ( in_array( $user_name, (array) $illegal_names ) ) {
1704
  $errors->add( 'user_name', __( 'That username is not allowed', 'buddypress' ) );
@@ -1764,6 +1795,40 @@ function bp_core_validate_user_signup( $user_name, $user_email ) {
1764
  return apply_filters( 'bp_core_validate_user_signup', $result );
1765
  }
1766
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1767
  /**
1768
  * Validate blog URL and title provided at signup.
1769
  *
@@ -2066,7 +2131,7 @@ function bp_core_activate_signup( $key ) {
2066
  if ( isset( $user['meta'][ $key ] ) ) {
2067
  $visibility_level = $user['meta'][ $key ];
2068
  } else {
2069
- $vfield = xprofile_get_field( $field_id );
2070
  $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public';
2071
  }
2072
  xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
@@ -2368,7 +2433,7 @@ function bp_core_signup_disable_inactive( $user = null, $username = '', $passwor
2368
  /* translators: %s: the activation url */
2369
  $resend_string .= sprintf( __( 'If you have not received an email yet, <a href="%s">click here to resend it</a>.', 'buddypress' ), esc_url( $resend_url ) );
2370
 
2371
- return new WP_Error( 'bp_account_not_activated', __( '<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link.', 'buddypress' ) . $resend_string );
2372
  }
2373
  add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30, 3 );
2374
 
@@ -2399,7 +2464,7 @@ function bp_members_login_resend_activation_email() {
2399
 
2400
  // Add feedback message.
2401
  if ( ! empty( $resend['errors'] ) ) {
2402
- $error = __( '<strong>ERROR</strong>: Your account has already been activated.', 'buddypress' );
2403
  } else {
2404
  $error = __( 'Activation email resent! Please check your inbox or spam folder.', 'buddypress' );
2405
  }
@@ -2544,7 +2609,7 @@ add_action( 'bp_init', 'bp_stop_live_spammer', 5 );
2544
  function bp_live_spammer_login_error() {
2545
  global $error;
2546
 
2547
- $error = __( '<strong>ERROR</strong>: Your account has been marked as a spammer.', 'buddypress' );
2548
 
2549
  // Shake shake shake!
2550
  add_action( 'login_head', 'wp_shake_js', 12 );
@@ -2605,6 +2670,136 @@ function bp_member_type_tax_name() {
2605
  return apply_filters( 'bp_get_member_type_tax_name', 'bp_member_type' );
2606
  }
2607
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2608
  /**
2609
  * Register a member type.
2610
  *
@@ -2624,6 +2819,10 @@ function bp_member_type_tax_name() {
2624
  * Pass `true` to use the `$member_type` string as the type's slug.
2625
  * Pass a string to customize the slug. Pass `false` to disable.
2626
  * Default: true.
 
 
 
 
2627
  * }
2628
  * @return object|WP_Error Member type object on success, WP_Error object on failure.
2629
  */
@@ -2637,6 +2836,9 @@ function bp_register_member_type( $member_type, $args = array() ) {
2637
  $r = bp_parse_args( $args, array(
2638
  'labels' => array(),
2639
  'has_directory' => true,
 
 
 
2640
  ), 'register_member_type' );
2641
 
2642
  $member_type = sanitize_key( $member_type );
@@ -2684,6 +2886,9 @@ function bp_register_member_type( $member_type, $args = array() ) {
2684
  $r['has_directory'] = false;
2685
  }
2686
 
 
 
 
2687
  $bp->members->types[ $member_type ] = $type = (object) $r;
2688
 
2689
  /**
@@ -2736,6 +2941,11 @@ function bp_get_member_type_object( $member_type ) {
2736
  function bp_get_member_types( $args = array(), $output = 'names', $operator = 'and' ) {
2737
  $types = buddypress()->members->types;
2738
 
 
 
 
 
 
2739
  $types = wp_filter_object_list( $types, $args, $operator );
2740
 
2741
  /**
@@ -2759,21 +2969,101 @@ function bp_get_member_types( $args = array(), $output = 'names', $operator = 'a
2759
  return $types;
2760
  }
2761
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2762
  /**
2763
  * Set type for a member.
2764
  *
2765
  * @since 2.2.0
 
2766
  *
2767
- * @param int $user_id ID of the user.
2768
- * @param string $member_type Member type.
2769
- * @param bool $append Optional. True to append this to existing types for user,
2770
- * false to replace. Default: false.
2771
  * @return false|array $retval See {@see bp_set_object_terms()}.
2772
  */
2773
  function bp_set_member_type( $user_id, $member_type, $append = false ) {
2774
  // Pass an empty $member_type to remove a user's type.
2775
- if ( ! empty( $member_type ) && ! bp_get_member_type_object( $member_type ) ) {
2776
- return false;
 
 
 
 
 
 
 
2777
  }
2778
 
2779
  $retval = bp_set_object_terms( $user_id, $member_type, bp_get_member_type_tax_name(), $append );
@@ -2787,9 +3077,9 @@ function bp_set_member_type( $user_id, $member_type, $append = false ) {
2787
  *
2788
  * @since 2.2.0
2789
  *
2790
- * @param int $user_id ID of the user whose member type has been updated.
2791
- * @param string $member_type Member type.
2792
- * @param bool $append Whether the type is being appended to existing types.
2793
  */
2794
  do_action( 'bp_set_member_type', $user_id, $member_type, $append );
2795
  }
@@ -2842,14 +3132,17 @@ function bp_remove_member_type( $user_id, $member_type ) {
2842
  * Get type for a member.
2843
  *
2844
  * @since 2.2.0
 
2845
  *
2846
  * @param int $user_id ID of the user.
2847
  * @param bool $single Optional. Whether to return a single type string. If multiple types are found
2848
  * for the user, the oldest one will be returned. Default: true.
 
 
2849
  * @return string|array|bool On success, returns a single member type (if $single is true) or an array of member
2850
  * types (if $single is false). Returns false on failure.
2851
  */
2852
- function bp_get_member_type( $user_id, $single = true ) {
2853
  $types = wp_cache_get( $user_id, 'bp_member_member_type' );
2854
 
2855
  if ( false === $types ) {
@@ -2869,6 +3162,12 @@ function bp_get_member_type( $user_id, $single = true ) {
2869
  }
2870
  }
2871
 
 
 
 
 
 
 
2872
  $type = false;
2873
  if ( ! empty( $types ) ) {
2874
  if ( $single ) {
@@ -2883,9 +3182,10 @@ function bp_get_member_type( $user_id, $single = true ) {
2883
  *
2884
  * @since 2.2.0
2885
  *
2886
- * @param string $type Member type.
2887
- * @param int $user_id ID of the user.
2888
- * @param bool $single Whether to return a single type string, or an array.
 
2889
  */
2890
  return apply_filters( 'bp_get_member_type', $type, $user_id, $single );
2891
  }
78
  * bp_use_legacy_user_query value, returning true.
79
  *
80
  * @since 1.2.0
81
+ * @since 7.0.0 Added `xprofile_query` parameter. Added `user_ids` parameter.
82
  *
83
  * @param array|string $args {
84
  * Array of arguments. All are optional. See {@link BP_User_Query} for
94
  * `$member_type` takes precedence over this parameter.
95
  * @type array|string $member_type__not_in Array or comma-separated string of member types to be excluded.
96
  * @type mixed $include Limit results by user IDs. Default: false.
97
+ * @type mixed $user_ids IDs corresponding to the users. Default: false.
98
  * @type int $per_page Results per page. Default: 20.
99
  * @type int $page Page of results. Default: 1.
100
  * @type bool $populate_extras Fetch optional extras. Default: true.
101
+ * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile
102
+ * component. See {@see BP_XProfile_Query} for details.
103
  * @type string|bool $count_total How to do total user count. Default: 'count_query'.
104
  * }
105
  * @return array
118
  'member_type__in' => '',
119
  'member_type__not_in' => '',
120
  'include' => false, // Pass comma separated list of user_ids to limit to only these users.
121
+ 'user_ids' => false,
122
  'per_page' => 20, // The number of results to return per page.
123
  'page' => 1, // The page to return if limiting per page.
124
  'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update.
125
+ 'xprofile_query' => false,
126
  'count_total' => 'count_query' // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false.
127
  ), 'core_get_users' );
128
 
129
+ /**
130
+ * For legacy users. Use of BP_Core_User::get_users() is deprecated.
131
+ *
132
+ * Forcing this filter to true will use the legacy user query. As of
133
+ * BuddyPress 7.0.0, mirroring of the 'last_activity' value to usermeta
134
+ * is also disabled if true. See bp_update_user_last_activity().
135
+ *
136
+ * @since 2.0.0
137
+ *
138
+ * @param bool $retval Defaults to false.
139
+ * @param string $function Current function name.
140
+ * @param array $r User query arguments.
141
+ */
142
+ $use_legacy_query = apply_filters( 'bp_use_legacy_user_query', false, __FUNCTION__, $r );
143
+
144
+ if ( $use_legacy_query ) {
145
  $retval = BP_Core_User::get_users(
146
  $r['type'],
147
  $r['per_page'],
1062
  * Update a user's last activity.
1063
  *
1064
  * @since 1.9.0
1065
+ * @since 7.0.0 Backward compatibility usermeta mirroring is only allowed if the
1066
+ * legacy user query is enabled.
1067
  *
1068
  * @param int $user_id ID of the user being updated.
1069
  * @param string $time Time of last activity, in 'Y-m-d H:i:s' format.
1086
  $time = bp_core_current_time();
1087
  }
1088
 
1089
+ /** This filter is documented in bp_core_get_users() */
1090
+ $use_legacy_query = apply_filters( 'bp_use_legacy_user_query', false, __FUNCTION__, [ 'user_id' => $user_id ] );
1091
+
1092
+ /*
1093
+ * As of BuddyPress 2.0, last_activity is no longer stored in usermeta.
1094
+ * However, we mirror it there for backward compatibility. Do not use!
1095
+ *
1096
+ * As of BuddyPress 7.0, mirroring is only allowed if the legacy user
1097
+ * query is enabled.
1098
+ */
1099
+ if ( $use_legacy_query ) {
1100
+ remove_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10 );
1101
+ remove_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10 );
1102
+ bp_update_user_meta( $user_id, 'last_activity', $time );
1103
+ add_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
1104
+ add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 4 );
1105
+ }
1106
 
1107
  return BP_Core_User::update_last_activity( $user_id, $time );
1108
  }
1426
  // The user exists; now do a check to see if the user is a spammer
1427
  // if the user is a spammer, stop them in their tracks!
1428
  if ( is_a( $user, 'WP_User' ) && ( ( is_multisite() && (int) $user->spam ) || 1 == $user->user_status ) ) {
1429
+ return new WP_Error( 'invalid_username', __( '<strong>Error</strong>: Your account has been marked as a spammer.', 'buddypress' ) );
1430
  }
1431
 
1432
  // User is good to go!
1612
  * Performs the following checks:
1613
  * - Is the email address well-formed?
1614
  * - Is the email address already used?
1615
+ * - If there are disallowed email domains, is the current domain among them?
1616
  * - If there's an email domain whitelest, is the current domain on it?
1617
  *
1618
  * @since 1.6.2
1729
  $errors->add( 'user_name', __( 'Please enter a username', 'buddypress' ) );
1730
  }
1731
 
1732
+ // User name can't be on the list of illegal names.
1733
  $illegal_names = get_site_option( 'illegal_names' );
1734
  if ( in_array( $user_name, (array) $illegal_names ) ) {
1735
  $errors->add( 'user_name', __( 'That username is not allowed', 'buddypress' ) );
1795
  return apply_filters( 'bp_core_validate_user_signup', $result );
1796
  }
1797
 
1798
+ /**
1799
+ * Validate a user password.
1800
+ *
1801
+ * @since 7.0.0
1802
+ *
1803
+ * @param string $pass The password.
1804
+ * @param string $confirm_pass The confirmed password.
1805
+ * @param null|WP_User $userdata Null or the userdata object when a member updates their password from front-end.
1806
+ * @return WP_Error A WP error object possibly containing error messages.
1807
+ */
1808
+ function bp_members_validate_user_password( $pass, $confirm_pass, $userdata = null ) {
1809
+ $errors = new WP_Error();
1810
+
1811
+ if ( ! $pass || ! $confirm_pass ) {
1812
+ $errors->add( 'missing_user_password', __( 'Please make sure you enter your password twice', 'buddypress' ) );
1813
+ }
1814
+
1815
+ if ( $pass && $confirm_pass && $pass !== $confirm_pass ) {
1816
+ $errors->add( 'mismatching_user_password', __( 'The passwords you entered do not match.', 'buddypress' ) );
1817
+ }
1818
+
1819
+ /**
1820
+ * Filter here to add password validation errors.
1821
+ *
1822
+ * @since 7.0.0
1823
+ *
1824
+ * @param WP_Error $errors Password validation errors.
1825
+ * @param string $pass The password.
1826
+ * @param string $confirm_pass The confirmed password.
1827
+ * @param null|WP_User $userdata Null or the userdata object when a member updates their password from front-end.
1828
+ */
1829
+ return apply_filters( 'bp_members_validate_user_password', $errors, $pass, $confirm_pass, $userdata );
1830
+ }
1831
+
1832
  /**
1833
  * Validate blog URL and title provided at signup.
1834
  *
2131
  if ( isset( $user['meta'][ $key ] ) ) {
2132
  $visibility_level = $user['meta'][ $key ];
2133
  } else {
2134
+ $vfield = xprofile_get_field( $field_id, null, false );
2135
  $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public';
2136
  }
2137
  xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
2433
  /* translators: %s: the activation url */
2434
  $resend_string .= sprintf( __( 'If you have not received an email yet, <a href="%s">click here to resend it</a>.', 'buddypress' ), esc_url( $resend_url ) );
2435
 
2436
+ return new WP_Error( 'bp_account_not_activated', __( '<strong>Error</strong>: Your account has not been activated. Check your email for the activation link.', 'buddypress' ) . $resend_string );
2437
  }
2438
  add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30, 3 );
2439
 
2464
 
2465
  // Add feedback message.
2466
  if ( ! empty( $resend['errors'] ) ) {
2467
+ $error = __( '<strong>Error</strong>: Your account has already been activated.', 'buddypress' );
2468
  } else {
2469
  $error = __( 'Activation email resent! Please check your inbox or spam folder.', 'buddypress' );
2470
  }
2609
  function bp_live_spammer_login_error() {
2610
  global $error;
2611
 
2612
+ $error = __( '<strong>Error</strong>: Your account has been marked as a spammer.', 'buddypress' );
2613
 
2614
  // Shake shake shake!
2615
  add_action( 'login_head', 'wp_shake_js', 12 );
2670
  return apply_filters( 'bp_get_member_type_tax_name', 'bp_member_type' );
2671
  }
2672
 
2673
+ /**
2674
+ * Returns labels used by the member type taxonomy.
2675
+ *
2676
+ * @since 7.0.0
2677
+ *
2678
+ * @return array
2679
+ */
2680
+ function bp_get_member_type_tax_labels() {
2681
+
2682
+ /**
2683
+ * Filters Member type taxonomy labels.
2684
+ *
2685
+ * @since 7.0.0
2686
+ *
2687
+ * @param array $value Associative array (name => label).
2688
+ */
2689
+ return apply_filters(
2690
+ 'bp_get_member_type_tax_labels',
2691
+ array(
2692
+
2693
+ // General labels
2694
+ 'name' => _x( 'Member Types', 'Member type taxonomy name', 'buddypress' ),
2695
+ 'singular_name' => _x( 'Member Type', 'Member type taxonomy singular name', 'buddypress' ),
2696
+ 'search_items' => _x( 'Search Member Types', 'Member type taxonomy search items label', 'buddypress' ),
2697
+ 'popular_items' => _x( 'Popular Member Types', 'Member type taxonomy popular items label', 'buddypress' ),
2698
+ 'all_items' => _x( 'All Member Types', 'Member type taxonomy all items label', 'buddypress' ),
2699
+ 'parent_item' => _x( 'Parent Member Type', 'Member type taxonomy parent item label', 'buddypress' ),
2700
+ 'parent_item_colon' => _x( 'Parent Member Type:', 'Member type taxonomy parent item label', 'buddypress' ),
2701
+ 'edit_item' => _x( 'Edit Member Type', 'Member type taxonomy edit item label', 'buddypress' ),
2702
+ 'view_item' => _x( 'View Member Type', 'Member type taxonomy view item label', 'buddypress' ),
2703
+ 'update_item' => _x( 'Update Member Type', 'Member type taxonomy update item label', 'buddypress' ),
2704
+ 'add_new_item' => _x( 'Add New Member Type', 'Member type taxonomy add new item label', 'buddypress' ),
2705
+ 'new_item_name' => _x( 'New Member Type Name', 'Member type taxonomy new item name label', 'buddypress' ),
2706
+ 'separate_items_with_commas' => _x( 'Separate member types with commas', 'Member type taxonomy separate items with commas label', 'buddypress' ),
2707
+ 'add_or_remove_items' => _x( 'Add or remove member types', 'Member type taxonomy add or remove items label', 'buddypress' ),
2708
+ 'choose_from_most_used' => _x( 'Choose from the most used meber types', 'Member type taxonomy choose from most used label', 'buddypress' ),
2709
+ 'not_found' => _x( 'No member types found.', 'Member type taxonomy not found label', 'buddypress' ),
2710
+ 'no_terms' => _x( 'No member types', 'Member type taxonomy no terms label', 'buddypress' ),
2711
+ 'items_list_navigation' => _x( 'Member Types list navigation', 'Member type taxonomy items list navigation label', 'buddypress' ),
2712
+ 'items_list' => _x( 'Member Types list', 'Member type taxonomy items list label', 'buddypress' ),
2713
+
2714
+ /* translators: Tab heading when selecting from the most used terms. */
2715
+ 'most_used' => _x( 'Most Used', 'Member type taxonomy most used items label', 'buddypress' ),
2716
+ 'back_to_items' => _x( '&larr; Back to Member Types', 'Member type taxonomy back to items label', 'buddypress' ),
2717
+
2718
+ // Specific to BuddyPress.
2719
+ 'bp_type_id_label' => _x( 'Member Type ID', 'BP Member type ID label', 'buddypress' ),
2720
+ 'bp_type_id_description' => _x( 'Enter a lower-case string without spaces or special characters (used internally to identify the member type).', 'BP Member type ID description', 'buddypress' ),
2721
+ 'bp_type_show_in_list' => _x( 'Show on Member', 'BP Member type show in list', 'buddypress' ),
2722
+ )
2723
+ );
2724
+ }
2725
+
2726
+ /**
2727
+ * Returns arguments used by the Member type taxonomy.
2728
+ *
2729
+ * @since 7.0.0
2730
+ *
2731
+ * @return array
2732
+ */
2733
+ function bp_get_member_type_tax_args() {
2734
+
2735
+ /**
2736
+ * Filters Member type taxonomy args.
2737
+ *
2738
+ * @since 7.0.0
2739
+ *
2740
+ * @param array $value Associative array (key => arg).
2741
+ */
2742
+ return apply_filters(
2743
+ 'bp_get_member_type_tax_args',
2744
+ array_merge(
2745
+ array(
2746
+ 'description' => _x( 'BuddyPress Member Types', 'Member type taxonomy description', 'buddypress' ),
2747
+ 'labels' => array_merge( bp_get_member_type_tax_labels(), bp_get_taxonomy_common_labels() ),
2748
+ ),
2749
+ bp_get_taxonomy_common_args()
2750
+ )
2751
+ );
2752
+ }
2753
+
2754
+ /**
2755
+ * Extend generic Type metadata schema to match Member Type needs.
2756
+ *
2757
+ * @since 7.0.0
2758
+ *
2759
+ * @param array $schema The generic Type metadata schema.
2760
+ * @param string $taxonomy The taxonomy name the schema applies to.
2761
+ * @return array The Member Type metadata schema.
2762
+ */
2763
+ function bp_get_member_type_metadata_schema( $schema = array(), $taxonomy = '' ) {
2764
+ if ( bp_get_member_type_tax_name() === $taxonomy ) {
2765
+
2766
+ // Directory.
2767
+ if ( isset( $schema['bp_type_has_directory']['description'] ) ) {
2768
+ $schema['bp_type_has_directory']['description'] = __( 'Make a list of members matching this type available on the members directory.', 'buddypress' );
2769
+ }
2770
+
2771
+ // Slug.
2772
+ if ( isset( $schema['bp_type_directory_slug']['description'] ) ) {
2773
+ $schema['bp_type_directory_slug']['description'] = __( 'Enter if you want the type slug to be different from its ID.', 'buddypress' );
2774
+ }
2775
+
2776
+ // List.
2777
+ $schema['bp_type_show_in_list'] = array(
2778
+ 'description' => __( 'Show where member types may be listed, like in the member header.', 'buddypress' ),
2779
+ 'type' => 'boolean',
2780
+ 'single' => true,
2781
+ 'sanitize_callback' => 'absint',
2782
+ );
2783
+ }
2784
+
2785
+ return $schema;
2786
+ }
2787
+ add_filter( 'bp_get_type_metadata_schema', 'bp_get_member_type_metadata_schema', 1, 2 );
2788
+
2789
+ /**
2790
+ * Registers the Member type metadata.
2791
+ *
2792
+ * @since 7.0.0
2793
+ */
2794
+ function bp_register_member_type_metadata() {
2795
+ $type_taxonomy = bp_get_member_type_tax_name();
2796
+
2797
+ foreach ( bp_get_type_metadata_schema( false, $type_taxonomy ) as $meta_key => $meta_args ) {
2798
+ bp_register_type_meta( $type_taxonomy, $meta_key, $meta_args );
2799
+ }
2800
+ }
2801
+ add_action( 'bp_register_type_metadata', 'bp_register_member_type_metadata' );
2802
+
2803
  /**
2804
  * Register a member type.
2805
  *
2819
  * Pass `true` to use the `$member_type` string as the type's slug.
2820
  * Pass a string to customize the slug. Pass `false` to disable.
2821
  * Default: true.
2822
+ * @type bool $show_in_list Whether this member type should be shown in lists rendered by
2823
+ * bp_member_type_list(). Default: false.
2824
+ * @type bool $code Whether this member type is registered using code. Default: true.
2825
+ * @type int $db_id The member type term ID. Default: 0.
2826
  * }
2827
  * @return object|WP_Error Member type object on success, WP_Error object on failure.
2828
  */
2836
  $r = bp_parse_args( $args, array(
2837
  'labels' => array(),
2838
  'has_directory' => true,
2839
+ 'show_in_list' => false,
2840
+ 'code' => true,
2841
+ 'db_id' => 0,
2842
  ), 'register_member_type' );
2843
 
2844
  $member_type = sanitize_key( $member_type );
2886
  $r['has_directory'] = false;
2887
  }
2888
 
2889
+ // Show the list of member types on front-end (member header, for now).
2890
+ $r['show_in_list'] = (bool) $r['show_in_list'];
2891
+
2892
  $bp->members->types[ $member_type ] = $type = (object) $r;
2893
 
2894
  /**
2941
  function bp_get_member_types( $args = array(), $output = 'names', $operator = 'and' ) {
2942
  $types = buddypress()->members->types;
2943
 
2944
+ // Merge with types available into the database.
2945
+ if ( ! isset( $args['code'] ) || true !== $args['code'] ) {
2946
+ $types = bp_get_taxonomy_types( bp_get_member_type_tax_name(), $types );
2947
+ }
2948
+
2949
  $types = wp_filter_object_list( $types, $args, $operator );
2950
 
2951
  /**
2969
  return $types;
2970
  }
2971
 
2972
+ /**
2973
+ * Only gets the member types registered by code.
2974
+ *
2975
+ * @since 7.0.0
2976
+ *
2977
+ * @return array The member types registered by code.
2978
+ */
2979
+ function bp_get_member_types_registered_by_code() {
2980
+ return bp_get_member_types(
2981
+ array(
2982
+ 'code' => true,
2983
+ ),
2984
+ 'objects'
2985
+ );
2986
+ }
2987
+ add_filter( bp_get_member_type_tax_name() . '_registered_by_code', 'bp_get_member_types_registered_by_code' );
2988
+
2989
+ /**
2990
+ * Generates missing metadata for a type registered by code.
2991
+ *
2992
+ * @since 7.0.0
2993
+ *
2994
+ * @return array The member type metadata.
2995
+ */
2996
+ function bp_set_registered_by_code_member_type_metadata( $metadata = array(), $type = '' ) {
2997
+ $member_type = bp_get_member_type_object( $type );
2998
+
2999
+ foreach ( get_object_vars( $member_type ) as $object_key => $object_value ) {
3000
+ if ( 'labels' === $object_key ) {
3001
+ foreach ( $object_value as $label_key => $label_value ) {
3002
+ $metadata[ 'bp_type_' . $label_key ] = $label_value;
3003
+ }
3004
+ } elseif ( ! in_array( $object_key, array( 'name', 'code', 'db_id' ), true ) ) {
3005
+ $metadata[ 'bp_type_' . $object_key ] = $object_value;
3006
+ }
3007
+ }
3008
+
3009
+ /**
3010
+ * Save metadata into database to avoid generating metadata
3011
+ * each time a type is listed into the Types Admin screen.
3012
+ */
3013
+ if ( isset( $member_type->db_id ) && $member_type->db_id ) {
3014
+ bp_update_type_metadata( $member_type->db_id, bp_get_member_type_tax_name(), $metadata );
3015
+ }
3016
+
3017
+ return $metadata;
3018
+ }
3019
+ add_filter( bp_get_member_type_tax_name() . '_set_registered_by_code_metada', 'bp_set_registered_by_code_member_type_metadata', 10, 2 );
3020
+
3021
+ /**
3022
+ * Insert member types registered by code not yet saved into the database as WP Terms.
3023
+ *
3024
+ * @since 7.0.0
3025
+ */
3026
+ function bp_insert_member_types_registered_by_code() {
3027
+ $all_types = bp_get_member_types( array(), 'objects' );
3028
+ $unsaved_types = wp_filter_object_list( $all_types, array( 'db_id' => 0 ), 'and', 'name' );
3029
+
3030
+ if ( $unsaved_types ) {
3031
+ foreach ( $unsaved_types as $type_name ) {
3032
+ bp_insert_term(
3033
+ $type_name,
3034
+ bp_get_member_type_tax_name(),
3035
+ array(
3036
+ 'slug' => $type_name,
3037
+ )
3038
+ );
3039
+ }
3040
+ }
3041
+ }
3042
+ add_action( bp_get_member_type_tax_name() . '_add_form', 'bp_insert_member_types_registered_by_code', 1 );
3043
+
3044
  /**
3045
  * Set type for a member.
3046
  *
3047
  * @since 2.2.0
3048
+ * @since 7.0.0 $member_type parameter also accepts an array of member type names.
3049
  *
3050
+ * @param int $user_id ID of the user.
3051
+ * @param string|array $member_type The member type name or an array of member type names.
3052
+ * @param bool $append Optional. True to append this to existing types for user,
3053
+ * false to replace. Default: false.
3054
  * @return false|array $retval See {@see bp_set_object_terms()}.
3055
  */
3056
  function bp_set_member_type( $user_id, $member_type, $append = false ) {
3057
  // Pass an empty $member_type to remove a user's type.
3058
+ if ( ! empty( $member_type ) ) {
3059
+ $member_types = (array) $member_type;
3060
+ $valid_types = array_filter( array_map( 'bp_get_member_type_object', $member_types ) );
3061
+
3062
+ if ( $valid_types ) {
3063
+ $member_type = wp_list_pluck( $valid_types, 'name' );
3064
+ } else {
3065
+ return false;
3066
+ }
3067
  }
3068
 
3069
  $retval = bp_set_object_terms( $user_id, $member_type, bp_get_member_type_tax_name(), $append );
3077
  *
3078
  * @since 2.2.0
3079
  *
3080
+ * @param int $user_id ID of the user whose member type has been updated.
3081
+ * @param string|array $member_type The member type name or an array of member type names.
3082
+ * @param bool $append Whether the type is being appended to existing types.
3083
  */
3084
  do_action( 'bp_set_member_type', $user_id, $member_type, $append );
3085
  }
3132
  * Get type for a member.
3133
  *
3134
  * @since 2.2.0
3135
+ * @since 7.0.0 Adds the `$use_db` parameter.
3136
  *
3137
  * @param int $user_id ID of the user.
3138
  * @param bool $single Optional. Whether to return a single type string. If multiple types are found
3139
  * for the user, the oldest one will be returned. Default: true.
3140
+ * @param bool $use_db Optional. Whether to request all member types or only the ones registered by code.
3141
+ * Default: true.
3142
  * @return string|array|bool On success, returns a single member type (if $single is true) or an array of member
3143
  * types (if $single is false). Returns false on failure.
3144
  */
3145
+ function bp_get_member_type( $user_id, $single = true, $use_db = true ) {
3146
  $types = wp_cache_get( $user_id, 'bp_member_member_type' );
3147
 
3148
  if ( false === $types ) {
3162
  }
3163
  }
3164
 
3165
+ if ( false === $use_db && $types ) {
3166
+ $registred_by_code = bp_get_member_types_registered_by_code();
3167
+ $ctype_names = wp_list_pluck( $registred_by_code, 'name' );
3168
+ $types = array_intersect( $types, $ctype_names );
3169
+ }
3170
+
3171
  $type = false;
3172
  if ( ! empty( $types ) ) {
3173
  if ( $single ) {
3182
  *
3183
  * @since 2.2.0
3184
  *
3185
+ * @param string|array|bool $type a single member type (if $single is true) or an array of member types
3186
+ * (if $single is false) or false on failure.
3187
+ * @param int $user_id ID of the user.
3188
+ * @param bool $single Whether to return a single type string, or an array.
3189
  */
3190
  return apply_filters( 'bp_get_member_type', $type, $user_id, $single );
3191
  }
bp-members/bp-members-template.php CHANGED
@@ -282,6 +282,7 @@ function bp_activate_slug() {
282
  * display a list of members.
283
  *
284
  * @since 1.2.0
 
285
  *
286
  * @global object $members_template {@link BP_Members_Template}
287
  *
@@ -309,6 +310,8 @@ function bp_activate_slug() {
309
  * @type array|int|string|bool $exclude Exclude users from results by ID. Accepts an array, a single
310
  * integer, a comma-separated list of IDs, or false (to disable
311
  * this limiting). Default: false.
 
 
312
  * @type int $user_id If provided, results are limited to the friends of the specified
313
  * user. When on a user's Friends page, defaults to the ID of the
314
  * displayed user. Otherwise defaults to 0.
@@ -325,6 +328,8 @@ function bp_activate_slug() {
325
  * Default: false.
326
  * @type mixed $meta_value When used with meta_key, limits results by the a matching
327
  * usermeta value. Default: false.
 
 
328
  * @type bool $populate_extras Whether to fetch optional data, such as friend counts.
329
  * Default: true.
330
  * }
@@ -368,6 +373,7 @@ function bp_has_members( $args = '' ) {
368
 
369
  'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users.
370
  'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users.
 
371
 
372
  'user_id' => $user_id, // Pass a user_id to only show friends of this user.
373
  'member_type' => $member_type,
@@ -378,6 +384,7 @@ function bp_has_members( $args = '' ) {
378
  'meta_key' => false, // Only return users with this usermeta.
379
  'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key.
380
 
 
381
  'populate_extras' => true // Fetch usermeta? Friend count, last active etc.
382
  ), 'has_members' );
383
 
@@ -396,23 +403,7 @@ function bp_has_members( $args = '' ) {
396
  }
397
 
398
  // Query for members and populate $members_template global.
399
- $members_template = new BP_Core_Members_Template(
400
- $r['type'],
401
- $r['page'],
402
- $r['per_page'],
403
- $r['max'],
404
- $r['user_id'],
405
- $r['search_terms'],
406
- $r['include'],
407
- $r['populate_extras'],
408
- $r['exclude'],
409
- $r['meta_key'],
410
- $r['meta_value'],
411
- $r['page_arg'],
412
- $r['member_type'],
413
- $r['member_type__in'],
414
- $r['member_type__not_in']
415
- );
416
 
417
  /**
418
  * Filters whether or not BuddyPress has members to iterate over.
@@ -964,7 +955,8 @@ function bp_member_last_active( $args = array() ) {
964
 
965
  // Backwards compatibility for anyone forcing a 'true' active_format.
966
  if ( true === $r['active_format'] ) {
967
- $r['active_format'] = __( 'active %s', 'buddypress' );
 
968
  }
969
 
970
  // Member has logged in at least one time.
@@ -1695,10 +1687,12 @@ function bp_last_activity( $user_id = 0 ) {
1695
  */
1696
  function bp_get_last_activity( $user_id = 0 ) {
1697
 
1698
- if ( empty( $user_id ) )
1699
  $user_id = bp_displayed_user_id();
 
1700
 
1701
- $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __('active %s', 'buddypress') );
 
1702
 
1703
  /**
1704
  * Filters the 'active [x days ago]' string for a user.
@@ -2026,6 +2020,190 @@ function bp_current_member_type_message() {
2026
  return apply_filters( 'bp_get_current_member_type_message', $message );
2027
  }
2028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2029
  /** Signup Form ***************************************************************/
2030
 
2031
  /**
@@ -2425,7 +2603,7 @@ function bp_signup_avatar_dir_value() {
2425
  */
2426
  function bp_signup_requires_privacy_policy_acceptance() {
2427
  // Bail if we're running a version of WP that doesn't have the Privacy Policy feature.
2428
- if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
2429
  return false;
2430
  }
2431
 
282
  * display a list of members.
283
  *
284
  * @since 1.2.0
285
+ * @since 7.0.0 Added `xprofile_query` parameter. Added `user_ids` parameter.
286
  *
287
  * @global object $members_template {@link BP_Members_Template}
288
  *
310
  * @type array|int|string|bool $exclude Exclude users from results by ID. Accepts an array, a single
311
  * integer, a comma-separated list of IDs, or false (to disable
312
  * this limiting). Default: false.
313
+ * @type array|string|bool $user_ids An array or comma-separated list of IDs, or false (to
314
+ * disable this limiting). Default: false.
315
  * @type int $user_id If provided, results are limited to the friends of the specified
316
  * user. When on a user's Friends page, defaults to the ID of the
317
  * displayed user. Otherwise defaults to 0.
328
  * Default: false.
329
  * @type mixed $meta_value When used with meta_key, limits results by the a matching
330
  * usermeta value. Default: false.
331
+ * @type array $xprofile_query Filter results by xprofile data. Requires the xprofile
332
+ * component. See {@see BP_XProfile_Query} for details.
333
  * @type bool $populate_extras Whether to fetch optional data, such as friend counts.
334
  * Default: true.
335
  * }
373
 
374
  'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users.
375
  'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users.
376
+ 'user_ids' => false,
377
 
378
  'user_id' => $user_id, // Pass a user_id to only show friends of this user.
379
  'member_type' => $member_type,
384
  'meta_key' => false, // Only return users with this usermeta.
385
  'meta_value' => false, // Only return users where the usermeta value matches. Requires meta_key.
386
 
387
+ 'xprofile_query' => false,
388
  'populate_extras' => true // Fetch usermeta? Friend count, last active etc.
389
  ), 'has_members' );
390
 
403
  }
404
 
405
  // Query for members and populate $members_template global.
406
+ $members_template = new BP_Core_Members_Template( $r );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
407
 
408
  /**
409
  * Filters whether or not BuddyPress has members to iterate over.
955
 
956
  // Backwards compatibility for anyone forcing a 'true' active_format.
957
  if ( true === $r['active_format'] ) {
958
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
959
+ $r['active_format'] = __( 'Active %s', 'buddypress' );
960
  }
961
 
962
  // Member has logged in at least one time.
1687
  */
1688
  function bp_get_last_activity( $user_id = 0 ) {
1689
 
1690
+ if ( empty( $user_id ) ) {
1691
  $user_id = bp_displayed_user_id();
1692
+ }
1693
 
1694
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
1695
+ $last_activity = bp_core_get_last_activity( bp_get_user_last_activity( $user_id ), __( 'Active %s', 'buddypress') );
1696
 
1697
  /**
1698
  * Filters the 'active [x days ago]' string for a user.
2020
  return apply_filters( 'bp_get_current_member_type_message', $message );
2021
  }
2022
 
2023
+ /**
2024
+ * Output member type directory link.
2025
+ *
2026
+ * @since 7.0.0
2027
+ *
2028
+ * @param string $member_type Unique member type identifier as used in bp_register_member_type().
2029
+ */
2030
+ function bp_member_type_directory_link( $member_type = '' ) {
2031
+ echo bp_get_member_type_directory_link( $member_type );
2032
+ }
2033
+ /**
2034
+ * Return member type directory link.
2035
+ *
2036
+ * @since 7.0.0
2037
+ *
2038
+ * @param string $member_type Unique member type identifier as used in bp_register_member_type().
2039
+ * @return string
2040
+ */
2041
+ function bp_get_member_type_directory_link( $member_type = '' ) {
2042
+ if ( empty( $member_type ) ) {
2043
+ return '';
2044
+ }
2045
+
2046
+ $member_type_object = bp_get_member_type_object( $member_type );
2047
+
2048
+ if ( ! isset( $member_type_object->labels['name'] ) ) {
2049
+ return '';
2050
+ }
2051
+
2052
+ $member_type_text = $member_type_object->labels['name'];
2053
+ if ( isset( $member_type_object->labels['singular_name'] ) && $member_type_object->labels['singular_name'] ) {
2054
+ $member_type_text = $member_type_object->labels['singular_name'];
2055
+ }
2056
+
2057
+ if ( empty( $member_type_object->has_directory ) ) {
2058
+ return esc_html( $member_type_text );
2059
+ }
2060
+
2061
+ return sprintf(
2062
+ '<a href="%1$s">%2$s</a>',
2063
+ esc_url( bp_get_member_type_directory_permalink( $member_type ) ),
2064
+ esc_html( $member_type_text )
2065
+ );
2066
+ }
2067
+
2068
+ /**
2069
+ * Output a comma-delimited list of member types.
2070
+ *
2071
+ * @since 7.0.0
2072
+ * @see bp_get_member_type_list() For additional information on default arguments.
2073
+ *
2074
+ * @param int $user_id User ID.
2075
+ * @param array $r Optional. Member type list arguments. Default empty array.
2076
+ */
2077
+ function bp_member_type_list( $user_id = 0, $r = array() ) {
2078
+ echo bp_get_member_type_list( $user_id, $r );
2079
+ }
2080
+ /**
2081
+ * Return a comma-delimited list of member types.
2082
+ *
2083
+ * @since 7.0.0
2084
+ *
2085
+ * @param int $user_id User ID. Defaults to displayed user ID if on a member page.
2086
+ * @param array|string $r {
2087
+ * Array of parameters. All items are optional.
2088
+ * @type string $parent_element Element to wrap around the list. Defaults to 'p'.
2089
+ * @type array $parent_attr Element attributes for parent element. Defaults to
2090
+ * array( 'class' => 'bp-member-type-list' ).
2091
+ * @type array $label Plural and singular labels to use before the list. Defaults to
2092
+ * array( 'plural' => 'Member Types:', 'singular' => 'Member Type:' ).
2093
+ * @type string $label_element Element to wrap around the label. Defaults to 'strong'.
2094
+ * @type array $label_attr Element attributes for label element. Defaults to array().
2095
+ * @type bool $show_all Whether to show all registered group types. Defaults to 'false'. If
2096
+ * 'false', only shows member types with the 'show_in_list' parameter set to
2097
+ * true. See bp_register_member_type() for more info.
2098
+ * @type string $list_element Element to wrap around the comma separated list of membet types. Defaults to ''.
2099
+ * @type string $list_element_attr Element attributes for list element. Defaults to array().
2100
+ * }
2101
+ * @return string
2102
+ */
2103
+ function bp_get_member_type_list( $user_id = 0, $r = array() ) {
2104
+ if ( empty( $user_id ) ) {
2105
+ $user_id = bp_displayed_user_id();
2106
+ }
2107
+
2108
+ $r = bp_parse_args(
2109
+ $r,
2110
+ array(
2111
+ 'parent_element' => 'p',
2112
+ 'parent_attr' => array(
2113
+ 'class' => 'bp-member-type-list',
2114
+ ),
2115
+ 'label' => array(),
2116
+ 'label_element' => 'strong',
2117
+ 'label_attr' => array(),
2118
+ 'show_all' => false,
2119
+ 'list_element' => '',
2120
+ 'list_element_attr' => array(),
2121
+ ),
2122
+ 'member_type_list'
2123
+ );
2124
+
2125
+ // Should the label be output?
2126
+ $has_label = ! empty( $r['label'] );
2127
+
2128
+ $labels = wp_parse_args(
2129
+ $r['label'],
2130
+ array(
2131
+ 'plural' => __( 'Member Types:', 'buddypress' ),
2132
+ 'singular' => __( 'Member Type:', 'buddypress' ),
2133
+ )
2134
+ );
2135
+
2136
+ $retval = '';
2137
+ $types = bp_get_member_type( $user_id, false );
2138
+
2139
+ if ( $types ) {
2140
+ // Make sure we can show the type in the list.
2141
+ if ( false === $r['show_all'] ) {
2142
+ $types = array_intersect( bp_get_member_types( array( 'show_in_list' => true ) ), $types );
2143
+ if ( empty( $types ) ) {
2144
+ return $retval;
2145
+ }
2146
+ }
2147
+
2148
+ $before = $after = $label = '';
2149
+ $count = count( $types );
2150
+
2151
+ if ( 1 === $count ) {
2152
+ $label_text = $labels['singular'];
2153
+ } else {
2154
+ $label_text = $labels['plural'];
2155
+ }
2156
+
2157
+ // Render parent element.
2158
+ if ( ! empty( $r['parent_element'] ) ) {
2159
+ $parent_elem = new BP_Core_HTML_Element( array(
2160
+ 'element' => $r['parent_element'],
2161
+ 'attr' => $r['parent_attr'],
2162
+ ) );
2163
+
2164
+ // Set before and after.
2165
+ $before = $parent_elem->get( 'open_tag' );
2166
+ $after = $parent_elem->get( 'close_tag' );
2167
+ }
2168
+
2169
+ // Render label element.
2170
+ if ( ! empty( $r['label_element'] ) ) {
2171
+ $label = new BP_Core_HTML_Element( array(
2172
+ 'element' => $r['label_element'],
2173
+ 'attr' => $r['label_attr'],
2174
+ 'inner_html' => esc_html( $label_text ),
2175
+ ) );
2176
+ $label = $label->contents() . ' ';
2177
+
2178
+ // No element, just the label.
2179
+ } elseif ( $has_label ) {
2180
+ $label = esc_html( $label_text );
2181
+ }
2182
+
2183
+ // The list of types.
2184
+ $list = implode( ', ', array_map( 'bp_get_member_type_directory_link', $types ) );
2185
+
2186
+ // Render the list of types element.
2187
+ if ( ! empty( $r['list_element'] ) ) {
2188
+ $list_element = new BP_Core_HTML_Element( array(
2189
+ 'element' => $r['list_element'],
2190
+ 'attr' => $r['list_element_attr'],
2191
+ 'inner_html' => $list,
2192
+ ) );
2193
+
2194
+ $list = $list_element->contents();
2195
+ }
2196
+
2197
+ // Comma-delimit each type into the group type directory link.
2198
+ $label .= $list;
2199
+
2200
+ // Retval time!
2201
+ $retval = $before . $label . $after;
2202
+ }
2203
+
2204
+ return $retval;
2205
+ }
2206
+
2207
  /** Signup Form ***************************************************************/
2208
 
2209
  /**
2603
  */
2604
  function bp_signup_requires_privacy_policy_acceptance() {
2605
  // Bail if we're running a version of WP that doesn't have the Privacy Policy feature.
2606
+ if ( bp_is_running_wp( '4.9.6', '<' ) ) {
2607
  return false;
2608
  }
2609
 
bp-members/classes/class-bp-core-members-template.php CHANGED
@@ -110,51 +110,111 @@ class BP_Core_Members_Template {
110
  * Constructor method.
111
  *
112
  * @since 1.5.0
 
113
  *
114
  * @see BP_User_Query for an in-depth description of parameters.
115
  *
116
- * @param string $type Sort order.
117
- * @param int $page_number Page of results.
118
- * @param int $per_page Number of results per page.
119
- * @param int $max Max number of results to return.
120
- * @param int $user_id Limit to friends of a user.
121
- * @param string $search_terms Limit to users matching search terms.
122
- * @param array $include Limit results by these user IDs.
123
- * @param bool $populate_extras Fetch optional extras.
124
- * @param array $exclude Exclude these IDs from results.
125
- * @param array $meta_key Limit to users with a meta_key.
126
- * @param array $meta_value Limit to users with a meta_value (with meta_key).
127
- * @param string $page_arg Optional. The string used as a query parameter in pagination links.
128
- * Default: 'upage'.
129
- * @param array|string $member_type Array or comma-separated string of member types to limit results to.
130
- * @param array|string $member_type__in Array or comma-separated string of member types to limit results to.
131
- * @param array|string $member_type__not_in Array or comma-separated string of member types to exclude
132
- * from results.
133
  */
134
- 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 = '' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
 
136
- $this->pag_arg = sanitize_key( $page_arg );
137
- $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $page_number );
138
- $this->pag_num = bp_sanitize_pagination_arg( 'num', $per_page );
139
- $this->type = $type;
140
 
141
- if ( !empty( $_REQUEST['letter'] ) )
142
- $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras, $exclude );
143
- else
144
- $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 ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
 
146
- if ( !$max || $max >= (int) $this->members['total'] )
147
  $this->total_member_count = (int) $this->members['total'];
148
- else
149
- $this->total_member_count = (int) $max;
 
150
 
151
  $this->members = $this->members['users'];
152
 
153
- if ( $max ) {
154
- if ( $max >= count( $this->members ) ) {
155
  $this->member_count = count( $this->members );
156
  } else {
157
- $this->member_count = (int) $max;
158
  }
159
  } else {
160
  $this->member_count = count( $this->members );
@@ -178,9 +238,9 @@ class BP_Core_Members_Template {
178
  */
179
  $add_args = array();
180
 
181
- if ( ! empty( $search_terms ) ) {
182
  $query_arg = bp_core_get_component_search_query_arg( 'members' );
183
- $add_args[ $query_arg ] = urlencode( $search_terms );
184
  }
185
 
186
  $this->pag_links = paginate_links( array(
110
  * Constructor method.
111
  *
112
  * @since 1.5.0
113
+ * @since 7.0.0 Added $xprofile_query parameter. Added $user_ids parameter.
114
  *
115
  * @see BP_User_Query for an in-depth description of parameters.
116
  *
117
+ * @param array $args {
118
+ * Array of arguments. Supports all arguments of BP_User_Query. Additional
119
+ * arguments, or those with different defaults, are described below.
120
+ *
121
+ * @type int $page_number Page of results. Accepted for legacy reasons. Use 'page' instead.
122
+ * @type int $max Max number of results to return.
123
+ * @type string $page_arg Optional. The string used as a query parameter in pagination links.
124
+ * }
 
 
 
 
 
 
 
 
 
125
  */
126
+ public function __construct( $args ) {
127
+ // Backward compatibility with old method of passing arguments.
128
+ if ( ! is_array( $args ) || func_num_args() > 1 ) {
129
+ _deprecated_argument( __METHOD__, '7.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__ ) );
130
+
131
+ $old_args_keys = array(
132
+ 0 => 'type',
133
+ 1 => 'page_number',
134
+ 2 => 'per_page',
135
+ 3 => 'max',
136
+ 4 => 'user_id',
137
+ 5 => 'search_terms',
138
+ 6 => 'include',
139
+ 7 => 'populate_extras',
140
+ 8 => 'exclude',
141
+ 9 => 'meta_key',
142
+ 10 => 'meta_value',
143
+ 11 => 'page_arg',
144
+ 12 => 'member_type',
145
+ 13 => 'member_type__in',
146
+ 14 => 'member_type__not_in'
147
+ );
148
 
149
+ $args = bp_core_parse_args_array( $old_args_keys, func_get_args() );
150
+ }
 
 
151
 
152
+ // Support both 'page_number' and 'page' for backward compatibility.
153
+ $args['page_number'] = isset( $args['page_number'] ) ? $args['page_number'] : $args['page'];
154
+
155
+ $defaults = array(
156
+ 'type' => 'active',
157
+ 'page_number' => 1,
158
+ 'per_page' => 20,
159
+ 'max' => false,
160
+ 'user_id' => false,
161
+ 'search_terms' => null,
162
+ 'include' => false,
163
+ 'populate_extras' => true,
164
+ 'exclude' => false,
165
+ 'user_ids' => false,
166
+ 'meta_key' => false,
167
+ 'meta_value' => false,
168
+ 'page_arg' => 'upage',
169
+ 'member_type' => '',
170
+ 'member_type__in' => '',
171
+ 'member_type__not_in' => '',
172
+ 'xprofile_query' => false,
173
+ );
174
+ $r = wp_parse_args( $args, $defaults );
175
+
176
+ $this->pag_arg = sanitize_key( $r['page_arg'] );
177
+ $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page_number'] );
178
+ $this->pag_num = bp_sanitize_pagination_arg( 'num', $r['per_page'] );
179
+ $this->type = $r['type'];
180
+
181
+ if ( ! empty( $_REQUEST['letter'] ) ) {
182
+ $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $r['populate_extras'], $r['exclude'] );
183
+ } else {
184
+ $this->members = bp_core_get_users(
185
+ array(
186
+ 'type' => $this->type,
187
+ 'per_page' => $this->pag_num,
188
+ 'page' => $this->pag_page,
189
+ 'user_id' => $r['user_id'],
190
+ 'include' => $r['include'],
191
+ 'search_terms' => $r['search_terms'],
192
+ 'populate_extras' => $r['populate_extras'],
193
+ 'exclude' => $r['exclude'],
194
+ 'user_ids' => $r['user_ids'],
195
+ 'meta_key' => $r['meta_key'],
196
+ 'meta_value' => $r['meta_value'],
197
+ 'member_type' => $r['member_type'],
198
+ 'member_type__in' => $r['member_type__in'],
199
+ 'member_type__not_in' => $r['member_type__not_in'],
200
+ 'xprofile_query' => $r['xprofile_query'],
201
+ )
202
+ );
203
+ }
204
 
205
+ if ( ! $r['max'] || $r['max'] >= (int) $this->members['total'] ) {
206
  $this->total_member_count = (int) $this->members['total'];
207
+ } else {
208
+ $this->total_member_count = (int) $r['max'];
209
+ }
210
 
211
  $this->members = $this->members['users'];
212
 
213
+ if ( $r['max'] ) {
214
+ if ( $r['max'] >= count( $this->members ) ) {
215
  $this->member_count = count( $this->members );
216
  } else {
217
+ $this->member_count = (int) $r['max'];
218
  }
219
  } else {
220
  $this->member_count = count( $this->members );
238
  */
239
  $add_args = array();
240
 
241
+ if ( ! empty( $r['search_terms'] ) ) {
242
  $query_arg = bp_core_get_component_search_query_arg( 'members' );
243
+ $add_args[ $query_arg ] = urlencode( $r['search_terms'] );
244
  }
245
 
246
  $this->pag_links = paginate_links( array(
bp-members/classes/class-bp-members-admin.php CHANGED
@@ -983,7 +983,7 @@ class BP_Members_Admin {
983
 
984
  if ( ! empty( $notice ) ) : ?>
985
 
986
- <div <?php if ( 'updated' === $notice['class'] ) : ?>id="message" <?php endif; ?>class="<?php echo esc_attr( $notice['class'] ); ?>">
987
 
988
  <p><?php echo esc_html( $notice['message'] ); ?></p>
989
 
@@ -998,47 +998,24 @@ class BP_Members_Admin {
998
  <?php endif; ?>
999
 
1000
  <div class="wrap" id="community-profile-page">
1001
- <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
1002
 
1003
- <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
1004
 
1005
- <?php if ( empty( $this->is_self_profile ) ) : ?>
1006
-
1007
- <?php if ( current_user_can( 'create_users' ) ) : ?>
1008
-
1009
- <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
1010
 
1011
- <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
1012
 
1013
- <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
1014
 
1015
- <?php endif; ?>
1016
 
1017
  <?php endif; ?>
1018
 
1019
- <hr class="wp-header-end">
1020
-
1021
- <?php else : ?>
1022
-
1023
- <h1><?php echo esc_html( $title ); ?>
1024
-
1025
- <?php if ( empty( $this->is_self_profile ) ) : ?>
1026
-
1027
- <?php if ( current_user_can( 'create_users' ) ) : ?>
1028
-
1029
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
1030
-
1031
- <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
1032
-
1033
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
1034
-
1035
- <?php endif; ?>
1036
-
1037
- <?php endif; ?>
1038
- </h1>
1039
-
1040
  <?php endif; ?>
1041
 
 
 
1042
  <?php if ( ! empty( $user ) ) :
1043
 
1044
  $this->profile_nav( $user, 'BuddyPress' ); ?>
@@ -1309,26 +1286,30 @@ class BP_Members_Admin {
1309
  return;
1310
  }
1311
 
1312
- $types = bp_get_member_types( array(), 'objects' );
1313
- $current_type = bp_get_member_type( $user->ID );
 
1314
  ?>
1315
 
1316
- <label for="bp-members-profile-member-type" class="screen-reader-text"><?php
 
1317
  /* translators: accessibility text */
1318
  esc_html_e( 'Select member type', 'buddypress' );
1319
- ?></label>
1320
- <select name="bp-members-profile-member-type" id="bp-members-profile-member-type">
1321
- <option value="" <?php selected( '', $current_type ); ?>><?php
1322
- /* translators: no option picked in select box */
1323
- esc_attr_e( '----', 'buddypress' );
1324
- ?></option>
1325
  <?php foreach ( $types as $type ) : ?>
1326
- <option value="<?php echo esc_attr( $type->name ) ?>" <?php selected( $type->name, $current_type ) ?>><?php echo esc_html( $type->labels['singular_name'] ) ?></option>
 
 
 
 
 
1327
  <?php endforeach; ?>
1328
- </select>
 
1329
 
1330
  <?php
1331
-
1332
  wp_nonce_field( 'bp-member-type-change-' . $user->ID, 'bp-member-type-nonce' );
1333
  }
1334
 
@@ -1338,7 +1319,7 @@ class BP_Members_Admin {
1338
  * @since 2.2.0
1339
  */
1340
  public function process_member_type_update() {
1341
- if ( ! isset( $_POST['bp-member-type-nonce'] ) || ! isset( $_POST['bp-members-profile-member-type'] ) ) {
1342
  return;
1343
  }
1344
 
@@ -1351,9 +1332,16 @@ class BP_Members_Admin {
1351
  return;
1352
  }
1353
 
1354
- // Member type string must either reference a valid member type, or be empty.
1355
- $member_type = stripslashes( $_POST['bp-members-profile-member-type'] );
1356
- if ( ! empty( $member_type ) && ! bp_get_member_type_object( $member_type ) ) {
 
 
 
 
 
 
 
1357
  return;
1358
  }
1359
 
@@ -1986,11 +1974,11 @@ class BP_Members_Admin {
1986
  if ( ! empty( $notice ) ) :
1987
  if ( 'updated' === $notice['class'] ) : ?>
1988
 
1989
- <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?>">
1990
 
1991
  <?php else: ?>
1992
 
1993
- <div class="<?php echo esc_attr( $notice['class'] ); ?>">
1994
 
1995
  <?php endif; ?>
1996
 
@@ -2076,49 +2064,24 @@ class BP_Members_Admin {
2076
  ?>
2077
 
2078
  <div class="wrap">
2079
- <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
2080
-
2081
- <h1 class="wp-heading-inline"><?php _e( 'Users', 'buddypress' ); ?></h1>
2082
-
2083
- <?php if ( current_user_can( 'create_users' ) ) : ?>
2084
 
2085
- <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
2086
-
2087
- <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
2088
-
2089
- <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
2090
-
2091
- <?php endif;
2092
-
2093
- if ( $usersearch ) {
2094
- printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
2095
- }
2096
- ?>
2097
-
2098
- <hr class="wp-header-end">
2099
-
2100
- <?php else : ?>
2101
 
2102
- <h1><?php _e( 'Users', 'buddypress' ); ?>
2103
 
2104
- <?php if ( current_user_can( 'create_users' ) ) : ?>
2105
 
2106
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
2107
 
2108
- <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
2109
-
2110
- <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
2111
-
2112
- <?php endif;
2113
-
2114
- if ( $usersearch ) {
2115
- printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
2116
- }
2117
 
2118
- ?>
2119
- </h1>
 
 
2120
 
2121
- <?php endif; ?>
2122
 
2123
  <?php // Display each signups on its own row. ?>
2124
  <?php $bp_members_signup_list_table->views(); ?>
@@ -2243,7 +2206,9 @@ class BP_Members_Admin {
2243
  ?>
2244
 
2245
  <div class="wrap">
2246
- <h1><?php echo esc_html( $header_text ); ?></h1>
 
 
2247
  <p><?php echo esc_html( $helper_text ); ?></p>
2248
 
2249
  <ol class="bp-signups-list">
@@ -2433,25 +2398,22 @@ class BP_Members_Admin {
2433
  foreach ( (array) $_REQUEST['users'] as $user_id ) {
2434
  $user_id = (int) $user_id;
2435
 
2436
- // Get the old member type to check against.
2437
- $member_type = bp_get_member_type( $user_id );
2438
 
2439
- if ( 'remove_member_type' === $new_type ) {
2440
- // Remove the current member type, if there's one to remove.
2441
- if ( $member_type ) {
2442
- $removed = bp_remove_member_type( $user_id, $member_type );
2443
- if ( false === $removed || is_wp_error( $removed ) ) {
2444
- $error = true;
2445
- }
2446
- }
2447
- } else {
2448
  // Set the new member type.
2449
- if ( $new_type !== $member_type ) {
2450
- $set = bp_set_member_type( $user_id, $new_type );
2451
- if ( false === $set || is_wp_error( $set ) ) {
2452
- $error = true;
2453
- }
 
 
2454
  }
 
2455
  }
2456
  }
2457
  }
@@ -2523,12 +2485,26 @@ class BP_Members_Admin {
2523
  }
2524
 
2525
  // Get the member type.
2526
- $type = bp_get_member_type( $user_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2527
 
2528
- // Output the
2529
- if ( $type_obj = bp_get_member_type_object( $type ) ) {
2530
- $url = add_query_arg( array( 'bp-member-type' => urlencode( $type ) ) );
2531
- $retval = '<a href="' . esc_url( $url ) . '">' . esc_html( $type_obj->labels['singular_name'] ) . '</a>';
2532
  }
2533
 
2534
  return $retval;
983
 
984
  if ( ! empty( $notice ) ) : ?>
985
 
986
+ <div <?php if ( 'updated' === $notice['class'] ) : ?>id="message" <?php endif; ?>class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
987
 
988
  <p><?php echo esc_html( $notice['message'] ); ?></p>
989
 
998
  <?php endif; ?>
999
 
1000
  <div class="wrap" id="community-profile-page">
1001
+ <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
1002
 
1003
+ <?php if ( empty( $this->is_self_profile ) ) : ?>
1004
 
1005
+ <?php if ( current_user_can( 'create_users' ) ) : ?>
 
 
 
 
1006
 
1007
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
1008
 
1009
+ <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
1010
 
1011
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
1012
 
1013
  <?php endif; ?>
1014
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1015
  <?php endif; ?>
1016
 
1017
+ <hr class="wp-header-end">
1018
+
1019
  <?php if ( ! empty( $user ) ) :
1020
 
1021
  $this->profile_nav( $user, 'BuddyPress' ); ?>
1286
  return;
1287
  }
1288
 
1289
+ $types = bp_get_member_types( array(), 'objects' );
1290
+ $current_type = (array) bp_get_member_type( $user->ID, false );
1291
+ $types_count = count( array_filter( $current_type ) );
1292
  ?>
1293
 
1294
+ <label for="bp-members-profile-member-type" class="screen-reader-text">
1295
+ <?php
1296
  /* translators: accessibility text */
1297
  esc_html_e( 'Select member type', 'buddypress' );
1298
+ ?>
1299
+ </label>
1300
+ <ul class="categorychecklist form-no-clear">
 
 
 
1301
  <?php foreach ( $types as $type ) : ?>
1302
+ <li>
1303
+ <label class="selectit">
1304
+ <input value="<?php echo esc_attr( $type->name ) ?>" name="bp-members-profile-member-type[]" type="checkbox" <?php checked( true, in_array( $type->name, $current_type ) ); ?>>
1305
+ <?php echo esc_html( $type->labels['singular_name'] ); ?>
1306
+ </label>
1307
+ </li>
1308
  <?php endforeach; ?>
1309
+ <input type="hidden" value="<?php echo intval( $types_count ); ?>" name="bp-members-profile-member-types-count" />
1310
+ </ul>
1311
 
1312
  <?php
 
1313
  wp_nonce_field( 'bp-member-type-change-' . $user->ID, 'bp-member-type-nonce' );
1314
  }
1315
 
1319
  * @since 2.2.0
1320
  */
1321
  public function process_member_type_update() {
1322
+ if ( ! isset( $_POST['bp-member-type-nonce'] ) || ! isset( $_POST['bp-members-profile-member-types-count'] ) ) {
1323
  return;
1324
  }
1325
 
1332
  return;
1333
  }
1334
 
1335
+ if ( isset( $_POST['bp-members-profile-member-type'] ) ) {
1336
+ // Member type [string] must either reference a valid member type, or be empty.
1337
+ $member_type = wp_parse_slug_list( wp_unslash( $_POST['bp-members-profile-member-type'] ) );
1338
+ $member_type = array_filter( $member_type );
1339
+ } elseif ( 0 !== intval( $_POST['bp-members-profile-member-types-count'] ) ) {
1340
+ $member_type = false;
1341
+ }
1342
+
1343
+ // Nothing to do there.
1344
+ if ( ! isset( $member_type ) ) {
1345
  return;
1346
  }
1347
 
1974
  if ( ! empty( $notice ) ) :
1975
  if ( 'updated' === $notice['class'] ) : ?>
1976
 
1977
+ <div id="message" class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
1978
 
1979
  <?php else: ?>
1980
 
1981
+ <div class="<?php echo esc_attr( $notice['class'] ); ?> notice is-dismissible">
1982
 
1983
  <?php endif; ?>
1984
 
2064
  ?>
2065
 
2066
  <div class="wrap">
2067
+ <h1 class="wp-heading-inline"><?php _e( 'Users', 'buddypress' ); ?></h1>
 
 
 
 
2068
 
2069
+ <?php if ( current_user_can( 'create_users' ) ) : ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2070
 
2071
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user', 'buddypress' ); ?></a>
2072
 
2073
+ <?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
2074
 
2075
+ <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user', 'buddypress' ); ?></a>
2076
 
2077
+ <?php endif;
 
 
 
 
 
 
 
 
2078
 
2079
+ if ( $usersearch ) {
2080
+ printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;', 'buddypress' ) . '</span>', esc_html( $usersearch ) );
2081
+ }
2082
+ ?>
2083
 
2084
+ <hr class="wp-header-end">
2085
 
2086
  <?php // Display each signups on its own row. ?>
2087
  <?php $bp_members_signup_list_table->views(); ?>
2206
  ?>
2207
 
2208
  <div class="wrap">
2209
+ <h1 class="wp-heading-inline"><?php echo esc_html( $header_text ); ?></h1>
2210
+ <hr class="wp-header-end">
2211
+
2212
  <p><?php echo esc_html( $helper_text ); ?></p>
2213
 
2214
  <ol class="bp-signups-list">
2398
  foreach ( (array) $_REQUEST['users'] as $user_id ) {
2399
  $user_id = (int) $user_id;
2400
 
2401
+ // Get the old member types to check against.
2402
+ $current_types = bp_get_member_type( $user_id, false );
2403
 
2404
+ if ( $current_types && 'remove_member_type' === $new_type ) {
2405
+ $member_types = array();
2406
+ } elseif ( ! $current_types || 1 !== count( $current_types ) || $new_type !== $current_types[0] ) {
 
 
 
 
 
 
2407
  // Set the new member type.
2408
+ $member_types = array( $new_type );
2409
+ }
2410
+
2411
+ if ( isset( $member_types ) ) {
2412
+ $set = bp_set_member_type( $user_id, $member_types );
2413
+ if ( false === $set || is_wp_error( $set ) ) {
2414
+ $error = true;
2415
  }
2416
+ unset( $member_types );
2417
  }
2418
  }
2419
  }
2485
  }
2486
 
2487
  // Get the member type.
2488
+ $member_type = bp_get_member_type( $user_id, false );
2489
+
2490
+ // Build the Output.
2491
+ if ( $member_type ) {
2492
+ $member_types = array_filter( array_map( 'bp_get_member_type_object', $member_type ) );
2493
+ if ( ! $member_types ) {
2494
+ return $retval;
2495
+ }
2496
+
2497
+ $type_links = array();
2498
+ foreach ( $member_types as $type ) {
2499
+ $url = add_query_arg( array( 'bp-member-type' => urlencode( $type->name ) ) );
2500
+ $type_links[] = sprintf(
2501
+ '<a href="%1$s">%2$s</a>',
2502
+ esc_url( $url ),
2503
+ esc_html( $type->labels['singular_name'] )
2504
+ );
2505
+ }
2506
 
2507
+ $retval = implode( ', ', $type_links );
 
 
 
2508
  }
2509
 
2510
  return $retval;
bp-members/classes/class-bp-members-component.php CHANGED
@@ -176,6 +176,7 @@ class BP_Members_Component extends BP_Component {
176
  'directory_title' => isset( $bp->pages->members->title ) ? $bp->pages->members->title : $default_directory_title,
177
  'search_string' => __( 'Search Members...', 'buddypress' ),
178
  'global_tables' => array(
 
179
  'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
180
  'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
181
  )
@@ -733,6 +734,61 @@ class BP_Members_Component extends BP_Component {
733
  ),
734
  ),
735
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  )
737
  );
738
  }
176
  'directory_title' => isset( $bp->pages->members->title ) ? $bp->pages->members->title : $default_directory_title,
177
  'search_string' => __( 'Search Members...', 'buddypress' ),
178
  'global_tables' => array(
179
+ 'table_name_invitations' => bp_core_get_table_prefix() . 'bp_invitations',
180
  'table_name_last_activity' => bp_core_get_table_prefix() . 'bp_activity',
181
  'table_name_signups' => $wpdb->base_prefix . 'signups', // Signups is a global WordPress table.
182
  )
734
  ),
735
  ),
736
  ),
737
+ 'bp/members' => array(
738
+ 'name' => 'bp/members',
739
+ 'editor_script' => 'bp-members-block',
740
+ 'editor_script_url' => plugins_url( 'js/blocks/members.js', dirname( __FILE__ ) ),
741
+ 'editor_script_deps' => array(
742
+ 'wp-blocks',
743
+ 'wp-element',
744
+ 'wp-components',
745
+ 'wp-i18n',
746
+ 'wp-compose',
747
+ 'wp-data',
748
+ 'wp-api-fetch',
749
+ 'wp-url',
750
+ 'wp-block-editor',
751
+ 'bp-block-components',
752
+ 'lodash',
753
+ ),
754
+ 'style' => 'bp-members-block',
755
+ 'style_url' => plugins_url( 'css/blocks/members.css', dirname( __FILE__ ) ),
756
+ 'attributes' => array(
757
+ 'itemIDs' => array(
758
+ 'type' => 'array',
759
+ 'items' => array(
760
+ 'type' => 'integer',
761
+ ),
762
+ ),
763
+ 'avatarSize' => array(
764
+ 'type' => 'string',
765
+ 'default' => 'full',
766
+ ),
767
+ 'displayMentionSlug' => array(
768
+ 'type' => 'boolean',
769
+ 'default' => true,
770
+ ),
771
+ 'displayUserName' => array(
772
+ 'type' => 'boolean',
773
+ 'default' => true,
774
+ ),
775
+ 'extraData' => array(
776
+ 'type' => 'string',
777
+ 'default' => 'none',
778
+ 'enum' => array( 'last_activity', 'latest_update', 'none' ),
779
+ ),
780
+ 'layoutPreference' => array(
781
+ 'type' => 'string',
782
+ 'default' => 'list',
783
+ 'enum' => array( 'list', 'grid' ),
784
+ ),
785
+ 'columns' => array(
786
+ 'type' => 'number',
787
+ 'default' => 2,
788
+ ),
789
+ ),
790
+ 'render_callback' => 'bp_members_render_members_block',
791
+ ),
792
  )
793
  );
794
  }
bp-members/classes/class-bp-rest-members-endpoint.php CHANGED
@@ -25,6 +25,72 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
25
  $this->rest_base = 'members';
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  /**
29
  * Retrieve users.
30
  *
@@ -35,16 +101,17 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
35
  */
36
  public function get_items( $request ) {
37
  $args = array(
38
- 'type' => $request['type'],
39
- 'user_id' => $request['user_id'],
40
- 'user_ids' => $request['user_ids'],
41
- 'xprofile_query' => $request['xprofile'],
42
- 'include' => $request['include'],
43
- 'exclude' => $request['exclude'],
44
- 'member_type' => $request['member_type'],
45
- 'search_terms' => $request['search'],
46
- 'per_page' => $request['per_page'],
47
- 'page' => $request['page'],
 
48
  );
49
 
50
  if ( empty( $request['user_ids'] ) ) {
@@ -126,6 +193,34 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
126
  return apply_filters( 'bp_rest_members_get_items_permissions_check', true, $request );
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  /**
130
  * Checks if a given request has access to read a user.
131
  *
@@ -136,20 +231,9 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
136
  */
137
  public function get_item_permissions_check( $request ) {
138
  $retval = true;
 
139
 
140
- if ( ! is_user_logged_in() ) {
141
- $retval = new WP_Error(
142
- 'bp_rest_authorization_required',
143
- __( 'Sorry, you are not allowed to view members.', 'buddypress' ),
144
- array(
145
- 'status' => rest_authorization_required_code(),
146
- )
147
- );
148
- }
149
-
150
- $user = bp_rest_get_user( $request['id'] );
151
-
152
- if ( true === $retval && ! $user instanceof WP_User ) {
153
  $retval = new WP_Error(
154
  'bp_rest_member_invalid_id',
155
  __( 'Invalid member ID.', 'buddypress' ),
@@ -164,7 +248,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
164
  } elseif ( true === $retval && 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
165
  $retval = new WP_Error(
166
  'bp_rest_authorization_required',
167
- __( 'Sorry, you are not allowed to view members.', 'buddypress' ),
168
  array(
169
  'status' => rest_authorization_required_code(),
170
  )
@@ -337,13 +421,18 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
337
  */
338
  public function prepare_item_for_response( $user, $request ) {
339
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
340
- $data = $this->user_data( $user, $context );
341
  $data = $this->add_additional_fields_to_object( $data, $request );
342
  $data = $this->filter_response_by_context( $data, $context );
343
  $response = rest_ensure_response( $data );
344
 
345
  $response->add_links( $this->prepare_links( $user ) );
346
 
 
 
 
 
 
347
  /**
348
  * Filters user data returned from the API.
349
  *
@@ -362,32 +451,79 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
362
  * This was abstracted to be used in other BuddyPress endpoints.
363
  *
364
  * @since 5.0.0
 
365
  *
366
- * @param WP_User $user User object.
367
- * @param string $context The context of the request. Defaults to 'view'.
 
368
  * @return array
369
  */
370
- public function user_data( $user, $context = 'view' ) {
 
 
 
 
371
  $data = array(
372
- 'id' => $user->ID,
373
- 'name' => $user->display_name,
374
- 'user_login' => $user->user_login,
375
- 'link' => bp_core_get_user_domain( $user->ID, $user->user_nicename, $user->user_login ),
376
- 'member_types' => bp_get_member_type( $user->ID, false ),
377
- 'roles' => array(),
378
- 'capabilities' => array(),
379
- 'extra_capabilities' => array(),
380
- 'registered_date' => '',
381
- 'xprofile' => $this->xprofile_data( $user->ID ),
382
- 'friendship_status' => false,
 
383
  );
384
 
385
- // Check if user is friends with current logged in user.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  if ( bp_is_active( 'friends' ) && get_current_user_id() !== $user->ID ) {
387
- $data['friendship_status'] = ( 'is_friend' === friends_check_friendship_status( get_current_user_id(), $user->ID ) );
 
 
 
388
  }
389
 
390
- if ( 'edit' === $context ) {
391
  $data['registered_date'] = bp_rest_prepare_date_response( $user->data->user_registered );
392
  $data['roles'] = (array) array_values( $user->roles );
393
  $data['capabilities'] = (array) array_keys( $user->allcaps );
@@ -448,6 +584,15 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
448
  $prepared_user->user_login = $request['user_login'];
449
  }
450
 
 
 
 
 
 
 
 
 
 
451
  // Set member type.
452
  if ( isset( $prepared_user->ID ) && isset( $request['member_type'] ) ) {
453
 
@@ -556,7 +701,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
556
  $member = $object->data;
557
  $member->id = $member->ID;
558
 
559
- return WP_REST_Controller::update_additional_fields_for_object( $member, $request );
560
  }
561
 
562
  /**
@@ -568,12 +713,12 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
568
  * @return array Endpoint arguments.
569
  */
570
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
571
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
572
  $key = 'get_item';
573
 
574
  // Add member type args.
575
  $member_type_args = array(
576
- 'description' => __( 'Set type(s) for a member.', 'buddypress' ),
577
  'type' => 'string',
578
  'enum' => bp_get_member_types(),
579
  'context' => array( 'edit' ),
@@ -588,7 +733,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
588
  unset( $args['mention_name'] );
589
 
590
  // Add member type args.
591
- $args['types'] = $member_type_args;
592
 
593
  // But we absolutely need the email.
594
  $args['email'] = array(
@@ -608,7 +753,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
608
  unset( $args['mention_name'], $args['user_login'], $args['password'] );
609
 
610
  // Add member type args.
611
- $args['types'] = $member_type_args;
612
  } elseif ( WP_REST_Server::DELETABLE === $method ) {
613
  $key = 'delete_item';
614
  }
@@ -658,6 +803,7 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
658
  'arg_options' => array(
659
  'sanitize_callback' => 'sanitize_text_field',
660
  ),
 
661
  ),
662
  'link' => array(
663
  'description' => __( 'Profile URL of the member.', 'buddypress' ),
@@ -677,7 +823,11 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
677
  ),
678
  'member_types' => array(
679
  'description' => __( 'Member types associated with the member.', 'buddypress' ),
680
- 'type' => 'object',
 
 
 
 
681
  'context' => array( 'embed', 'view', 'edit' ),
682
  'readonly' => true,
683
  ),
@@ -717,18 +867,71 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
717
  'context' => array( 'edit' ),
718
  'readonly' => true,
719
  ),
720
- 'xprofile' => array(
721
  'description' => __( 'Member XProfile groups and its fields.', 'buddypress' ),
722
  'type' => 'array',
723
  'context' => array( 'view', 'edit' ),
724
  'readonly' => true,
725
  ),
726
- 'friendship_status' => array(
727
  'description' => __( 'Friendship relation with, current, logged in user.', 'buddypress' ),
728
  'type' => 'bool',
729
  'context' => array( 'view', 'edit' ),
730
  'readonly' => true,
731
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  ),
733
  );
734
 
@@ -831,6 +1034,14 @@ class BP_REST_Members_Endpoint extends WP_REST_Users_Controller {
831
  'validate_callback' => 'rest_validate_request_arg',
832
  );
833
 
 
 
 
 
 
 
 
 
834
  $params['member_type'] = array(
835
  'description' => __( 'Limit results set to certain type(s).', 'buddypress' ),
836
  'default' => array(),
25
  $this->rest_base = 'members';
26
  }
27
 
28
+ /**
29
+ * Registers the routes for the objects of the controller.
30
+ *
31
+ * @since 7.0.0
32
+ *
33
+ * @see register_rest_route()
34
+ */
35
+ public function register_routes() {
36
+ parent::register_routes();
37
+
38
+ register_rest_route(
39
+ $this->namespace,
40
+ '/' . $this->rest_base . '/(?P<id>[\d]+)',
41
+ array(
42
+ 'args' => array(
43
+ 'id' => array(
44
+ 'description' => __( 'Unique identifier for the member.', 'buddypress' ),
45
+ 'type' => 'integer',
46
+ ),
47
+ ),
48
+ array(
49
+ 'methods' => WP_REST_Server::READABLE,
50
+ 'callback' => array( $this, 'get_item' ),
51
+ 'permission_callback' => array( $this, 'get_item_permissions_check' ),
52
+ 'args' => array(
53
+ 'context' => parent::get_context_param( array( 'default' => 'view' ) ),
54
+ 'populate_extras' => array(
55
+ 'description' => __( 'Whether to fetch extra BP data about the returned member.', 'buddypress' ),
56
+ 'context' => array( 'view', 'edit' ),
57
+ 'default' => false,
58
+ 'type' => 'boolean',
59
+ 'sanitize_callback' => 'rest_sanitize_boolean',
60
+ 'validate_callback' => 'rest_validate_request_arg',
61
+ ),
62
+ ),
63
+ ),
64
+ array(
65
+ 'methods' => WP_REST_Server::EDITABLE,
66
+ 'callback' => array( $this, 'update_item' ),
67
+ 'permission_callback' => array( $this, 'update_item_permissions_check' ),
68
+ 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ),
69
+ ),
70
+ array(
71
+ 'methods' => WP_REST_Server::DELETABLE,
72
+ 'callback' => array( $this, 'delete_item' ),
73
+ 'permission_callback' => array( $this, 'delete_item_permissions_check' ),
74
+ 'args' => array(
75
+ 'force' => array(
76
+ 'type' => 'boolean',
77
+ 'default' => false,
78
+ 'description' => __( 'Required to be true, as members do not support trashing.', 'buddypress' ),
79
+ ),
80
+ 'reassign' => array(
81
+ 'type' => 'integer',
82
+ 'description' => __( 'Reassign the deleted member\'s posts and links to this user ID.', 'buddypress' ),
83
+ 'required' => true,
84
+ 'sanitize_callback' => array( $this, 'check_reassign' ),
85
+ ),
86
+ ),
87
+ ),
88
+ 'schema' => array( $this, 'get_public_item_schema' ),
89
+ ),
90
+ true // Override the members/id READABLE route generated by WP_REST_Users_Controller.
91
+ );
92
+ }
93
+
94
  /**
95
  * Retrieve users.
96
  *
101
  */
102
  public function get_items( $request ) {
103
  $args = array(
104
+ 'type' => $request['type'],
105
+ 'user_id' => $request['user_id'],
106
+ 'user_ids' => $request['user_ids'],
107
+ 'xprofile_query' => $request['xprofile'],
108
+ 'include' => $request['include'],
109
+ 'exclude' => $request['exclude'],
110
+ 'populate_extras' => $request['populate_extras'],
111
+ 'member_type' => $request['member_type'],
112
+ 'search_terms' => $request['search'],
113
+ 'per_page' => $request['per_page'],
114
+ 'page' => $request['page'],
115
  );
116
 
117
  if ( empty( $request['user_ids'] ) ) {
193
  return apply_filters( 'bp_rest_members_get_items_permissions_check', true, $request );
194
  }
195
 
196
+ /**
197
+ * Retrieves a single member.
198
+ *
199
+ * @since 7.0.0
200
+ *
201
+ * @param WP_REST_Request $request Full details about the request.
202
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
203
+ */
204
+ public function get_item( $request ) {
205
+ if ( true === $request['populate_extras'] ) {
206
+ $args = array(
207
+ 'user_ids' => array( $request['id'] ),
208
+ 'populate_extras' => true,
209
+ );
210
+
211
+ // Get the member with BuddyPress extra data.
212
+ $member_query = new BP_User_Query( $args );
213
+ $member = reset( $member_query->results );
214
+
215
+ $member = $this->prepare_item_for_response( $member, $request );
216
+ $response = rest_ensure_response( $member );
217
+
218
+ return $response;
219
+ }
220
+
221
+ return parent::get_item( $request );
222
+ }
223
+
224
  /**
225
  * Checks if a given request has access to read a user.
226
  *
231
  */
232
  public function get_item_permissions_check( $request ) {
233
  $retval = true;
234
+ $user = bp_rest_get_user( $request['id'] );
235
 
236
+ if ( ! $user instanceof WP_User ) {
 
 
 
 
 
 
 
 
 
 
 
 
237
  $retval = new WP_Error(
238
  'bp_rest_member_invalid_id',
239
  __( 'Invalid member ID.', 'buddypress' ),
248
  } elseif ( true === $retval && 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) {
249
  $retval = new WP_Error(
250
  'bp_rest_authorization_required',
251
+ __( 'Sorry, you are not allowed to view members with the edit context.', 'buddypress' ),
252
  array(
253
  'status' => rest_authorization_required_code(),
254
  )
421
  */
422
  public function prepare_item_for_response( $user, $request ) {
423
  $context = ! empty( $request['context'] ) ? $request['context'] : 'view';
424
+ $data = $this->user_data( $user, $context, $request );
425
  $data = $this->add_additional_fields_to_object( $data, $request );
426
  $data = $this->filter_response_by_context( $data, $context );
427
  $response = rest_ensure_response( $data );
428
 
429
  $response->add_links( $this->prepare_links( $user ) );
430
 
431
+ // Update current user's last activity.
432
+ if ( strpos( $request->get_route(), 'members/me' ) !== false && get_current_user_id() === $user->ID ) {
433
+ bp_update_user_last_activity();
434
+ }
435
+
436
  /**
437
  * Filters user data returned from the API.
438
  *
451
  * This was abstracted to be used in other BuddyPress endpoints.
452
  *
453
  * @since 5.0.0
454
+ * @since 7.0.0 Add the $request parameter.
455
  *
456
+ * @param WP_User $user User object.
457
+ * @param string $context The context of the request. Defaults to 'view'.
458
+ * @param WP_REST_Request $request Full details about the request.
459
  * @return array
460
  */
461
+ public function user_data( $user, $context, $request ) {
462
+ if ( ! $context ) {
463
+ $context = 'view';
464
+ }
465
+
466
  $data = array(
467
+ 'id' => $user->ID,
468
+ 'name' => $user->display_name,
469
+ 'user_login' => $user->user_login,
470
+ 'link' => bp_core_get_user_domain( $user->ID, $user->user_nicename, $user->user_login ),
471
+ 'member_types' => bp_get_member_type( $user->ID, false ),
472
+ 'roles' => array(),
473
+ 'capabilities' => array(),
474
+ 'extra_capabilities' => array(),
475
+ 'registered_date' => '',
476
+ 'xprofile' => $this->xprofile_data( $user->ID ),
477
+ 'friendship_status' => false,
478
+ 'friendship_status_slug' => '',
479
  );
480
 
481
+ if ( $request->get_param( 'populate_extras' ) ) {
482
+ $data['last_activity']['timediff'] = '';
483
+ $data['last_activity']['date'] = '';
484
+
485
+ if ( get_current_user_id() === $user->ID ) {
486
+ $right_now = gmdate( 'Y-m-d H:i:s', bp_core_current_time( true, 'timestamp' ) );
487
+ $data['last_activity']['timediff'] = bp_core_time_since( $right_now );
488
+ $data['last_activity']['date'] = bp_rest_prepare_date_response( $right_now );
489
+
490
+ } elseif ( $user->last_activity ) {
491
+ $data['last_activity']['timediff'] = bp_core_time_since( $user->last_activity );
492
+ $data['last_activity']['date'] = bp_rest_prepare_date_response( $user->last_activity );
493
+ }
494
+
495
+ if ( bp_is_active( 'activity' ) ) {
496
+ $data['latest_update'] = array(
497
+ 'id' => 0,
498
+ 'raw' => '',
499
+ 'rendered' => '',
500
+ );
501
+
502
+ if ( isset( $user->latest_update ) && $user->latest_update ) {
503
+ $activity_data = maybe_unserialize( $user->latest_update );
504
+
505
+ if ( isset( $activity_data['id'], $activity_data['content'] ) ) {
506
+ $data['latest_update']['id'] = $activity_data['id'];
507
+ $data['latest_update']['raw'] = $activity_data['content'];
508
+ $data['latest_update']['rendered'] = apply_filters( 'bp_get_activity_content', $activity_data['content'] );
509
+ }
510
+ }
511
+ }
512
+
513
+ if ( bp_is_active( 'friends' ) && isset( $user->total_friend_count ) && $user->total_friend_count ) {
514
+ $data['total_friend_count'] = absint( $user->total_friend_count );
515
+ }
516
+ }
517
+
518
+ // Friends related fields.
519
  if ( bp_is_active( 'friends' ) && get_current_user_id() !== $user->ID ) {
520
+ $friendship_status = friends_check_friendship_status( get_current_user_id(), $user->ID );
521
+
522
+ $data['friendship_status_slug'] = $friendship_status;
523
+ $data['friendship_status'] = ( 'is_friend' === $friendship_status );
524
  }
525
 
526
+ if ( 'edit' === $context && current_user_can( 'list_users' ) ) {
527
  $data['registered_date'] = bp_rest_prepare_date_response( $user->data->user_registered );
528
  $data['roles'] = (array) array_values( $user->roles );
529
  $data['capabilities'] = (array) array_keys( $user->allcaps );
584
  $prepared_user->user_login = $request['user_login'];
585
  }
586
 
587
+ /**
588
+ * Until BP REST version 0.3.0 the `types` parameter was used into the schema
589
+ * but not used to actually assign the member type to the user.
590
+ */
591
+ $types = $request->get_param( 'types' );
592
+ if ( $types ) {
593
+ $request->set_param( 'member_type', bp_rest_sanitize_member_types( $types ) );
594
+ }
595
+
596
  // Set member type.
597
  if ( isset( $prepared_user->ID ) && isset( $request['member_type'] ) ) {
598
 
701
  $member = $object->data;
702
  $member->id = $member->ID;
703
 
704
+ return parent::update_additional_fields_for_object( $member, $request );
705
  }
706
 
707
  /**
713
  * @return array Endpoint arguments.
714
  */
715
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
716
+ $args = parent::get_endpoint_args_for_item_schema( $method );
717
  $key = 'get_item';
718
 
719
  // Add member type args.
720
  $member_type_args = array(
721
+ 'description' => __( 'Assign a member type to a member, use a comma separated list of member types to assign more than one.', 'buddypress' ),
722
  'type' => 'string',
723
  'enum' => bp_get_member_types(),
724
  'context' => array( 'edit' ),
733
  unset( $args['mention_name'] );
734
 
735
  // Add member type args.
736
+ $args['member_type'] = $member_type_args;
737
 
738
  // But we absolutely need the email.
739
  $args['email'] = array(
753
  unset( $args['mention_name'], $args['user_login'], $args['password'] );
754
 
755
  // Add member type args.
756
+ $args['member_type'] = $member_type_args;
757
  } elseif ( WP_REST_Server::DELETABLE === $method ) {
758
  $key = 'delete_item';
759
  }
803
  'arg_options' => array(
804
  'sanitize_callback' => 'sanitize_text_field',
805
  ),
806
+ 'readonly' => true,
807
  ),
808
  'link' => array(
809
  'description' => __( 'Profile URL of the member.', 'buddypress' ),
823
  ),
824
  'member_types' => array(
825
  'description' => __( 'Member types associated with the member.', 'buddypress' ),
826
+ 'enum' => bp_get_member_types(),
827
+ 'type' => 'array',
828
+ 'items' => array(
829
+ 'type' => 'string',
830
+ ),
831
  'context' => array( 'embed', 'view', 'edit' ),
832
  'readonly' => true,
833
  ),
867
  'context' => array( 'edit' ),
868
  'readonly' => true,
869
  ),
870
+ 'xprofile' => array(
871
  'description' => __( 'Member XProfile groups and its fields.', 'buddypress' ),
872
  'type' => 'array',
873
  'context' => array( 'view', 'edit' ),
874
  'readonly' => true,
875
  ),
876
+ 'friendship_status' => array(
877
  'description' => __( 'Friendship relation with, current, logged in user.', 'buddypress' ),
878
  'type' => 'bool',
879
  'context' => array( 'view', 'edit' ),
880
  'readonly' => true,
881
  ),
882
+ 'friendship_status_slug' => array(
883
+ 'description' => __( 'Slug of the friendship status with current logged in user.', 'buddypress' ),
884
+ 'enum' => array( 'is_friend', 'not_friends', 'pending', 'awaiting_response' ),
885
+ 'type' => 'string',
886
+ 'context' => array( 'view', 'edit' ),
887
+ 'readonly' => true,
888
+ ),
889
+ 'last_activity' => array(
890
+ 'description' => __( 'Last date the member was active on the site.', 'buddypress' ),
891
+ 'type' => 'object',
892
+ 'properties' => array(
893
+ 'timediff' => array(
894
+ 'type' => 'string',
895
+ ),
896
+ 'date' => array(
897
+ 'type' => 'string',
898
+ 'format' => 'date-time',
899
+ ),
900
+ ),
901
+ 'format' => 'date-time',
902
+ 'context' => array( 'view', 'edit' ),
903
+ 'readonly' => true,
904
+ ),
905
+ 'latest_update' => array(
906
+ 'description' => __( 'The content of the latest activity posted by the member.', 'buddypress' ),
907
+ 'type' => 'object',
908
+ 'properties' => array(
909
+ 'id' => array(
910
+ 'context' => array( 'view', 'edit' ),
911
+ 'description' => __( 'A unique numeric ID for the activity.', 'buddypress' ),
912
+ 'readonly' => true,
913
+ 'type' => 'integer',
914
+ ),
915
+ 'raw' => array(
916
+ 'description' => __( 'Content for the activity, as it exists in the database.', 'buddypress' ),
917
+ 'type' => 'string',
918
+ 'context' => array( 'view', 'edit' ),
919
+ ),
920
+ 'rendered' => array(
921
+ 'description' => __( 'HTML content for the activity, transformed for display.', 'buddypress' ),
922
+ 'type' => 'string',
923
+ 'context' => array( 'view', 'edit' ),
924
+ 'readonly' => true,
925
+ ),
926
+ ),
927
+ 'readonly' => true,
928
+ ),
929
+ 'total_friend_count' => array(
930
+ 'context' => array( 'view', 'edit' ),
931
+ 'description' => __( 'Total number of friends for the member.', 'buddypress' ),
932
+ 'type' => 'integer',
933
+ 'readonly' => true,
934
+ ),
935
  ),
936
  );
937
 
1034
  'validate_callback' => 'rest_validate_request_arg',
1035
  );
1036
 
1037
+ $params['populate_extras'] = array(
1038
+ 'description' => __( 'Whether to fetch extra BP data about the returned members.', 'buddypress' ),
1039
+ 'default' => false,
1040
+ 'type' => 'boolean',
1041
+ 'sanitize_callback' => 'rest_sanitize_boolean',
1042
+ 'validate_callback' => 'rest_validate_request_arg',
1043
+ );
1044
+
1045
  $params['member_type'] = array(
1046
  'description' => __( 'Limit results set to certain type(s).', 'buddypress' ),
1047
  'default' => array(),
bp-members/classes/class-bp-rest-signup-endpoint.php CHANGED
@@ -809,7 +809,7 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
809
  public function is_blog_signup_allowed() {
810
  $active_signup = get_network_option( get_main_network_id(), 'registration' );
811
 
812
- return 'blog' === $active_signup || 'all' === $active_signup;
813
  }
814
 
815
  /**
@@ -834,7 +834,7 @@ class BP_REST_Signup_Endpoint extends WP_REST_Controller {
834
  * @return array Endpoint arguments.
835
  */
836
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
837
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
838
  $key = 'get_item';
839
 
840
  if ( WP_REST_Server::CREATABLE === $method ) {
809
  public function is_blog_signup_allowed() {
810
  $active_signup = get_network_option( get_main_network_id(), 'registration' );
811
 
812
+ return ( 'blog' === $active_signup || 'all' === $active_signup );
813
  }
814
 
815
  /**
834
  * @return array Endpoint arguments.
835
  */
836
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
837
+ $args = parent::get_endpoint_args_for_item_schema( $method );
838
  $key = 'get_item';
839
 
840
  if ( WP_REST_Server::CREATABLE === $method ) {
bp-members/classes/class-bp-signup.php CHANGED
@@ -121,7 +121,7 @@ class BP_Signup {
121
  * Fetch signups based on parameters.
122
  *
123
  * @since 2.0.0
124
- * @since 6.0.0 Adds a whitelist of allowed orderby parameters.
125
  *
126
  * @param array $args {
127
  * The argument to retrieve desired signups.
@@ -160,7 +160,7 @@ class BP_Signup {
160
  'bp_core_signups_get_args'
161
  );
162
 
163
- // Whitelist sanitization.
164
  if ( ! in_array( $r['orderby'], array( 'login', 'email', 'registered', 'activated' ), true ) ) {
165
  $r['orderby'] = 'signup_id';
166
  }
@@ -412,7 +412,7 @@ class BP_Signup {
412
  if ( isset( $usermeta[ $key ] ) ) {
413
  $visibility_level = $usermeta[ $key ];
414
  } else {
415
- $vfield = xprofile_get_field( $field_id );
416
  $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public';
417
  }
418
  xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
121
  * Fetch signups based on parameters.
122
  *
123
  * @since 2.0.0
124
+ * @since 6.0.0 Added a list of allowed orderby parameters.
125
  *
126
  * @param array $args {
127
  * The argument to retrieve desired signups.
160
  'bp_core_signups_get_args'
161
  );
162
 
163
+ // Make sure the orderby clause is allowed.
164
  if ( ! in_array( $r['orderby'], array( 'login', 'email', 'registered', 'activated' ), true ) ) {
165
  $r['orderby'] = 'signup_id';
166
  }
412
  if ( isset( $usermeta[ $key ] ) ) {
413
  $visibility_level = $usermeta[ $key ];
414
  } else {
415
+ $vfield = xprofile_get_field( $field_id, null, false );
416
  $visibility_level = isset( $vfield->default_visibility ) ? $vfield->default_visibility : 'public';
417
  }
418
  xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level );
bp-members/css/blocks/member-rtl.css CHANGED
@@ -1,4 +1,11 @@
1
  /* CSS for the bp/member block */
 
 
 
 
 
 
 
2
  .bp-block-member {
3
  position: relative;
4
  }
@@ -7,12 +14,38 @@
7
  display: flex;
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  .bp-block-member.has-cover .member-content,
11
  .bp-block-member.has-cover .item-header-avatar,
12
  .bp-block-member.has-cover .member-description {
13
  z-index: 2;
14
  }
15
 
 
 
 
 
16
  .bp-block-member.has-cover .member-description {
17
  padding-top: 75px;
18
  }
@@ -51,28 +84,24 @@
51
  min-height: 150px;
52
  }
53
 
54
- .bp-block-member.avatar-full.has-cover {
55
- min-height: 300px;
56
- }
57
-
58
  .bp-block-member.avatar-full .item-header-avatar {
59
  width: 180px;
60
  }
61
 
62
- .bp-block-member.has-cover.avatar-full .item-header-avatar {
 
 
 
 
63
  width: 200px;
64
  }
65
 
66
- .bp-block-member.has-cover.avatar-full img.avatar {
67
  border: solid 2px #fff;
68
  background: rgba(255, 255, 255, 0.8);
69
  margin-right: 20px;
70
  }
71
 
72
- .bp-block-member.has-cover .member-content {
73
- padding-top: 75px;
74
- }
75
-
76
  .bp-block-member.avatar-thumb .member-content {
77
  min-height: 50px;
78
  align-items: center;
@@ -86,25 +115,8 @@
86
  padding-top: 75px;
87
  }
88
 
89
- .bp-block-member .user-nicename {
90
- display: block;
91
- }
92
-
93
- .bp-block-member .user-nicename a,
94
  .entry .entry-content .bp-block-member .user-nicename a {
95
  color: currentColor;
96
  text-decoration: none;
97
  border: none;
98
  }
99
-
100
- .bp-block-member .bp-profile-button {
101
- width: 100%;
102
- }
103
-
104
- .bp-block-member .bp-profile-button a.button {
105
- position: absolute;
106
- bottom: 10px;
107
- left: 0;
108
- display: inline-block;
109
- margin: 18px 0 0;
110
- }
1
  /* CSS for the bp/member block */
2
+ [data-type="bp/member"] input.components-placeholder__input {
3
+ flex: 1 1 auto;
4
+ border-radius: 2px;
5
+ border: 1px solid #757575;
6
+ padding: 6px 8px;
7
+ }
8
+
9
  .bp-block-member {
10
  position: relative;
11
  }
14
  display: flex;
15
  }
16
 
17
+ .bp-block-member .user-nicename {
18
+ display: block;
19
+ }
20
+
21
+ .bp-block-member .user-nicename a {
22
+ color: currentColor;
23
+ text-decoration: none;
24
+ border: none;
25
+ }
26
+
27
+ .bp-block-member .bp-profile-button {
28
+ width: 100%;
29
+ }
30
+
31
+ .bp-block-member .bp-profile-button a.button {
32
+ position: absolute;
33
+ bottom: 10px;
34
+ left: 0;
35
+ display: inline-block;
36
+ margin: 18px 0 0;
37
+ }
38
+
39
  .bp-block-member.has-cover .member-content,
40
  .bp-block-member.has-cover .item-header-avatar,
41
  .bp-block-member.has-cover .member-description {
42
  z-index: 2;
43
  }
44
 
45
+ .bp-block-member.has-cover .member-content {
46
+ padding-top: 75px;
47
+ }
48
+
49
  .bp-block-member.has-cover .member-description {
50
  padding-top: 75px;
51
  }
84
  min-height: 150px;
85
  }
86
 
 
 
 
 
87
  .bp-block-member.avatar-full .item-header-avatar {
88
  width: 180px;
89
  }
90
 
91
+ .bp-block-member.avatar-full.has-cover {
92
+ min-height: 300px;
93
+ }
94
+
95
+ .bp-block-member.avatar-full.has-cover .item-header-avatar {
96
  width: 200px;
97
  }
98
 
99
+ .bp-block-member.avatar-full.has-cover img.avatar {
100
  border: solid 2px #fff;
101
  background: rgba(255, 255, 255, 0.8);
102
  margin-right: 20px;
103
  }
104
 
 
 
 
 
105
  .bp-block-member.avatar-thumb .member-content {
106
  min-height: 50px;
107
  align-items: center;
115
  padding-top: 75px;
116
  }
117
 
 
 
 
 
 
118
  .entry .entry-content .bp-block-member .user-nicename a {
119
  color: currentColor;
120
  text-decoration: none;
121
  border: none;
122
  }
 
 
 
 
 
 
 
 
 
 
 
 
bp-members/css/blocks/member-rtl.min.css CHANGED
@@ -1 +1 @@
1
- .bp-block-member{position:relative}.bp-block-member .member-content{display:flex}.bp-block-member.has-cover .item-header-avatar,.bp-block-member.has-cover .member-content,.bp-block-member.has-cover .member-description{z-index:2}.bp-block-member.has-cover .member-description{padding-top:75px}.bp-block-member.has-cover .bp-member-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;height:150px}.bp-block-member img.avatar{width:auto;height:auto}.bp-block-member.avatar-none .item-header-avatar{display:none}.bp-block-member.avatar-none.has-cover{min-height:200px}.bp-block-member.avatar-full{min-height:150px}.bp-block-member.avatar-full.has-cover{min-height:300px}.bp-block-member.avatar-full .item-header-avatar{width:180px}.bp-block-member.has-cover.avatar-full .item-header-avatar{width:200px}.bp-block-member.has-cover.avatar-full img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-right:20px}.bp-block-member.has-cover .member-content{padding-top:75px}.bp-block-member.avatar-thumb .member-content{min-height:50px;align-items:center}.bp-block-member.avatar-thumb .item-header-avatar{width:70px}.bp-block-member.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-member .user-nicename{display:block}.bp-block-member .user-nicename a,.entry .entry-content .bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-member .bp-profile-button{width:100%}.bp-block-member .bp-profile-button a.button{position:absolute;bottom:10px;left:0;display:inline-block;margin:18px 0 0}
1
+ [data-type="bp/member"] input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}.bp-block-member{position:relative}.bp-block-member .member-content{display:flex}.bp-block-member .user-nicename{display:block}.bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-member .bp-profile-button{width:100%}.bp-block-member .bp-profile-button a.button{position:absolute;bottom:10px;left:0;display:inline-block;margin:18px 0 0}.bp-block-member.has-cover .item-header-avatar,.bp-block-member.has-cover .member-content,.bp-block-member.has-cover .member-description{z-index:2}.bp-block-member.has-cover .member-content{padding-top:75px}.bp-block-member.has-cover .member-description{padding-top:75px}.bp-block-member.has-cover .bp-member-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;height:150px}.bp-block-member img.avatar{width:auto;height:auto}.bp-block-member.avatar-none .item-header-avatar{display:none}.bp-block-member.avatar-none.has-cover{min-height:200px}.bp-block-member.avatar-full{min-height:150px}.bp-block-member.avatar-full .item-header-avatar{width:180px}.bp-block-member.avatar-full.has-cover{min-height:300px}.bp-block-member.avatar-full.has-cover .item-header-avatar{width:200px}.bp-block-member.avatar-full.has-cover img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-right:20px}.bp-block-member.avatar-thumb .member-content{min-height:50px;align-items:center}.bp-block-member.avatar-thumb .item-header-avatar{width:70px}.bp-block-member.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.entry .entry-content .bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}
bp-members/css/blocks/member.css CHANGED
@@ -1,4 +1,11 @@
1
  /* CSS for the bp/member block */
 
 
 
 
 
 
 
2
  .bp-block-member {
3
  position: relative;
4
  }
@@ -7,12 +14,38 @@
7
  display: flex;
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  .bp-block-member.has-cover .member-content,
11
  .bp-block-member.has-cover .item-header-avatar,
12
  .bp-block-member.has-cover .member-description {
13
  z-index: 2;
14
  }
15
 
 
 
 
 
16
  .bp-block-member.has-cover .member-description {
17
  padding-top: 75px;
18
  }
@@ -51,28 +84,24 @@
51
  min-height: 150px;
52
  }
53
 
54
- .bp-block-member.avatar-full.has-cover {
55
- min-height: 300px;
56
- }
57
-
58
  .bp-block-member.avatar-full .item-header-avatar {
59
  width: 180px;
60
  }
61
 
62
- .bp-block-member.has-cover.avatar-full .item-header-avatar {
 
 
 
 
63
  width: 200px;
64
  }
65
 
66
- .bp-block-member.has-cover.avatar-full img.avatar {
67
  border: solid 2px #fff;
68
  background: rgba(255, 255, 255, 0.8);
69
  margin-left: 20px;
70
  }
71
 
72
- .bp-block-member.has-cover .member-content {
73
- padding-top: 75px;
74
- }
75
-
76
  .bp-block-member.avatar-thumb .member-content {
77
  min-height: 50px;
78
  align-items: center;
@@ -86,25 +115,8 @@
86
  padding-top: 75px;
87
  }
88
 
89
- .bp-block-member .user-nicename {
90
- display: block;
91
- }
92
-
93
- .bp-block-member .user-nicename a,
94
  .entry .entry-content .bp-block-member .user-nicename a {
95
  color: currentColor;
96
  text-decoration: none;
97
  border: none;
98
  }
99
-
100
- .bp-block-member .bp-profile-button {
101
- width: 100%;
102
- }
103
-
104
- .bp-block-member .bp-profile-button a.button {
105
- position: absolute;
106
- bottom: 10px;
107
- right: 0;
108
- display: inline-block;
109
- margin: 18px 0 0;
110
- }
1
  /* CSS for the bp/member block */
2
+ [data-type="bp/member"] input.components-placeholder__input {
3
+ flex: 1 1 auto;
4
+ border-radius: 2px;
5
+ border: 1px solid #757575;
6
+ padding: 6px 8px;
7
+ }
8
+
9
  .bp-block-member {
10
  position: relative;
11
  }
14
  display: flex;
15
  }
16
 
17
+ .bp-block-member .user-nicename {
18
+ display: block;
19
+ }
20
+
21
+ .bp-block-member .user-nicename a {
22
+ color: currentColor;
23
+ text-decoration: none;
24
+ border: none;
25
+ }
26
+
27
+ .bp-block-member .bp-profile-button {
28
+ width: 100%;
29
+ }
30
+
31
+ .bp-block-member .bp-profile-button a.button {
32
+ position: absolute;
33
+ bottom: 10px;
34
+ right: 0;
35
+ display: inline-block;
36
+ margin: 18px 0 0;
37
+ }
38
+
39
  .bp-block-member.has-cover .member-content,
40
  .bp-block-member.has-cover .item-header-avatar,
41
  .bp-block-member.has-cover .member-description {
42
  z-index: 2;
43
  }
44
 
45
+ .bp-block-member.has-cover .member-content {
46
+ padding-top: 75px;
47
+ }
48
+
49
  .bp-block-member.has-cover .member-description {
50
  padding-top: 75px;
51
  }
84
  min-height: 150px;
85
  }
86
 
 
 
 
 
87
  .bp-block-member.avatar-full .item-header-avatar {
88
  width: 180px;
89
  }
90
 
91
+ .bp-block-member.avatar-full.has-cover {
92
+ min-height: 300px;
93
+ }
94
+
95
+ .bp-block-member.avatar-full.has-cover .item-header-avatar {
96
  width: 200px;
97
  }
98
 
99
+ .bp-block-member.avatar-full.has-cover img.avatar {
100
  border: solid 2px #fff;
101
  background: rgba(255, 255, 255, 0.8);
102
  margin-left: 20px;
103
  }
104
 
 
 
 
 
105
  .bp-block-member.avatar-thumb .member-content {
106
  min-height: 50px;
107
  align-items: center;
115
  padding-top: 75px;
116
  }
117
 
 
 
 
 
 
118
  .entry .entry-content .bp-block-member .user-nicename a {
119
  color: currentColor;
120
  text-decoration: none;
121
  border: none;
122
  }
 
 
 
 
 
 
 
 
 
 
 
 
bp-members/css/blocks/member.min.css CHANGED
@@ -1 +1 @@
1
- .bp-block-member{position:relative}.bp-block-member .member-content{display:flex}.bp-block-member.has-cover .item-header-avatar,.bp-block-member.has-cover .member-content,.bp-block-member.has-cover .member-description{z-index:2}.bp-block-member.has-cover .member-description{padding-top:75px}.bp-block-member.has-cover .bp-member-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;height:150px}.bp-block-member img.avatar{width:auto;height:auto}.bp-block-member.avatar-none .item-header-avatar{display:none}.bp-block-member.avatar-none.has-cover{min-height:200px}.bp-block-member.avatar-full{min-height:150px}.bp-block-member.avatar-full.has-cover{min-height:300px}.bp-block-member.avatar-full .item-header-avatar{width:180px}.bp-block-member.has-cover.avatar-full .item-header-avatar{width:200px}.bp-block-member.has-cover.avatar-full img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-left:20px}.bp-block-member.has-cover .member-content{padding-top:75px}.bp-block-member.avatar-thumb .member-content{min-height:50px;align-items:center}.bp-block-member.avatar-thumb .item-header-avatar{width:70px}.bp-block-member.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.bp-block-member .user-nicename{display:block}.bp-block-member .user-nicename a,.entry .entry-content .bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-member .bp-profile-button{width:100%}.bp-block-member .bp-profile-button a.button{position:absolute;bottom:10px;right:0;display:inline-block;margin:18px 0 0}
1
+ [data-type="bp/member"] input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}.bp-block-member{position:relative}.bp-block-member .member-content{display:flex}.bp-block-member .user-nicename{display:block}.bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-member .bp-profile-button{width:100%}.bp-block-member .bp-profile-button a.button{position:absolute;bottom:10px;right:0;display:inline-block;margin:18px 0 0}.bp-block-member.has-cover .item-header-avatar,.bp-block-member.has-cover .member-content,.bp-block-member.has-cover .member-description{z-index:2}.bp-block-member.has-cover .member-content{padding-top:75px}.bp-block-member.has-cover .member-description{padding-top:75px}.bp-block-member.has-cover .bp-member-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;height:150px}.bp-block-member img.avatar{width:auto;height:auto}.bp-block-member.avatar-none .item-header-avatar{display:none}.bp-block-member.avatar-none.has-cover{min-height:200px}.bp-block-member.avatar-full{min-height:150px}.bp-block-member.avatar-full .item-header-avatar{width:180px}.bp-block-member.avatar-full.has-cover{min-height:300px}.bp-block-member.avatar-full.has-cover .item-header-avatar{width:200px}.bp-block-member.avatar-full.has-cover img.avatar{border:solid 2px #fff;background:rgba(255,255,255,.8);margin-left:20px}.bp-block-member.avatar-thumb .member-content{min-height:50px;align-items:center}.bp-block-member.avatar-thumb .item-header-avatar{width:70px}.bp-block-member.avatar-thumb.has-cover .item-header-avatar{padding-top:75px}.entry .entry-content .bp-block-member .user-nicename a{color:currentColor;text-decoration:none;border:none}
bp-members/css/blocks/members-rtl.css ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/members"] .components-placeholder.is-appender {
3
+ min-height: 0;
4
+ }
5
+
6
+ [data-type="bp/members"] .components-placeholder.is-appender .components-placeholder__label:empty {
7
+ display: none;
8
+ }
9
+
10
+ [data-type="bp/members"] .components-placeholder input.components-placeholder__input {
11
+ flex: 1 1 auto;
12
+ border-radius: 2px;
13
+ border: 1px solid #757575;
14
+ padding: 6px 8px;
15
+ }
16
+
17
+ [data-type="bp/members"].avatar-none .member-description {
18
+ width: calc(100% - 44px);
19
+ }
20
+
21
+ [data-type="bp/members"].avatar-full .member-description {
22
+ width: calc(100% - 224px);
23
+ }
24
+
25
+ [data-type="bp/members"].avatar-thumb .member-description {
26
+ width: calc(100% - 114px);
27
+ }
28
+
29
+ [data-type="bp/members"] .member-content {
30
+ position: relative;
31
+ }
32
+
33
+ [data-type="bp/members"] .member-content .is-right {
34
+ position: absolute;
35
+ top: 2px;
36
+ left: 2px;
37
+ }
38
+
39
+ [data-type="bp/members"] .columns-2 .member-content .member-description,
40
+ [data-type="bp/members"] .columns-3 .member-content .member-description,
41
+ [data-type="bp/members"] .columns-4 .member-content .member-description {
42
+ padding-right: 44px;
43
+ width: calc(100% - 44px);
44
+ }
45
+
46
+ [data-type="bp/members"] .columns-3 .is-right {
47
+ left: -10px;
48
+ }
49
+
50
+ [data-type="bp/members"] .columns-4 .is-right {
51
+ left: -50px;
52
+ }
53
+
54
+ .bp-block-members.is-grid {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ padding: 0;
58
+ }
59
+
60
+ .bp-block-members.is-grid .member-content {
61
+ margin: 0 0 1.25em 1.25em;
62
+ width: 100%;
63
+ }
64
+
65
+ @media (min-width: 600px) {
66
+ .bp-block-members.columns-2 .member-content {
67
+ width: calc((100% / 2) - 1.25em + (1.25em / 2));
68
+ }
69
+ .bp-block-members.columns-2 .member-content:nth-child(2n) {
70
+ margin-left: 0;
71
+ }
72
+ .bp-block-members.columns-3 .member-content {
73
+ width: calc((100% / 3) - 1.25em + (1.25em / 3));
74
+ }
75
+ .bp-block-members.columns-3 .member-content:nth-child(3n) {
76
+ margin-left: 0;
77
+ }
78
+ .bp-block-members.columns-4 .member-content {
79
+ width: calc((100% / 4) - 1.25em + (1.25em / 4));
80
+ }
81
+ .bp-block-members.columns-4 .member-content:nth-child(4n) {
82
+ margin-left: 0;
83
+ }
84
+ }
85
+
86
+ .bp-block-members .member-content {
87
+ display: flex;
88
+ flex-direction: column;
89
+ padding-bottom: 1em;
90
+ text-align: center;
91
+ }
92
+
93
+ .bp-block-members .member-content .item-header-avatar,
94
+ .bp-block-members .member-content .member-description {
95
+ width: 100%;
96
+ }
97
+
98
+ .bp-block-members .member-content .item-header-avatar {
99
+ margin: 0 auto;
100
+ }
101
+
102
+ .bp-block-members .member-content .item-header-avatar img.avatar {
103
+ display: inline-block;
104
+ }
105
+
106
+ @media (min-width: 600px) {
107
+ .bp-block-members .member-content {
108
+ flex-direction: row;
109
+ text-align: right;
110
+ }
111
+ .bp-block-members .member-content .item-header-avatar,
112
+ .bp-block-members .member-content .member-description {
113
+ width: auto;
114
+ }
115
+ .bp-block-members .member-content .item-header-avatar {
116
+ margin: 0;
117
+ }
118
+ }
119
+
120
+ .bp-block-members .member-content .user-nicename {
121
+ display: block;
122
+ }
123
+
124
+ .bp-block-members .member-content .user-nicename a {
125
+ color: currentColor;
126
+ text-decoration: none;
127
+ border: none;
128
+ }
129
+
130
+ .bp-block-members .member-content time {
131
+ display: block;
132
+ font-size: 80%;
133
+ color: #767676;
134
+ }
135
+
136
+ .bp-block-members.avatar-none .item-header-avatar {
137
+ display: none;
138
+ }
139
+
140
+ .bp-block-members.avatar-full {
141
+ min-height: 190px;
142
+ }
143
+
144
+ .bp-block-members.avatar-full .item-header-avatar {
145
+ width: 180px;
146
+ }
147
+
148
+ .bp-block-members.avatar-thumb .member-content {
149
+ min-height: 80px;
150
+ }
151
+
152
+ .bp-block-members.avatar-thumb .item-header-avatar {
153
+ width: 70px;
154
+ }
155
+
156
+ .bp-block-members.columns-2 .member-content,
157
+ .bp-block-members.columns-3 .member-content,
158
+ .bp-block-members.columns-4 .member-content {
159
+ display: block;
160
+ text-align: center;
161
+ }
162
+
163
+ .bp-block-members.columns-2 .member-content .item-header-avatar,
164
+ .bp-block-members.columns-3 .member-content .item-header-avatar,
165
+ .bp-block-members.columns-4 .member-content .item-header-avatar {
166
+ margin: 0 auto;
167
+ }
168
+
169
+ .bp-block-members img.avatar {
170
+ width: auto;
171
+ height: auto;
172
+ max-width: -webkit-fit-content;
173
+ max-width: fit-content;
174
+ }
175
+
176
+ .bp-block-members .member-content.has-activity {
177
+ align-items: center;
178
+ }
179
+
180
+ .bp-block-members .member-content.has-activity .item-header-avatar {
181
+ padding-left: 1em;
182
+ }
183
+
184
+ .bp-block-members .member-content.has-activity .wp-block-quote {
185
+ margin-bottom: 0;
186
+ text-align: right;
187
+ }
188
+
189
+ .bp-block-members .member-content.has-activity .wp-block-quote cite a {
190
+ color: currentColor;
191
+ text-decoration: none;
192
+ border: none;
193
+ }
194
+
195
+ .entry .entry-content .bp-block-members .user-nicename a {
196
+ color: currentColor;
197
+ text-decoration: none;
198
+ border: none;
199
+ }
bp-members/css/blocks/members-rtl.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [data-type="bp/members"] .components-placeholder.is-appender{min-height:0}[data-type="bp/members"] .components-placeholder.is-appender .components-placeholder__label:empty{display:none}[data-type="bp/members"] .components-placeholder input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}[data-type="bp/members"].avatar-none .member-description{width:calc(100% - 44px)}[data-type="bp/members"].avatar-full .member-description{width:calc(100% - 224px)}[data-type="bp/members"].avatar-thumb .member-description{width:calc(100% - 114px)}[data-type="bp/members"] .member-content{position:relative}[data-type="bp/members"] .member-content .is-right{position:absolute;top:2px;left:2px}[data-type="bp/members"] .columns-2 .member-content .member-description,[data-type="bp/members"] .columns-3 .member-content .member-description,[data-type="bp/members"] .columns-4 .member-content .member-description{padding-right:44px;width:calc(100% - 44px)}[data-type="bp/members"] .columns-3 .is-right{left:-10px}[data-type="bp/members"] .columns-4 .is-right{left:-50px}.bp-block-members.is-grid{display:flex;flex-wrap:wrap;padding:0}.bp-block-members.is-grid .member-content{margin:0 0 1.25em 1.25em;width:100%}@media (min-width:600px){.bp-block-members.columns-2 .member-content{width:calc((100% / 2) - 1.25em + (1.25em / 2))}.bp-block-members.columns-2 .member-content:nth-child(2n){margin-left:0}.bp-block-members.columns-3 .member-content{width:calc((100% / 3) - 1.25em + (1.25em / 3))}.bp-block-members.columns-3 .member-content:nth-child(3n){margin-left:0}.bp-block-members.columns-4 .member-content{width:calc((100% / 4) - 1.25em + (1.25em / 4))}.bp-block-members.columns-4 .member-content:nth-child(4n){margin-left:0}}.bp-block-members .member-content{display:flex;flex-direction:column;padding-bottom:1em;text-align:center}.bp-block-members .member-content .item-header-avatar,.bp-block-members .member-content .member-description{width:100%}.bp-block-members .member-content .item-header-avatar{margin:0 auto}.bp-block-members .member-content .item-header-avatar img.avatar{display:inline-block}@media (min-width:600px){.bp-block-members .member-content{flex-direction:row;text-align:right}.bp-block-members .member-content .item-header-avatar,.bp-block-members .member-content .member-description{width:auto}.bp-block-members .member-content .item-header-avatar{margin:0}}.bp-block-members .member-content .user-nicename{display:block}.bp-block-members .member-content .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-members .member-content time{display:block;font-size:80%;color:#767676}.bp-block-members.avatar-none .item-header-avatar{display:none}.bp-block-members.avatar-full{min-height:190px}.bp-block-members.avatar-full .item-header-avatar{width:180px}.bp-block-members.avatar-thumb .member-content{min-height:80px}.bp-block-members.avatar-thumb .item-header-avatar{width:70px}.bp-block-members.columns-2 .member-content,.bp-block-members.columns-3 .member-content,.bp-block-members.columns-4 .member-content{display:block;text-align:center}.bp-block-members.columns-2 .member-content .item-header-avatar,.bp-block-members.columns-3 .member-content .item-header-avatar,.bp-block-members.columns-4 .member-content .item-header-avatar{margin:0 auto}.bp-block-members img.avatar{width:auto;height:auto;max-width:-webkit-fit-content;max-width:fit-content}.bp-block-members .member-content.has-activity{align-items:center}.bp-block-members .member-content.has-activity .item-header-avatar{padding-left:1em}.bp-block-members .member-content.has-activity .wp-block-quote{margin-bottom:0;text-align:right}.bp-block-members .member-content.has-activity .wp-block-quote cite a{color:currentColor;text-decoration:none;border:none}.entry .entry-content .bp-block-members .user-nicename a{color:currentColor;text-decoration:none;border:none}
bp-members/css/blocks/members.css ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/members"] .components-placeholder.is-appender {
3
+ min-height: 0;
4
+ }
5
+
6
+ [data-type="bp/members"] .components-placeholder.is-appender .components-placeholder__label:empty {
7
+ display: none;
8
+ }
9
+
10
+ [data-type="bp/members"] .components-placeholder input.components-placeholder__input {
11
+ flex: 1 1 auto;
12
+ border-radius: 2px;
13
+ border: 1px solid #757575;
14
+ padding: 6px 8px;
15
+ }
16
+
17
+ [data-type="bp/members"].avatar-none .member-description {
18
+ width: calc(100% - 44px);
19
+ }
20
+
21
+ [data-type="bp/members"].avatar-full .member-description {
22
+ width: calc(100% - 224px);
23
+ }
24
+
25
+ [data-type="bp/members"].avatar-thumb .member-description {
26
+ width: calc(100% - 114px);
27
+ }
28
+
29
+ [data-type="bp/members"] .member-content {
30
+ position: relative;
31
+ }
32
+
33
+ [data-type="bp/members"] .member-content .is-right {
34
+ position: absolute;
35
+ top: 2px;
36
+ right: 2px;
37
+ }
38
+
39
+ [data-type="bp/members"] .columns-2 .member-content .member-description,
40
+ [data-type="bp/members"] .columns-3 .member-content .member-description,
41
+ [data-type="bp/members"] .columns-4 .member-content .member-description {
42
+ padding-left: 44px;
43
+ width: calc(100% - 44px);
44
+ }
45
+
46
+ [data-type="bp/members"] .columns-3 .is-right {
47
+ right: -10px;
48
+ }
49
+
50
+ [data-type="bp/members"] .columns-4 .is-right {
51
+ right: -50px;
52
+ }
53
+
54
+ .bp-block-members.is-grid {
55
+ display: flex;
56
+ flex-wrap: wrap;
57
+ padding: 0;
58
+ }
59
+
60
+ .bp-block-members.is-grid .member-content {
61
+ margin: 0 1.25em 1.25em 0;
62
+ width: 100%;
63
+ }
64
+
65
+ @media (min-width: 600px) {
66
+ .bp-block-members.columns-2 .member-content {
67
+ width: calc((100% / 2) - 1.25em + (1.25em / 2));
68
+ }
69
+ .bp-block-members.columns-2 .member-content:nth-child(2n) {
70
+ margin-right: 0;
71
+ }
72
+ .bp-block-members.columns-3 .member-content {
73
+ width: calc((100% / 3) - 1.25em + (1.25em / 3));
74
+ }
75
+ .bp-block-members.columns-3 .member-content:nth-child(3n) {
76
+ margin-right: 0;
77
+ }
78
+ .bp-block-members.columns-4 .member-content {
79
+ width: calc((100% / 4) - 1.25em + (1.25em / 4));
80
+ }
81
+ .bp-block-members.columns-4 .member-content:nth-child(4n) {
82
+ margin-right: 0;
83
+ }
84
+ }
85
+
86
+ .bp-block-members .member-content {
87
+ display: flex;
88
+ flex-direction: column;
89
+ padding-bottom: 1em;
90
+ text-align: center;
91
+ }
92
+
93
+ .bp-block-members .member-content .item-header-avatar,
94
+ .bp-block-members .member-content .member-description {
95
+ width: 100%;
96
+ }
97
+
98
+ .bp-block-members .member-content .item-header-avatar {
99
+ margin: 0 auto;
100
+ }
101
+
102
+ .bp-block-members .member-content .item-header-avatar img.avatar {
103
+ display: inline-block;
104
+ }
105
+
106
+ @media (min-width: 600px) {
107
+ .bp-block-members .member-content {
108
+ flex-direction: row;
109
+ text-align: left;
110
+ }
111
+ .bp-block-members .member-content .item-header-avatar,
112
+ .bp-block-members .member-content .member-description {
113
+ width: auto;
114
+ }
115
+ .bp-block-members .member-content .item-header-avatar {
116
+ margin: 0;
117
+ }
118
+ }
119
+
120
+ .bp-block-members .member-content .user-nicename {
121
+ display: block;
122
+ }
123
+
124
+ .bp-block-members .member-content .user-nicename a {
125
+ color: currentColor;
126
+ text-decoration: none;
127
+ border: none;
128
+ }
129
+
130
+ .bp-block-members .member-content time {
131
+ display: block;
132
+ font-size: 80%;
133
+ color: #767676;
134
+ }
135
+
136
+ .bp-block-members.avatar-none .item-header-avatar {
137
+ display: none;
138
+ }
139
+
140
+ .bp-block-members.avatar-full {
141
+ min-height: 190px;
142
+ }
143
+
144
+ .bp-block-members.avatar-full .item-header-avatar {
145
+ width: 180px;
146
+ }
147
+
148
+ .bp-block-members.avatar-thumb .member-content {
149
+ min-height: 80px;
150
+ }
151
+
152
+ .bp-block-members.avatar-thumb .item-header-avatar {
153
+ width: 70px;
154
+ }
155
+
156
+ .bp-block-members.columns-2 .member-content,
157
+ .bp-block-members.columns-3 .member-content,
158
+ .bp-block-members.columns-4 .member-content {
159
+ display: block;
160
+ text-align: center;
161
+ }
162
+
163
+ .bp-block-members.columns-2 .member-content .item-header-avatar,
164
+ .bp-block-members.columns-3 .member-content .item-header-avatar,
165
+ .bp-block-members.columns-4 .member-content .item-header-avatar {
166
+ margin: 0 auto;
167
+ }
168
+
169
+ .bp-block-members img.avatar {
170
+ width: auto;
171
+ height: auto;
172
+ max-width: -webkit-fit-content;
173
+ max-width: fit-content;
174
+ }
175
+
176
+ .bp-block-members .member-content.has-activity {
177
+ align-items: center;
178
+ }
179
+
180
+ .bp-block-members .member-content.has-activity .item-header-avatar {
181
+ padding-right: 1em;
182
+ }
183
+
184
+ .bp-block-members .member-content.has-activity .wp-block-quote {
185
+ margin-bottom: 0;
186
+ text-align: left;
187
+ }
188
+
189
+ .bp-block-members .member-content.has-activity .wp-block-quote cite a {
190
+ color: currentColor;
191
+ text-decoration: none;
192
+ border: none;
193
+ }
194
+
195
+ .entry .entry-content .bp-block-members .user-nicename a {
196
+ color: currentColor;
197
+ text-decoration: none;
198
+ border: none;
199
+ }
bp-members/css/blocks/members.min.css ADDED
@@ -0,0 +1 @@
 
1
+ [data-type="bp/members"] .components-placeholder.is-appender{min-height:0}[data-type="bp/members"] .components-placeholder.is-appender .components-placeholder__label:empty{display:none}[data-type="bp/members"] .components-placeholder input.components-placeholder__input{flex:1 1 auto;border-radius:2px;border:1px solid #757575;padding:6px 8px}[data-type="bp/members"].avatar-none .member-description{width:calc(100% - 44px)}[data-type="bp/members"].avatar-full .member-description{width:calc(100% - 224px)}[data-type="bp/members"].avatar-thumb .member-description{width:calc(100% - 114px)}[data-type="bp/members"] .member-content{position:relative}[data-type="bp/members"] .member-content .is-right{position:absolute;top:2px;right:2px}[data-type="bp/members"] .columns-2 .member-content .member-description,[data-type="bp/members"] .columns-3 .member-content .member-description,[data-type="bp/members"] .columns-4 .member-content .member-description{padding-left:44px;width:calc(100% - 44px)}[data-type="bp/members"] .columns-3 .is-right{right:-10px}[data-type="bp/members"] .columns-4 .is-right{right:-50px}.bp-block-members.is-grid{display:flex;flex-wrap:wrap;padding:0}.bp-block-members.is-grid .member-content{margin:0 1.25em 1.25em 0;width:100%}@media (min-width:600px){.bp-block-members.columns-2 .member-content{width:calc((100% / 2) - 1.25em + (1.25em / 2))}.bp-block-members.columns-2 .member-content:nth-child(2n){margin-right:0}.bp-block-members.columns-3 .member-content{width:calc((100% / 3) - 1.25em + (1.25em / 3))}.bp-block-members.columns-3 .member-content:nth-child(3n){margin-right:0}.bp-block-members.columns-4 .member-content{width:calc((100% / 4) - 1.25em + (1.25em / 4))}.bp-block-members.columns-4 .member-content:nth-child(4n){margin-right:0}}.bp-block-members .member-content{display:flex;flex-direction:column;padding-bottom:1em;text-align:center}.bp-block-members .member-content .item-header-avatar,.bp-block-members .member-content .member-description{width:100%}.bp-block-members .member-content .item-header-avatar{margin:0 auto}.bp-block-members .member-content .item-header-avatar img.avatar{display:inline-block}@media (min-width:600px){.bp-block-members .member-content{flex-direction:row;text-align:left}.bp-block-members .member-content .item-header-avatar,.bp-block-members .member-content .member-description{width:auto}.bp-block-members .member-content .item-header-avatar{margin:0}}.bp-block-members .member-content .user-nicename{display:block}.bp-block-members .member-content .user-nicename a{color:currentColor;text-decoration:none;border:none}.bp-block-members .member-content time{display:block;font-size:80%;color:#767676}.bp-block-members.avatar-none .item-header-avatar{display:none}.bp-block-members.avatar-full{min-height:190px}.bp-block-members.avatar-full .item-header-avatar{width:180px}.bp-block-members.avatar-thumb .member-content{min-height:80px}.bp-block-members.avatar-thumb .item-header-avatar{width:70px}.bp-block-members.columns-2 .member-content,.bp-block-members.columns-3 .member-content,.bp-block-members.columns-4 .member-content{display:block;text-align:center}.bp-block-members.columns-2 .member-content .item-header-avatar,.bp-block-members.columns-3 .member-content .item-header-avatar,.bp-block-members.columns-4 .member-content .item-header-avatar{margin:0 auto}.bp-block-members img.avatar{width:auto;height:auto;max-width:-webkit-fit-content;max-width:fit-content}.bp-block-members .member-content.has-activity{align-items:center}.bp-block-members .member-content.has-activity .item-header-avatar{padding-right:1em}.bp-block-members .member-content.has-activity .wp-block-quote{margin-bottom:0;text-align:left}.bp-block-members .member-content.has-activity .wp-block-quote cite a{color:currentColor;text-decoration:none;border:none}.entry .entry-content .bp-block-members .user-nicename a{color:currentColor;text-decoration:none;border:none}
bp-members/js/blocks/member.js CHANGED
@@ -1,4 +1,8 @@
1
- parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"TmUL":[function(require,module,exports) {
2
- var e=wp.blocks.registerBlockType,t=wp.element,n=t.createElement,l=t.Fragment,s=wp.components,a=s.Placeholder,r=s.Disabled,o=s.PanelBody,i=s.SelectControl,d=s.ToggleControl,u=s.Toolbar,p=s.ToolbarButton,b=wp.blockEditor,m=b.InspectorControls,y=b.BlockControls,c=wp.data.withSelect,g=wp.compose.compose,h=wp.editor.ServerSideRender,v=wp.i18n.__,f=bp.blockComponents.AutoCompleter,S=[{label:v("None","buddypress"),value:"none"},{label:v("Thumb","buddypress"),value:"thumb"},{label:v("Full","buddypress"),value:"full"}],C=function(e){var t=e.attributes,s=e.setAttributes,b=e.bpSettings,c=b.isAvatarEnabled,g=b.isMentionEnabled,C=b.isCoverImageEnabled,I=t.avatarSize,k=t.displayMentionSlug,w=t.displayActionButton,M=t.displayCoverImage;return t.itemID?n(l,null,n(y,null,n(u,null,n(p,{icon:"edit",title:v("Select another member","buddypress"),onClick:function(){s({itemID:0})}}))),n(m,null,n(o,{title:v("Settings","buddypress"),initialOpen:!0},n(d,{label:v("Display Profile button","buddypress"),checked:!!w,onChange:function(){s({displayActionButton:!w})},help:v(w?"Include a link to the user's profile page under their display name.":"Toggle to display a link to the user's profile page under their display name.","buddypress")}),c&&n(i,{label:v("Avatar size","buddypress"),value:I,options:S,help:v('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){s({avatarSize:e})}}),C&&n(d,{label:v("Display Cover Image","buddypress"),checked:!!M,onChange:function(){s({displayCoverImage:!M})},help:v(M?"Include the user's cover image over their display name.":"Toggle to display the user's cover image over their display name.","buddypress")}),g&&n(d,{label:v("Display Mention slug","buddypress"),checked:!!k,onChange:function(){s({displayMentionSlug:!k})},help:v(k?"Include the user's mention name under their display name.":"Toggle to display the user's mention name under their display name.","buddypress")}))),n(r,null,n(h,{block:"bp/member",attributes:t}))):n(a,{icon:"admin-users",label:v("BuddyPress Member","buddypress"),instructions:v("Start typing the name of the member you want to feature into this post.","buddypress")},n(f,{component:"members",ariaLabel:v("Member's username","buddypress"),placeholder:v("Enter Member's username here…","buddypress"),onSelectItem:s,useAvatar:c}))},I=g([c(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.members||{}}})])(C);e("bp/member",{title:v("Member","buddypress"),description:v("BuddyPress Member.","buddypress"),icon:"admin-users",category:"buddypress",attributes:{itemID:{type:"integer",default:0},avatarSize:{type:"string",default:"full"},displayMentionSlug:{type:"boolean",default:!0},displayActionButton:{type:"boolean",default:!0},displayCoverImage:{type:"boolean",default:!0}},edit:I});
3
- },{}]},{},["TmUL"], null)
 
 
 
 
4
  //# sourceMappingURL=/bp-members/js/blocks/member.js.map
1
+ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"AE3e":[function(require,module,exports) {
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AVATAR_SIZES=void 0;var e=wp,l=e.i18n.__,u=[{label:l("None","buddypress"),value:"none"},{label:l("Thumb","buddypress"),value:"thumb"},{label:l("Full","buddypress"),value:"full"}];exports.AVATAR_SIZES=u;
3
+ },{}],"YNTp":[function(require,module,exports) {
4
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=wp,n=t.blockEditor,o=n.InspectorControls,r=n.BlockControls,s=t.components,l=s.Placeholder,a=s.Disabled,i=s.PanelBody,d=s.SelectControl,u=s.ToggleControl,p=s.Toolbar,m=s.ToolbarButton,b=t.compose.compose,c=t.data.withSelect,y=t.editor.ServerSideRender,h=t.element,g=h.Fragment,v=h.createElement,S=t.i18n.__,f=bp.blockComponents.AutoCompleter,C=function(e){return e&&e.mention_name?e.mention_name:null},I=function(t){var n=t.attributes,s=t.setAttributes,b=t.bpSettings,c=b.isAvatarEnabled,h=b.isMentionEnabled,I=b.isCoverImageEnabled,k=n.avatarSize,A=n.displayMentionSlug,E=n.displayActionButton,M=n.displayCoverImage;return n.itemID?v(g,null,v(r,null,v(p,null,v(m,{icon:"edit",title:S("Select another member","buddypress"),onClick:function(){s({itemID:0})}}))),v(o,null,v(i,{title:S("Settings","buddypress"),initialOpen:!0},v(u,{label:S("Display Profile button","buddypress"),checked:!!E,onChange:function(){s({displayActionButton:!E})},help:S(E?"Include a link to the user's profile page under their display name.":"Toggle to display a link to the user's profile page under their display name.","buddypress")}),c&&v(d,{label:S("Avatar size","buddypress"),value:k,options:e.AVATAR_SIZES,help:S('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){s({avatarSize:e})}}),I&&v(u,{label:S("Display Cover Image","buddypress"),checked:!!M,onChange:function(){s({displayCoverImage:!M})},help:S(M?"Include the user's cover image over their display name.":"Toggle to display the user's cover image over their display name.","buddypress")}),h&&v(u,{label:S("Display Mention slug","buddypress"),checked:!!A,onChange:function(){s({displayMentionSlug:!A})},help:S(A?"Include the user's mention name under their display name.":"Toggle to display the user's mention name under their display name.","buddypress")}))),v(a,null,v(y,{block:"bp/member",attributes:n}))):v(l,{icon:"admin-users",label:S("BuddyPress Member","buddypress"),instructions:S("Start typing the name of the member you want to feature into this post.","buddypress")},v(f,{component:"members",slugValue:C,ariaLabel:S("Member's username","buddypress"),placeholder:S("Enter Member's username here…","buddypress"),onSelectItem:s,useAvatar:c}))},k=b([c(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.members||{}}})])(I),A=k;exports.default=A;
5
+ },{"./constants":"AE3e"}],"TmUL":[function(require,module,exports) {
6
+ "use strict";var e=t(require("./member/edit"));function t(e){return e&&e.__esModule?e:{default:e}}var r=wp,d=r.blocks.registerBlockType,a=r.i18n.__;d("bp/member",{title:a("Member","buddypress"),description:a("BuddyPress Member.","buddypress"),icon:"admin-users",category:"buddypress",attributes:{itemID:{type:"integer",default:0},avatarSize:{type:"string",default:"full"},displayMentionSlug:{type:"boolean",default:!0},displayActionButton:{type:"boolean",default:!0},displayCoverImage:{type:"boolean",default:!0}},edit:e.default});
7
+ },{"./member/edit":"YNTp"}]},{},["TmUL"], null)
8
  //# sourceMappingURL=/bp-members/js/blocks/member.js.map
bp-members/js/blocks/member.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["bp-members/js/blocks/member.js"],"names":["registerBlockType","wp","blocks","element","createElement","Fragment","components","Placeholder","Disabled","PanelBody","SelectControl","ToggleControl","Toolbar","ToolbarButton","blockEditor","InspectorControls","BlockControls","withSelect","data","compose","ServerSideRender","editor","__","i18n","AutoCompleter","bp","blockComponents","AVATAR_SIZES","label","value","editMember","attributes","setAttributes","bpSettings","isAvatarEnabled","isMentionEnabled","isCoverImageEnabled","avatarSize","displayMentionSlug","displayActionButton","displayCoverImage","itemID","option","editMemberBlock","select","getEditorSettings","members","title","description","icon","category","type","default","edit"],"mappings":";AAGQA,IAAAA,EAAsBC,GAAGC,OAAzBF,kBAC4BC,EAAAA,GAAGE,QAA/BC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,SAC4EJ,EAAAA,GAAGK,WAA9FC,EAAAA,EAAAA,YAAaC,EAAAA,EAAAA,SAAUC,EAAAA,EAAAA,UAAWC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,QAASC,EAAAA,EAAAA,cACpCZ,EAAAA,GAAGa,YAAxCC,EAAAA,EAAAA,kBAAmBC,EAAAA,EAAAA,cACnBC,EAAehB,GAAGiB,KAAlBD,WACAE,EAAYlB,GAAGkB,QAAfA,QACAC,EAAqBnB,GAAGoB,OAAxBD,iBACAE,EAAOrB,GAAGsB,KAAVD,GAKAE,EAAkBC,GAAGC,gBAArBF,cAEFG,EAAe,CACpB,CACCC,MAAON,EAAI,OAAQ,cACnBO,MAAO,QAER,CACCD,MAAON,EAAI,QAAS,cACpBO,MAAO,SAER,CACCD,MAAON,EAAI,OAAQ,cACnBO,MAAO,SAIHC,EAAa,SAAiD,GAA7CC,IAAAA,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WACzCC,EAA2DD,EAA3DC,gBAAiBC,EAA0CF,EAA1CE,iBAAkBC,EAAwBH,EAAxBG,oBACnCC,EAA2EN,EAA3EM,WAAYC,EAA+DP,EAA/DO,mBAAoBC,EAA2CR,EAA3CQ,oBAAqBC,EAAsBT,EAAtBS,kBAExD,OAAET,EAAWU,OAmBjB,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAK,OACL,MAAQnB,EAAI,wBAAyB,cACrC,QAAU,WACTU,EAAe,CAAES,OAAQ,SAK7B,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQnB,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,yBAA0B,cACtC,UAAaiB,EACb,SAAW,WACVP,EAAe,CAAEO,qBAAuBA,KAEzC,KAEIjB,EADHiB,EACO,sEACA,gFADwE,gBAK/EL,GACD,EAAC,EAAD,CACC,MAAQZ,EAAI,cAAe,cAC3B,MAAQe,EACR,QAAUV,EACV,KAAOL,EAAI,uCAAwC,cACnD,SAAW,SAAEoB,GACZV,EAAe,CAAEK,WAAYK,OAK9BN,GACD,EAAC,EAAD,CACC,MAAQd,EAAI,sBAAuB,cACnC,UAAakB,EACb,SAAW,WACVR,EAAe,CAAEQ,mBAAqBA,KAEvC,KAEIlB,EADHkB,EACO,0DACA,oEAD4D,gBAMpEL,GACD,EAAC,EAAD,CACC,MAAQb,EAAI,uBAAwB,cACpC,UAAagB,EACb,SAAW,WACVN,EAAe,CAAEM,oBAAsBA,KAExC,KAEIhB,EADHgB,EACO,4DACA,sEAD8D,kBAO1E,EAAC,EACA,KAAA,EAAC,EAAD,CAAkB,MAAM,YAAY,WAAaP,MAxFlD,EAAC,EAAD,CACC,KAAK,cACL,MAAQT,EAAI,oBAAqB,cACjC,aAAeA,EAAI,0EAA2E,eAE9F,EAAC,EAAD,CACC,UAAU,UACV,UAAYA,EAAI,oBAAsB,cACtC,YAAcA,EAAI,gCAAkC,cACpD,aAAeU,EACf,UAAYE,MAoFXS,EAAkBxB,EAAS,CAChCF,EAAY,SAAE2B,GAEN,MAAA,CACNX,WAFsBW,EAAQ,eAAgBC,oBAEnBpB,GAAGqB,SAAW,OAJpB3B,CAOnBW,GAEL9B,EAAmB,YAAa,CAC/B+C,MAAOzB,EAAI,SAAU,cAErB0B,YAAa1B,EAAI,qBAAsB,cAEvC2B,KAAM,cAENC,SAAU,aAEVnB,WAAY,CACXU,OAAQ,CACPU,KAAM,UACNC,QAAS,GAEVf,WAAY,CACXc,KAAM,SACNC,QAAS,QAEVd,mBAAoB,CACnBa,KAAM,UACNC,SAAS,GAEVb,oBAAqB,CACpBY,KAAM,UACNC,SAAS,GAEVZ,kBAAmB,CAClBW,KAAM,UACNC,SAAS,IAIXC,KAAMV","file":"member.js","sourceRoot":"../src/js","sourcesContent":["/**\n * WordPress dependencies.\n */\nconst { registerBlockType } = wp.blocks;\nconst { createElement, Fragment } = wp.element;\nconst { Placeholder, Disabled, PanelBody, SelectControl, ToggleControl, Toolbar, ToolbarButton } = wp.components;\nconst { InspectorControls, BlockControls } = wp.blockEditor;\nconst { withSelect } = wp.data;\nconst { compose } = wp.compose;\nconst { ServerSideRender } = wp.editor;\nconst { __ } = wp.i18n;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\nconst AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n\nconst editMember = ( { attributes, setAttributes, bpSettings } ) => {\n\tconst { isAvatarEnabled, isMentionEnabled, isCoverImageEnabled } = bpSettings;\n\tconst { avatarSize, displayMentionSlug, displayActionButton, displayCoverImage } = attributes;\n\n\tif ( ! attributes.itemID ) {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon=\"admin-users\"\n\t\t\t\tlabel={ __( 'BuddyPress Member', 'buddypress' ) }\n\t\t\t\tinstructions={ __( 'Start typing the name of the member you want to feature into this post.', 'buddypress' ) }\n\t\t\t>\n\t\t\t\t<AutoCompleter\n\t\t\t\t\tcomponent=\"members\"\n\t\t\t\t\tariaLabel={ __( 'Member\\'s username', 'buddypress' ) }\n\t\t\t\t\tplaceholder={ __( 'Enter Member\\'s username here…', 'buddypress' ) }\n\t\t\t\t\tonSelectItem={ setAttributes }\n\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t/>\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<Toolbar>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\t\ttitle={ __( 'Select another member', 'buddypress' ) }\n\t\t\t\t\t\tonClick={ () =>{\n\t\t\t\t\t\t\tsetAttributes( { itemID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Toolbar>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display Profile button', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayActionButton }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayActionButton: ! displayActionButton } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayActionButton\n\t\t\t\t\t\t\t\t? __( 'Include a link to the user\\'s profile page under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display a link to the user\\'s profile page under their display name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isCoverImageEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Cover Image', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayCoverImage }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayCoverImage: ! displayCoverImage } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayCoverImage\n\t\t\t\t\t\t\t\t\t? __( 'Include the user\\'s cover image over their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the user\\'s cover image over their display name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isMentionEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Mention slug', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayMentionSlug }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayMentionSlug: ! displayMentionSlug } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayMentionSlug\n\t\t\t\t\t\t\t\t\t? __( 'Include the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<Disabled>\n\t\t\t\t<ServerSideRender block=\"bp/member\" attributes={ attributes } />\n\t\t\t</Disabled>\n\t\t</Fragment>\n\t);\n};\n\nconst editMemberBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.members || {},\n\t\t};\n\t} ),\n] )( editMember );\n\nregisterBlockType( 'bp/member', {\n\ttitle: __( 'Member', 'buddypress' ),\n\n\tdescription: __( 'BuddyPress Member.', 'buddypress' ),\n\n\ticon: 'admin-users',\n\n\tcategory: 'buddypress',\n\n\tattributes: {\n\t\titemID: {\n\t\t\ttype: 'integer',\n\t\t\tdefault: 0,\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayMentionSlug: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayActionButton: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayCoverImage: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\tedit: editMemberBlock,\n} );\n"]}
1
+ {"version":3,"sources":["bp-members/js/blocks/member/constants.js","bp-members/js/blocks/member/edit.js","bp-members/js/blocks/member.js"],"names":["wp","__","i18n","AVATAR_SIZES","label","value","editMemberBlock","blockEditor","InspectorControls","BlockControls","components","Placeholder","Disabled","PanelBody","SelectControl","ToggleControl","Toolbar","ToolbarButton","compose","withSelect","data","ServerSideRender","editor","element","Fragment","createElement","AutoCompleter","bp","blockComponents","getSlugValue","item","mention_name","editMember","attributes","setAttributes","bpSettings","isAvatarEnabled","isMentionEnabled","isCoverImageEnabled","avatarSize","displayMentionSlug","displayActionButton","displayCoverImage","itemID","option","select","getEditorSettings","members","registerBlockType","blocks","title","description","icon","category","type","default","edit"],"mappings":";AAcO,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,kBAAA,EAPHA,IAAAA,EAAAA,GAFFC,EADDC,EAAAA,KACCD,GASWE,EAAe,CAC3B,CACCC,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,QAAS,cACpBI,MAAO,SAER,CACCD,MAAOH,EAAI,OAAQ,cACnBI,MAAO,SAXF,QAAA,aAAA;;ACqJQC,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAxHf,IAAA,EAAA,QAAA,eAVIN,EAAAA,GA7BHO,EAAAA,EAAAA,YACCC,EAAAA,EAAAA,kBACAC,EAAAA,EAAAA,cAEDC,EAAAA,EAAAA,WACCC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,cAGAC,EADDA,EAAAA,QACCA,QAGAC,EADDC,EAAAA,KACCD,WAGAE,EADDC,EAAAA,OACCD,iBAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,cAGAxB,EADDC,EAAAA,KACCD,GAOMyB,EAAkBC,GAAGC,gBAArBF,cAOFG,EAAe,SAAEC,GACjBA,OAAAA,GAAQA,EAAKC,aACVD,EAAKC,aAGN,MAGFC,EAAa,SAAiD,GAA7CC,IAAAA,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WACzCC,EAA2DD,EAA3DC,gBAAiBC,EAA0CF,EAA1CE,iBAAkBC,EAAwBH,EAAxBG,oBACnCC,EAA2EN,EAA3EM,WAAYC,EAA+DP,EAA/DO,mBAAoBC,EAA2CR,EAA3CQ,oBAAqBC,EAAsBT,EAAtBS,kBAExD,OAAET,EAAWU,OAoBjB,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CACC,KAAK,OACL,MAAQ1C,EAAI,wBAAyB,cACrC,QAAU,WACTiC,EAAe,CAAES,OAAQ,SAK7B,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQ1C,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,yBAA0B,cACtC,UAAawC,EACb,SAAW,WACVP,EAAe,CAAEO,qBAAuBA,KAEzC,KAEIxC,EADHwC,EACO,sEACA,gFADwE,gBAK/EL,GACD,EAAC,EAAD,CACC,MAAQnC,EAAI,cAAe,cAC3B,MAAQsC,EACR,QAAUpC,EAHX,aAIC,KAAOF,EAAI,uCAAwC,cACnD,SAAW,SAAE2C,GACZV,EAAe,CAAEK,WAAYK,OAK9BN,GACD,EAAC,EAAD,CACC,MAAQrC,EAAI,sBAAuB,cACnC,UAAayC,EACb,SAAW,WACVR,EAAe,CAAEQ,mBAAqBA,KAEvC,KAEIzC,EADHyC,EACO,0DACA,oEAD4D,gBAMpEL,GACD,EAAC,EAAD,CACC,MAAQpC,EAAI,uBAAwB,cACpC,UAAauC,EACb,SAAW,WACVN,EAAe,CAAEM,oBAAsBA,KAExC,KAEIvC,EADHuC,EACO,4DACA,sEAD8D,kBAO1E,EAAC,EACA,KAAA,EAAC,EAAD,CAAkB,MAAM,YAAY,WAAaP,MAzFlD,EAAC,EAAD,CACC,KAAK,cACL,MAAQhC,EAAI,oBAAqB,cACjC,aAAeA,EAAI,0EAA2E,eAE9F,EAAC,EAAD,CACC,UAAU,UACV,UAAY4B,EACZ,UAAY5B,EAAI,oBAAsB,cACtC,YAAcA,EAAI,gCAAkC,cACpD,aAAeiC,EACf,UAAYE,MAoFX9B,EAAkBY,EAAS,CAChCC,EAAY,SAAE0B,GAEN,MAAA,CACNV,WAFsBU,EAAQ,eAAgBC,oBAEnBnB,GAAGoB,SAAW,OAJpB7B,CAOnBc,GAEU1B,EAAAA,EAAAA,QAAAA,QAAAA;;AClJf,aAFA,IAAA,EAAA,EAAA,QAAA,kBAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAPIN,IAAAA,EAAAA,GALFgD,EADDC,EAAAA,OACCD,kBAGA/C,EADDC,EAAAA,KACCD,GASF+C,EAAmB,YAAa,CAC/BE,MAAOjD,EAAI,SAAU,cACrBkD,YAAalD,EAAI,qBAAsB,cACvCmD,KAAM,cACNC,SAAU,aACVpB,WAAY,CACXU,OAAQ,CACPW,KAAM,UACNC,QAAS,GAEVhB,WAAY,CACXe,KAAM,SACNC,QAAS,QAEVf,mBAAoB,CACnBc,KAAM,UACNC,SAAS,GAEVd,oBAAqB,CACpBa,KAAM,UACNC,SAAS,GAEVb,kBAAmB,CAClBY,KAAM,UACNC,SAAS,IAGXC,KAAMlD,EAAAA","file":"member.js","sourceRoot":"../src/js","sourcesContent":["/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Avatar sizes.\n *\n * @type {Array}\n */\nexport const AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblockEditor: {\n\t\tInspectorControls,\n\t\tBlockControls,\n\t},\n\tcomponents: {\n\t\tPlaceholder,\n\t\tDisabled,\n\t\tPanelBody,\n\t\tSelectControl,\n\t\tToggleControl,\n\t\tToolbar,\n\t\tToolbarButton,\n\t},\n\tcompose: {\n\t\tcompose,\n\t},\n\tdata: {\n\t\twithSelect,\n\t},\n\teditor: {\n\t\tServerSideRender,\n\t},\n\telement: {\n\t\tFragment,\n\t\tcreateElement,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\n/**\n * Internal dependencies.\n */\nimport { AVATAR_SIZES } from './constants';\n\nconst getSlugValue = ( item ) => {\n\tif ( item && item.mention_name ) {\n\t\treturn item.mention_name;\n\t}\n\n\treturn null;\n}\n\nconst editMember = ( { attributes, setAttributes, bpSettings } ) => {\n\tconst { isAvatarEnabled, isMentionEnabled, isCoverImageEnabled } = bpSettings;\n\tconst { avatarSize, displayMentionSlug, displayActionButton, displayCoverImage } = attributes;\n\n\tif ( ! attributes.itemID ) {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon=\"admin-users\"\n\t\t\t\tlabel={ __( 'BuddyPress Member', 'buddypress' ) }\n\t\t\t\tinstructions={ __( 'Start typing the name of the member you want to feature into this post.', 'buddypress' ) }\n\t\t\t>\n\t\t\t\t<AutoCompleter\n\t\t\t\t\tcomponent=\"members\"\n\t\t\t\t\tslugValue={ getSlugValue }\n\t\t\t\t\tariaLabel={ __( 'Member\\'s username', 'buddypress' ) }\n\t\t\t\t\tplaceholder={ __( 'Enter Member\\'s username here…', 'buddypress' ) }\n\t\t\t\t\tonSelectItem={ setAttributes }\n\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t/>\n\t\t\t</Placeholder>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<Toolbar>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon=\"edit\"\n\t\t\t\t\t\ttitle={ __( 'Select another member', 'buddypress' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( { itemID: 0 } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Toolbar>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display Profile button', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayActionButton }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayActionButton: ! displayActionButton } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayActionButton\n\t\t\t\t\t\t\t\t? __( 'Include a link to the user\\'s profile page under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to display a link to the user\\'s profile page under their display name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isCoverImageEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Cover Image', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayCoverImage }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayCoverImage: ! displayCoverImage } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayCoverImage\n\t\t\t\t\t\t\t\t\t? __( 'Include the user\\'s cover image over their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the user\\'s cover image over their display name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isMentionEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Mention slug', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayMentionSlug }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayMentionSlug: ! displayMentionSlug } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayMentionSlug\n\t\t\t\t\t\t\t\t\t? __( 'Include the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<Disabled>\n\t\t\t\t<ServerSideRender block=\"bp/member\" attributes={ attributes } />\n\t\t\t</Disabled>\n\t\t</Fragment>\n\t);\n};\n\nconst editMemberBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.members || {},\n\t\t};\n\t} ),\n] )( editMember );\n\nexport default editMemberBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblocks: {\n\t\tregisterBlockType,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport editMemberBlock from './member/edit';\n\nregisterBlockType( 'bp/member', {\n\ttitle: __( 'Member', 'buddypress' ),\n\tdescription: __( 'BuddyPress Member.', 'buddypress' ),\n\ticon: 'admin-users',\n\tcategory: 'buddypress',\n\tattributes: {\n\t\titemID: {\n\t\t\ttype: 'integer',\n\t\t\tdefault: 0,\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayMentionSlug: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayActionButton: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayCoverImage: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t},\n\tedit: editMemberBlock,\n} );\n"]}
bp-members/js/blocks/members.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"LGpM":[function(require,module,exports) {
2
+ function n(n,r){(null==r||r>n.length)&&(r=n.length);for(var e=0,l=new Array(r);e<r;e++)l[e]=n[e];return l}module.exports=n;
3
+ },{}],"o3SL":[function(require,module,exports) {
4
+ var r=require("./arrayLikeToArray");function a(a){if(Array.isArray(a))return r(a)}module.exports=a;
5
+ },{"./arrayLikeToArray":"LGpM"}],"lZpU":[function(require,module,exports) {
6
+ function e(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}module.exports=e;
7
+ },{}],"Vzqv":[function(require,module,exports) {
8
+ var r=require("./arrayLikeToArray");function t(t,e){if(t){if("string"==typeof t)return r(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(o):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(t,e):void 0}}module.exports=t;
9
+ },{"./arrayLikeToArray":"LGpM"}],"NCaH":[function(require,module,exports) {
10
+ function e(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e;
11
+ },{}],"I9dH":[function(require,module,exports) {
12
+ var r=require("./arrayWithoutHoles"),e=require("./iterableToArray"),u=require("./unsupportedIterableToArray"),a=require("./nonIterableSpread");function o(o){return r(o)||e(o)||u(o)||a()}module.exports=o;
13
+ },{"./arrayWithoutHoles":"o3SL","./iterableToArray":"lZpU","./unsupportedIterableToArray":"Vzqv","./nonIterableSpread":"NCaH"}],"dEOc":[function(require,module,exports) {
14
+ function r(r){if(Array.isArray(r))return r}module.exports=r;
15
+ },{}],"RonT":[function(require,module,exports) {
16
+ function r(r,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r)){var e=[],n=!0,o=!1,l=void 0;try{for(var i,u=r[Symbol.iterator]();!(n=(i=u.next()).done)&&(e.push(i.value),!t||e.length!==t);n=!0);}catch(a){o=!0,l=a}finally{try{n||null==u.return||u.return()}finally{if(o)throw l}}return e}}module.exports=r;
17
+ },{}],"sa4T":[function(require,module,exports) {
18
+ function e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}module.exports=e;
19
+ },{}],"xkYc":[function(require,module,exports) {
20
+ var r=require("./arrayWithHoles"),e=require("./iterableToArrayLimit"),t=require("./unsupportedIterableToArray"),i=require("./nonIterableRest");function u(u,a){return r(u)||e(u,a)||t(u,a)||i()}module.exports=u;
21
+ },{"./arrayWithHoles":"dEOc","./iterableToArrayLimit":"RonT","./unsupportedIterableToArray":"Vzqv","./nonIterableRest":"sa4T"}],"gr8I":[function(require,module,exports) {
22
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EXTRA_DATA=exports.AVATAR_SIZES=void 0;var e=wp,s=e.i18n.__,l=[{label:s("None","buddypress"),value:"none"},{label:s("Thumb","buddypress"),value:"thumb"},{label:s("Full","buddypress"),value:"full"}];exports.AVATAR_SIZES=l;var t=[{label:s("None","buddypress"),value:"none"},{label:s("Last time the user was active","buddypress"),value:"last_activity"},{label:s("Latest activity the user posted","buddypress"),value:"latest_update"}];exports.EXTRA_DATA=t;
23
+ },{}],"PZSE":[function(require,module,exports) {
24
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("@babel/runtime/helpers/toConsumableArray")),t=a(require("@babel/runtime/helpers/slicedToArray")),n=require("./constants");function a(e){return e&&e.__esModule?e:{default:e}}var r=wp,s=r.blockEditor,i=s.InspectorControls,l=s.BlockControls,o=r.components,u=o.Placeholder,d=o.PanelBody,c=o.SelectControl,m=o.ToggleControl,p=o.Button,b=o.Dashicon,y=o.Tooltip,h=o.ToolbarGroup,g=o.RangeControl,v=r.compose.compose,f=r.data.withSelect,_=r.element,A=_.createElement,k=_.Fragment,S=_.useState,C=r.i18n,x=C.__,N=C.sprintf,T=r.apiFetch,D=r.url.addQueryArgs,I=bp.blockComponents.AutoCompleter,M=lodash,E=M.reject,P=M.remove,w=M.sortBy,q=function(e){return e&&e.mention_name?e.mention_name:null},B=function(a){var r,s=a.attributes,o=a.setAttributes,v=a.isSelected,f=a.bpSettings,_=f.isAvatarEnabled,C=f.isMentionEnabled,M=s.itemIDs,B=s.avatarSize,R=s.displayMentionSlug,O=s.displayUserName,j=s.extraData,z=s.layoutPreference,L=s.columns,F=0!==M.length,G=S([]),Q=(0,t.default)(G,2),U=Q[0],V=Q[1],X=[{icon:"text",title:x("List view","buddypress"),onClick:function(){return o({layoutPreference:"list"})},isActive:"list"===z},{icon:"screenoptions",title:x("Grid view","buddypress"),onClick:function(){return o({layoutPreference:"grid"})},isActive:"grid"===z}],H="bp-block-members avatar-"+B,Z=n.EXTRA_DATA;"grid"===z&&(H+=" is-grid columns-"+L,Z=n.EXTRA_DATA.filter(function(e){return"latest_update"!==e.value}));return F&&M.length!==U.length&&T({path:D("/buddypress/v1/members",{populate_extras:!0,include:M})}).then(function(e){V(w(e,[function(e){return M.indexOf(e.id)}]))}),U.length&&(r=U.map(function(e){var t=!1,n="member-content";return"list"===z&&"latest_update"===j&&e.latest_update&&e.latest_update.rendered&&(t=!0,n="member-content has-activity"),A("div",{key:"bp-member-"+e.id,className:n},v&&A(y,{text:x("Remove member","buddypress")},A(p,{className:"is-right",onClick:function(){var t;(t=e.id)&&-1!==M.indexOf(t)&&(V(E(U,["id",t])),o({itemIDs:P(M,function(e){return e!==t})}))},label:x("Remove member","buddypress")},A(b,{icon:"no"}))),_&&"none"!==B&&A("div",{className:"item-header-avatar"},A("a",{href:e.link,target:"_blank"},A("img",{key:"avatar-"+e.id,className:"avatar",alt:N(x("Profile photo of %s","buddypress"),e.name),src:e.avatar_urls[B]}))),A("div",{className:"member-description"},t&&A("blockquote",{className:"wp-block-quote"},A("div",{dangerouslySetInnerHTML:{__html:e.latest_update.rendered}}),A("cite",null,O&&A("span",null,e.name)," ",C&&R&&A("a",{href:e.link,target:"_blank"},"(@",e.mention_name,")"))),!t&&O&&A("strong",null,A("a",{href:e.link,target:"_blank"},e.name)),!t&&C&&R&&A("span",{className:"user-nicename"},"@",e.mention_name),"last_activity"===j&&e.last_activity&&e.last_activity.date&&A("time",{dateTime:e.last_activity.date},N(x("Active %s","buddypress"),e.last_activity.timediff))))})),A(k,null,A(i,null,A(d,{title:x("Settings","buddypress"),initialOpen:!0},A(m,{label:x("Display the user name","buddypress"),checked:!!O,onChange:function(){o({displayUserName:!O})},help:x(O?"Include the user's display name.":"Toggle to include user's display name.","buddypress")}),C&&A(m,{label:x("Display Mention slug","buddypress"),checked:!!R,onChange:function(){o({displayMentionSlug:!R})},help:x(R?"Include the user's mention name under their display name.":"Toggle to display the user's mention name under their display name.","buddypress")}),_&&A(c,{label:x("Avatar size","buddypress"),value:B,options:n.AVATAR_SIZES,help:x('Select "None" to disable the avatar.',"buddypress"),onChange:function(e){o({avatarSize:e})}}),A(c,{label:x("BuddyPress extra information","buddypress"),value:j,options:Z,help:x('Select "None" to show no extra information.',"buddypress"),onChange:function(e){o({extraData:e})}}),"grid"===z&&A(g,{label:x("Columns","buddypress"),value:L,onChange:function(e){return o({columns:e})},min:2,max:4,required:!0}))),A(l,null,A(h,{controls:X})),F&&A("div",{className:H},r),(v||0===M.length)&&A(u,{icon:F?"":"groups",label:F?"":x("BuddyPress Members","buddypress"),instructions:x("Start typing the name of the member you want to add to the members list.","buddypress"),className:0!==M.length?"is-appender":"is-large"},A(I,{component:"members",objectQueryArgs:{exclude:M},slugValue:q,ariaLabel:x("Member's username","buddypress"),placeholder:x("Enter Member's username here…","buddypress"),onSelectItem:function(t){var n=t.itemID;n&&-1===M.indexOf(n)&&o({itemIDs:[].concat((0,e.default)(M),[parseInt(n,10)])})},useAvatar:_})))},R=v([f(function(e){return{bpSettings:e("core/editor").getEditorSettings().bp.members||{}}})])(B),O=R;exports.default=O;
25
+ },{"@babel/runtime/helpers/toConsumableArray":"I9dH","@babel/runtime/helpers/slicedToArray":"xkYc","./constants":"gr8I"}],"XEHU":[function(require,module,exports) {
26
+ "use strict";var e=t(require("./members/edit"));function t(e){return e&&e.__esModule?e:{default:e}}var r=wp,s=r.blocks.registerBlockType,a=r.i18n.__;s("bp/members",{title:a("Members","buddypress"),description:a("BuddyPress Members.","buddypress"),icon:"groups",category:"buddypress",attributes:{itemIDs:{type:"array",items:{type:"integer"},default:[]},avatarSize:{type:"string",default:"full"},displayMentionSlug:{type:"boolean",default:!0},displayUserName:{type:"boolean",default:!0},extraData:{type:"string",default:"none"},layoutPreference:{type:"string",default:"list"},columns:{type:"number",default:2}},edit:e.default});
27
+ },{"./members/edit":"PZSE"}]},{},["XEHU"], null)
28
+ //# sourceMappingURL=/bp-members/js/blocks/members.js.map
bp-members/js/blocks/members.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["../../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","bp-members/js/blocks/members/constants.js","bp-members/js/blocks/members/edit.js","bp-members/js/blocks/members.js"],"names":["wp","__","i18n","AVATAR_SIZES","label","value","EXTRA_DATA","editMembersBlock","blockEditor","InspectorControls","BlockControls","components","Placeholder","PanelBody","SelectControl","ToggleControl","Button","Dashicon","Tooltip","ToolbarGroup","RangeControl","compose","withSelect","data","element","createElement","Fragment","useState","sprintf","apiFetch","addQueryArgs","url","AutoCompleter","bp","blockComponents","lodash","reject","remove","sortBy","getSlugValue","item","mention_name","editMembers","attributes","membersList","setAttributes","isSelected","bpSettings","isAvatarEnabled","isMentionEnabled","itemIDs","avatarSize","displayMentionSlug","displayUserName","extraData","layoutPreference","columns","hasMembers","length","members","setMembers","layoutControls","icon","title","onClick","isActive","containerClasses","extraDataOptions","filter","extra","path","populate_extras","include","then","items","indexOf","id","map","member","hasActivity","memberItemClasses","latest_update","rendered","itemID","link","name","avatar_urls","__html","last_activity","date","timediff","option","exclude","parseInt","select","getEditorSettings","registerBlockType","blocks","description","category","type","default","edit"],"mappings":";AAAA,SAAA,EAAA,EAAA,IACA,MAAA,GAAA,EAAA,EAAA,UAAA,EAAA,EAAA,QAEA,IAAA,IAAA,EAAA,EAAA,EAAA,IAAA,MAAA,GAAA,EAAA,EAAA,IACA,EAAA,GAAA,EAAA,GAGA,OAAA,EAGA,OAAA,QAAA;;ACVA,IAAA,EAAA,QAAA,sBAEA,SAAA,EAAA,GACA,GAAA,MAAA,QAAA,GAAA,OAAA,EAAA,GAGA,OAAA,QAAA;;ACNA,SAAA,EAAA,GACA,GAAA,oBAAA,QAAA,OAAA,YAAA,OAAA,GAAA,OAAA,MAAA,KAAA,GAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,sBAEA,SAAA,EAAA,EAAA,GACA,GAAA,EAAA,CACA,GAAA,iBAAA,EAAA,OAAA,EAAA,EAAA,GACA,IAAA,EAAA,OAAA,UAAA,SAAA,KAAA,GAAA,MAAA,GAAA,GAEA,MADA,WAAA,GAAA,EAAA,cAAA,EAAA,EAAA,YAAA,MACA,QAAA,GAAA,QAAA,EAAA,MAAA,KAAA,GACA,cAAA,GAAA,2CAAA,KAAA,GAAA,EAAA,EAAA,QAAA,GAGA,OAAA,QAAA;;ACXA,SAAA,IACA,MAAA,IAAA,UAAA,wIAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,uBAEA,EAAA,QAAA,qBAEA,EAAA,QAAA,gCAEA,EAAA,QAAA,uBAEA,SAAA,EAAA,GACA,OAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,IAGA,OAAA,QAAA;;ACZA,SAAA,EAAA,GACA,GAAA,MAAA,QAAA,GAAA,OAAA,EAGA,OAAA,QAAA;;ACJA,SAAA,EAAA,EAAA,GACA,GAAA,oBAAA,QAAA,OAAA,YAAA,OAAA,GAAA,CACA,IAAA,EAAA,GACA,GAAA,EACA,GAAA,EACA,OAAA,EAEA,IACA,IAAA,IAAA,EAAA,EAAA,EAAA,OAAA,cAAA,GAAA,EAAA,EAAA,QAAA,QACA,EAAA,KAAA,EAAA,QAEA,GAAA,EAAA,SAAA,GAHA,GAAA,IAKA,MAAA,GACA,GAAA,EACA,EAAA,EACA,QACA,IACA,GAAA,MAAA,EAAA,QAAA,EAAA,SACA,QACA,GAAA,EAAA,MAAA,GAIA,OAAA,GAGA,OAAA,QAAA;;AC3BA,SAAA,IACA,MAAA,IAAA,UAAA,6IAGA,OAAA,QAAA;;ACJA,IAAA,EAAA,QAAA,oBAEA,EAAA,QAAA,0BAEA,EAAA,QAAA,gCAEA,EAAA,QAAA,qBAEA,SAAA,EAAA,EAAA,GACA,OAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,IAAA,IAGA,OAAA,QAAA;;ACsBO,aAAA,OAAA,eAAA,QAAA,aAAA,CAAA,OAAA,IAAA,QAAA,WAAA,QAAA,kBAAA,EA3BHA,IAAAA,EAAAA,GAFFC,EADDC,EAAAA,KACCD,GASWE,EAAe,CAC3B,CACCC,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,QAAS,cACpBI,MAAO,SAER,CACCD,MAAOH,EAAI,OAAQ,cACnBI,MAAO,SASF,QAAA,aAAA,EAAA,IAAMC,EAAa,CACzB,CACCF,MAAOH,EAAI,OAAQ,cACnBI,MAAO,QAER,CACCD,MAAOH,EAAI,gCAAiC,cAC5CI,MAAO,iBAER,CACCD,MAAOH,EAAI,kCAAmC,cAC9CI,MAAO,kBAXF,QAAA,WAAA;;ACmSQE,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,aAAAA,EAAAA,IAAAA,EAAAA,EAAAA,QAAAA,6CAAAA,EAAAA,EAAAA,QAAAA,yCArRf,EAAA,QAAA,eAqReA,SAAAA,EAAAA,GAAAA,OAAAA,GAAAA,EAAAA,WAAAA,EAAAA,CAAAA,QAAAA,GA/RXP,IAAAA,EAAAA,GAlCHQ,EAAAA,EAAAA,YACCC,EAAAA,EAAAA,kBACAC,EAAAA,EAAAA,cAEDC,EAAAA,EAAAA,WACCC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,aACAC,EAAAA,EAAAA,aAGAC,EADDA,EAAAA,QACCA,QAGAC,EADDC,EAAAA,KACCD,WAEDE,EAAAA,EAAAA,QACCC,EAAAA,EAAAA,cACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,SAEDzB,EAAAA,EAAAA,KACCD,EAAAA,EAAAA,GACA2B,EAAAA,EAAAA,QAEDC,EAAAA,EAAAA,SAECC,EADDC,EAAAA,IACCD,aAOME,EAAkBC,GAAGC,gBAArBF,cAcJG,EAAAA,OAHHC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,OACAC,EAAAA,EAAAA,OAGKC,EAAe,SAAEC,GACjBA,OAAAA,GAAQA,EAAKC,aACVD,EAAKC,aAGN,MAGFC,EAAc,SAA6D,GAAzDC,IA8BnBC,EA9BmBD,EAAAA,EAAAA,WAAYE,EAAAA,EAAAA,cAAeC,EAAAA,EAAAA,WAAYC,EAAAA,EAAAA,WAE7DC,EAEGD,EAFHC,gBACAC,EACGF,EADHE,iBAGAC,EAOGP,EAPHO,QACAC,EAMGR,EANHQ,WACAC,EAKGT,EALHS,mBACAC,EAIGV,EAJHU,gBACAC,EAGGX,EAHHW,UACAC,EAEGZ,EAFHY,iBACAC,EACGb,EADHa,QAEKC,EAAa,IAAMP,EAAQQ,OACD/B,EAAAA,EAAU,IAfsC,GAAA,EAAA,EAAA,SAAA,EAAA,GAexEgC,EAfwE,EAAA,GAe/DC,EAf+D,EAAA,GAgB1EC,EAAiB,CACtB,CACCC,KAAM,OACNC,MAAO9D,EAAI,YAAa,cACxB+D,QAAS,WAAMnB,OAAAA,EAAe,CAAEU,iBAAkB,UAClDU,SAA+B,SAArBV,GAEX,CACCO,KAAM,gBACNC,MAAO9D,EAAI,YAAa,cACxB+D,QAAS,WAAMnB,OAAAA,EAAe,CAAEU,iBAAkB,UAClDU,SAA+B,SAArBV,IAIRW,EAAmB,2BAA6Bf,EAChDgB,EAAmB7D,EAAvB,WAE0B,SAArBiD,IACJW,GAAoB,oBAAsBV,EAC1CW,EAAmB7D,EAAW8D,WAAAA,OAAQ,SAAEC,GAChC,MAAA,kBAAoBA,EAAMhE,SA+GlC,OA1FIoD,GAAcP,EAAQQ,SAAWC,EAAQD,QAC7C7B,EAAU,CACTyC,KAAMxC,EAAwC,yBAAA,CAAEyC,iBAAiB,EAAMC,QAAStB,MAC7EuB,KAAM,SAAAC,GACTd,EACCtB,EAAQoC,EAAO,CAAE,SAAElC,GACXU,OAAAA,EAAQyB,QAASnC,EAAKoC,UAM5BjB,EAAQD,SACZd,EAAce,EAAQkB,IAAK,SAAEC,GACxBC,IAAAA,GAAc,EACdC,EAAoB,iBAQvB,MANyB,SAArBzB,GAA+B,kBAAoBD,GAAawB,EAAOG,eAAiBH,EAAOG,cAAcC,WACjHH,GAAc,EACdC,EAAoB,+BAIpB,EAAA,MAAA,CAAK,IAAM,aAAeF,EAAOF,GAAK,UAAYI,GAC/ClC,GACD,EAAC,EAAD,CAAS,KAAO7C,EAAI,gBAAiB,eACpC,EAAC,EAAD,CACC,UAAU,WACV,QAAU,WArCQ,IAAEkF,GAAAA,EAqCYL,EAAOF,MApC7B,IAAM1B,EAAQyB,QAASQ,KACtCvB,EAAYxB,EAAQuB,EAAS,CAAC,KAAMwB,KACpCtC,EAAe,CACdK,QAASb,EAAQa,EAAS,SAAE7C,GAAoBA,OAAAA,IAAU8E,QAkCtD,MAAQlF,EAAI,gBAAiB,eAE7B,EAAC,EAAD,CAAU,KAAK,SAIhB+C,GAAmB,SAAWG,GAC/B,EAAA,MAAA,CAAK,UAAU,sBACd,EAAA,IAAA,CAAG,KAAO2B,EAAOM,KAAO,OAAO,UAC9B,EAAA,MAAA,CACC,IAAM,UAAYN,EAAOF,GACzB,UAAU,SACV,IAAMhD,EAAS3B,EAAI,sBAAuB,cAAgB6E,EAAOO,MACjE,IAAMP,EAAOQ,YAAanC,OAK9B,EAAA,MAAA,CAAK,UAAU,sBACZ4B,GACD,EAAA,aAAA,CAAY,UAAU,kBACrB,EAAA,MAAA,CAAK,wBAA0B,CAAEQ,OAAQT,EAAOG,cAAcC,YAC9D,EACG7B,OAAAA,KAAAA,GACD,EACGyB,OAAAA,KAAAA,EAAOO,MAITpC,IAAAA,GAAoBG,GACrB,EAAA,IAAA,CAAG,KAAO0B,EAAOM,KAAO,OAAO,UAC1BN,KAAAA,EAAOrC,aATd,QAeEsC,GAAe1B,GAClB,EACC,SAAA,KAAA,EAAA,IAAA,CAAG,KAAOyB,EAAOM,KAAO,OAAO,UAC5BN,EAAOO,QAKRN,GAAe9B,GAAoBG,GACtC,EAAA,OAAA,CAAM,UAAU,iBAAmB0B,IAAAA,EAAOrC,cAGzC,kBAAoBa,GAAawB,EAAOU,eAAiBV,EAAOU,cAAcC,MAC/E,EAAA,OAAA,CAAM,SAAWX,EAAOU,cAAcC,MACnC7D,EAAS3B,EAAI,YAAa,cAAgB6E,EAAOU,cAAcE,gBAUvE,EAAC,EACA,KAAA,EAAC,EACA,KAAA,EAAC,EAAD,CAAW,MAAQzF,EAAI,WAAY,cAAiB,aAAc,GACjE,EAAC,EAAD,CACC,MAAQA,EAAI,wBAAyB,cACrC,UAAaoD,EACb,SAAW,WACVR,EAAe,CAAEQ,iBAAmBA,KAErC,KAEIpD,EADHoD,EACO,mCACA,yCADqC,gBAK5CJ,GACD,EAAC,EAAD,CACC,MAAQhD,EAAI,uBAAwB,cACpC,UAAamD,EACb,SAAW,WACVP,EAAe,CAAEO,oBAAsBA,KAExC,KAEInD,EADHmD,EACO,4DACA,sEAD8D,gBAMtEJ,GACD,EAAC,EAAD,CACC,MAAQ/C,EAAI,cAAe,cAC3B,MAAQkD,EACR,QAAUhD,EAHX,aAIC,KAAOF,EAAI,uCAAwC,cACnD,SAAW,SAAE0F,GACZ9C,EAAe,CAAEM,WAAYwC,OAKhC,EAAC,EAAD,CACC,MAAQ1F,EAAI,+BAAgC,cAC5C,MAAQqD,EACR,QAAUa,EACV,KAAOlE,EAAI,8CAA+C,cAC1D,SAAW,SAAE0F,GACZ9C,EAAe,CAAES,UAAWqC,OAIP,SAArBpC,GACD,EAAC,EAAD,CACC,MAAQtD,EAAI,UAAW,cACvB,MAAQuD,EACR,SAAW,SAAEnD,GACZwC,OAAAA,EAAe,CAAEW,QAASnD,KAE3B,IAAM,EACN,IAAM,EACN,UAAQ,MAMZ,EAAC,EACA,KAAA,EAAC,EAAD,CAAc,SAAWwD,KAGxBJ,GACD,EAAA,MAAA,CAAK,UAAYS,GACdtB,IAIAE,GAAc,IAAMI,EAAQQ,SAC/B,EAAC,EAAD,CACC,KAAOD,EAAa,GAAK,SACzB,MAAQA,EAAa,GAAKxD,EAAI,qBAAsB,cACpD,aAAeA,EAAI,2EAA4E,cAC/F,UAAY,IAAMiD,EAAQQ,OAAS,cAAgB,YAEnD,EAAC,EAAD,CACC,UAAU,UACV,gBAAkB,CAAEkC,QAAS1C,GAC7B,UAAYX,EACZ,UAAYtC,EAAI,oBAAsB,cACtC,YAAcA,EAAI,gCAAkC,cACpD,aAtMoB,SAAkB,GAAdkF,IAAAA,EAAAA,EAAAA,OACvBA,IAAW,IAAMjC,EAAQyB,QAASQ,IACtCtC,EAAe,CACdK,QAAaA,GAAAA,QAAAA,EAAAA,EAAAA,SAAAA,GAAS2C,CAAAA,SAAUV,EAAQ,SAoMtC,UAAYnC,OAQZzC,EAAmBc,EAAS,CACjCC,EAAY,SAAEwE,GAGN,MAAA,CACN/C,WAHsB+C,EAAQ,eAAgBC,oBAGnB9D,GAAG0B,SAAW,OALnBtC,CAQpBqB,GAEUnC,EAAAA,EAAAA,QAAAA,QAAAA;;ACpTf,aAFA,IAAA,EAAA,EAAA,QAAA,mBAEA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAPIP,IAAAA,EAAAA,GALFgG,EADDC,EAAAA,OACCD,kBAGA/F,EADDC,EAAAA,KACCD,GASF+F,EAAmB,aAAc,CAChCjC,MAAO9D,EAAI,UAAW,cACtBiG,YAAajG,EAAI,sBAAuB,cACxC6D,KAAM,SACNqC,SAAU,aACVxD,WAAY,CACXO,QAAS,CACRkD,KAAM,QACN1B,MAAO,CACN0B,KAAM,WAEPC,QAAS,IAEVlD,WAAY,CACXiD,KAAM,SACNC,QAAS,QAEVjD,mBAAoB,CACnBgD,KAAM,UACNC,SAAS,GAEVhD,gBAAiB,CAChB+C,KAAM,UACNC,SAAS,GAEV/C,UAAW,CACV8C,KAAM,SACNC,QAAS,QAEV9C,iBAAkB,CACjB6C,KAAM,SACNC,QAAS,QAEV7C,QAAS,CACR4C,KAAM,SACNC,QAAS,IAGXC,KAAM/F,EAAAA","file":"members.js","sourceRoot":"../src/js","sourcesContent":["function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray;","var arrayLikeToArray = require(\"./arrayLikeToArray\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread;","var arrayWithoutHoles = require(\"./arrayWithoutHoles\");\n\nvar iterableToArray = require(\"./iterableToArray\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableSpread = require(\"./nonIterableSpread\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","/**\n * WordPress dependencies.\n */\nconst {\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Avatar sizes.\n *\n * @type {Array}\n */\nexport const AVATAR_SIZES = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Thumb', 'buddypress' ),\n\t\tvalue: 'thumb',\n\t},\n\t{\n\t\tlabel: __( 'Full', 'buddypress' ),\n\t\tvalue: 'full',\n\t},\n];\n\n/**\n * BuddyPress Extra data.\n *\n * @type {Array}\n */\nexport const EXTRA_DATA = [\n\t{\n\t\tlabel: __( 'None', 'buddypress' ),\n\t\tvalue: 'none',\n\t},\n\t{\n\t\tlabel: __( 'Last time the user was active', 'buddypress' ),\n\t\tvalue: 'last_activity',\n\t},\n\t{\n\t\tlabel: __( 'Latest activity the user posted', 'buddypress' ),\n\t\tvalue: 'latest_update',\n\t},\n];\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblockEditor: {\n\t\tInspectorControls,\n\t\tBlockControls,\n\t},\n\tcomponents: {\n\t\tPlaceholder,\n\t\tPanelBody,\n\t\tSelectControl,\n\t\tToggleControl,\n\t\tButton,\n\t\tDashicon,\n\t\tTooltip,\n\t\tToolbarGroup,\n\t\tRangeControl,\n\t},\n\tcompose: {\n\t\tcompose,\n\t},\n\tdata: {\n\t\twithSelect,\n\t},\n\telement: {\n\t\tcreateElement,\n\t\tFragment,\n\t\tuseState,\n\t},\n\ti18n: {\n\t\t__,\n\t\tsprintf,\n\t},\n\tapiFetch,\n\turl: {\n\t\taddQueryArgs,\n\t},\n} = wp;\n\n/**\n * BuddyPress dependencies.\n */\nconst { AutoCompleter } = bp.blockComponents;\n\n/**\n * Internal dependencies.\n */\nimport { AVATAR_SIZES, EXTRA_DATA } from './constants';\n\n/**\n * External dependencies.\n */\nconst {\n\treject,\n\tremove,\n\tsortBy,\n} = lodash;\n\nconst getSlugValue = ( item ) => {\n\tif ( item && item.mention_name ) {\n\t\treturn item.mention_name;\n\t}\n\n\treturn null;\n}\n\nconst editMembers = ( { attributes, setAttributes, isSelected, bpSettings } ) => {\n\tconst {\n\t\tisAvatarEnabled,\n\t\tisMentionEnabled,\n\t} = bpSettings;\n\tconst {\n\t\titemIDs,\n\t\tavatarSize,\n\t\tdisplayMentionSlug,\n\t\tdisplayUserName,\n\t\textraData,\n\t\tlayoutPreference,\n\t\tcolumns,\n\t} = attributes;\n\tconst hasMembers = 0 !== itemIDs.length;\n\tconst [ members, setMembers ] = useState( [] );\n\tconst layoutControls = [\n\t\t{\n\t\t\ticon: 'text',\n\t\t\ttitle: __( 'List view', 'buddypress' ),\n\t\t\tonClick: () => setAttributes( { layoutPreference: 'list' } ),\n\t\t\tisActive: layoutPreference === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: 'screenoptions',\n\t\t\ttitle: __( 'Grid view', 'buddypress' ),\n\t\t\tonClick: () => setAttributes( { layoutPreference: 'grid' } ),\n\t\t\tisActive: layoutPreference === 'grid',\n\t\t},\n\t];\n\tlet membersList;\n\tlet containerClasses = 'bp-block-members avatar-' + avatarSize;\n\tlet extraDataOptions = EXTRA_DATA;\n\n\tif ( layoutPreference === 'grid' ) {\n\t\tcontainerClasses += ' is-grid columns-' + columns;\n\t\textraDataOptions = EXTRA_DATA.filter( ( extra ) => {\n\t\t\treturn 'latest_update' !== extra.value;\n\t\t} );\n\t}\n\n\tconst onSelectedMember = ( { itemID } ) => {\n\t\tif ( itemID && -1 === itemIDs.indexOf( itemID ) ) {\n\t\t\tsetAttributes( {\n\t\t\t\titemIDs: [...itemIDs, parseInt( itemID, 10 ) ]\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst onRemoveMember = ( ( itemID ) => {\n\t\tif ( itemID && -1 !== itemIDs.indexOf( itemID ) ) {\n\t\t\tsetMembers( reject( members, ['id', itemID ] ) );\n\t\t\tsetAttributes( {\n\t\t\t\titemIDs: remove( itemIDs, ( value ) => { return value !== itemID } )\n\t\t\t} );\n\t\t}\n\t} );\n\n\tif ( hasMembers && itemIDs.length !== members.length ) {\n\t\tapiFetch( {\n\t\t\tpath: addQueryArgs( `/buddypress/v1/members`, { populate_extras: true, include: itemIDs } ),\n\t\t} ).then( items => {\n\t\t\tsetMembers(\n\t\t\t\tsortBy( items, [ ( item ) => {\n\t\t\t\t\treturn itemIDs.indexOf( item.id );\n\t\t\t\t} ] )\n\t\t\t);\n\t\t} )\n\t}\n\n\tif ( members.length ) {\n\t\tmembersList = members.map( ( member ) => {\n\t\t\tlet hasActivity = false;\n\t\t\tlet memberItemClasses = 'member-content';\n\n\t\t\tif ( layoutPreference === 'list' && 'latest_update' === extraData && member.latest_update && member.latest_update.rendered ) {\n\t\t\t\thasActivity = true;\n\t\t\t\tmemberItemClasses = 'member-content has-activity';\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div key={ 'bp-member-' + member.id } className={ memberItemClasses }>\n\t\t\t\t\t{ isSelected && (\n\t\t\t\t\t\t<Tooltip text={ __( 'Remove member', 'buddypress' ) }>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"is-right\"\n\t\t\t\t\t\t\t\tonClick={ () => onRemoveMember( member.id ) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Remove member', 'buddypress' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Dashicon icon=\"no\"/>\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isAvatarEnabled && 'none' !== avatarSize && (\n\t\t\t\t\t\t<div className=\"item-header-avatar\">\n\t\t\t\t\t\t\t<a href={ member.link } target=\"_blank\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tkey={ 'avatar-' + member.id }\n\t\t\t\t\t\t\t\t\tclassName=\"avatar\"\n\t\t\t\t\t\t\t\t\talt={ sprintf( __( 'Profile photo of %s', 'buddypress' ), member.name ) }\n\t\t\t\t\t\t\t\t\tsrc={ member.avatar_urls[ avatarSize ] }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<div className=\"member-description\">\n\t\t\t\t\t\t{ hasActivity && (\n\t\t\t\t\t\t\t<blockquote className=\"wp-block-quote\">\n\t\t\t\t\t\t\t\t<div dangerouslySetInnerHTML={ { __html: member.latest_update.rendered } } />\n\t\t\t\t\t\t\t\t<cite>\n\t\t\t\t\t\t\t\t\t{ displayUserName && (\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t{ member.name }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t\t\t\t\t{ isMentionEnabled && displayMentionSlug && (\n\t\t\t\t\t\t\t\t\t\t<a href={ member.link } target=\"_blank\">\n\t\t\t\t\t\t\t\t\t\t\t(@{ member.mention_name })\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</cite>\n\t\t\t\t\t\t\t</blockquote>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! hasActivity && displayUserName && (\n\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t<a href={ member.link } target=\"_blank\">\n\t\t\t\t\t\t\t\t\t{ member.name }\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ ! hasActivity && isMentionEnabled && displayMentionSlug && (\n\t\t\t\t\t\t\t<span className=\"user-nicename\">@{ member.mention_name }</span>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ 'last_activity' === extraData && member.last_activity && member.last_activity.date && (\n\t\t\t\t\t\t\t<time dateTime={ member.last_activity.date }>\n\t\t\t\t\t\t\t\t{ sprintf( __( 'Active %s', 'buddypress' ), member.last_activity.timediff ) }\n\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} );\n\t}\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings', 'buddypress' ) } initialOpen={ true }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Display the user name', 'buddypress' ) }\n\t\t\t\t\t\tchecked={ !! displayUserName }\n\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\tsetAttributes( { displayUserName: ! displayUserName } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tdisplayUserName\n\t\t\t\t\t\t\t\t? __( 'Include the user\\'s display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t: __( 'Toggle to include user\\'s display name.', 'buddypress' )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ isMentionEnabled && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Display Mention slug', 'buddypress' ) }\n\t\t\t\t\t\t\tchecked={ !! displayMentionSlug }\n\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { displayMentionSlug: ! displayMentionSlug } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdisplayMentionSlug\n\t\t\t\t\t\t\t\t\t? __( 'Include the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t\t\t: __( 'Toggle to display the user\\'s mention name under their display name.', 'buddypress' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isAvatarEnabled && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Avatar size', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ avatarSize }\n\t\t\t\t\t\t\toptions={ AVATAR_SIZES }\n\t\t\t\t\t\t\thelp={ __( 'Select \"None\" to disable the avatar.', 'buddypress' ) }\n\t\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { avatarSize: option } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'BuddyPress extra information', 'buddypress' ) }\n\t\t\t\t\t\tvalue={ extraData }\n\t\t\t\t\t\toptions={ extraDataOptions }\n\t\t\t\t\t\thelp={ __( 'Select \"None\" to show no extra information.', 'buddypress' ) }\n\t\t\t\t\t\tonChange={ ( option ) => {\n\t\t\t\t\t\t\tsetAttributes( { extraData: option } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ layoutPreference === 'grid' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Columns', 'buddypress' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\tmax={ 4 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ layoutControls } />\n\t\t\t</BlockControls>\n\n\t\t\t{ hasMembers && (\n\t\t\t\t<div className={ containerClasses }>\n\t\t\t\t\t{ membersList }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ ( isSelected || 0 === itemIDs.length ) && (\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ hasMembers ? '' : 'groups' }\n\t\t\t\t\tlabel={ hasMembers ? '' : __( 'BuddyPress Members', 'buddypress' ) }\n\t\t\t\t\tinstructions={ __( 'Start typing the name of the member you want to add to the members list.', 'buddypress' ) }\n\t\t\t\t\tclassName={ 0 !== itemIDs.length ? 'is-appender' : 'is-large' }\n\t\t\t\t>\n\t\t\t\t\t<AutoCompleter\n\t\t\t\t\t\tcomponent=\"members\"\n\t\t\t\t\t\tobjectQueryArgs={ { exclude: itemIDs } }\n\t\t\t\t\t\tslugValue={ getSlugValue }\n\t\t\t\t\t\tariaLabel={ __( 'Member\\'s username', 'buddypress' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Enter Member\\'s username here…', 'buddypress' ) }\n\t\t\t\t\t\tonSelectItem={ onSelectedMember }\n\t\t\t\t\t\tuseAvatar={ isAvatarEnabled }\n\t\t\t\t\t/>\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t</Fragment>\n\t);\n};\n\nconst editMembersBlock = compose( [\n\twithSelect( ( select ) => {\n\t\tconst editorSettings = select( 'core/editor' ).getEditorSettings();\n\n\t\treturn {\n\t\t\tbpSettings: editorSettings.bp.members || {},\n\t\t};\n\t} ),\n] )( editMembers );\n\nexport default editMembersBlock;\n","/**\n * WordPress dependencies.\n */\nconst {\n\tblocks: {\n\t\tregisterBlockType,\n\t},\n\ti18n: {\n\t\t__,\n\t},\n} = wp;\n\n/**\n * Internal dependencies.\n */\nimport editMembersBlock from './members/edit';\n\nregisterBlockType( 'bp/members', {\n\ttitle: __( 'Members', 'buddypress' ),\n\tdescription: __( 'BuddyPress Members.', 'buddypress' ),\n\ticon: 'groups',\n\tcategory: 'buddypress',\n\tattributes: {\n\t\titemIDs: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\ttype: 'integer',\n\t\t\t},\n\t\t\tdefault: [],\n\t\t},\n\t\tavatarSize: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'full',\n\t\t},\n\t\tdisplayMentionSlug: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\tdisplayUserName: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t},\n\t\textraData: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'none',\n\t\t},\n\t\tlayoutPreference: {\n\t\t\ttype: 'string',\n\t\t\tdefault: 'list',\n\t\t},\n\t\tcolumns: {\n\t\t\ttype: 'number',\n\t\t\tdefault: 2\n\t\t},\n\t},\n\tedit: editMembersBlock,\n} );\n"]}
bp-members/sass/blocks/member.scss ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/member block */
2
+ [data-type="bp/member"] {
3
+
4
+ input.components-placeholder__input {
5
+ flex: 1 1 auto;
6
+ border-radius: 2px;
7
+ border: 1px solid #757575;
8
+ padding: 6px 8px;
9
+ }
10
+ }
11
+
12
+ .bp-block-member {
13
+ position: relative;
14
+
15
+ .member-content {
16
+ display: flex;
17
+ }
18
+
19
+ .user-nicename {
20
+ display: block;
21
+
22
+ a {
23
+ color: currentColor;
24
+ text-decoration: none;
25
+ border: none;
26
+ }
27
+ }
28
+
29
+ .bp-profile-button {
30
+ width: 100%;
31
+
32
+ a.button {
33
+ position: absolute;
34
+ bottom: 10px;
35
+ right: 0;
36
+ display: inline-block;
37
+ margin: 18px 0 0;
38
+ }
39
+ }
40
+
41
+ &.has-cover {
42
+
43
+ .member-content,
44
+ .item-header-avatar,
45
+ .member-description {
46
+ z-index: 2;
47
+ }
48
+
49
+ .member-content {
50
+ padding-top: 75px;
51
+ }
52
+
53
+ .member-description {
54
+ padding-top: 75px;
55
+ }
56
+
57
+ .bp-member-cover-image {
58
+ background-color: #c5c5c5;
59
+ background-position: center top;
60
+ background-repeat: no-repeat;
61
+ background-size: cover;
62
+ border: 0;
63
+ display: block;
64
+ left: 0;
65
+ margin: 0;
66
+ padding: 0;
67
+ position: absolute;
68
+ top: 0;
69
+ width: 100%;
70
+ z-index: 1;
71
+ height: 150px;
72
+ }
73
+ }
74
+
75
+ img.avatar {
76
+ width: auto;
77
+ height: auto;
78
+ }
79
+
80
+ &.avatar-none {
81
+
82
+ .item-header-avatar {
83
+ display: none;
84
+ }
85
+ }
86
+
87
+ &.avatar-none.has-cover {
88
+ min-height: 200px;
89
+ }
90
+
91
+ &.avatar-full {
92
+ min-height: 150px;
93
+
94
+ .item-header-avatar {
95
+ width: 180px;
96
+ }
97
+ }
98
+
99
+ &.avatar-full.has-cover {
100
+ min-height: 300px;
101
+
102
+ .item-header-avatar {
103
+ width: 200px;
104
+ }
105
+
106
+ img.avatar {
107
+ border: solid 2px #fff;
108
+ background: rgba(255, 255, 255, 0.8);
109
+ margin-left: 20px;
110
+ }
111
+ }
112
+
113
+ &.avatar-thumb {
114
+
115
+ .member-content {
116
+ min-height: 50px;
117
+ align-items: center;
118
+ }
119
+
120
+ .item-header-avatar {
121
+ width: 70px;
122
+ }
123
+ }
124
+
125
+ &.avatar-thumb.has-cover {
126
+
127
+ .item-header-avatar {
128
+ padding-top: 75px;
129
+ }
130
+ }
131
+ }
132
+
133
+ .entry .entry-content .bp-block-member .user-nicename {
134
+
135
+ a {
136
+ color: currentColor;
137
+ text-decoration: none;
138
+ border: none;
139
+ }
140
+ }
bp-members/sass/blocks/members.scss ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS for the bp/members block */
2
+ [data-type="bp/members"] {
3
+
4
+ .components-placeholder {
5
+
6
+ &.is-appender {
7
+ min-height: 0;
8
+
9
+ .components-placeholder__label:empty {
10
+ display: none;
11
+ }
12
+ }
13
+
14
+ input.components-placeholder__input {
15
+ flex: 1 1 auto;
16
+ border-radius: 2px;
17
+ border: 1px solid #757575;
18
+ padding: 6px 8px;
19
+ }
20
+ }
21
+
22
+ &.avatar-none {
23
+
24
+ .member-description {
25
+ width: calc(100% - 44px);
26
+ }
27
+ }
28
+
29
+ &.avatar-full {
30
+
31
+ .member-description {
32
+ width: calc(100% - 224px);
33
+ }
34
+ }
35
+
36
+ &.avatar-thumb {
37
+
38
+ .member-description {
39
+ width: calc(100% - 114px);
40
+ }
41
+ }
42
+
43
+ .member-content {
44
+ position: relative;
45
+
46
+ .is-right {
47
+ position: absolute;
48
+ top: 2px;
49
+ right: 2px;
50
+ }
51
+ }
52
+
53
+ .columns-2,
54
+ .columns-3,
55
+ .columns-4 {
56
+
57
+ .member-content {
58
+
59
+ .member-description {
60
+ padding-left: 44px;
61
+ width: calc(100% - 44px);
62
+ }
63
+ }
64
+ }
65
+
66
+ .columns-3 {
67
+
68
+ .is-right {
69
+ right: -10px;
70
+ }
71
+ }
72
+
73
+ .columns-4 {
74
+
75
+ .is-right {
76
+ right: -50px;
77
+ }
78
+ }
79
+ }
80
+
81
+ .bp-block-members {
82
+
83
+ &.is-grid {
84
+ display: flex;
85
+ flex-wrap: wrap;
86
+ padding: 0;
87
+
88
+ .member-content {
89
+ margin: 0 1.25em 1.25em 0;
90
+ width: 100%;
91
+ }
92
+ }
93
+
94
+ @media (min-width: 600px) {
95
+
96
+ @for $i from 2 through 4 {
97
+ &.columns-#{ $i } .member-content {
98
+ width: calc((100% / #{ $i }) - 1.25em + (1.25em / #{ $i }));
99
+
100
+ &:nth-child( #{ $i }n ) {
101
+ margin-right: 0;
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ .member-content {
108
+ display: flex;
109
+ flex-direction: column;
110
+ padding-bottom: 1em;
111
+ text-align: center;
112
+
113
+ .item-header-avatar,
114
+ .member-description {
115
+ width: 100%;
116
+ }
117
+
118
+ .item-header-avatar {
119
+ margin: 0 auto;
120
+
121
+ img.avatar {
122
+ display: inline-block;
123
+ }
124
+ }
125
+
126
+ @media (min-width: 600px) {
127
+ flex-direction: row;
128
+ text-align: left;
129
+
130
+ .item-header-avatar,
131
+ .member-description {
132
+ width: auto;
133
+ }
134
+
135
+ .item-header-avatar {
136
+ margin: 0;
137
+ }
138
+ }
139
+
140
+ .user-nicename {
141
+ display: block;
142
+
143
+ a {
144
+ color: currentColor;
145
+ text-decoration: none;
146
+ border: none;
147
+ }
148
+ }
149
+
150
+ time {
151
+ display: block;
152
+ font-size: 80%;
153
+ color: #767676;
154
+ }
155
+ }
156
+
157
+ &.avatar-none {
158
+
159
+ .item-header-avatar {
160
+ display: none;
161
+ }
162
+ }
163
+
164
+ &.avatar-full {
165
+ min-height: 190px;
166
+
167
+ .item-header-avatar {
168
+ width: 180px;
169
+ }
170
+ }
171
+
172
+ &.avatar-thumb {
173
+
174
+ .member-content {
175
+ min-height: 80px;
176
+ }
177
+
178
+ .item-header-avatar {
179
+ width: 70px;
180
+ }
181
+ }
182
+
183
+ &.columns-2 .member-content,
184
+ &.columns-3 .member-content,
185
+ &.columns-4 .member-content {
186
+ display: block;
187
+ text-align: center;
188
+
189
+ .item-header-avatar {
190
+ margin: 0 auto;
191
+ }
192
+ }
193
+
194
+ img.avatar {
195
+ width: auto;
196
+ height: auto;
197
+ max-width: fit-content;
198
+ }
199
+
200
+ .member-content.has-activity {
201
+ align-items: center;
202
+
203
+ .item-header-avatar {
204
+ padding-right: 1em;
205
+ }
206
+
207
+ .wp-block-quote {
208
+ margin-bottom: 0;
209
+ text-align: left;
210
+
211
+ cite a {
212
+ color: currentColor;
213
+ text-decoration: none;
214
+ border: none;
215
+ }
216
+ }
217
+ }
218
+ }
219
+
220
+ .entry .entry-content .bp-block-members .user-nicename {
221
+
222
+ a {
223
+ color: currentColor;
224
+ text-decoration: none;
225
+ border: none;
226
+ }
227
+ }
bp-members/screens/register.php CHANGED
@@ -59,19 +59,31 @@ function bp_core_screen_signup() {
59
  $account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );
60
 
61
  // If there are errors with account details, set them for display.
62
- if ( !empty( $account_details['errors']->errors['user_name'] ) )
63
  $bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0];
 
64
 
65
- if ( !empty( $account_details['errors']->errors['user_email'] ) )
66
  $bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0];
 
67
 
68
- // Check that both password fields are filled in.
69
- if ( empty( $_POST['signup_password'] ) || empty( $_POST['signup_password_confirm'] ) )
70
- $bp->signup->errors['signup_password'] = __( 'Please make sure you enter your password twice', 'buddypress' );
 
71
 
72
- // Check that the passwords match.
73
- if ( ( !empty( $_POST['signup_password'] ) && !empty( $_POST['signup_password_confirm'] ) ) && $_POST['signup_password'] != $_POST['signup_password_confirm'] )
74
- $bp->signup->errors['signup_password'] = __( 'The passwords you entered do not match.', 'buddypress' );
 
 
 
 
 
 
 
 
 
75
 
76
  if ( bp_signup_requires_privacy_policy_acceptance() && ! empty( $_POST['signup-privacy-policy-check'] ) && empty( $_POST['signup-privacy-policy-accept'] ) ) {
77
  $bp->signup->errors['signup_privacy_policy'] = __( 'You must indicate that you have read and agreed to the Privacy Policy.', 'buddypress' );
@@ -237,4 +249,4 @@ function bp_core_screen_signup() {
237
  */
238
  bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );
239
  }
240
- add_action( 'bp_screens', 'bp_core_screen_signup' );
59
  $account_details = bp_core_validate_user_signup( $_POST['signup_username'], $_POST['signup_email'] );
60
 
61
  // If there are errors with account details, set them for display.
62
+ if ( ! empty( $account_details['errors']->errors['user_name'] ) ) {
63
  $bp->signup->errors['signup_username'] = $account_details['errors']->errors['user_name'][0];
64
+ }
65
 
66
+ if ( ! empty( $account_details['errors']->errors['user_email'] ) ) {
67
  $bp->signup->errors['signup_email'] = $account_details['errors']->errors['user_email'][0];
68
+ }
69
 
70
+ $signup_pass = '';
71
+ if ( isset( $_POST['signup_password'] ) ) {
72
+ $signup_pass = wp_unslash( $_POST['signup_password'] );
73
+ }
74
 
75
+ $signup_pass_confirm = '';
76
+ if ( isset( $_POST['signup_password_confirm'] ) ) {
77
+ $signup_pass_confirm = wp_unslash( $_POST['signup_password_confirm'] );
78
+ }
79
+
80
+ // Check the account password for problems.
81
+ $account_password = bp_members_validate_user_password( $signup_pass, $signup_pass_confirm );
82
+ $password_error = $account_password->get_error_message();
83
+
84
+ if ( $password_error ) {
85
+ $bp->signup->errors['signup_password'] = $password_error;
86
+ }
87
 
88
  if ( bp_signup_requires_privacy_policy_acceptance() && ! empty( $_POST['signup-privacy-policy-check'] ) && empty( $_POST['signup-privacy-policy-accept'] ) ) {
89
  $bp->signup->errors['signup_privacy_policy'] = __( 'You must indicate that you have read and agreed to the Privacy Policy.', 'buddypress' );
249
  */
250
  bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) );
251
  }
252
+ add_action( 'bp_screens', 'bp_core_screen_signup' );
bp-messages/bp-messages-filters.php CHANGED
@@ -32,12 +32,10 @@ add_filter( 'messages_message_subject_before_save', 'force_balance_tags' );
32
  add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
33
  add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
34
 
35
- if ( function_exists( 'wp_encode_emoji' ) ) {
36
- add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' );
37
- add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' );
38
- add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' );
39
- add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' );
40
- }
41
 
42
  add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
43
  add_filter( 'bp_get_message_notice_text', 'wptexturize' );
@@ -79,6 +77,8 @@ add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' );
79
  add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' );
80
  add_filter( 'bp_get_message_thread_content', 'stripslashes_deep', 1 );
81
 
 
 
82
  // Personal data export.
83
  add_filter( 'wp_privacy_personal_data_exporters', 'bp_messages_register_personal_data_exporter' );
84
 
32
  add_filter( 'messages_notice_message_before_save', 'force_balance_tags' );
33
  add_filter( 'messages_notice_subject_before_save', 'force_balance_tags' );
34
 
35
+ add_filter( 'messages_message_subject_before_save', 'wp_encode_emoji' );
36
+ add_filter( 'messages_message_content_before_save', 'wp_encode_emoji' );
37
+ add_filter( 'messages_notice_message_before_save', 'wp_encode_emoji' );
38
+ add_filter( 'messages_notice_subject_before_save', 'wp_encode_emoji' );
 
 
39
 
40
  add_filter( 'bp_get_message_notice_subject', 'wptexturize' );
41
  add_filter( 'bp_get_message_notice_text', 'wptexturize' );
77
  add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' );
78
  add_filter( 'bp_get_message_thread_content', 'stripslashes_deep', 1 );
79
 
80
+ add_filter( 'bp_get_the_thread_message_content', 'bp_core_add_loading_lazy_attribute' );
81
+
82
  // Personal data export.
83
  add_filter( 'wp_privacy_personal_data_exporters', 'bp_messages_register_personal_data_exporter' );
84
 
bp-messages/classes/class-bp-messages-notices-admin.php CHANGED
@@ -183,16 +183,8 @@ class BP_Messages_Notices_Admin {
183
  $this->list_table->prepare_items();
184
  ?>
185
  <div class="wrap">
186
- <?php if ( version_compare( $GLOBALS['wp_version'], '4.8', '>=' ) ) : ?>
187
-
188
- <h1 class="wp-heading-inline"><?php echo esc_html_x( 'Site Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
189
- <hr class="wp-header-end">
190
-
191
- <?php else : ?>
192
-
193
- <h1><?php echo esc_html_x( 'Site Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
194
-
195
- <?php endif; ?>
196
 
197
  <p class="bp-notice-about"><?php esc_html_e( 'Manage notices shown at front end of your site to all logged-in users.', 'buddypress' ); ?></p>
198
 
@@ -218,7 +210,7 @@ class BP_Messages_Notices_Admin {
218
 
219
  <?php if ( isset( $_GET['success'] ) || isset( $_GET['error'] ) ) : ?>
220
 
221
- <div id="message" class="<?php echo isset( $_GET['success'] ) ? 'updated' : 'error'; ?>">
222
 
223
  <p>
224
  <?php
183
  $this->list_table->prepare_items();
184
  ?>
185
  <div class="wrap">
186
+ <h1 class="wp-heading-inline"><?php echo esc_html_x( 'Site Notices', 'Notices admin page title', 'buddypress' ); ?></h1>
187
+ <hr class="wp-header-end">
 
 
 
 
 
 
 
 
188
 
189
  <p class="bp-notice-about"><?php esc_html_e( 'Manage notices shown at front end of your site to all logged-in users.', 'buddypress' ); ?></p>
190
 
210
 
211
  <?php if ( isset( $_GET['success'] ) || isset( $_GET['error'] ) ) : ?>
212
 
213
+ <div id="message" class="<?php echo isset( $_GET['success'] ) ? 'updated' : 'error'; ?> notice is-dismissible">
214
 
215
  <p>
216
  <?php
bp-messages/classes/class-bp-rest-messages-endpoint.php CHANGED
@@ -1008,7 +1008,7 @@ class BP_REST_Messages_Endpoint extends WP_REST_Controller {
1008
  */
1009
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
1010
  $key = 'get_item';
1011
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
1012
  $args['id']['description'] = __( 'ID of the Messages Thread.', 'buddypress' );
1013
 
1014
  if ( WP_REST_Server::CREATABLE === $method ) {
1008
  */
1009
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
1010
  $key = 'get_item';
1011
+ $args = parent::get_endpoint_args_for_item_schema( $method );
1012
  $args['id']['description'] = __( 'ID of the Messages Thread.', 'buddypress' );
1013
 
1014
  if ( WP_REST_Server::CREATABLE === $method ) {
bp-notifications/classes/class-bp-notifications-notification.php CHANGED
@@ -556,12 +556,16 @@ class BP_Notifications_Notification {
556
  * @return bool True if the notification belongs to the user, otherwise
557
  * false.
558
  */
559
- public static function check_access( $user_id, $notification_id ) {
560
  global $wpdb;
561
 
562
  $bp = buddypress();
563
 
564
- return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->core->table_name_notifications} WHERE id = %d AND user_id = %d", $notification_id, $user_id ) );
 
 
 
 
565
  }
566
 
567
  /**
556
  * @return bool True if the notification belongs to the user, otherwise
557
  * false.
558
  */
559
+ public static function check_access( $user_id = 0, $notification_id = 0 ) {
560
  global $wpdb;
561
 
562
  $bp = buddypress();
563
 
564
+ $query = "SELECT COUNT(id) FROM {$bp->notifications->table_name} WHERE id = %d AND user_id = %d";
565
+ $prepare = $wpdb->prepare( $query, $notification_id, $user_id );
566
+ $result = $wpdb->get_var( $prepare );
567
+
568
+ return $result;
569
  }
570
 
571
  /**
bp-notifications/classes/class-bp-rest-notifications-endpoint.php CHANGED
@@ -463,7 +463,7 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller {
463
  'bp_rest_notification_invalid_id',
464
  __( 'Invalid notification ID.', 'buddypress' ),
465
  array(
466
- 'status' => 500,
467
  )
468
  );
469
  }
@@ -655,7 +655,7 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller {
655
  *
656
  * @since 5.0.0
657
  *
658
- * @param array $links The prepared links of the REST response.
659
  * @param BP_Notifications_Notification $notification Notification object.
660
  */
661
  return apply_filters( 'bp_rest_notifications_prepare_links', $links, $notification );
@@ -690,7 +690,7 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller {
690
  * @since 5.0.0
691
  *
692
  * @param WP_REST_Request $request Full details about the request.
693
- * @return BP_Notifications_Notification|string A notification object.
694
  */
695
  public function get_notification_object( $request ) {
696
  $notification_id = is_numeric( $request ) ? $request : (int) $request['id'];
@@ -713,7 +713,7 @@ class BP_REST_Notifications_Endpoint extends WP_REST_Controller {
713
  * @return array Endpoint arguments.
714
  */
715
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
716
- $args = WP_REST_Controller::get_endpoint_args_for_item_schema( $method );
717
  $key = 'get_item';
718
 
719
  if ( WP_REST_Server::EDITABLE === $method ) {
463
  'bp_rest_notification_invalid_id',
464
  __( 'Invalid notification ID.', 'buddypress' ),
465
  array(
466
+ 'status' => 404,
467
  )
468
  );
469
  }
655
  *
656
  * @since 5.0.0
657
  *
658
+ * @param array $links The prepared links of the REST response.
659
  * @param BP_Notifications_Notification $notification Notification object.
660
  */
661
  return apply_filters( 'bp_rest_notifications_prepare_links', $links, $notification );
690
  * @since 5.0.0
691
  *
692
  * @param WP_REST_Request $request Full details about the request.
693
+ * @return BP_Notifications_Notification|string A notification object|Empty string.
694
  */
695
  public function get_notification_object( $request ) {
696
  $notification_id = is_numeric( $request ) ? $request : (int) $request['id'];
713
  * @return array Endpoint arguments.
714
  */
715
  public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) {
716
+ $args = parent::get_endpoint_args_for_item_schema( $method );
717
  $key = 'get_item';
718
 
719
  if ( WP_REST_Server::EDITABLE === $method ) {
bp-settings/actions/general.php CHANGED
@@ -130,23 +130,22 @@ function bp_settings_action_general() {
130
 
131
  /* Password Change Attempt ***************************************/
132
 
133
- if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
134
-
135
- if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . wp_unslash( $_POST['pass1'] ), "\\" ) ) {
 
136
 
 
137
  // Password change attempt is successful.
138
- if ( ( ! empty( $_POST['pwd'] ) && $_POST['pwd'] != $_POST['pass1'] ) || is_super_admin() ) {
139
  $update_user->user_pass = $_POST['pass1'];
140
- $pass_changed = true;
 
141
 
142
  // The new password is the same as the current password.
143
  } else {
144
- $pass_error = 'same';
145
  }
146
-
147
- // Password change attempt was unsuccessful.
148
- } else {
149
- $pass_error = 'mismatch';
150
  }
151
 
152
  // Both password fields were empty.
@@ -154,8 +153,8 @@ function bp_settings_action_general() {
154
  $pass_error = false;
155
 
156
  // One of the password boxes was left empty.
157
- } elseif ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) {
158
- $pass_error = 'empty';
159
  }
160
 
161
  // The structure of the $update_user object changed in WP 3.3, but
@@ -180,7 +179,7 @@ function bp_settings_action_general() {
180
 
181
  // Password Error.
182
  } else {
183
- $pass_error = 'invalid';
184
  }
185
 
186
  // Email feedback.
@@ -202,23 +201,8 @@ function bp_settings_action_general() {
202
  break;
203
  }
204
 
205
- // Password feedback.
206
- switch ( $pass_error ) {
207
- case 'invalid' :
208
- $feedback['pass_error'] = __( 'Your current password is invalid.', 'buddypress' );
209
- break;
210
- case 'mismatch' :
211
- $feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' );
212
- break;
213
- case 'empty' :
214
- $feedback['pass_empty'] = __( 'One of the password fields was empty.', 'buddypress' );
215
- break;
216
- case 'same' :
217
- $feedback['pass_same'] = __( 'The new password must be different from the current password.', 'buddypress' );
218
- break;
219
- case false :
220
- // No change.
221
- break;
222
  }
223
 
224
  // No errors so show a simple success message.
130
 
131
  /* Password Change Attempt ***************************************/
132
 
133
+ if ( ! empty( $_POST['pass1'] ) && ! empty( $_POST['pass2'] ) ) {
134
+ $pass = wp_unslash( $_POST['pass1'] );
135
+ $pass_confirm = wp_unslash( $_POST['pass2'] );
136
+ $pass_error = bp_members_validate_user_password( $pass, $pass_confirm, $update_user );
137
 
138
+ if ( ! $pass_error->get_error_message() ) {
139
  // Password change attempt is successful.
140
+ if ( ( ! empty( $_POST['pwd'] ) && wp_unslash( $_POST['pwd'] ) !== $pass ) || is_super_admin() ) {
141
  $update_user->user_pass = $_POST['pass1'];
142
+ $pass_error = false;
143
+ $pass_changed = true;
144
 
145
  // The new password is the same as the current password.
146
  } else {
147
+ $pass_error->add( 'same_user_password', __( 'The new password must be different from the current password.', 'buddypress' ) );
148
  }
 
 
 
 
149
  }
150
 
151
  // Both password fields were empty.
153
  $pass_error = false;
154
 
155
  // One of the password boxes was left empty.
156
+ } elseif ( ( empty( $_POST['pass1'] ) && ! empty( $_POST['pass2'] ) ) || ( ! empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) {
157
+ $pass_error = new WP_Error( 'empty_user_password', __( 'One of the password fields was empty.', 'buddypress' ) );
158
  }
159
 
160
  // The structure of the $update_user object changed in WP 3.3, but
179
 
180
  // Password Error.
181
  } else {
182
+ $pass_error = new WP_Error( 'invalid_user_password', __( 'Your current password is invalid.', 'buddypress' ) );
183
  }
184
 
185
  // Email feedback.
201
  break;
202
  }
203
 
204
+ if ( is_wp_error( $pass_error ) && $pass_error->get_error_message() ) {
205
+ $feedback[ $pass_error->get_error_code() ] = $pass_error->get_error_message();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  }
207
 
208
  // No errors so show a simple success message.
bp-settings/bp-settings-functions.php CHANGED
@@ -81,7 +81,7 @@ function bp_settings_sanitize_notification_settings( $settings = array() ) {
81
  }
82
 
83
  /**
84
- * Build a dynamic whitelist of notification keys, based on what's hooked to 'bp_notification_settings'.
85
  *
86
  * @since 2.3.5
87
  *
@@ -91,7 +91,7 @@ function bp_settings_get_registered_notification_keys() {
91
 
92
  ob_start();
93
  /**
94
- * Fires at the start of the notification keys whitelisting.
95
  *
96
  * @since 1.0.0
97
  */
@@ -101,12 +101,12 @@ function bp_settings_get_registered_notification_keys() {
101
  $matched = preg_match_all( '/<input[^>]+name="notifications\[([^\]]+)\]/', $screen, $matches );
102
 
103
  if ( $matched && isset( $matches[1] ) ) {
104
- $key_whitelist = $matches[1];
105
  } else {
106
- $key_whitelist = array();
107
  }
108
 
109
- return $key_whitelist;
110
  }
111
 
112
  /**
@@ -249,7 +249,7 @@ function bp_settings_get_personal_data_request( $user_id = 0 ) {
249
 
250
  if ( ! empty( $query->post ) ) {
251
  // WP 5.4 changed the user request function name to wp_get_user_request()
252
- $user_request = function_exists( 'wp_get_user_request' ) ? 'wp_get_user_request' : 'wp_get_user_request_data';
253
  return $user_request( $query->post->ID );
254
  } else {
255
  return false;
81
  }
82
 
83
  /**
84
+ * Build a dynamic list of allowed notification keys, based on what's hooked to 'bp_notification_settings'.
85
  *
86
  * @since 2.3.5
87
  *
91
 
92
  ob_start();
93
  /**
94
+ * Fires at the start of the building of the notification keys allowed list.
95
  *
96
  * @since 1.0.0
97
  */
101
  $matched = preg_match_all( '/<input[^>]+name="notifications\[([^\]]+)\]/', $screen, $matches );
102
 
103
  if ( $matched && isset( $matches[1] ) ) {
104
+ $allowed_key_list = $matches[1];
105
  } else {
106
+ $allowed_key_list = array();
107
  }
108
 
109
+ return $allowed_key_list;
110
  }
111
 
112
  /**
249
 
250
  if ( ! empty( $query->post ) ) {
251
  // WP 5.4 changed the user request function name to wp_get_user_request()
252
+ $user_request = bp_is_running_wp( '4.9.6' ) ? 'wp_get_user_request' : 'wp_get_user_request_data';
253
  return $user_request( $query->post->ID );
254
  } else {
255
  return false;
bp-settings/classes/class-bp-settings-component.php CHANGED
@@ -193,7 +193,7 @@ class BP_Settings_Component extends BP_Component {
193
  $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
194
 
195
  // Export Data - only available for WP 4.9.6+.
196
- if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
197
  $sub_nav[] = array(
198
  'name' => __( 'Export Data', 'buddypress' ),
199
  'slug' => 'data',
@@ -268,7 +268,7 @@ class BP_Settings_Component extends BP_Component {
268
  $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
269
 
270
  // Export Data.
271
- if ( true === $show_data_page && version_compare( $GLOBALS['wp_version'], '4.9.6', '>=' ) ) {
272
  $wp_admin_nav[] = array(
273
  'parent' => 'my-account-' . $this->id,
274
  'id' => 'my-account-' . $this->id . '-data',
193
  $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
194
 
195
  // Export Data - only available for WP 4.9.6+.
196
+ if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
197
  $sub_nav[] = array(
198
  'name' => __( 'Export Data', 'buddypress' ),
199
  'slug' => 'data',
268
  $show_data_page = apply_filters( 'bp_settings_show_user_data_page', true );
269
 
270
  // Export Data.
271
+ if ( true === $show_data_page && bp_is_running_wp( '4.9.6' ) ) {
272
  $wp_admin_nav[] = array(
273
  'parent' => 'my-account-' . $this->id,
274
  'id' => 'my-account-' . $this->id . '-data',
bp-templates/bp-legacy/buddypress/activity/entry.php CHANGED
@@ -145,7 +145,7 @@ do_action( 'bp_before_activity_entry' ); ?>
145
  */
146
  do_action( 'bp_activity_entry_comments' ); ?>
147
 
148
- <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
149
 
150
  </form>
151
 
145
  */
146
  do_action( 'bp_activity_entry_comments' ); ?>
147
 
148
+ <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment_' . bp_get_activity_id() ); ?>
149
 
150
  </form>
151
 
bp-templates/bp-legacy/buddypress/blogs/create.php CHANGED
@@ -14,43 +14,47 @@
14
  */
15
  do_action( 'bp_before_create_blog_content_template' ); ?>
16
 
17
- <div id="template-notices" role="alert" aria-atomic="true">
18
- <?php
19
 
20
- /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
21
- do_action( 'template_notices' ); ?>
22
 
23
- </div>
 
24
 
25
- <?php
26
 
27
- /**
28
- * Fires before the display of the blog creation form.
29
- *
30
- * @since 1.1.0
31
- */
32
- do_action( 'bp_before_create_blog_content' ); ?>
33
 
34
- <?php if ( bp_blog_signup_enabled() ) : ?>
 
 
 
 
 
35
 
36
- <?php bp_show_blog_signup_form(); ?>
37
 
38
- <?php else: ?>
39
 
40
- <div id="message" class="info">
41
- <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
42
- </div>
43
 
44
- <?php endif; ?>
 
 
45
 
46
- <?php
47
 
48
- /**
49
- * Fires after the display of the blog creation form.
50
- *
51
- * @since 1.1.0
52
- */
53
- do_action( 'bp_after_create_blog_content' ); ?>
 
 
 
 
54
 
55
  <?php
56
 
14
  */
15
  do_action( 'bp_before_create_blog_content_template' ); ?>
16
 
17
+ <div id="buddypress">
 
18
 
19
+ <div id="template-notices" role="alert" aria-atomic="true">
20
+ <?php
21
 
22
+ /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
23
+ do_action( 'template_notices' ); ?>
24
 
25
+ </div>
26
 
27
+ <?php
 
 
 
 
 
28
 
29
+ /**
30
+ * Fires before the display of the blog creation form.
31
+ *
32
+ * @since 1.1.0
33
+ */
34
+ do_action( 'bp_before_create_blog_content' ); ?>
35
 
36
+ <?php if ( bp_blog_signup_enabled() ) : ?>
37
 
38
+ <?php bp_show_blog_signup_form(); ?>
39
 
40
+ <?php else: ?>
 
 
41
 
42
+ <div id="message" class="info">
43
+ <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
44
+ </div>
45
 
46
+ <?php endif; ?>
47
 
48
+ <?php
49
+
50
+ /**
51
+ * Fires after the display of the blog creation form.
52
+ *
53
+ * @since 1.1.0
54
+ */
55
+ do_action( 'bp_after_create_blog_content' ); ?>
56
+
57
+ </div>
58
 
59
  <?php
60
 
bp-templates/bp-legacy/buddypress/groups/groups-loop.php CHANGED
@@ -64,7 +64,14 @@ do_action( 'bp_before_groups_loop' ); ?>
64
 
65
  <div class="item">
66
  <div class="item-title"><?php bp_group_link(); ?></div>
67
- <div class="item-meta"><span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div>
 
 
 
 
 
 
 
68
 
69
  <div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
70
 
64
 
65
  <div class="item">
66
  <div class="item-title"><?php bp_group_link(); ?></div>
67
+ <div class="item-meta">
68
+ <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
69
+ <?php
70
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
71
+ printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
72
+ ?>
73
+ </span>
74
+ </div>
75
 
76
  <div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
77
 
bp-templates/bp-legacy/buddypress/groups/single/cover-image-header.php CHANGED
@@ -60,7 +60,12 @@ do_action( 'bp_before_group_header' ); ?>
60
  do_action( 'bp_group_header_meta' ); ?>
61
 
62
  <span class="highlight"><?php bp_group_type(); ?></span>
63
- <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
 
 
 
 
 
64
 
65
  <?php bp_group_description(); ?>
66
 
60
  do_action( 'bp_group_header_meta' ); ?>
61
 
62
  <span class="highlight"><?php bp_group_type(); ?></span>
63
+ <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
64
+ <?php
65
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
66
+ printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
67
+ ?>
68
+ </span>
69
 
70
  <?php bp_group_description(); ?>
71
 
bp-templates/bp-legacy/buddypress/groups/single/group-header.php CHANGED
@@ -69,7 +69,12 @@ do_action( 'bp_before_group_header' );
69
 
70
  <div id="item-header-content">
71
  <span class="highlight"><?php bp_group_type(); ?></span>
72
- <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
 
 
 
 
 
73
 
74
  <?php
75
 
69
 
70
  <div id="item-header-content">
71
  <span class="highlight"><?php bp_group_type(); ?></span>
72
+ <span class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
73
+ <?php
74
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
75
+ printf( __( 'Active %s', 'buddypress' ), bp_get_group_last_active() );
76
+ ?>
77
+ </span>
78
 
79
  <?php
80
 
bp-templates/bp-legacy/css/buddypress-rtl.css CHANGED
@@ -733,6 +733,20 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
733
  margin-bottom: -1em;
734
  }
735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  /*--------------------------------------------------------------
737
  3.5 - Forms
738
  --------------------------------------------------------------*/
733
  margin-bottom: -1em;
734
  }
735
 
736
+ body.create-blog #buddypress .error {
737
+ background-color: #fdc;
738
+ border: 1px solid #a00;
739
+ color: #800;
740
+ padding: 10px 15px;
741
+ }
742
+
743
+ body.create-blog #buddypress .success {
744
+ background-color: #efc;
745
+ border: 1px solid #591;
746
+ color: #250;
747
+ padding: 10px 15px;
748
+ }
749
+
750
  /*--------------------------------------------------------------
751
  3.5 - Forms
752
  --------------------------------------------------------------*/
bp-templates/bp-legacy/css/buddypress-rtl.min.css CHANGED
@@ -1 +1 @@
1
- #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 div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:right}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:right}#buddypress form#whats-new-form #whats-new-content{margin-right:55px;padding:0 20px 20px 0}#buddypress form#whats-new-form p.activity-greeting{line-height:.5;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:1.5;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:2.2}#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{margin:0}#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 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,#sitewide-notice strong:first-child{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}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{right:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress form fieldset{border:0;padding:0}#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:#737373;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 legend,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress label.xprofile-field-label{display:inline}#buddypress .standard-form #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form .checkbox label,#buddypress .standard-form .radio label{color:#767676;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form .checkbox label input,#buddypress .standard-form .radio label input{margin-left:3px}#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 .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}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 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 .standard-form button,#buddypress a.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 .standard-form button:hover,#buddypress a.button:focus,#buddypress a.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 h3,#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}fieldset.register-site{margin-top:1em}fieldset.create-site{margin-bottom:2em}fieldset.create-site legend{margin-bottom:1em}fieldset.create-site label{margin-left:3em}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px;word-wrap:normal!important}.bp-screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#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}#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=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled]{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#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.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-left:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p{margin:0}#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;color:#707070}#buddypress table.notification-settings{margin-bottom:20px;text-align:right}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-right:35px}#buddypress table.forum td p.topic-text{color:#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;padding:0}#buddypress span.user-nicename{color:#767676;display:inline-block;font-size:120%;font-weight:700}#sitewide-notice,.bp-site-wide-message{position:relative}#buddypress div#message p,#sitewide-notice #message{background-color:#ffd;border:1px solid #cb2;color:#440;font-weight:400;margin-top:3px;text-decoration:none}.admin-bar-on #message p,.bp-site-wide-message #message p{padding-left:25px}.admin-bar-on #message button,.bp-site-wide-message #message button{font-size:.8em;padding:2px 4px;position:absolute;left:0;top:0}.admin-bar-on #message button{left:10px;top:7px}#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:1.2;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:1.7;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:#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 h2,#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header div#item-actions a{display:inline-block}#buddypress div#item-header ul{margin-bottom:15px}#buddypress div#item-header ul:after{clear:both;content:"";display:table}#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}body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#buddypress div#item-header div#message.info{line-height:.8}#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 h3,#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:.9;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 .group-members-list{width:100%;margin-top:1em;clear:both;overflow:auto}#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-metadata:after{clear:both;content:"";display:table}#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 h2{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:#707070}#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{border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0;background:#f5f5f5;color:#707070}#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0;background:#f5f5f5;color:#707070}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom:0}.widget.buddypress span.activity{display:inline-block;font-size:small;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 div.avatar-block:after{clear:both;content:"";display:table}.widget.buddypress .item-avatar a{float:right;margin-bottom:15px;margin-left:10px}.widget.buddypress div.item-avatar img{display:inline-block;height:40px;margin:1px;width:40px}.widget.buddypress .item-avatar a,.widget.buddypress .item-avatar a img,.widget.buddypress .item-avatar a:active,.widget.buddypress .item-avatar a:focus,.widget.buddypress .item-avatar a:hover{box-shadow:none}.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}.widget.buddypress .bp-login-widget-user-links>div{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}.buddypress .bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}#group-admins .bp-tooltip:after,#group-mods .bp-tooltip:after,.message-metadata .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.feed .bp-tooltip:after,.item-list .bp-tooltip:after,.messages-notices .bp-tooltip:after{right:0;left:auto;text-align:right;transform:translateX(0)}.admin-bar-on .bp-tooltip:after,.bp-site-wide-message .bp-tooltip:after{left:50px}@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 h3,#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:right;float:right;margin-top:0;text-align:right}#buddypress li#groups-order-select{clear:right;float:right}#buddypress ul.item-list li div.action{clear:right;float:right;margin-top:0;margin-right:70px;position:relative;top:0;left:0;text-align:right}#buddypress ul.item-list li div.item-desc{clear:right;float:right;margin:10px 0 0;width:auto}#buddypress li div.item{margin-right:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-right:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:right;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:right}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-right:45px}h1 a.bp-title-button{clear:right;float:right;margin:10px 0 20px}}
1
+ #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 div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:right}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:right}#buddypress form#whats-new-form #whats-new-content{margin-right:55px;padding:0 20px 20px 0}#buddypress form#whats-new-form p.activity-greeting{line-height:.5;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:1.5;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:2.2}#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{margin:0}#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 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,#sitewide-notice strong:first-child{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}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{right:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}body.create-blog #buddypress .error{background-color:#fdc;border:1px solid #a00;color:#800;padding:10px 15px}body.create-blog #buddypress .success{background-color:#efc;border:1px solid #591;color:#250;padding:10px 15px}#buddypress form fieldset{border:0;padding:0}#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:#737373;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 legend,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress label.xprofile-field-label{display:inline}#buddypress .standard-form #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form .checkbox label,#buddypress .standard-form .radio label{color:#767676;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form .checkbox label input,#buddypress .standard-form .radio label input{margin-left:3px}#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 .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}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 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 .standard-form button,#buddypress a.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 .standard-form button:hover,#buddypress a.button:focus,#buddypress a.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 h3,#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}fieldset.register-site{margin-top:1em}fieldset.create-site{margin-bottom:2em}fieldset.create-site legend{margin-bottom:1em}fieldset.create-site label{margin-left:3em}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px;word-wrap:normal!important}.bp-screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;right:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#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}#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=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled]{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#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.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-left:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p{margin:0}#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;color:#707070}#buddypress table.notification-settings{margin-bottom:20px;text-align:right}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-right:35px}#buddypress table.forum td p.topic-text{color:#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;padding:0}#buddypress span.user-nicename{color:#767676;display:inline-block;font-size:120%;font-weight:700}#sitewide-notice,.bp-site-wide-message{position:relative}#buddypress div#message p,#sitewide-notice #message{background-color:#ffd;border:1px solid #cb2;color:#440;font-weight:400;margin-top:3px;text-decoration:none}.admin-bar-on #message p,.bp-site-wide-message #message p{padding-left:25px}.admin-bar-on #message button,.bp-site-wide-message #message button{font-size:.8em;padding:2px 4px;position:absolute;left:0;top:0}.admin-bar-on #message button{left:10px;top:7px}#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:1.2;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:1.7;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:#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 h2,#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header div#item-actions a{display:inline-block}#buddypress div#item-header ul{margin-bottom:15px}#buddypress div#item-header ul:after{clear:both;content:"";display:table}#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}body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#buddypress div#item-header div#message.info{line-height:.8}#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 h3,#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:.9;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 .group-members-list{width:100%;margin-top:1em;clear:both;overflow:auto}#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-metadata:after{clear:both;content:"";display:table}#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 h2{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:#707070}#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{border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0;background:#f5f5f5;color:#707070}#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0;background:#f5f5f5;color:#707070}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom:0}.widget.buddypress span.activity{display:inline-block;font-size:small;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 div.avatar-block:after{clear:both;content:"";display:table}.widget.buddypress .item-avatar a{float:right;margin-bottom:15px;margin-left:10px}.widget.buddypress div.item-avatar img{display:inline-block;height:40px;margin:1px;width:40px}.widget.buddypress .item-avatar a,.widget.buddypress .item-avatar a img,.widget.buddypress .item-avatar a:active,.widget.buddypress .item-avatar a:focus,.widget.buddypress .item-avatar a:hover{box-shadow:none}.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}.widget.buddypress .bp-login-widget-user-links>div{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}.buddypress .bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:-1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;left:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(-50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}#group-admins .bp-tooltip:after,#group-mods .bp-tooltip:after,.message-metadata .bp-tooltip:after{left:0;text-align:left;transform:translateX(0)}.feed .bp-tooltip:after,.item-list .bp-tooltip:after,.messages-notices .bp-tooltip:after{right:0;left:auto;text-align:right;transform:translateX(0)}.admin-bar-on .bp-tooltip:after,.bp-site-wide-message .bp-tooltip:after{left:50px}@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 h3,#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:right;float:right;margin-top:0;text-align:right}#buddypress li#groups-order-select{clear:right;float:right}#buddypress ul.item-list li div.action{clear:right;float:right;margin-top:0;margin-right:70px;position:relative;top:0;left:0;text-align:right}#buddypress ul.item-list li div.item-desc{clear:right;float:right;margin:10px 0 0;width:auto}#buddypress li div.item{margin-right:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-right:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:right;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:right}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-right:45px}h1 a.bp-title-button{clear:right;float:right;margin:10px 0 20px}}
bp-templates/bp-legacy/css/buddypress.css CHANGED
@@ -733,6 +733,20 @@ body.activity-permalink #buddypress div.activity-comments div.acomment-content {
733
  margin-bottom: -1em;
734
  }
735
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  /*--------------------------------------------------------------
737
  3.5 - Forms
738
  --------------------------------------------------------------*/
733
  margin-bottom: -1em;
734
  }
735
 
736
+ body.create-blog #buddypress .error {
737
+ background-color: #fdc;
738
+ border: 1px solid #a00;
739
+ color: #800;
740
+ padding: 10px 15px;
741
+ }
742
+
743
+ body.create-blog #buddypress .success {
744
+ background-color: #efc;
745
+ border: 1px solid #591;
746
+ color: #250;
747
+ padding: 10px 15px;
748
+ }
749
+
750
  /*--------------------------------------------------------------
751
  3.5 - Forms
752
  --------------------------------------------------------------*/
bp-templates/bp-legacy/css/buddypress.min.css CHANGED
@@ -1 +1 @@
1
- #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 div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:left}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:left}#buddypress form#whats-new-form #whats-new-content{margin-left:55px;padding:0 0 20px 20px}#buddypress form#whats-new-form p.activity-greeting{line-height:.5;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:1.5;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:2.2}#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{margin:0}#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 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,#sitewide-notice strong:first-child{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}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{left:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}#buddypress form fieldset{border:0;padding:0}#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:#737373;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 legend,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress label.xprofile-field-label{display:inline}#buddypress .standard-form #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form .checkbox label,#buddypress .standard-form .radio label{color:#767676;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form .checkbox label input,#buddypress .standard-form .radio label input{margin-right:3px}#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 .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}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 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 .standard-form button,#buddypress a.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 .standard-form button:hover,#buddypress a.button:focus,#buddypress a.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 h3,#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}fieldset.register-site{margin-top:1em}fieldset.create-site{margin-bottom:2em}fieldset.create-site legend{margin-bottom:1em}fieldset.create-site label{margin-right:3em}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px;word-wrap:normal!important}.bp-screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#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}#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=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled]{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#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.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-right:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p{margin:0}#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;color:#707070}#buddypress table.notification-settings{margin-bottom:20px;text-align:left}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-left:35px}#buddypress table.forum td p.topic-text{color:#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;padding:0}#buddypress span.user-nicename{color:#767676;display:inline-block;font-size:120%;font-weight:700}#sitewide-notice,.bp-site-wide-message{position:relative}#buddypress div#message p,#sitewide-notice #message{background-color:#ffd;border:1px solid #cb2;color:#440;font-weight:400;margin-top:3px;text-decoration:none}.admin-bar-on #message p,.bp-site-wide-message #message p{padding-right:25px}.admin-bar-on #message button,.bp-site-wide-message #message button{font-size:.8em;padding:2px 4px;position:absolute;right:0;top:0}.admin-bar-on #message button{right:10px;top:7px}#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:1.2;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:1.7;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:#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 h2,#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header div#item-actions a{display:inline-block}#buddypress div#item-header ul{margin-bottom:15px}#buddypress div#item-header ul:after{clear:both;content:"";display:table}#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}body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#buddypress div#item-header div#message.info{line-height:.8}#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 h3,#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:.9;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 .group-members-list{width:100%;margin-top:1em;clear:both;overflow:auto}#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-metadata:after{clear:both;content:"";display:table}#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 h2{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:#707070}#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{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;background:#f5f5f5;color:#707070}#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;background:#f5f5f5;color:#707070}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom:0}.widget.buddypress span.activity{display:inline-block;font-size:small;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 div.avatar-block:after{clear:both;content:"";display:table}.widget.buddypress .item-avatar a{float:left;margin-bottom:15px;margin-right:10px}.widget.buddypress div.item-avatar img{display:inline-block;height:40px;margin:1px;width:40px}.widget.buddypress .item-avatar a,.widget.buddypress .item-avatar a img,.widget.buddypress .item-avatar a:active,.widget.buddypress .item-avatar a:focus,.widget.buddypress .item-avatar a:hover{box-shadow:none}.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}.widget.buddypress .bp-login-widget-user-links>div{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}.buddypress .bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}#group-admins .bp-tooltip:after,#group-mods .bp-tooltip:after,.message-metadata .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.feed .bp-tooltip:after,.item-list .bp-tooltip:after,.messages-notices .bp-tooltip:after{left:0;right:auto;text-align:left;transform:translateX(0)}.admin-bar-on .bp-tooltip:after,.bp-site-wide-message .bp-tooltip:after{right:50px}@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 h3,#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:left;float:left;margin-top:0;text-align:left}#buddypress li#groups-order-select{clear:left;float:left}#buddypress ul.item-list li div.action{clear:left;float:left;margin-top:0;margin-left:70px;position:relative;top:0;right:0;text-align:left}#buddypress ul.item-list li div.item-desc{clear:left;float:left;margin:10px 0 0;width:auto}#buddypress li div.item{margin-left:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-left:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:left;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:left}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-left:45px}h1 a.bp-title-button{clear:left;float:left;margin:10px 0 20px}}
1
+ #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 div.pagination .pagination-links a:hover{font-weight:700}#buddypress noscript div.pagination{margin-bottom:15px}#buddypress #nav-above{display:none}#buddypress .paged #nav-above{display:block}#buddypress img.wp-smiley{border:none!important;clear:none!important;float:none!important;margin:0!important;padding:0!important}#buddypress .clear{clear:left}#buddypress #activity-stream{margin-top:-5px}#buddypress #activity-stream p{margin:5px 0}#buddypress #item-body form#whats-new-form{margin:0;padding:0}#buddypress .home-page form#whats-new-form{border-bottom:none;padding-bottom:0}#buddypress form#whats-new-form #whats-new-avatar{float:left}#buddypress form#whats-new-form #whats-new-content{margin-left:55px;padding:0 0 20px 20px}#buddypress form#whats-new-form p.activity-greeting{line-height:.5;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:1.5;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:2.2}#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{margin:0}#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 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,#sitewide-notice strong:first-child{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}#buddypress ul.button-nav li.current a{font-weight:700}#sitewide-notice #message{left:2%;position:fixed;top:1em;width:96%;z-index:9999}#sitewide-notice.admin-bar-on #message{top:3.3em}#sitewide-notice strong{display:block;margin-bottom:-1em}body.create-blog #buddypress .error{background-color:#fdc;border:1px solid #a00;color:#800;padding:10px 15px}body.create-blog #buddypress .success{background-color:#efc;border:1px solid #591;color:#250;padding:10px 15px}#buddypress form fieldset{border:0;padding:0}#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:#737373;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 legend,#buddypress .standard-form span.label{display:block;font-weight:700;margin:15px 0 5px;width:auto}#buddypress label.xprofile-field-label{display:inline}#buddypress .standard-form #invite-list label,#buddypress .standard-form p label{font-weight:400;margin:auto}#buddypress .standard-form .checkbox label,#buddypress .standard-form .radio label{color:#767676;font-size:100%;font-weight:400;margin:5px 0 0}#buddypress .standard-form .checkbox label input,#buddypress .standard-form .radio label input{margin-right:3px}#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 .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}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 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 .standard-form button,#buddypress a.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 .standard-form button:hover,#buddypress a.button:focus,#buddypress a.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 h3,#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}fieldset.register-site{margin-top:1em}fieldset.create-site{margin-bottom:2em}fieldset.create-site legend{margin-bottom:1em}fieldset.create-site label{margin-right:3em}.bp-screen-reader-text{clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;position:absolute!important;width:1px;word-wrap:normal!important}.bp-screen-reader-text:focus{background-color:#f1f1f1;border-radius:3px;box-shadow:0 0 2px 2px rgba(0,0,0,.6);clip:auto!important;color:#21759b;display:block;font-size:14px;font-size:.875rem;font-weight:700;height:auto;left:5px;line-height:normal;padding:15px 23px 14px;text-decoration:none;top:5px;width:auto;z-index:100000}#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}#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=button].disabled,#buddypress input[type=button].pending,#buddypress input[type=reset].disabled,#buddypress input[type=reset].pending,#buddypress input[type=submit].disabled,#buddypress input[type=submit].pending,#buddypress input[type=submit][disabled=disabled]{border-color:#eee;color:#bbb;cursor:default}#buddypress a.disabled:hover,#buddypress button.disabled:hover,#buddypress button.pending:hover,#buddypress div.pending a:hover,#buddypress input[type=button]:hover.disabled,#buddypress input[type=button]:hover.pending,#buddypress input[type=reset]:hover.disabled,#buddypress input[type=reset]:hover.pending,#buddypress input[type=submit]:hover.disabled,#buddypress input[type=submit]:hover.pending{border-color:#eee;color:#bbb}#buddypress ul#topic-post-list{margin:0;width:auto}#buddypress ul#topic-post-list li{padding:15px;position:relative}#buddypress ul#topic-post-list li.alt{background:#f5f5f5}#buddypress ul#topic-post-list li div.poster-meta{color:#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.profile-fields:last-child{margin-bottom:0}#buddypress table.profile-fields p{margin:0}#buddypress table.profile-fields p:last-child{margin-top:0}#buddypress table.forum tr td,#buddypress table.forum tr th,#buddypress table.messages-notices tr td,#buddypress table.messages-notices tr th,#buddypress table.notifications tr td,#buddypress table.notifications tr th,#buddypress table.notifications-settings tr td,#buddypress table.notifications-settings tr th,#buddypress table.profile-fields tr td,#buddypress table.profile-fields tr th,#buddypress table.profile-settings tr td,#buddypress table.wp-profile-fields tr td,#buddypress table.wp-profile-fields tr th{padding:8px;vertical-align:middle}#buddypress table.forum tr td.label,#buddypress table.messages-notices tr td.label,#buddypress table.notifications tr td.label,#buddypress table.notifications-settings tr td.label,#buddypress table.profile-fields tr td.label,#buddypress table.wp-profile-fields tr td.label{border-right:1px solid #eaeaea;font-weight:700;width:25%}#buddypress #message-threads .thread-info{min-width:40%}#buddypress table tr td.thread-info p{margin:0}#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;color:#707070}#buddypress table.notification-settings{margin-bottom:20px;text-align:left}#buddypress #groups-notification-settings{margin-bottom:0}#buddypress table.notification-settings td:first-child,#buddypress table.notification-settings th.icon,#buddypress table.notifications td:first-child,#buddypress table.notifications th.icon{display:none}#buddypress table.notification-settings th.title,#buddypress table.profile-settings th.title{width:80%}#buddypress table.notification-settings .no,#buddypress table.notification-settings .yes{text-align:center;width:40px}#buddypress table.forum{margin:0;width:auto;clear:both}#buddypress table.forum tr.sticky td{font-size:110%;background:#fff9db;border-top:1px solid #ffe8c4;border-bottom:1px solid #ffe8c4}#buddypress table.forum tr.closed td.td-title{padding-left:35px}#buddypress table.forum td p.topic-text{color:#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;padding:0}#buddypress span.user-nicename{color:#767676;display:inline-block;font-size:120%;font-weight:700}#sitewide-notice,.bp-site-wide-message{position:relative}#buddypress div#message p,#sitewide-notice #message{background-color:#ffd;border:1px solid #cb2;color:#440;font-weight:400;margin-top:3px;text-decoration:none}.admin-bar-on #message p,.bp-site-wide-message #message p{padding-right:25px}.admin-bar-on #message button,.bp-site-wide-message #message button{font-size:.8em;padding:2px 4px;position:absolute;right:0;top:0}.admin-bar-on #message button{right:10px;top:7px}#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:1.2;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:1.7;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:#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 h2,#buddypress div#item-header div#item-actions h3{margin:0 0 5px}#buddypress div#item-header div#item-actions a{display:inline-block}#buddypress div#item-header ul{margin-bottom:15px}#buddypress div#item-header ul:after{clear:both;content:"";display:table}#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}body.no-js #buddypress div#item-header .js-self-profile-button{display:none}#buddypress div#item-header div#message.info{line-height:.8}#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 h3,#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:.9;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 .group-members-list{width:100%;margin-top:1em;clear:both;overflow:auto}#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-metadata:after{clear:both;content:"";display:table}#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 h2{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:#707070}#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{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;background:#f5f5f5;color:#707070}#buddypress .tmce-active button.switch-tmce{border-bottom-color:transparent;border-bottom-left-radius:0;border-bottom-right-radius:0;background:#f5f5f5;color:#707070}#buddypress .standard-form .wp-editor-container textarea{width:100%;padding-top:0;padding-bottom:0}.widget.buddypress span.activity{display:inline-block;font-size:small;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 div.avatar-block:after{clear:both;content:"";display:table}.widget.buddypress .item-avatar a{float:left;margin-bottom:15px;margin-right:10px}.widget.buddypress div.item-avatar img{display:inline-block;height:40px;margin:1px;width:40px}.widget.buddypress .item-avatar a,.widget.buddypress .item-avatar a img,.widget.buddypress .item-avatar a:active,.widget.buddypress .item-avatar a:focus,.widget.buddypress .item-avatar a:hover{box-shadow:none}.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}.widget.buddypress .bp-login-widget-user-links>div{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}.buddypress .bp-tooltip{position:relative}.bp-tooltip:after{background:#fff;border:1px solid #aaa;border-collapse:separate;border-radius:1px;box-shadow:1px 1px 0 1px rgba(132,132,132,.3);color:#000;content:attr(data-bp-tooltip);display:none;font-family:sans-serif;font-size:11px;font-weight:400;letter-spacing:normal;line-height:1.5;margin-top:10px;max-width:240px;opacity:0;padding:3px 6px;position:absolute;right:50%;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;top:100%;transform:translateX(50%);transition:opacity 2s ease-out;white-space:pre;word-wrap:break-word;z-index:998}.bp-tooltip:active:after,.bp-tooltip:focus:after,.bp-tooltip:hover:after{display:inline-block;opacity:1;overflow:visible;text-decoration:none;z-index:999}#group-admins .bp-tooltip:after,#group-mods .bp-tooltip:after,.message-metadata .bp-tooltip:after{right:0;text-align:right;transform:translateX(0)}.feed .bp-tooltip:after,.item-list .bp-tooltip:after,.messages-notices .bp-tooltip:after{left:0;right:auto;text-align:left;transform:translateX(0)}.admin-bar-on .bp-tooltip:after,.bp-site-wide-message .bp-tooltip:after{right:50px}@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 h3,#buddypress form.standard-form .main-column ul#friend-list h4{width:100%}}@media only screen and (max-width:320px){#buddypress div.dir-search{clear:left;float:left;margin-top:0;text-align:left}#buddypress li#groups-order-select{clear:left;float:left}#buddypress ul.item-list li div.action{clear:left;float:left;margin-top:0;margin-left:70px;position:relative;top:0;right:0;text-align:left}#buddypress ul.item-list li div.item-desc{clear:left;float:left;margin:10px 0 0;width:auto}#buddypress li div.item{margin-left:70px;width:auto}#buddypress ul.item-list li div.meta{margin-top:0}#buddypress .item-desc p{margin:0 0 10px}#buddypress div.pagination .pag-count{margin-left:0}}@media only screen and (max-width:240px){#buddypress div.dir-search{float:left;margin:0}#buddypress div.dir-search input[type=text]{width:50%}#buddypress li#groups-order-select{float:left}#buddypress ul.item-list li img.avatar{width:30px;height:auto}#buddypress li div.item,#buddypress ul.item-list li div.action{margin-left:45px}h1 a.bp-title-button{clear:left;float:left;margin:10px 0 20px}}
bp-templates/bp-legacy/js/buddypress.js CHANGED
@@ -610,7 +610,7 @@ jq(document).ready( function() {
610
  ajaxdata = {
611
  action: 'new_activity_comment',
612
  'cookie': bp_get_cookies(),
613
- '_wpnonce_new_activity_comment': jq('#_wpnonce_new_activity_comment').val(),
614
  'comment_id': comment_id,
615
  'form_id': form_id[2],
616
  'content': content.val()
610
  ajaxdata = {
611
  action: 'new_activity_comment',
612
  'cookie': bp_get_cookies(),
613
+ '_wpnonce_new_activity_comment': jq('#_wpnonce_new_activity_comment' + '_' + form_id[2] ).val(),
614
  'comment_id': comment_id,
615
  'form_id': form_id[2],
616
  'content': content.val()
bp-templates/bp-legacy/js/buddypress.min.js CHANGED
@@ -1 +1 @@
1
- function bp_get_directory_preference(e,t){var i={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var a={};for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s]);directoryPreferences[e]=a}return BP_DTheme.store_filter_settings&&(directoryPreferences[e][t]=jq.cookie("bp-"+e+"-"+t)),directoryPreferences[e][t]}function bp_set_directory_preference(e,t,i){var a={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var s={};for(var r in a)a.hasOwnProperty(r)&&(s[r]=a[r]);directoryPreferences[e]=s}BP_DTheme.store_filter_settings&&jq.cookie("bp-"+e+"-"+t,i,{path:"/",secure:"https:"===window.location.protocol}),directoryPreferences[e][t]=i}function bp_init_activity(){var e=bp_get_directory_preference("activity","scope"),t=bp_get_directory_preference("activity","filter");void 0!==t&&jq("#activity-filter-select").length&&jq('#activity-filter-select select option[value="'+t+'"]').prop("selected",!0),void 0!==e&&jq(".activity-type-tabs").length&&(jq(".activity-type-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#activity-"+e+", .item-list-tabs li.current").addClass("selected"))}function bp_init_objects(e){jq(e).each(function(t){var i=bp_get_directory_preference(e[t],"scope"),a=bp_get_directory_preference(e[t],"filter");void 0!==a&&jq("#"+e[t]+"-order-select select").length&&jq("#"+e[t]+'-order-select select option[value="'+a+'"]').prop("selected",!0),void 0!==i&&jq("div."+e[t]).length&&(jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+e[t]+"-"+i+", #object-nav li.current").addClass("selected"))})}function bp_filter_request(e,t,i,a,s,r,n,o,c){if("activity"===e)return!1;null===i&&(i="all"),bp_set_directory_preference(e,"scope",i),bp_set_directory_preference(e,"filter",t),bp_set_directory_preference(e,"extras",n),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+e+"-"+i+", #object-nav li.current").addClass("selected"),jq(".item-list-tabs li.selected").addClass("loading"),jq('.item-list-tabs select option[value="'+t+'"]').prop("selected",!0),"friends"!==e&&"group_members"!==e||(e="members"),bp_ajax_request&&bp_ajax_request.abort();var l={};l["bp-"+e+"-filter"]=bp_get_directory_preference(e,"filter"),l["bp-"+e+"-scope"]=bp_get_directory_preference(e,"scope");var d=encodeURIComponent(jq.param(l));bp_ajax_request=jq.post(ajaxurl,{action:e+"_filter",cookie:d,object:e,filter:t,search_terms:s,scope:i,page:r,extras:n,template:c},function(e){if("pag-bottom"===o&&jq("#subnav").length){var t=jq("#subnav").parent();jq("html,body").animate({scrollTop:t.offset().top},"slow",function(){jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100)})})}else jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100)});jq(".item-list-tabs li.selected").removeClass("loading")})}function bp_activity_request(e,t){bp_set_directory_preference("activity","scope",e),bp_set_directory_preference("activity","filter",t),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected loading")}),jq("#activity-"+e+", .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="'+t+'"]').prop("selected",!0),jq(".widget_bp_activity_widget h2 span.ajax-loader").show(),bp_ajax_request&&bp_ajax_request.abort();var i={"bp-activity-filter":bp_get_directory_preference("activity","filter"),"bp-activity-scope":bp_get_directory_preference("activity","scope")},a=encodeURIComponent(jq.param(i));bp_ajax_request=jq.post(ajaxurl,{action:"activity_widget_filter",cookie:a,_wpnonce_activity_filter:jq("#_wpnonce_activity_filter").val(),scope:e,filter:t},function(e){jq(".widget_bp_activity_widget h2 span.ajax-loader").hide(),jq("div.activity").fadeOut(100,function(){jq(this).html(e.contents),jq(this).fadeIn(100),bp_legacy_theme_hide_comments()}),void 0!==e.feed_url&&jq(".directory #subnav li.feed a, .home-page #subnav li.feed a").attr("href",e.feed_url),jq(".item-list-tabs li.selected").removeClass("loading")},"json")}function bp_legacy_theme_hide_comments(){var e,t,i,a=jq("div.activity-comments");if(!a.length)return!1;a.each(function(){jq(this).children("ul").children("li").length<5||(comments_div=jq(this),e=comments_div.parents("#activity-stream > li"),t=jq(this).children("ul").children("li"),i=" ",jq("#"+e.attr("id")+" li").length&&(i=jq("#"+e.attr("id")+" li").length),t.each(function(a){a<t.length-5&&(jq(this).hide(),a||jq(this).before('<li class="show-all"><a href="#'+e.attr("id")+'/show-all/">'+BP_DTheme.show_x_comments.replace("%d",i)+"</a></li>"))}))})}function checkAll(){var e,t=document.getElementsByTagName("input");for(e=0;e<t.length;e++)"checkbox"===t[e].type&&(""===$("check_all").checked?t[e].checked="":t[e].checked="checked")}function clear(e){if(e=document.getElementById(e)){var t=e.getElementsByTagName("INPUT"),i=e.getElementsByTagName("OPTION"),a=0;if(t)for(a=0;a<t.length;a++)t[a].checked="";if(i)for(a=0;a<i.length;a++)i[a].selected=!1}}function bp_get_cookies(){var e,t,i,a,s,r=document.cookie.split(";"),n={};for(e=0;e<r.length;e++)i=(t=r[e]).indexOf("="),a=jq.trim(unescape(t.slice(0,i))),s=unescape(t.slice(i+1)),0===a.indexOf("bp-")&&(n[a]=s);return encodeURIComponent(jq.param(n))}function bp_get_query_var(e,t){var i={};return(t=void 0===t?location.search.substr(1).split("&"):t.split("?")[1].split("&")).forEach(function(e){i[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}),!(!i.hasOwnProperty(e)||null==i[e])&&i[e]}var jq=jQuery,bp_ajax_request=null,newest_activities="",activity_last_recorded=0,directoryPreferences={};jq(document).ready(function(){var e=1;bp_init_activity();var t=["members","groups","blogs","group_members"],i=jq("#whats-new");if(bp_init_objects(t),i.length&&bp_get_querystring("r")){var a=i.val();jq("#whats-new-options").slideDown(),i.animate({height:"3.8em"}),jq.scrollTo(i,500,{offset:-125,easing:"swing"}),i.val("").focus().val(a)}else jq("#whats-new-options").hide();if(i.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 e=jq("form#whats-new-form"),t=jq("#activity-all");e.hasClass("submitted")&&e.removeClass("submitted"),t.length&&(t.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"),t.children("a").trigger("click")))}),jq("#whats-new-form").on("focusout",function(e){var t=jq(this);setTimeout(function(){if(!t.find(":hover").length){if(""!==i.val())return;i.animate({height:"2.2em"}),jq("#whats-new-options").slideUp(),jq("#aw-whats-new-submit").prop("disabled",!0),jq("#whats-new-content").removeClass("active"),i.parent().removeClass("active")}},0)}),jq("#aw-whats-new-submit").on("click",function(){var e,t=0,i=jq(this),a=i.closest("form#whats-new-form"),s={};return jq.each(a.serializeArray(),function(e,t){"_"!==t.name.substr(0,1)&&"whats-new"!==t.name.substr(0,9)&&(s[t.name]?jq.isArray(s[t.name])?s[t.name].push(t.value):s[t.name]=new Array(s[t.name],t.value):s[t.name]=t.value)}),a.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),i.addClass("loading"),i.prop("disabled",!0),a.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&&(t=timestamp[1]),item_id>0&&(object=jq("#whats-new-post-object").val()),e=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:t,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},s),jq.post(ajaxurl,e,function(e){if(a.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),e[0]+e[1]==="-1")a.prepend(e.substr(2,e.length)),jq("#"+a.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(e),t||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length){var i=jq("#activity-stream li.new-update .activity-content .activity-inner p").html(),s=jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr("href"),r="";""!==jq("#activity-stream li.new-update .activity-content .activity-inner p").text()&&(r=i+" "),r+='<a href="'+s+'" rel="nofollow">'+BP_DTheme.view+"</a>",jq("#latest-update").slideUp(300,function(){jq("#latest-update").html(r),jq("#latest-update").slideDown(300)})}jq("li.new-update").hide().slideDown(300),jq("li.new-update").removeClass("new-update"),jq("#whats-new").val(""),a.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(e){var t,i,a=jq(e.target).parent();if("STRONG"===e.target.nodeName||"SPAN"===e.target.nodeName)a=a.parent();else if("A"!==e.target.nodeName)return!1;return t=a.attr("id").substr(9,a.attr("id").length),i=jq("#activity-filter-select select").val(),"mentions"===t&&jq("#"+a.attr("id")+" a strong").remove(),bp_activity_request(t,i),!1}),jq("#activity-filter-select select").change(function(){var e,t=jq("div.activity-type-tabs li.selected"),i=jq(this).val();return e=t.length?t.attr("id").substr(9,t.attr("id").length):null,bp_activity_request(e,i),!1}),jq("div.activity").on("click",function(t){var i,a,s,r,n,o,c,l,d,p,u=jq(t.target);return u.hasClass("fav")||u.hasClass("unfav")?!u.hasClass("loading")&&(i=u.hasClass("fav")?"fav":"unfav",a=u.closest(".activity-item"),s=a.attr("id").substr(9,a.attr("id").length),c=bp_get_query_var("_wpnonce",u.attr("href")),u.addClass("loading"),jq.post(ajaxurl,{action:"activity_mark_"+i,cookie:bp_get_cookies(),id:s,nonce:c},function(e){u.removeClass("loading"),u.fadeOut(200,function(){jq(this).html(e),jq(this).attr("title","fav"===i?BP_DTheme.remove_fav:BP_DTheme.mark_as_fav),jq(this).fadeIn(200)}),"fav"===i?(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)),u.removeClass("fav"),u.addClass("unfav")):(u.removeClass("unfav"),u.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")&&u.closest(".activity-item").slideUp(100)}),!1):u.hasClass("delete-activity")?(r=u.parents("div.activity ul li"),n=r.attr("id").substr(9,r.attr("id").length),o=u.attr("href"),c=o.split("_wpnonce="),l=r.prop("class").match(/date-recorded-([0-9]+)/),c=c[1],u.addClass("loading"),jq.post(ajaxurl,{action:"delete_activity",cookie:bp_get_cookies(),id:n,_wpnonce:c},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.hasClass("spam-activity")?(r=u.parents("div.activity ul li"),l=r.prop("class").match(/date-recorded-([0-9]+)/),u.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:r.attr("id").substr(9,r.attr("id").length),_wpnonce:u.attr("href").split("_wpnonce=")[1]},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.parent().hasClass("load-more")?(bp_ajax_request&&bp_ajax_request.abort(),jq("#buddypress li.load-more").addClass("loading"),d=e+1,p=[],jq(".activity-list li.just-posted").each(function(){p.push(jq(this).attr("id").replace("activity-",""))}),load_more_args={action:"activity_get_older_updates",cookie:bp_get_cookies(),page:d,exclude_just_posted:p.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(t){jq("#buddypress li.load-more").removeClass("loading"),e=d,jq("#buddypress ul.activity-list").append(t.contents),u.parent().hide()},"json"),!1):void(u.parent().hasClass("load-newest")&&(t.preventDefault(),u.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(e,t){"LI"===t.nodeName&&jq(t).hasClass("just-posted")&&jq("#"+jq(t).attr("id")).length&&jq("#"+jq(t).attr("id")).remove()}),jq("#buddypress ul.activity-list").prepend(newest_activities),newest_activities=""))}),jq("div.activity").on("click",".activity-read-more a",function(e){var t,i,a=jq(e.target),s=a.parent().attr("id").split("-"),r=s[3],n=s[0];return t="acomment"===n?"acomment-content":"activity-inner",i=jq("#"+n+"-"+r+" ."+t+":first"),jq(a).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:r},function(e){jq(i).slideUp(300).html(e).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(e){var t,i,a,s,r,n,o,c,l,d,p,u,m,h,_,v=jq(e.target);return v.hasClass("acomment-reply")||v.parent().hasClass("acomment-reply")?(v.parent().hasClass("acomment-reply")&&(v=v.parent()),t=v.attr("id"),i=t.split("-"),a=i[2],s=v.attr("href").substr(10,v.attr("href").length),(r=jq("#ac-form-"+a)).css("display","none"),r.removeClass("root"),jq(".ac-form").hide(),r.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),"comment"!==i[1]?jq("#acomment-"+s).append(r):jq("#activity-"+a+" .activity-comments").append(r),r.parent().hasClass("activity-comments")&&r.addClass("root"),r.slideDown(200),jq.scrollTo(r,500,{offset:-100,easing:"swing"}),jq("#ac-form-"+i[2]+" textarea").focus(),!1):"ac_form_submit"===v.attr("name")?(r=v.parents("form"),n=r.parent(),o=r.attr("id").split("-"),c=n.hasClass("activity-comments")?o[2]:n.attr("id").split("-")[1],content=jq("#"+r.attr("id")+" textarea"),jq("#"+r.attr("id")+" div.error").hide(),v.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),l={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment").val(),comment_id:c,form_id:o[2],content:content.val()},(d=jq("#_bp_as_nonce_"+c).val())&&(l["_bp_as_nonce_"+c]=d),jq.post(ajaxurl,l,function(e){if(v.removeClass("loading"),content.removeClass("loading"),e[0]+e[1]==="-1")r.append(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t=r.parent();r.fadeOut(200,function(){0===t.children("ul").length&&(t.hasClass("activity-comments")?t.prepend("<ul></ul>"):t.append("<ul></ul>"));var i=jq.trim(e);t.children("ul").append(jq(i).hide().fadeIn(200)),r.children("textarea").val(""),t.parent().addClass("has-comments")}),jq("#"+r.attr("id")+" textarea").val(""),u=Number(jq("#activity-"+o[2]+" a.acomment-reply span").html())+1,jq("#activity-"+o[2]+" a.acomment-reply span").html(u),(p=t.parents(".activity-comments").find(".show-all a"))&&p.html(BP_DTheme.show_x_comments.replace("%d",u))}jq(v).prop("disabled",!1),jq(content).prop("disabled",!1)}),!1):v.hasClass("acomment-delete")?(m=v.attr("href"),h=v.parent().parent(),r=h.parents("div.activity-comments").children("form"),_=m.split("_wpnonce="),_=_[1],c=m.split("cid="),c=c[1].split("&"),c=c[0],v.addClass("loading"),jq(".activity-comments ul .error").remove(),h.parents(".activity-comments").append(r),jq.post(ajaxurl,{action:"delete_activity_comment",cookie:bp_get_cookies(),_wpnonce:_,id:c},function(e){if(e[0]+e[1]==="-1")h.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t,i,a,s=jq("#"+h.attr("id")+" ul").children("li"),r=0;jq(s).each(function(){jq(this).is(":hidden")||r++}),h.fadeOut(200,function(){h.remove()}),i=(t=jq("#"+h.parents("#activity-stream > li").attr("id")+" a.acomment-reply span")).html()-(1+r),t.html(i),(a=h.parents(".activity-comments").find(".show-all a"))&&a.html(BP_DTheme.show_x_comments.replace("%d",i)),0===i&&jq(h.parents("#activity-stream > li")).removeClass("has-comments")}}),!1):v.hasClass("spam-activity-comment")?(m=v.attr("href"),h=v.parent().parent(),v.addClass("loading"),jq(".activity-comments ul div.error").remove(),h.parents(".activity-comments").append(h.parents(".activity-comments").children("form")),jq.post(ajaxurl,{action:"bp_spam_activity_comment",cookie:encodeURIComponent(document.cookie),_wpnonce:m.split("_wpnonce=")[1],id:m.split("cid=")[1].split("&")[0]},function(e){if(e[0]+e[1]==="-1")h.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t,i=jq("#"+h.attr("id")+" ul").children("li"),a=0;jq(i).each(function(){jq(this).is(":hidden")||a++}),h.fadeOut(200),t=h.parents("#activity-stream > li"),jq("#"+t.attr("id")+" a.acomment-reply span").html(jq("#"+t.attr("id")+" a.acomment-reply span").html()-(1+a))}}),!1):v.parent().hasClass("show-all")?(v.parent().addClass("loading"),setTimeout(function(){v.parent().parent().children("li").fadeIn(200,function(){v.parent().remove()})},600),!1):v.hasClass("ac-reply-cancel")?(jq(v).closest(".ac-form").slideUp(200),!1):void 0}),jq(document).keydown(function(e){(e=e||window.event).target?element=e.target:e.srcElement&&(element=e.srcElement),3===element.nodeType&&(element=element.parentNode),!0!==e.ctrlKey&&!0!==e.altKey&&!0!==e.metaKey&&27===(e.keyCode?e.keyCode:e.which)&&"TEXTAREA"===element.tagName&&jq(element).hasClass("ac-input")&&jq(element).parent().parent().parent().slideUp(200)}),jq(".dir-search, .groups-members-search").on("click",function(e){if(!jq(this).hasClass("no-ajax")){var t,i,a,s=jq(e.target);if("submit"===s.attr("type")){t=jq(".item-list-tabs li.selected").attr("id").split("-")[0],i=null,a=s.parent().find("#"+t+"_search").val(),"groups-members-search"===e.currentTarget.className&&(t="group_members",i="groups/single/members");var r=bp_get_directory_preference(t,"scope");return bp_filter_request(t,bp_get_directory_preference(t,"filter"),r,"div."+t,a,1,bp_get_directory_preference(t,"extras"),null,i),!1}}}),jq("div.item-list-tabs").on("click",function(e){if(jq("body").hasClass("type")&&jq("body").hasClass("directory")&&jq(this).addClass("no-ajax"),!jq(this).hasClass("no-ajax")&&!jq(e.target).hasClass("no-ajax")){var t,i,a,s="SPAN"===e.target.nodeName?e.target.parentNode:e.target,r=jq(s).parent();return"LI"!==r[0].nodeName||r.hasClass("last")?void 0:(t=r.attr("id").split("-"),"activity"!==(i=t[0])&&(a=t[1],bp_filter_request(i,jq("#"+i+"-order-select select").val(),a,"div."+i,jq("#"+i+"_search").val(),1,bp_get_directory_preference(i,"extras")),!1))}}),jq("li.filter select").change(function(){var e,t,i,a,s,r,n;return t=(e=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":this).attr("id").split("-"))[0],i=e[1],a=jq(this).val(),s=!1,r=null,jq(".dir-search input").length&&(s=jq(".dir-search input").val()),(n=jq(".groups-members-search input")).length&&(s=n.val(),t="members",i="groups"),"members"===t&&"groups"===i&&(t="group_members",r="groups/single/members"),"friends"===t&&(t="members"),bp_filter_request(t,a,i,"div."+t,s,1,bp_get_directory_preference(t,"extras"),null,r),!1}),jq("#buddypress").on("click",function(e){var t,i,a,s,r,n,o,c,l=jq(e.target);if(l.hasClass("button"))return!0;if(l.parent().parent().hasClass("pagination")&&!l.parent().parent().hasClass("no-ajax")){if(l.hasClass("dots")||l.hasClass("current"))return!1;i=(t=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":"li.filter select").attr("id").split("-"))[0],a=!1,s=jq(l).closest(".pagination-links").attr("id"),r=null,jq("div.dir-search input").length&&(a=!(a=jq(".dir-search input")).val()&&bp_get_querystring(a.attr("name"))?jq(".dir-search input").prop("placeholder"):a.val()),n=jq(l).hasClass("next")||jq(l).hasClass("prev")?jq(".pagination span.current").html():jq(l).html(),n=Number(n.replace(/\D/g,"")),jq(l).hasClass("next")?n++:jq(l).hasClass("prev")&&n--,(o=jq(".groups-members-search input")).length&&(a=o.val(),i="members"),"members"===i&&"groups"===t[1]&&(i="group_members",r="groups/single/members"),"admin"===i&&jq("body").hasClass("membership-requests")&&(i="requests"),c=-1!==s.indexOf("pag-bottom")?"pag-bottom":null;var d=bp_get_directory_preference(i,"scope");return bp_filter_request(i,bp_get_directory_preference(i,"filter"),d,"div."+i,a,n,bp_get_directory_preference(i,"extras"),c,r),!1}}),jq("#send-invite-form").on("click","#invite-list input",function(){var e,t,i=jq("#send-invite-form > .invite").length;jq(".ajax-loader").toggle(),i&&jq(this).parents("ul").find("input").prop("disabled",!0),e=jq(this).val(),t=!0===jq(this).prop("checked")?"invite":"uninvite",i||jq(".item-list-tabs li.selected").addClass("loading"),jq.post(ajaxurl,{action:"groups_invite_user",friend_action:t,cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:e,group_id:jq("#group_id").val()},function(a){jq("#message")&&jq("#message").hide(),i?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),"invite"===t?jq("#friend-list").append(a):"uninvite"===t&&jq("#friend-list li#uid-"+e).remove(),jq(".item-list-tabs li.selected").removeClass("loading"))})}),jq("#send-invite-form").on("click","a.remove",function(){var e=jq("#send-invite-form > .invite").length,t=jq(this).attr("id");return jq(".ajax-loader").toggle(),t=t.split("-"),t=t[1],jq.post(ajaxurl,{action:"groups_invite_user",friend_action:"uninvite",cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:t,group_id:jq("#group_id").val()},function(i){e?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),jq("#friend-list #uid-"+t).remove(),jq("#invite-list #f-"+t).prop("checked",!1))}),!1}),jq(".visibility-toggle-link").on("click",function(e){e.preventDefault(),jq(this).attr("aria-expanded","true").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(e){e.preventDefault(),jq(".visibility-toggle-link").attr("aria-expanded","false");var t=jq(this).parent(),i=t.find("input:checked").parent().text();t.hide().removeClass("field-visibility-settings-open").siblings(".field-visibility-settings-toggle").find(".current-visibility-level").text(i).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 e=!0;jq("#profile-edit-form input:submit, #signup_form input:submit").on("click",function(){e=!1}),window.onbeforeunload=function(t){if(e)return BP_DTheme.unsaved_changes}}),jq("#friend-list a.accept, #friend-list a.reject").on("click",function(){var e,t=jq(this),i=jq(this).parents("#friend-list li"),a=jq(this).parents("li div.action"),s=i.attr("id").substr(11,i.attr("id").length),r=t.attr("href").split("_wpnonce=")[1];return!jq(this).hasClass("accepted")&&!jq(this).hasClass("rejected")&&(jq(this).hasClass("accept")?(e="accept_friendship",a.children("a.reject").css("visibility","hidden")):(e="reject_friendship",a.children("a.accept").css("visibility","hidden")),t.addClass("loading"),jq.post(ajaxurl,{action:e,cookie:bp_get_cookies(),id:s,_wpnonce:r},function(e){t.removeClass("loading"),e[0]+e[1]==="-1"?(i.prepend(e.substr(2,e.length)),i.children("#message").hide().fadeIn(200)):t.fadeOut(100,function(){jq(this).hasClass("accept")?(a.children("a.reject").hide(),jq(this).html(BP_DTheme.accepted).contents().unwrap()):(a.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 e=jq(this).attr("id"),t=jq(this).attr("href"),i=jq(this);return e=e.split("-"),e=e[1],t=t.split("?_wpnonce="),t=t[1].split("&"),t=t[0],jq.post(ajaxurl,{action:"addremove_friend",cookie:bp_get_cookies(),fid:e,_wpnonce:t},function(e){var t=i.attr("rel");parentdiv=i.parent(),"add"===t?jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("add_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("pending_friend"),parentdiv.fadeIn(200).html(e)}):"remove"===t&&jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("remove_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("add"),parentdiv.fadeIn(200).html(e)})}),!1}),jq("#buddypress").on("click",".group-button .leave-group",function(){if(!1===confirm(BP_DTheme.leave_group_confirm))return!1}),jq("#groups-dir-list").on("click",".group-button a",function(){var e=jq(this).parent().attr("id"),t=jq(this).attr("href"),i=jq(this);return e=e.split("-"),e=e[1],t=t.split("?_wpnonce="),t=t[1].split("&"),t=t[0],(!i.hasClass("leave-group")||!1!==confirm(BP_DTheme.leave_group_confirm))&&(jq.post(ajaxurl,{action:"joinleave_group",cookie:bp_get_cookies(),gid:e,_wpnonce:t},function(e){var t=i.parent();jq("body.directory").length?jq(t).fadeOut(200,function(){t.fadeIn(200).html(e);var a=jq("#groups-personal span"),s=1;i.hasClass("leave-group")?(t.hasClass("hidden")&&t.closest("li").slideUp(200),s=0):i.hasClass("request-membership")&&(s=!1),a.length&&!1!==s&&(s?a.text(1+(a.text()>>0)):a.text((a.text()>>0)-1))}):window.location.reload()}),!1)}),jq("#groups-list li.hidden").each(function(){"none"===jq(this).css("display")&&jq(this).css("cssText","display: list-item !important")}),jq("#buddypress").on("click",".pending",function(){return!1}),jq("body").hasClass("register")){var s=jq("#signup_with_blog");s.prop("checked")||jq("#blog-details").toggle(),s.change(function(){jq("#blog-details").toggle()})}jq(".message-search").on("click",function(e){if(!jq(this).hasClass("no-ajax")){var t,i=jq(e.target);if("submit"===i.attr("type")||"button"===i.attr("type")){var a=bp_get_directory_preference(t="messages","scope"),s=bp_get_directory_preference(t,"filter"),r=bp_get_directory_preference(t,"extras");return bp_filter_request(t,s,a,"div."+t,jq("#messages_search").val(),1,r),!1}}}),jq("#send_reply_button").click(function(){var e=jq("#messages_order").val()||"ASC",t=jq("#message-recipients").offset(),i=jq("#send_reply_button");return jq(i).addClass("loading").prop("disabled",!0),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(a){a[0]+a[1]==="-1"?jq("#send-reply").prepend(a.substr(2,a.length)):(jq("#send-reply #message").remove(),jq("#message_content").val(""),"ASC"===e?jq("#send-reply").before(a):(jq("#message-recipients").after(a),jq(window).scrollTop(t.top)),jq(".new-message").hide().slideDown(200,function(){jq(".new-message").removeClass("new-message")})),jq(i).removeClass("loading").prop("disabled",!1)}),!1}),jq("body.messages #item-body div.messages").on("change","#message-type-select",function(){var e=this.value,t=jq('td input[type="checkbox"]'),i="checked";switch(t.each(function(e){t[e].checked=""}),e){case"unread":t=jq('tr.unread td input[type="checkbox"]');break;case"read":t=jq('tr.read td input[type="checkbox"]');break;case"":i=""}t.each(function(e){t[e].checked=i})}),jq("#select-all-messages").click(function(e){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 e=jq(this);return jq.post(ajaxurl,{action:"messages_star",message_id:e.data("message-id"),star_status:e.data("star-status"),nonce:e.data("star-nonce"),bulk:e.data("star-bulk")},function(t){1===parseInt(t,10)&&("unstar"===e.data("star-status")?(e.data("star-status","star"),e.removeClass("message-action-unstar").addClass("message-action-star"),e.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_star),1===BP_PM_Star.is_single_thread?e.attr("data-bp-tooltip",BP_PM_Star.strings.title_star):e.attr("data-bp-tooltip",BP_PM_Star.strings.title_star_thread)):(e.data("star-status","unstar"),e.removeClass("message-action-star").addClass("message-action-unstar"),e.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_unstar),1===BP_PM_Star.is_single_thread?e.attr("data-bp-tooltip",BP_PM_Star.strings.title_unstar):e.attr("data-bp-tooltip",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 e=jq(this),t=e.closest("tr").find(".thread-star a");e.prop("checked")?"unstar"===t.data("star-status")?BP_PM_Star.star_counter++:BP_PM_Star.unstar_counter++:"unstar"===t.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(e){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),nonce:jq("#close-notice-nonce").val()},function(e){jq("#close-notice").removeClass("loading"),e[0]+e[1]==="-1"?(jq(".notice").prepend(e.substr(2,e.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:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-oldestpage",{path:"/",secure:"https:"===window.location.protocol});var e=["members","groups","blogs","forums"];jq(e).each(function(t){jq.removeCookie("bp-"+e[t]+"-scope",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+e[t]+"-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+e[t]+"-extras",{path:"/",secure:"https:"===window.location.protocol})})}),jq("body").hasClass("no-js")&&jq("body").attr("class",jq("body").attr("class").replace(/no-js/,"js")),"undefined"!=typeof wp&&void 0!==wp.heartbeat&&void 0!==BP_DTheme.pulse&&(wp.heartbeat.interval(Number(BP_DTheme.pulse)),jq.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send.buddypress")}}));var r=0;jq(document).on("heartbeat-send.buddypress",function(e,t){r=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&&(r=timestamp[1])),(0===activity_last_recorded||Number(r)>activity_last_recorded)&&(activity_last_recorded=Number(r)),t.bp_activity_last_recorded=activity_last_recorded,last_recorded_search=bp_get_querystring("s"),last_recorded_search&&(t.bp_activity_last_recorded_search_terms=last_recorded_search)}),jq(document).on("heartbeat-tick",function(e,t){t.bp_activity_newest_activities&&(newest_activities=t.bp_activity_newest_activities.activities+newest_activities,activity_last_recorded=Number(t.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>"))})});
1
+ function bp_get_directory_preference(e,t){var i={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var a={};for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s]);directoryPreferences[e]=a}return BP_DTheme.store_filter_settings&&(directoryPreferences[e][t]=jq.cookie("bp-"+e+"-"+t)),directoryPreferences[e][t]}function bp_set_directory_preference(e,t,i){var a={filter:"",scope:"",extras:""};if(!directoryPreferences.hasOwnProperty(e)){var s={};for(var r in a)a.hasOwnProperty(r)&&(s[r]=a[r]);directoryPreferences[e]=s}BP_DTheme.store_filter_settings&&jq.cookie("bp-"+e+"-"+t,i,{path:"/",secure:"https:"===window.location.protocol}),directoryPreferences[e][t]=i}function bp_init_activity(){var e=bp_get_directory_preference("activity","scope"),t=bp_get_directory_preference("activity","filter");void 0!==t&&jq("#activity-filter-select").length&&jq('#activity-filter-select select option[value="'+t+'"]').prop("selected",!0),void 0!==e&&jq(".activity-type-tabs").length&&(jq(".activity-type-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#activity-"+e+", .item-list-tabs li.current").addClass("selected"))}function bp_init_objects(e){jq(e).each(function(t){var i=bp_get_directory_preference(e[t],"scope"),a=bp_get_directory_preference(e[t],"filter");void 0!==a&&jq("#"+e[t]+"-order-select select").length&&jq("#"+e[t]+'-order-select select option[value="'+a+'"]').prop("selected",!0),void 0!==i&&jq("div."+e[t]).length&&(jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+e[t]+"-"+i+", #object-nav li.current").addClass("selected"))})}function bp_filter_request(e,t,i,a,s,r,n,o,c){if("activity"===e)return!1;null===i&&(i="all"),bp_set_directory_preference(e,"scope",i),bp_set_directory_preference(e,"filter",t),bp_set_directory_preference(e,"extras",n),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected")}),jq("#"+e+"-"+i+", #object-nav li.current").addClass("selected"),jq(".item-list-tabs li.selected").addClass("loading"),jq('.item-list-tabs select option[value="'+t+'"]').prop("selected",!0),"friends"!==e&&"group_members"!==e||(e="members"),bp_ajax_request&&bp_ajax_request.abort();var l={};l["bp-"+e+"-filter"]=bp_get_directory_preference(e,"filter"),l["bp-"+e+"-scope"]=bp_get_directory_preference(e,"scope");var d=encodeURIComponent(jq.param(l));bp_ajax_request=jq.post(ajaxurl,{action:e+"_filter",cookie:d,object:e,filter:t,search_terms:s,scope:i,page:r,extras:n,template:c},function(e){if("pag-bottom"===o&&jq("#subnav").length){var t=jq("#subnav").parent();jq("html,body").animate({scrollTop:t.offset().top},"slow",function(){jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100)})})}else jq(a).fadeOut(100,function(){jq(this).html(e),jq(this).fadeIn(100)});jq(".item-list-tabs li.selected").removeClass("loading")})}function bp_activity_request(e,t){bp_set_directory_preference("activity","scope",e),bp_set_directory_preference("activity","filter",t),jq(".item-list-tabs li").each(function(){jq(this).removeClass("selected loading")}),jq("#activity-"+e+", .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="'+t+'"]').prop("selected",!0),jq(".widget_bp_activity_widget h2 span.ajax-loader").show(),bp_ajax_request&&bp_ajax_request.abort();var i={"bp-activity-filter":bp_get_directory_preference("activity","filter"),"bp-activity-scope":bp_get_directory_preference("activity","scope")},a=encodeURIComponent(jq.param(i));bp_ajax_request=jq.post(ajaxurl,{action:"activity_widget_filter",cookie:a,_wpnonce_activity_filter:jq("#_wpnonce_activity_filter").val(),scope:e,filter:t},function(e){jq(".widget_bp_activity_widget h2 span.ajax-loader").hide(),jq("div.activity").fadeOut(100,function(){jq(this).html(e.contents),jq(this).fadeIn(100),bp_legacy_theme_hide_comments()}),void 0!==e.feed_url&&jq(".directory #subnav li.feed a, .home-page #subnav li.feed a").attr("href",e.feed_url),jq(".item-list-tabs li.selected").removeClass("loading")},"json")}function bp_legacy_theme_hide_comments(){var e,t,i,a=jq("div.activity-comments");if(!a.length)return!1;a.each(function(){jq(this).children("ul").children("li").length<5||(comments_div=jq(this),e=comments_div.parents("#activity-stream > li"),t=jq(this).children("ul").children("li"),i=" ",jq("#"+e.attr("id")+" li").length&&(i=jq("#"+e.attr("id")+" li").length),t.each(function(a){a<t.length-5&&(jq(this).hide(),a||jq(this).before('<li class="show-all"><a href="#'+e.attr("id")+'/show-all/">'+BP_DTheme.show_x_comments.replace("%d",i)+"</a></li>"))}))})}function checkAll(){var e,t=document.getElementsByTagName("input");for(e=0;e<t.length;e++)"checkbox"===t[e].type&&(""===$("check_all").checked?t[e].checked="":t[e].checked="checked")}function clear(e){if(e=document.getElementById(e)){var t=e.getElementsByTagName("INPUT"),i=e.getElementsByTagName("OPTION"),a=0;if(t)for(a=0;a<t.length;a++)t[a].checked="";if(i)for(a=0;a<i.length;a++)i[a].selected=!1}}function bp_get_cookies(){var e,t,i,a,s,r=document.cookie.split(";"),n={};for(e=0;e<r.length;e++)i=(t=r[e]).indexOf("="),a=jq.trim(unescape(t.slice(0,i))),s=unescape(t.slice(i+1)),0===a.indexOf("bp-")&&(n[a]=s);return encodeURIComponent(jq.param(n))}function bp_get_query_var(e,t){var i={};return(t=void 0===t?location.search.substr(1).split("&"):t.split("?")[1].split("&")).forEach(function(e){i[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}),!(!i.hasOwnProperty(e)||null==i[e])&&i[e]}var jq=jQuery,bp_ajax_request=null,newest_activities="",activity_last_recorded=0,directoryPreferences={};jq(document).ready(function(){var e=1;bp_init_activity();var t=["members","groups","blogs","group_members"],i=jq("#whats-new");if(bp_init_objects(t),i.length&&bp_get_querystring("r")){var a=i.val();jq("#whats-new-options").slideDown(),i.animate({height:"3.8em"}),jq.scrollTo(i,500,{offset:-125,easing:"swing"}),i.val("").focus().val(a)}else jq("#whats-new-options").hide();if(i.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 e=jq("form#whats-new-form"),t=jq("#activity-all");e.hasClass("submitted")&&e.removeClass("submitted"),t.length&&(t.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"),t.children("a").trigger("click")))}),jq("#whats-new-form").on("focusout",function(e){var t=jq(this);setTimeout(function(){if(!t.find(":hover").length){if(""!==i.val())return;i.animate({height:"2.2em"}),jq("#whats-new-options").slideUp(),jq("#aw-whats-new-submit").prop("disabled",!0),jq("#whats-new-content").removeClass("active"),i.parent().removeClass("active")}},0)}),jq("#aw-whats-new-submit").on("click",function(){var e,t=0,i=jq(this),a=i.closest("form#whats-new-form"),s={};return jq.each(a.serializeArray(),function(e,t){"_"!==t.name.substr(0,1)&&"whats-new"!==t.name.substr(0,9)&&(s[t.name]?jq.isArray(s[t.name])?s[t.name].push(t.value):s[t.name]=new Array(s[t.name],t.value):s[t.name]=t.value)}),a.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!0)}),jq("div.error").remove(),i.addClass("loading"),i.prop("disabled",!0),a.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&&(t=timestamp[1]),item_id>0&&(object=jq("#whats-new-post-object").val()),e=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:t,_bp_as_nonce:jq("#_bp_as_nonce").val()||""},s),jq.post(ajaxurl,e,function(e){if(a.find("*").each(function(){(jq.nodeName(this,"textarea")||jq.nodeName(this,"input"))&&jq(this).prop("disabled",!1)}),e[0]+e[1]==="-1")a.prepend(e.substr(2,e.length)),jq("#"+a.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(e),t||jq("#activity-stream li:first").addClass("new-update just-posted"),0!==jq("#latest-update").length){var i=jq("#activity-stream li.new-update .activity-content .activity-inner p").html(),s=jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr("href"),r="";""!==jq("#activity-stream li.new-update .activity-content .activity-inner p").text()&&(r=i+" "),r+='<a href="'+s+'" rel="nofollow">'+BP_DTheme.view+"</a>",jq("#latest-update").slideUp(300,function(){jq("#latest-update").html(r),jq("#latest-update").slideDown(300)})}jq("li.new-update").hide().slideDown(300),jq("li.new-update").removeClass("new-update"),jq("#whats-new").val(""),a.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(e){var t,i,a=jq(e.target).parent();if("STRONG"===e.target.nodeName||"SPAN"===e.target.nodeName)a=a.parent();else if("A"!==e.target.nodeName)return!1;return t=a.attr("id").substr(9,a.attr("id").length),i=jq("#activity-filter-select select").val(),"mentions"===t&&jq("#"+a.attr("id")+" a strong").remove(),bp_activity_request(t,i),!1}),jq("#activity-filter-select select").change(function(){var e,t=jq("div.activity-type-tabs li.selected"),i=jq(this).val();return e=t.length?t.attr("id").substr(9,t.attr("id").length):null,bp_activity_request(e,i),!1}),jq("div.activity").on("click",function(t){var i,a,s,r,n,o,c,l,d,p,u=jq(t.target);return u.hasClass("fav")||u.hasClass("unfav")?!u.hasClass("loading")&&(i=u.hasClass("fav")?"fav":"unfav",a=u.closest(".activity-item"),s=a.attr("id").substr(9,a.attr("id").length),c=bp_get_query_var("_wpnonce",u.attr("href")),u.addClass("loading"),jq.post(ajaxurl,{action:"activity_mark_"+i,cookie:bp_get_cookies(),id:s,nonce:c},function(e){u.removeClass("loading"),u.fadeOut(200,function(){jq(this).html(e),jq(this).attr("title","fav"===i?BP_DTheme.remove_fav:BP_DTheme.mark_as_fav),jq(this).fadeIn(200)}),"fav"===i?(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)),u.removeClass("fav"),u.addClass("unfav")):(u.removeClass("unfav"),u.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")&&u.closest(".activity-item").slideUp(100)}),!1):u.hasClass("delete-activity")?(r=u.parents("div.activity ul li"),n=r.attr("id").substr(9,r.attr("id").length),o=u.attr("href"),c=o.split("_wpnonce="),l=r.prop("class").match(/date-recorded-([0-9]+)/),c=c[1],u.addClass("loading"),jq.post(ajaxurl,{action:"delete_activity",cookie:bp_get_cookies(),id:n,_wpnonce:c},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.hasClass("spam-activity")?(r=u.parents("div.activity ul li"),l=r.prop("class").match(/date-recorded-([0-9]+)/),u.addClass("loading"),jq.post(ajaxurl,{action:"bp_spam_activity",cookie:encodeURIComponent(document.cookie),id:r.attr("id").substr(9,r.attr("id").length),_wpnonce:u.attr("href").split("_wpnonce=")[1]},function(e){e[0]+e[1]==="-1"?(r.prepend(e.substr(2,e.length)),r.children("#message").hide().fadeIn(300)):(r.slideUp(300),l&&activity_last_recorded===l[1]&&(newest_activities="",activity_last_recorded=0))}),!1):u.parent().hasClass("load-more")?(bp_ajax_request&&bp_ajax_request.abort(),jq("#buddypress li.load-more").addClass("loading"),d=e+1,p=[],jq(".activity-list li.just-posted").each(function(){p.push(jq(this).attr("id").replace("activity-",""))}),load_more_args={action:"activity_get_older_updates",cookie:bp_get_cookies(),page:d,exclude_just_posted:p.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(t){jq("#buddypress li.load-more").removeClass("loading"),e=d,jq("#buddypress ul.activity-list").append(t.contents),u.parent().hide()},"json"),!1):void(u.parent().hasClass("load-newest")&&(t.preventDefault(),u.parent().hide(),activity_html=jq.parseHTML(newest_activities),jq.each(activity_html,function(e,t){"LI"===t.nodeName&&jq(t).hasClass("just-posted")&&jq("#"+jq(t).attr("id")).length&&jq("#"+jq(t).attr("id")).remove()}),jq("#buddypress ul.activity-list").prepend(newest_activities),newest_activities=""))}),jq("div.activity").on("click",".activity-read-more a",function(e){var t,i,a=jq(e.target),s=a.parent().attr("id").split("-"),r=s[3],n=s[0];return t="acomment"===n?"acomment-content":"activity-inner",i=jq("#"+n+"-"+r+" ."+t+":first"),jq(a).addClass("loading"),jq.post(ajaxurl,{action:"get_single_activity_content",activity_id:r},function(e){jq(i).slideUp(300).html(e).slideDown(300)}),!1}),jq("form.ac-form").hide(),jq(".activity-comments").length&&bp_legacy_theme_hide_comments(),jq("div.activity").on("click",function(e){var t,i,a,s,r,n,o,c,l,d,p,u,m,h,_,v=jq(e.target);return v.hasClass("acomment-reply")||v.parent().hasClass("acomment-reply")?(v.parent().hasClass("acomment-reply")&&(v=v.parent()),t=v.attr("id"),i=t.split("-"),a=i[2],s=v.attr("href").substr(10,v.attr("href").length),(r=jq("#ac-form-"+a)).css("display","none"),r.removeClass("root"),jq(".ac-form").hide(),r.children("div").each(function(){jq(this).hasClass("error")&&jq(this).hide()}),"comment"!==i[1]?jq("#acomment-"+s).append(r):jq("#activity-"+a+" .activity-comments").append(r),r.parent().hasClass("activity-comments")&&r.addClass("root"),r.slideDown(200),jq.scrollTo(r,500,{offset:-100,easing:"swing"}),jq("#ac-form-"+i[2]+" textarea").focus(),!1):"ac_form_submit"===v.attr("name")?(r=v.parents("form"),n=r.parent(),o=r.attr("id").split("-"),c=n.hasClass("activity-comments")?o[2]:n.attr("id").split("-")[1],content=jq("#"+r.attr("id")+" textarea"),jq("#"+r.attr("id")+" div.error").hide(),v.addClass("loading").prop("disabled",!0),content.addClass("loading").prop("disabled",!0),l={action:"new_activity_comment",cookie:bp_get_cookies(),_wpnonce_new_activity_comment:jq("#_wpnonce_new_activity_comment_"+o[2]).val(),comment_id:c,form_id:o[2],content:content.val()},(d=jq("#_bp_as_nonce_"+c).val())&&(l["_bp_as_nonce_"+c]=d),jq.post(ajaxurl,l,function(e){if(v.removeClass("loading"),content.removeClass("loading"),e[0]+e[1]==="-1")r.append(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t=r.parent();r.fadeOut(200,function(){0===t.children("ul").length&&(t.hasClass("activity-comments")?t.prepend("<ul></ul>"):t.append("<ul></ul>"));var i=jq.trim(e);t.children("ul").append(jq(i).hide().fadeIn(200)),r.children("textarea").val(""),t.parent().addClass("has-comments")}),jq("#"+r.attr("id")+" textarea").val(""),u=Number(jq("#activity-"+o[2]+" a.acomment-reply span").html())+1,jq("#activity-"+o[2]+" a.acomment-reply span").html(u),(p=t.parents(".activity-comments").find(".show-all a"))&&p.html(BP_DTheme.show_x_comments.replace("%d",u))}jq(v).prop("disabled",!1),jq(content).prop("disabled",!1)}),!1):v.hasClass("acomment-delete")?(m=v.attr("href"),h=v.parent().parent(),r=h.parents("div.activity-comments").children("form"),_=m.split("_wpnonce="),_=_[1],c=m.split("cid="),c=c[1].split("&"),c=c[0],v.addClass("loading"),jq(".activity-comments ul .error").remove(),h.parents(".activity-comments").append(r),jq.post(ajaxurl,{action:"delete_activity_comment",cookie:bp_get_cookies(),_wpnonce:_,id:c},function(e){if(e[0]+e[1]==="-1")h.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t,i,a,s=jq("#"+h.attr("id")+" ul").children("li"),r=0;jq(s).each(function(){jq(this).is(":hidden")||r++}),h.fadeOut(200,function(){h.remove()}),i=(t=jq("#"+h.parents("#activity-stream > li").attr("id")+" a.acomment-reply span")).html()-(1+r),t.html(i),(a=h.parents(".activity-comments").find(".show-all a"))&&a.html(BP_DTheme.show_x_comments.replace("%d",i)),0===i&&jq(h.parents("#activity-stream > li")).removeClass("has-comments")}}),!1):v.hasClass("spam-activity-comment")?(m=v.attr("href"),h=v.parent().parent(),v.addClass("loading"),jq(".activity-comments ul div.error").remove(),h.parents(".activity-comments").append(h.parents(".activity-comments").children("form")),jq.post(ajaxurl,{action:"bp_spam_activity_comment",cookie:encodeURIComponent(document.cookie),_wpnonce:m.split("_wpnonce=")[1],id:m.split("cid=")[1].split("&")[0]},function(e){if(e[0]+e[1]==="-1")h.prepend(jq(e.substr(2,e.length)).hide().fadeIn(200));else{var t,i=jq("#"+h.attr("id")+" ul").children("li"),a=0;jq(i).each(function(){jq(this).is(":hidden")||a++}),h.fadeOut(200),t=h.parents("#activity-stream > li"),jq("#"+t.attr("id")+" a.acomment-reply span").html(jq("#"+t.attr("id")+" a.acomment-reply span").html()-(1+a))}}),!1):v.parent().hasClass("show-all")?(v.parent().addClass("loading"),setTimeout(function(){v.parent().parent().children("li").fadeIn(200,function(){v.parent().remove()})},600),!1):v.hasClass("ac-reply-cancel")?(jq(v).closest(".ac-form").slideUp(200),!1):void 0}),jq(document).keydown(function(e){(e=e||window.event).target?element=e.target:e.srcElement&&(element=e.srcElement),3===element.nodeType&&(element=element.parentNode),!0!==e.ctrlKey&&!0!==e.altKey&&!0!==e.metaKey&&27===(e.keyCode?e.keyCode:e.which)&&"TEXTAREA"===element.tagName&&jq(element).hasClass("ac-input")&&jq(element).parent().parent().parent().slideUp(200)}),jq(".dir-search, .groups-members-search").on("click",function(e){if(!jq(this).hasClass("no-ajax")){var t,i,a,s=jq(e.target);if("submit"===s.attr("type")){t=jq(".item-list-tabs li.selected").attr("id").split("-")[0],i=null,a=s.parent().find("#"+t+"_search").val(),"groups-members-search"===e.currentTarget.className&&(t="group_members",i="groups/single/members");var r=bp_get_directory_preference(t,"scope");return bp_filter_request(t,bp_get_directory_preference(t,"filter"),r,"div."+t,a,1,bp_get_directory_preference(t,"extras"),null,i),!1}}}),jq("div.item-list-tabs").on("click",function(e){if(jq("body").hasClass("type")&&jq("body").hasClass("directory")&&jq(this).addClass("no-ajax"),!jq(this).hasClass("no-ajax")&&!jq(e.target).hasClass("no-ajax")){var t,i,a,s="SPAN"===e.target.nodeName?e.target.parentNode:e.target,r=jq(s).parent();return"LI"!==r[0].nodeName||r.hasClass("last")?void 0:(t=r.attr("id").split("-"),"activity"!==(i=t[0])&&(a=t[1],bp_filter_request(i,jq("#"+i+"-order-select select").val(),a,"div."+i,jq("#"+i+"_search").val(),1,bp_get_directory_preference(i,"extras")),!1))}}),jq("li.filter select").change(function(){var e,t,i,a,s,r,n;return t=(e=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":this).attr("id").split("-"))[0],i=e[1],a=jq(this).val(),s=!1,r=null,jq(".dir-search input").length&&(s=jq(".dir-search input").val()),(n=jq(".groups-members-search input")).length&&(s=n.val(),t="members",i="groups"),"members"===t&&"groups"===i&&(t="group_members",r="groups/single/members"),"friends"===t&&(t="members"),bp_filter_request(t,a,i,"div."+t,s,1,bp_get_directory_preference(t,"extras"),null,r),!1}),jq("#buddypress").on("click",function(e){var t,i,a,s,r,n,o,c,l=jq(e.target);if(l.hasClass("button"))return!0;if(l.parent().parent().hasClass("pagination")&&!l.parent().parent().hasClass("no-ajax")){if(l.hasClass("dots")||l.hasClass("current"))return!1;i=(t=jq(jq(".item-list-tabs li.selected").length?".item-list-tabs li.selected":"li.filter select").attr("id").split("-"))[0],a=!1,s=jq(l).closest(".pagination-links").attr("id"),r=null,jq("div.dir-search input").length&&(a=!(a=jq(".dir-search input")).val()&&bp_get_querystring(a.attr("name"))?jq(".dir-search input").prop("placeholder"):a.val()),n=jq(l).hasClass("next")||jq(l).hasClass("prev")?jq(".pagination span.current").html():jq(l).html(),n=Number(n.replace(/\D/g,"")),jq(l).hasClass("next")?n++:jq(l).hasClass("prev")&&n--,(o=jq(".groups-members-search input")).length&&(a=o.val(),i="members"),"members"===i&&"groups"===t[1]&&(i="group_members",r="groups/single/members"),"admin"===i&&jq("body").hasClass("membership-requests")&&(i="requests"),c=-1!==s.indexOf("pag-bottom")?"pag-bottom":null;var d=bp_get_directory_preference(i,"scope");return bp_filter_request(i,bp_get_directory_preference(i,"filter"),d,"div."+i,a,n,bp_get_directory_preference(i,"extras"),c,r),!1}}),jq("#send-invite-form").on("click","#invite-list input",function(){var e,t,i=jq("#send-invite-form > .invite").length;jq(".ajax-loader").toggle(),i&&jq(this).parents("ul").find("input").prop("disabled",!0),e=jq(this).val(),t=!0===jq(this).prop("checked")?"invite":"uninvite",i||jq(".item-list-tabs li.selected").addClass("loading"),jq.post(ajaxurl,{action:"groups_invite_user",friend_action:t,cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:e,group_id:jq("#group_id").val()},function(a){jq("#message")&&jq("#message").hide(),i?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),"invite"===t?jq("#friend-list").append(a):"uninvite"===t&&jq("#friend-list li#uid-"+e).remove(),jq(".item-list-tabs li.selected").removeClass("loading"))})}),jq("#send-invite-form").on("click","a.remove",function(){var e=jq("#send-invite-form > .invite").length,t=jq(this).attr("id");return jq(".ajax-loader").toggle(),t=t.split("-"),t=t[1],jq.post(ajaxurl,{action:"groups_invite_user",friend_action:"uninvite",cookie:bp_get_cookies(),_wpnonce:jq("#_wpnonce_invite_uninvite_user").val(),friend_id:t,group_id:jq("#group_id").val()},function(i){e?bp_filter_request("invite","bp-invite-filter","bp-invite-scope","div.invite",!1,1,"","",""):(jq(".ajax-loader").toggle(),jq("#friend-list #uid-"+t).remove(),jq("#invite-list #f-"+t).prop("checked",!1))}),!1}),jq(".visibility-toggle-link").on("click",function(e){e.preventDefault(),jq(this).attr("aria-expanded","true").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(e){e.preventDefault(),jq(".visibility-toggle-link").attr("aria-expanded","false");var t=jq(this).parent(),i=t.find("input:checked").parent().text();t.hide().removeClass("field-visibility-settings-open").siblings(".field-visibility-settings-toggle").find(".current-visibility-level").text(i).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 e=!0;jq("#profile-edit-form input:submit, #signup_form input:submit").on("click",function(){e=!1}),window.onbeforeunload=function(t){if(e)return BP_DTheme.unsaved_changes}}),jq("#friend-list a.accept, #friend-list a.reject").on("click",function(){var e,t=jq(this),i=jq(this).parents("#friend-list li"),a=jq(this).parents("li div.action"),s=i.attr("id").substr(11,i.attr("id").length),r=t.attr("href").split("_wpnonce=")[1];return!jq(this).hasClass("accepted")&&!jq(this).hasClass("rejected")&&(jq(this).hasClass("accept")?(e="accept_friendship",a.children("a.reject").css("visibility","hidden")):(e="reject_friendship",a.children("a.accept").css("visibility","hidden")),t.addClass("loading"),jq.post(ajaxurl,{action:e,cookie:bp_get_cookies(),id:s,_wpnonce:r},function(e){t.removeClass("loading"),e[0]+e[1]==="-1"?(i.prepend(e.substr(2,e.length)),i.children("#message").hide().fadeIn(200)):t.fadeOut(100,function(){jq(this).hasClass("accept")?(a.children("a.reject").hide(),jq(this).html(BP_DTheme.accepted).contents().unwrap()):(a.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 e=jq(this).attr("id"),t=jq(this).attr("href"),i=jq(this);return e=e.split("-"),e=e[1],t=t.split("?_wpnonce="),t=t[1].split("&"),t=t[0],jq.post(ajaxurl,{action:"addremove_friend",cookie:bp_get_cookies(),fid:e,_wpnonce:t},function(e){var t=i.attr("rel");parentdiv=i.parent(),"add"===t?jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("add_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("pending_friend"),parentdiv.fadeIn(200).html(e)}):"remove"===t&&jq(parentdiv).fadeOut(200,function(){parentdiv.removeClass("remove_friend"),parentdiv.removeClass("loading"),parentdiv.addClass("add"),parentdiv.fadeIn(200).html(e)})}),!1}),jq("#buddypress").on("click",".group-button .leave-group",function(){if(!1===confirm(BP_DTheme.leave_group_confirm))return!1}),jq("#groups-dir-list").on("click",".group-button a",function(){var e=jq(this).parent().attr("id"),t=jq(this).attr("href"),i=jq(this);return e=e.split("-"),e=e[1],t=t.split("?_wpnonce="),t=t[1].split("&"),t=t[0],(!i.hasClass("leave-group")||!1!==confirm(BP_DTheme.leave_group_confirm))&&(jq.post(ajaxurl,{action:"joinleave_group",cookie:bp_get_cookies(),gid:e,_wpnonce:t},function(e){var t=i.parent();jq("body.directory").length?jq(t).fadeOut(200,function(){t.fadeIn(200).html(e);var a=jq("#groups-personal span"),s=1;i.hasClass("leave-group")?(t.hasClass("hidden")&&t.closest("li").slideUp(200),s=0):i.hasClass("request-membership")&&(s=!1),a.length&&!1!==s&&(s?a.text(1+(a.text()>>0)):a.text((a.text()>>0)-1))}):window.location.reload()}),!1)}),jq("#groups-list li.hidden").each(function(){"none"===jq(this).css("display")&&jq(this).css("cssText","display: list-item !important")}),jq("#buddypress").on("click",".pending",function(){return!1}),jq("body").hasClass("register")){var s=jq("#signup_with_blog");s.prop("checked")||jq("#blog-details").toggle(),s.change(function(){jq("#blog-details").toggle()})}jq(".message-search").on("click",function(e){if(!jq(this).hasClass("no-ajax")){var t,i=jq(e.target);if("submit"===i.attr("type")||"button"===i.attr("type")){var a=bp_get_directory_preference(t="messages","scope"),s=bp_get_directory_preference(t,"filter"),r=bp_get_directory_preference(t,"extras");return bp_filter_request(t,s,a,"div."+t,jq("#messages_search").val(),1,r),!1}}}),jq("#send_reply_button").click(function(){var e=jq("#messages_order").val()||"ASC",t=jq("#message-recipients").offset(),i=jq("#send_reply_button");return jq(i).addClass("loading").prop("disabled",!0),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(a){a[0]+a[1]==="-1"?jq("#send-reply").prepend(a.substr(2,a.length)):(jq("#send-reply #message").remove(),jq("#message_content").val(""),"ASC"===e?jq("#send-reply").before(a):(jq("#message-recipients").after(a),jq(window).scrollTop(t.top)),jq(".new-message").hide().slideDown(200,function(){jq(".new-message").removeClass("new-message")})),jq(i).removeClass("loading").prop("disabled",!1)}),!1}),jq("body.messages #item-body div.messages").on("change","#message-type-select",function(){var e=this.value,t=jq('td input[type="checkbox"]'),i="checked";switch(t.each(function(e){t[e].checked=""}),e){case"unread":t=jq('tr.unread td input[type="checkbox"]');break;case"read":t=jq('tr.read td input[type="checkbox"]');break;case"":i=""}t.each(function(e){t[e].checked=i})}),jq("#select-all-messages").click(function(e){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 e=jq(this);return jq.post(ajaxurl,{action:"messages_star",message_id:e.data("message-id"),star_status:e.data("star-status"),nonce:e.data("star-nonce"),bulk:e.data("star-bulk")},function(t){1===parseInt(t,10)&&("unstar"===e.data("star-status")?(e.data("star-status","star"),e.removeClass("message-action-unstar").addClass("message-action-star"),e.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_star),1===BP_PM_Star.is_single_thread?e.attr("data-bp-tooltip",BP_PM_Star.strings.title_star):e.attr("data-bp-tooltip",BP_PM_Star.strings.title_star_thread)):(e.data("star-status","unstar"),e.removeClass("message-action-star").addClass("message-action-unstar"),e.find(".bp-screen-reader-text").text(BP_PM_Star.strings.text_unstar),1===BP_PM_Star.is_single_thread?e.attr("data-bp-tooltip",BP_PM_Star.strings.title_unstar):e.attr("data-bp-tooltip",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 e=jq(this),t=e.closest("tr").find(".thread-star a");e.prop("checked")?"unstar"===t.data("star-status")?BP_PM_Star.star_counter++:BP_PM_Star.unstar_counter++:"unstar"===t.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(e){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),nonce:jq("#close-notice-nonce").val()},function(e){jq("#close-notice").removeClass("loading"),e[0]+e[1]==="-1"?(jq(".notice").prepend(e.substr(2,e.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:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-activity-oldestpage",{path:"/",secure:"https:"===window.location.protocol});var e=["members","groups","blogs","forums"];jq(e).each(function(t){jq.removeCookie("bp-"+e[t]+"-scope",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+e[t]+"-filter",{path:"/",secure:"https:"===window.location.protocol}),jq.removeCookie("bp-"+e[t]+"-extras",{path:"/",secure:"https:"===window.location.protocol})})}),jq("body").hasClass("no-js")&&jq("body").attr("class",jq("body").attr("class").replace(/no-js/,"js")),"undefined"!=typeof wp&&void 0!==wp.heartbeat&&void 0!==BP_DTheme.pulse&&(wp.heartbeat.interval(Number(BP_DTheme.pulse)),jq.fn.extend({"heartbeat-send":function(){return this.bind("heartbeat-send.buddypress")}}));var r=0;jq(document).on("heartbeat-send.buddypress",function(e,t){r=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&&(r=timestamp[1])),(0===activity_last_recorded||Number(r)>activity_last_recorded)&&(activity_last_recorded=Number(r)),t.bp_activity_last_recorded=activity_last_recorded,last_recorded_search=bp_get_querystring("s"),last_recorded_search&&(t.bp_activity_last_recorded_search_terms=last_recorded_search)}),jq(document).on("heartbeat-tick",function(e,t){t.bp_activity_newest_activities&&(newest_activities=t.bp_activity_newest_activities.activities+newest_activities,activity_last_recorded=Number(t.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>"))})});
bp-templates/bp-legacy/js/password-verify.js CHANGED
@@ -14,7 +14,12 @@
14
  return;
15
  }
16
 
17
- strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );
 
 
 
 
 
18
 
19
  switch ( strength ) {
20
  case 2:
14
  return;
15
  }
16
 
17
+ // wp.passwordStrength.userInputBlacklist() has been deprecated in WP 5.5.0.
18
+ if ( 'function' === typeof wp.passwordStrength.userInputDisallowedList ) {
19
+ strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputDisallowedList(), pass2 );
20
+ } else {
21
+ strength = wp.passwordStrength.meter( pass1, wp.passwordStrength.userInputBlacklist(), pass2 );
22
+ }
23
 
24
  switch ( strength ) {
25
  case 2:
bp-templates/bp-legacy/js/password-verify.min.js CHANGED
@@ -1 +1 @@
1
- !function(s){function t(){var t=s(".password-entry").val(),r=s(".password-entry-confirm").val();if(s("#pass-strength-result").removeClass("short bad good strong"),t)switch(wp.passwordStrength.meter(t,wp.passwordStrength.userInputBlacklist(),r)){case 2:s("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:s("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:s("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:s("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:s("#pass-strength-result").addClass("short").html(pwsL10n.short)}else s("#pass-strength-result").html(pwsL10n.empty)}s(document).ready(function(){s(".password-entry").val("").keyup(t),s(".password-entry-confirm").val("").keyup(t)})}(jQuery);
1
+ !function(s){function t(){var t=s(".password-entry").val(),r=s(".password-entry-confirm").val();if(s("#pass-strength-result").removeClass("short bad good strong"),t)switch("function"==typeof wp.passwordStrength.userInputDisallowedList?wp.passwordStrength.meter(t,wp.passwordStrength.userInputDisallowedList(),r):wp.passwordStrength.meter(t,wp.passwordStrength.userInputBlacklist(),r)){case 2:s("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:s("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:s("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:s("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:s("#pass-strength-result").addClass("short").html(pwsL10n.short)}else s("#pass-strength-result").html(pwsL10n.empty)}s(document).ready(function(){s(".password-entry").val("").keyup(t),s(".password-entry-confirm").val("").keyup(t)})}(jQuery);
bp-templates/bp-nouveau/buddypress-functions.php CHANGED
@@ -283,6 +283,33 @@ class BP_Nouveau extends BP_Theme_Compat {
283
  }
284
  }
285
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
 
288
  /**
283
  }
284
  }
285
  }
286
+
287
+ // Compatibility stylesheets for specific themes.
288
+ $theme = get_template();
289
+ $companion_stylesheet = bp_locate_template_asset( sprintf( 'css/%1$s%2$s.css', $theme, $min ) );
290
+ $companion_handle = 'bp-' . $theme;
291
+
292
+ if ( ! is_rtl() && isset( $companion_stylesheet['uri'] ) && $companion_stylesheet['uri'] ) {
293
+ wp_enqueue_style( $companion_handle, $companion_stylesheet['uri'], array(), $this->version, 'screen' );
294
+
295
+ if ( $min ) {
296
+ wp_style_add_data( $companion_handle, 'suffix', $min );
297
+ }
298
+ }
299
+
300
+ // Compatibility stylesheet for specific themes, RTL-version.
301
+ if ( is_rtl() ) {
302
+ $rtl_companion_stylesheet = bp_locate_template_asset( sprintf( 'css/%1$s-rtl%2$s.css', $theme, $min ) );
303
+
304
+ if ( isset( $rtl_companion_stylesheet['uri'] ) ) {
305
+ $companion_handle .= '-rtl';
306
+ wp_enqueue_style( $companion_handle, $rtl_companion_stylesheet['uri'], array(), $this->version, 'screen' );
307
+
308
+ if ( $min ) {
309
+ wp_style_add_data( $companion_handle, 'suffix', $min );
310
+ }
311
+ }
312
+ }
313
  }
314
 
315
  /**
bp-templates/bp-nouveau/buddypress/activity/comment-form.php CHANGED
@@ -23,7 +23,7 @@ if ( ! bp_nouveau_current_user_can( 'comment_activity' ) || ! bp_activity_can_co
23
  <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
24
 
25
  <?php
26
- bp_nouveau_submit_button( 'activity-new-comment' );
27
  printf(
28
  '&nbsp; <button type="button" class="ac-reply-cancel">%s</button>',
29
  esc_html( _x( 'Cancel', 'button', 'buddypress' ) )
23
  <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
24
 
25
  <?php
26
+ bp_nouveau_submit_button( 'activity-new-comment', bp_get_activity_id() );
27
  printf(
28
  '&nbsp; <button type="button" class="ac-reply-cancel">%s</button>',
29
  esc_html( _x( 'Cancel', 'button', 'buddypress' ) )
bp-templates/bp-nouveau/buddypress/activity/comment.php CHANGED
@@ -5,10 +5,11 @@
5
  * This template is used by bp_activity_comments() functions to show
6
  * each activity.
7
  *
8
- * @version 3.0.0
 
9
  */
10
 
11
- ?>
12
 
13
  <li id="acomment-<?php bp_activity_comment_id(); ?>" class="comment-item" data-bp-activity-comment-id="<?php bp_activity_comment_id(); ?>">
14
  <div class="acomment-avatar item-avatar">
@@ -36,3 +37,6 @@
36
 
37
  <?php bp_nouveau_activity_recurse_comments( bp_activity_current_comment() ); ?>
38
  </li>
 
 
 
5
  * This template is used by bp_activity_comments() functions to show
6
  * each activity.
7
  *
8
+ * @since 3.0.0
9
+ * @version 7.0.0
10
  */
11
 
12
+ bp_nouveau_activity_hook( 'before', 'comment' ); ?>
13
 
14
  <li id="acomment-<?php bp_activity_comment_id(); ?>" class="comment-item" data-bp-activity-comment-id="<?php bp_activity_comment_id(); ?>">
15
  <div class="acomment-avatar item-avatar">
37
 
38
  <?php bp_nouveau_activity_recurse_comments( bp_activity_current_comment() ); ?>
39
  </li>
40
+
41
+ <?php
42
+ bp_nouveau_activity_hook( 'after', 'comment' );
bp-templates/bp-nouveau/buddypress/groups/groups-loop.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Groups Loop
4
  *
5
  * @since 3.0.0
6
- * @version 3.1.0
7
  */
8
 
9
  bp_nouveau_before_loop(); ?>
@@ -18,57 +18,58 @@ bp_nouveau_before_loop(); ?>
18
 
19
  <ul id="groups-list" class="<?php bp_nouveau_loop_classes(); ?>">
20
 
21
- <?php
22
- while ( bp_groups() ) :
23
- bp_the_group();
24
- ?>
25
 
26
- <li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
27
- <div class="list-wrap">
28
 
29
- <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
30
- <div class="item-avatar">
31
- <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( bp_nouveau_avatar_args() ); ?></a>
32
- </div>
33
- <?php endif; ?>
34
 
35
- <div class="item">
36
 
37
- <div class="item-block">
38
 
39
- <h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
40
 
41
- <?php if ( bp_nouveau_group_has_meta() ) : ?>
42
 
43
- <p class="item-meta group-details"><?php bp_nouveau_group_meta(); ?></p>
44
 
45
- <?php endif; ?>
46
 
47
- <p class="last-activity item-meta">
48
- <?php
49
- printf(
50
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
51
- __( 'active %s', 'buddypress' ),
52
- bp_get_group_last_active()
53
- );
54
- ?>
55
- </p>
 
 
 
 
56
 
57
- </div>
58
 
59
- <div class="group-desc"><p><?php bp_nouveau_group_description_excerpt(); ?></p></div>
60
 
61
- <?php bp_nouveau_groups_loop_item(); ?>
62
 
63
- <?php bp_nouveau_groups_loop_buttons(); ?>
64
 
65
- </div>
66
 
 
67
 
68
- </div>
69
- </li>
70
 
71
- <?php endwhile; ?>
72
 
73
  </ul>
74
 
3
  * BuddyPress - Groups Loop
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
 
9
  bp_nouveau_before_loop(); ?>
18
 
19
  <ul id="groups-list" class="<?php bp_nouveau_loop_classes(); ?>">
20
 
21
+ <?php while ( bp_groups() ) : bp_the_group(); ?>
 
 
 
22
 
23
+ <li <?php bp_group_class( array( 'item-entry' ) ); ?> data-bp-item-id="<?php bp_group_id(); ?>" data-bp-item-component="groups">
24
+ <div class="list-wrap">
25
 
26
+ <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
27
+ <div class="item-avatar">
28
+ <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( bp_nouveau_avatar_args() ); ?></a>
29
+ </div>
30
+ <?php endif; ?>
31
 
32
+ <div class="item">
33
 
34
+ <div class="item-block">
35
 
36
+ <h2 class="list-title groups-title"><?php bp_group_link(); ?></h2>
37
 
38
+ <?php if ( bp_nouveau_group_has_meta() ) : ?>
39
 
40
+ <p class="item-meta group-details"><?php bp_nouveau_the_group_meta( array( 'keys' => array( 'status', 'count' ) ) ); ?></p>
41
 
42
+ <?php endif; ?>
43
 
44
+ <p class="last-activity item-meta">
45
+ <?php
46
+ printf(
47
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
48
+ esc_html__( 'Active %s', 'buddypress' ),
49
+ sprintf(
50
+ '<span data-livestamp="%1$s">%2$s</span>',
51
+ bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
52
+ esc_html( bp_get_group_last_active() )
53
+ )
54
+ );
55
+ ?>
56
+ </p>
57
 
58
+ </div>
59
 
60
+ <div class="group-desc"><p><?php bp_nouveau_group_description_excerpt(); ?></p></div>
61
 
62
+ <?php bp_nouveau_groups_loop_item(); ?>
63
 
64
+ <?php bp_nouveau_groups_loop_buttons(); ?>
65
 
66
+ </div>
67
 
68
+ </div>
69
 
70
+ </li>
 
71
 
72
+ <?php endwhile; ?>
73
 
74
  </ul>
75
 
bp-templates/bp-nouveau/buddypress/groups/single/admin/group-cover-image.php CHANGED
@@ -3,15 +3,15 @@
3
  * BP Nouveau Group's cover image template.
4
  *
5
  * @since 3.0.0
6
- * @version 3.1.0
7
  */
8
  ?>
9
 
10
  <?php if ( bp_is_group_create() ) : ?>
11
 
12
- <h2 class="bp-screen-title creation-step-name">
13
  <?php esc_html_e( 'Upload Cover Image', 'buddypress' ); ?>
14
- </h2>
15
 
16
  <div id="header-cover-image"></div>
17
 
3
  * BP Nouveau Group's cover image template.
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
  ?>
9
 
10
  <?php if ( bp_is_group_create() ) : ?>
11
 
12
+ <h3 class="bp-screen-title creation-step-name">
13
  <?php esc_html_e( 'Upload Cover Image', 'buddypress' ); ?>
14
+ </h3>
15
 
16
  <div id="header-cover-image"></div>
17
 
bp-templates/bp-nouveau/buddypress/groups/single/cover-image-header.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Groups Cover Image Header.
4
  *
5
  * @since 3.0.0
6
- * @version 3.2.0
7
  */
8
  ?>
9
 
@@ -21,32 +21,54 @@
21
  </div><!-- #item-header-avatar -->
22
  <?php endif; ?>
23
 
24
- <?php if ( ! bp_nouveau_groups_front_page_description() ) : ?>
25
- <div id="item-header-content">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
- <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_group_meta()->status ); ?></strong></p>
28
- <p class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
29
  <?php
30
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
31
- printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() );
 
 
 
 
 
 
 
 
32
  ?>
33
- </p>
34
 
35
- <?php echo bp_nouveau_group_meta()->group_type_list; ?>
36
- <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
37
 
38
- <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
39
- <div class="item-meta">
40
 
41
- <?php echo bp_nouveau_group_meta()->extra; ?>
42
 
43
- </div><!-- .item-meta -->
44
- <?php endif; ?>
45
 
46
- <?php bp_nouveau_group_header_buttons(); ?>
47
 
48
- </div><!-- #item-header-content -->
49
- <?php endif; ?>
50
 
51
  <?php bp_get_template_part( 'groups/single/parts/header-item-actions' ); ?>
52
 
3
  * BuddyPress - Groups Cover Image Header.
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
  ?>
9
 
21
  </div><!-- #item-header-avatar -->
22
  <?php endif; ?>
23
 
24
+ <?php if ( ! bp_nouveau_groups_front_page_description() ) : ?>
25
+ <div id="item-header-content">
26
+
27
+ <?php if ( bp_nouveau_group_has_meta( 'status' ) ) : ?>
28
+ <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_the_group_meta( array( 'keys' => 'status' ) ) ); ?></strong></p>
29
+ <?php endif; ?>
30
+
31
+ <p class="activity">
32
+ <?php
33
+ printf(
34
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
35
+ esc_html__( 'Active %s', 'buddypress' ),
36
+ sprintf(
37
+ '<span data-livestamp="%1$s">%2$s</span>',
38
+ bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
39
+ esc_html( bp_get_group_last_active() )
40
+ )
41
+ );
42
+ ?>
43
+ </p>
44
 
 
 
45
  <?php
46
+ bp_group_type_list(
47
+ bp_get_group_id(),
48
+ array(
49
+ 'label' => array(
50
+ 'plural' => __( 'Group Types', 'buddypress' ),
51
+ 'singular' => __( 'Group Type', 'buddypress' ),
52
+ ),
53
+ 'list_element' => 'span',
54
+ )
55
+ );
56
  ?>
 
57
 
58
+ <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
 
59
 
60
+ <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
61
+ <div class="item-meta">
62
 
63
+ <?php echo bp_nouveau_the_group_meta( array( 'keys' => 'extra' ) ); ?>
64
 
65
+ </div><!-- .item-meta -->
66
+ <?php endif; ?>
67
 
68
+ <?php bp_nouveau_group_header_buttons(); ?>
69
 
70
+ </div><!-- #item-header-content -->
71
+ <?php endif; ?>
72
 
73
  <?php bp_get_template_part( 'groups/single/parts/header-item-actions' ); ?>
74
 
bp-templates/bp-nouveau/buddypress/groups/single/group-header.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Groups Header
4
  *
5
  * @since 3.0.0
6
- * @version 3.2.0
7
  */
8
  ?>
9
 
@@ -21,26 +21,43 @@
21
 
22
  <div id="item-header-content">
23
 
24
- <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_group_meta()->status ); ?></strong></p>
 
 
25
 
26
- <p class="activity" data-livestamp="<?php bp_core_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ); ?>">
27
  <?php
28
- echo esc_html(
29
- sprintf(
30
- /* translators: %s: last activity timestamp (e.g. "active 1 hour ago") */
31
- __( 'active %s', 'buddypress' ),
32
- bp_get_group_last_active()
33
- )
34
- );
 
 
35
  ?>
36
  </p>
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
39
 
40
  <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
41
  <div class="item-meta">
42
 
43
- <?php echo bp_nouveau_group_meta()->extra; ?>
44
 
45
  </div><!-- .item-meta -->
46
  <?php endif; ?>
3
  * BuddyPress - Groups Header
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
  ?>
9
 
21
 
22
  <div id="item-header-content">
23
 
24
+ <?php if ( bp_nouveau_group_has_meta( 'status' ) ) : ?>
25
+ <p class="highlight group-status"><strong><?php echo esc_html( bp_nouveau_the_group_meta( array( 'keys' => 'status' ) ) ); ?></strong></p>
26
+ <?php endif; ?>
27
 
28
+ <p class="activity">
29
  <?php
30
+ printf(
31
+ /* translators: %s: last activity timestamp (e.g. "Active 1 hour ago") */
32
+ esc_html__( 'Active %s', 'buddypress' ),
33
+ sprintf(
34
+ '<span data-livestamp="%1$s">%2$s</span>',
35
+ bp_core_get_iso8601_date( bp_get_group_last_active( 0, array( 'relative' => false ) ) ),
36
+ esc_html( bp_get_group_last_active() )
37
+ )
38
+ );
39
  ?>
40
  </p>
41
 
42
+ <?php
43
+ bp_group_type_list(
44
+ bp_get_group_id(),
45
+ array(
46
+ 'label' => array(
47
+ 'plural' => __( 'Group Types', 'buddypress' ),
48
+ 'singular' => __( 'Group Type', 'buddypress' ),
49
+ ),
50
+ 'list_element' => 'span',
51
+ )
52
+ );
53
+ ?>
54
+
55
  <?php bp_nouveau_group_hook( 'before', 'header_meta' ); ?>
56
 
57
  <?php if ( bp_nouveau_group_has_meta_extra() ) : ?>
58
  <div class="item-meta">
59
 
60
+ <?php echo bp_nouveau_the_group_meta( array( 'keys' => 'extra' ) ); ?>
61
 
62
  </div><!-- .item-meta -->
63
  <?php endif; ?>
bp-templates/bp-nouveau/buddypress/members/single/cover-image-header.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Users Cover Image Header
4
  *
5
  * @since 3.0.0
6
- * @version 3.0.0
7
  */
8
  ?>
9
 
@@ -33,7 +33,7 @@
33
  'container_classes' => array( 'member-header-actions' ),
34
  )
35
  );
36
- ?>
37
 
38
  <?php bp_nouveau_member_hook( 'before', 'header_meta' ); ?>
39
 
@@ -45,6 +45,19 @@
45
  </div><!-- #item-meta -->
46
  <?php endif; ?>
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </div><!-- #item-header-content -->
49
 
50
  </div><!-- #item-header-cover-image -->
3
  * BuddyPress - Users Cover Image Header
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
  ?>
9
 
33
  'container_classes' => array( 'member-header-actions' ),
34
  )
35
  );
36
+ ?>
37
 
38
  <?php bp_nouveau_member_hook( 'before', 'header_meta' ); ?>
39
 
45
  </div><!-- #item-meta -->
46
  <?php endif; ?>
47
 
48
+ <?php
49
+ bp_member_type_list(
50
+ bp_displayed_user_id(),
51
+ array(
52
+ 'label' => array(
53
+ 'plural' => __( 'Member Types', 'buddypress' ),
54
+ 'singular' => __( 'Member Type', 'buddypress' ),
55
+ ),
56
+ 'list_element' => 'span',
57
+ )
58
+ );
59
+ ?>
60
+
61
  </div><!-- #item-header-content -->
62
 
63
  </div><!-- #item-header-cover-image -->
bp-templates/bp-nouveau/buddypress/members/single/member-header.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Users Header
4
  *
5
  * @since 3.0.0
6
- * @version 3.0.0
7
  */
8
  ?>
9
 
@@ -31,5 +31,18 @@
31
  </div><!-- #item-meta -->
32
  <?php endif; ?>
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  <?php bp_nouveau_member_header_buttons( array( 'container_classes' => array( 'member-header-actions' ) ) ); ?>
35
  </div><!-- #item-header-content -->
3
  * BuddyPress - Users Header
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
  ?>
9
 
31
  </div><!-- #item-meta -->
32
  <?php endif; ?>
33
 
34
+ <?php
35
+ bp_member_type_list(
36
+ bp_displayed_user_id(),
37
+ array(
38
+ 'label' => array(
39
+ 'plural' => __( 'Member Types', 'buddypress' ),
40
+ 'singular' => __( 'Member Type', 'buddypress' ),
41
+ ),
42
+ 'list_element' => 'span',
43
+ )
44
+ );
45
+ ?>
46
+
47
  <?php bp_nouveau_member_header_buttons( array( 'container_classes' => array( 'member-header-actions' ) ) ); ?>
48
  </div><!-- #item-header-content -->
bp-templates/bp-nouveau/buddypress/members/single/settings/delete-account.php CHANGED
@@ -3,7 +3,7 @@
3
  * BuddyPress - Members Settings ( Delete Account )
4
  *
5
  * @since 3.0.0
6
- * @version 4.0.0
7
  */
8
 
9
  bp_nouveau_member_hook( 'before', 'settings_template' ); ?>
@@ -14,10 +14,10 @@ bp_nouveau_member_hook( 'before', 'settings_template' ); ?>
14
 
15
  <?php bp_nouveau_user_feedback( 'member-delete-account' ); ?>
16
 
17
- <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account' ); ?>" name="account-delete-form" id="#account-delete-form" class="standard-form" method="post">
18
 
19
  <label id="delete-account-understand" class="warn" for="delete-account-understand">
20
- <input class="disabled" type="checkbox" name="delete-account-understand" value="1" data-bp-disable-input="#delete-account-button" />
21
  <?php esc_html_e( 'I understand the consequences.', 'buddypress' ); ?>
22
  </label>
23
 
3
  * BuddyPress - Members Settings ( Delete Account )
4
  *
5
  * @since 3.0.0
6
+ * @version 7.0.0
7
  */
8
 
9
  bp_nouveau_member_hook( 'before', 'settings_template' ); ?>
14
 
15
  <?php bp_nouveau_user_feedback( 'member-delete-account' ); ?>
16
 
17
+ <form action="<?php echo esc_url( bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account' ); ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
18
 
19
  <label id="delete-account-understand" class="warn" for="delete-account-understand">
20
+ <input class="disabled" type="checkbox" name="delete-account-understand" value="1" data-bp-disable-input="delete-account-button" />
21
  <?php esc_html_e( 'I understand the consequences.', 'buddypress' ); ?>
22
  </label>
23
 
bp-templates/bp-nouveau/common-styles/_bp_blogs_loop.scss CHANGED
@@ -7,6 +7,19 @@
7
 
8
  li {
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  @include medium-up() {
11
 
12
  .item-block {
7
 
8
  li {
9
 
10
+ .item-avatar {
11
+
12
+ img.avatar-150 {
13
+ max-width: 150px;
14
+ max-height: 150px;
15
+ }
16
+
17
+ img.avatar-50 {
18
+ max-width: 50px;
19
+ max-height: 50px;
20
+ }
21
+ }
22
+
23
  @include medium-up() {
24
 
25
  .item-block {
bp-templates/bp-nouveau/common-styles/_bp_buttons.scss CHANGED
@@ -83,6 +83,7 @@
83
  input[type="button"].disabled,
84
  input[type="reset"].disabled,
85
  input[type="submit"][disabled="disabled"],
 
86
  button.pending,
87
  button.disabled,
88
  div.pending a,
83
  input[type="button"].disabled,
84
  input[type="reset"].disabled,
85
  input[type="submit"][disabled="disabled"],
86
+ input[type="submit"]:disabled,
87
  button.pending,
88
  button.disabled,
89
  div.pending a,
bp-templates/bp-nouveau/common-styles/_bp_forms.scss CHANGED
@@ -1,6 +1,6 @@
1
  // BP Forms Elements Global Styles
2
  // @since 3.0.0
3
- // @version 5.0.0
4
 
5
  // Some essential classes used for forms elements:
6
  // labels - sizing especially for standalone controls
@@ -87,7 +87,7 @@
87
  [data-bp-search] input[type="text"],
88
  .groups-members-search input[type="search"],
89
  .groups-members-search input[type="text"] {
90
- background: $off-white;
91
  border: 1px solid $form-border-color;
92
  border-radius: 0;
93
  font: inherit;
@@ -163,7 +163,7 @@
163
  input:focus,
164
  textarea:focus,
165
  select:focus {
166
- background: $off-white;
167
  color: $bp-text;
168
  outline: 0;
169
  }
1
  // BP Forms Elements Global Styles
2
  // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
  // Some essential classes used for forms elements:
6
  // labels - sizing especially for standalone controls
87
  [data-bp-search] input[type="text"],
88
  .groups-members-search input[type="search"],
89
  .groups-members-search input[type="text"] {
90
+ background-color: $off-white;
91
  border: 1px solid $form-border-color;
92
  border-radius: 0;
93
  font: inherit;
163
  input:focus,
164
  textarea:focus,
165
  select:focus {
166
+ background-color: $off-white;
167
  color: $bp-text;
168
  outline: 0;
169
  }
bp-templates/bp-nouveau/common-styles/_bp_generic_and_typography.scss CHANGED
@@ -1,6 +1,6 @@
1
  // BP Generic elements, Typography and Images.
2
  // @since 3.0.0
3
- // @version 5.0.0
4
 
5
  // ========= Generic Sitewide elements ========
6
  body {
@@ -59,7 +59,10 @@ body.buddypress {
59
  .entry-header,
60
  .site-content .entry-header,
61
  .entry-content {
62
- max-width: none;
 
 
 
63
  }
64
 
65
  .entry-header {
@@ -166,7 +169,7 @@ body.buddypress {
166
  margin-bottom: 2em;
167
  padding: 0;
168
 
169
- .entry-title {
170
 
171
  @include responsive-font(34);
172
  font-weight: inherit;
1
  // BP Generic elements, Typography and Images.
2
  // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
  // ========= Generic Sitewide elements ========
6
  body {
59
  .entry-header,
60
  .site-content .entry-header,
61
  .entry-content {
62
+
63
+ &:not(.alignwide):not(.alignfull) {
64
+ max-width: none;
65
+ }
66
  }
67
 
68
  .entry-header {
169
  margin-bottom: 2em;
170
  padding: 0;
171
 
172
+ &:not(.alignwide):not(.alignfull) .entry-title {
173
 
174
  @include responsive-font(34);
175
  font-weight: inherit;
bp-templates/bp-nouveau/common-styles/_bp_group_header.scss CHANGED
@@ -1,10 +1,20 @@
1
  // BP Single Group Header Styles.
2
- // @version 3.0.0
 
3
 
4
  .groups-header {
5
 
6
  .bp-group-type-list {
 
 
7
  margin: 0;
 
 
 
 
 
 
 
8
  }
9
 
10
  .bp-feedback {
1
  // BP Single Group Header Styles.
2
+ // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
  .groups-header {
6
 
7
  .bp-group-type-list {
8
+
9
+ @include font-size(18);
10
  margin: 0;
11
+ color: $black;
12
+ display: flex;
13
+
14
+ strong {
15
+ padding-right: $pad-med;
16
+ white-space: nowrap;
17
+ }
18
  }
19
 
20
  .bp-feedback {
bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss CHANGED
@@ -1,5 +1,6 @@
1
  // Sitewide template error & info messages constructs.
2
- // @version 3.0.0.
 
3
  .buddypress-wrap {
4
 
5
  .warn {
@@ -27,22 +28,6 @@
27
  clear: both;
28
  display: block;
29
  }
30
-
31
- // Error message boxes
32
- &.error {
33
-
34
- p {
35
- // oh linter you're too boringly pedantic, there will be properties!
36
- }
37
- }
38
-
39
- // Warning boxes
40
- // &.warning {
41
-
42
- // p {
43
- // }
44
- // }
45
-
46
  } // close .bp-messages
47
 
48
  // user message screens handled separately due to backbone templates
@@ -317,3 +302,28 @@
317
  }
318
 
319
  } // close .buddypress-wrap
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  // Sitewide template error & info messages constructs.
2
+ // @since 3.0.0.
3
+ // @version 7.0.0
4
  .buddypress-wrap {
5
 
6
  .warn {
28
  clear: both;
29
  display: block;
30
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  } // close .bp-messages
32
 
33
  // user message screens handled separately due to backbone templates
302
  }
303
 
304
  } // close .buddypress-wrap
305
+
306
+ body.create-blog {
307
+
308
+ #buddypress {
309
+
310
+ .error,
311
+ .success {
312
+
313
+ @include message-box($border: none);
314
+ @include box-shadow( 0 1px 1px 1px rgba(0, 0, 0, 0.1) );
315
+ color: $light-text-plus;
316
+ padding: 10px 15px;
317
+ background-color: $white;
318
+ }
319
+
320
+ .error {
321
+ border-left: 4px solid $warnings;
322
+ }
323
+
324
+ .success {
325
+ border-left: 4px solid $update-success;
326
+
327
+ }
328
+ }
329
+ }
bp-templates/bp-nouveau/common-styles/_bp_layouts.scss CHANGED
@@ -3,7 +3,7 @@
3
  // layouts on a user selectable basis.
4
  // The sheet also adds layout properties such as border-box
5
  // @since 3.0.0
6
- // @version 6.0.0
7
 
8
  #item-body,
9
  .single-screen-navs {
@@ -432,14 +432,14 @@
432
  }
433
  }
434
 
435
- .grid.members-list, {
436
 
437
  .list-wrap {
438
  min-height: 300px;
439
  }
440
  }
441
 
442
- .grid.blogs-list, {
443
 
444
  .list-wrap {
445
  min-height: 320px;
3
  // layouts on a user selectable basis.
4
  // The sheet also adds layout properties such as border-box
5
  // @since 3.0.0
6
+ // @version 7.0.0
7
 
8
  #item-body,
9
  .single-screen-navs {
432
  }
433
  }
434
 
435
+ .grid.members-list {
436
 
437
  .list-wrap {
438
  min-height: 300px;
439
  }
440
  }
441
 
442
+ .grid.blogs-list {
443
 
444
  .list-wrap {
445
  min-height: 320px;
bp-templates/bp-nouveau/common-styles/_bp_navigation.scss CHANGED
@@ -1,5 +1,6 @@
1
  // BP primary & secondary navigation - directory and single screens
2
- // @version 3.0.0
 
3
 
4
  // all devices & generic styles sitewide
5
  .bp-navs {
@@ -100,7 +101,7 @@
100
  }
101
 
102
  li:not(.current),
103
- li:not(.selected), {
104
 
105
  a:focus,
106
  a:hover {
@@ -251,7 +252,6 @@
251
  }
252
  }
253
  }
254
-
255
  } // close .buddypress-wrap
256
 
257
  // Single screens object navs
@@ -421,7 +421,6 @@
421
  }
422
 
423
  } // close @media
424
-
425
  } // close .buddypress-wrap
426
 
427
 
@@ -440,7 +439,6 @@
440
  }
441
  }
442
  }
443
-
444
  }
445
  }
446
 
1
  // BP primary & secondary navigation - directory and single screens
2
+ // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
  // all devices & generic styles sitewide
6
  .bp-navs {
101
  }
102
 
103
  li:not(.current),
104
+ li:not(.selected) {
105
 
106
  a:focus,
107
  a:hover {
252
  }
253
  }
254
  }
 
255
  } // close .buddypress-wrap
256
 
257
  // Single screens object navs
421
  }
422
 
423
  } // close @media
 
424
  } // close .buddypress-wrap
425
 
426
 
439
  }
440
  }
441
  }
 
442
  }
443
  }
444
 
bp-templates/bp-nouveau/common-styles/_bp_search.scss CHANGED
@@ -1,6 +1,6 @@
1
  // BP Directory Search elements
2
  // @since 3.0.0
3
- // @version 5.0.0
4
 
5
  .buddypress-wrap { // the ID is required to add weight to rules
6
 
@@ -30,9 +30,9 @@
30
  input[type="search"],
31
  input[type="text"] {
32
  float: left;
33
- line-height: 1.5;
34
  padding: 3px 10px;
35
- width: 80%;
36
  }
37
 
38
  button[type="submit"] {
1
  // BP Directory Search elements
2
  // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
  .buddypress-wrap { // the ID is required to add weight to rules
6
 
30
  input[type="search"],
31
  input[type="text"] {
32
  float: left;
33
+ line-height: 2;
34
  padding: 3px 10px;
35
+ width: 78%;
36
  }
37
 
38
  button[type="submit"] {
bp-templates/bp-nouveau/common-styles/_bp_tables.scss CHANGED
@@ -1,5 +1,6 @@
1
  // BP default/generic Table styles.
2
- // @version 3.0.0
 
3
  .buddypress-wrap {
4
 
5
  .bp-tables-user,
@@ -58,7 +59,7 @@
58
  }
59
 
60
  .bp-tables-user,
61
- table.wp-profile-fields, {
62
 
63
  tr.alt {
64
 
1
  // BP default/generic Table styles.
2
+ // @since 3.0.0
3
+ // @version 7.0.0
4
  .buddypress-wrap {
5
 
6
  .bp-tables-user,
59
  }
60
 
61
  .bp-tables-user,
62
+ table.wp-profile-fields {
63
 
64
  tr.alt {
65
 
bp-templates/bp-nouveau/common-styles/_bp_user_header.scss CHANGED
@@ -1,20 +1,40 @@
1
  // BP Single User Specific Header Styles
2
- // @version 3.0.0
 
3
 
4
- .bp-user {
5
 
6
- .users-header {
7
 
8
- .user-nicename {
9
- margin-bottom: $marg-xsml;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
- }
12
 
13
- .member-header-actions {
14
- overflow: hidden;
 
15
 
16
- * > * {
17
- display: block;
 
18
  }
19
  }
20
  }
1
  // BP Single User Specific Header Styles
2
+ // @since 3.0.0
3
+ // @version 7.0.0
4
 
5
+ body.buddypress.bp-user {
6
 
7
+ .buddypress-wrap {
8
 
9
+ .users-header {
10
+
11
+ h2.user-nicename {
12
+ margin-top: 0;
13
+ margin-bottom: $marg-xsml;
14
+ }
15
+
16
+ .bp-member-type-list {
17
+ padding-bottom: 0.5em;
18
+
19
+ @include font-size(18);
20
+ margin: 0;
21
+ color: $black;
22
+ display: flex;
23
+
24
+ strong {
25
+ padding-right: $pad-med;
26
+ white-space: nowrap;
27
+ }
28
+ }
29
  }
 
30
 
31
+ .member-header-actions {
32
+ overflow: hidden;
33
+ padding-left: 0;
34
 
35
+ * > * {
36
+ display: block;
37
+ }
38
  }
39
  }
40
  }
bp-templates/bp-nouveau/css/buddypress-rtl.css CHANGED
@@ -1,7 +1,8 @@
1
  /*--------------------------------------------------------------
2
  Hello, this is the BuddyPress Nouveau stylesheet.
3
 
4
- @version 4.0.0
 
5
 
6
  ----------------------------------------------------------------
7
  >>> TABLE OF CONTENTS:
@@ -82,9 +83,9 @@ body #buddypress .bp-list .action {
82
  }
83
 
84
  @media screen and (min-width: 46.8em) {
85
- body.buddypress .entry-header,
86
- body.buddypress .site-content .entry-header,
87
- body.buddypress .entry-content {
88
  max-width: none;
89
  }
90
  body.buddypress .entry-header {
@@ -141,14 +142,14 @@ body.buddypress article.page > .entry-header {
141
  padding: 0;
142
  }
143
 
144
- body.buddypress article.page > .entry-header .entry-title {
145
  font-size: 28px;
146
  font-weight: inherit;
147
  color: #767676;
148
  }
149
 
150
  @media screen and (min-width: 46.8em) {
151
- body.buddypress article.page > .entry-header .entry-title {
152
  font-size: 34px;
153
  }
154
  }
@@ -1774,6 +1775,16 @@ form.ac-form .ac-reply-content input {
1774
  * @section 3.2 - Blogs Loop
1775
  *----------------------------------------------------------
1776
  */
 
 
 
 
 
 
 
 
 
 
1777
  @media screen and (min-width: 46.8em) {
1778
  .buddypress-wrap .blogs-list li .item-block {
1779
  float: none;
@@ -2291,7 +2302,15 @@ body.no-js .single-item-header .js-self-profile-button {
2291
  *-----------------------------------------------------
2292
  */
2293
  .groups-header .bp-group-type-list {
 
2294
  margin: 0;
 
 
 
 
 
 
 
2295
  }
2296
 
2297
  .groups-header .bp-feedback {
@@ -2385,15 +2404,30 @@ body.no-js .single-item-header .js-self-profile-button {
2385
  * User Accounts Specific Item Header
2386
  *-----------------------------------------------------
2387
  */
2388
- .bp-user .users-header .user-nicename {
 
2389
  margin-bottom: 5px;
2390
  }
2391
 
2392
- .bp-user .member-header-actions {
 
 
 
 
 
 
 
 
 
 
 
 
 
2393
  overflow: hidden;
 
2394
  }
2395
 
2396
- .bp-user .member-header-actions * > * {
2397
  display: block;
2398
  }
2399
 
@@ -3447,7 +3481,7 @@ body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a {
3447
  .buddypress-wrap .standard-form [data-bp-search] input[type="text"],
3448
  .buddypress-wrap .standard-form .groups-members-search input[type="search"],
3449
  .buddypress-wrap .standard-form .groups-members-search input[type="text"] {
3450
- background: #fafafa;
3451
  border: 1px solid #d6d6d6;
3452
  border-radius: 0;
3453
  font: inherit;
@@ -3518,7 +3552,7 @@ body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a {
3518
  .buddypress-wrap .standard-form input:focus,
3519
  .buddypress-wrap .standard-form textarea:focus,
3520
  .buddypress-wrap .standard-form select:focus {
3521
- background: #fafafa;
3522
  color: #555;
3523
  outline: 0;
3524
  }
@@ -3757,9 +3791,9 @@ body.no-js .buddypress #messages-bulk-management #select-all-messages {
3757
  .buddypress-wrap form#group-members-search input[type="search"],
3758
  .buddypress-wrap form#group-members-search input[type="text"] {
3759
  float: right;
3760
- line-height: 1.5;
3761
  padding: 3px 10px;
3762
- width: 80%;
3763
  }
3764
 
3765
  .buddypress-wrap form.bp-dir-search-form button[type="submit"],
@@ -4105,6 +4139,7 @@ body.no-js .buddypress #messages-bulk-management #select-all-messages {
4105
  .buddypress .buddypress-wrap input[type="button"].disabled,
4106
  .buddypress .buddypress-wrap input[type="reset"].disabled,
4107
  .buddypress .buddypress-wrap input[type="submit"][disabled="disabled"],
 
4108
  .buddypress .buddypress-wrap button.pending,
4109
  .buddypress .buddypress-wrap button.disabled,
4110
  .buddypress .buddypress-wrap div.pending a,
@@ -4571,6 +4606,24 @@ body.no-js .buddypress #messages-bulk-management #select-all-messages {
4571
  top: 30px;
4572
  }
4573
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4574
  .buddypress.widget .item-options {
4575
  font-size: 12px;
4576
  margin: 0 0 1em;
1
  /*--------------------------------------------------------------
2
  Hello, this is the BuddyPress Nouveau stylesheet.
3
 
4
+ @since 3.0.0
5
+ @version 7.0.0
6
 
7
  ----------------------------------------------------------------
8
  >>> TABLE OF CONTENTS:
83
  }
84
 
85
  @media screen and (min-width: 46.8em) {
86
+ body.buddypress .entry-header:not(.alignwide):not(.alignfull),
87
+ body.buddypress .site-content .entry-header:not(.alignwide):not(.alignfull),
88
+ body.buddypress .entry-content:not(.alignwide):not(.alignfull) {
89
  max-width: none;
90
  }
91
  body.buddypress .entry-header {
142
  padding: 0;
143
  }
144
 
145
+ body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
146
  font-size: 28px;
147
  font-weight: inherit;
148
  color: #767676;
149
  }
150
 
151
  @media screen and (min-width: 46.8em) {
152
+ body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
153
  font-size: 34px;
154
  }
155
  }
1775
  * @section 3.2 - Blogs Loop
1776
  *----------------------------------------------------------
1777
  */
1778
+ .buddypress-wrap .blogs-list li .item-avatar img.avatar-150 {
1779
+ max-width: 150px;
1780
+ max-height: 150px;
1781
+ }
1782
+
1783
+ .buddypress-wrap .blogs-list li .item-avatar img.avatar-50 {
1784
+ max-width: 50px;
1785
+ max-height: 50px;
1786
+ }
1787
+
1788
  @media screen and (min-width: 46.8em) {
1789
  .buddypress-wrap .blogs-list li .item-block {
1790
  float: none;
2302
  *-----------------------------------------------------
2303
  */
2304
  .groups-header .bp-group-type-list {
2305
+ font-size: 18px;
2306
  margin: 0;
2307
+ color: #333;
2308
+ display: flex;
2309
+ }
2310
+
2311
+ .groups-header .bp-group-type-list strong {
2312
+ padding-left: 1em;
2313
+ white-space: nowrap;
2314
  }
2315
 
2316
  .groups-header .bp-feedback {
2404
  * User Accounts Specific Item Header
2405
  *-----------------------------------------------------
2406
  */
2407
+ body.buddypress.bp-user .buddypress-wrap .users-header h2.user-nicename {
2408
+ margin-top: 0;
2409
  margin-bottom: 5px;
2410
  }
2411
 
2412
+ body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list {
2413
+ padding-bottom: 0.5em;
2414
+ font-size: 18px;
2415
+ margin: 0;
2416
+ color: #333;
2417
+ display: flex;
2418
+ }
2419
+
2420
+ body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list strong {
2421
+ padding-left: 1em;
2422
+ white-space: nowrap;
2423
+ }
2424
+
2425
+ body.buddypress.bp-user .buddypress-wrap .member-header-actions {
2426
  overflow: hidden;
2427
+ padding-right: 0;
2428
  }
2429
 
2430
+ body.buddypress.bp-user .buddypress-wrap .member-header-actions * > * {
2431
  display: block;
2432
  }
2433
 
3481
  .buddypress-wrap .standard-form [data-bp-search] input[type="text"],
3482
  .buddypress-wrap .standard-form .groups-members-search input[type="search"],
3483
  .buddypress-wrap .standard-form .groups-members-search input[type="text"] {
3484
+ background-color: #fafafa;
3485
  border: 1px solid #d6d6d6;
3486
  border-radius: 0;
3487
  font: inherit;
3552
  .buddypress-wrap .standard-form input:focus,
3553
  .buddypress-wrap .standard-form textarea:focus,
3554
  .buddypress-wrap .standard-form select:focus {
3555
+ background-color: #fafafa;
3556
  color: #555;
3557
  outline: 0;
3558
  }
3791
  .buddypress-wrap form#group-members-search input[type="search"],
3792
  .buddypress-wrap form#group-members-search input[type="text"] {
3793
  float: right;
3794
+ line-height: 2;
3795
  padding: 3px 10px;
3796
+ width: 78%;
3797
  }
3798
 
3799
  .buddypress-wrap form.bp-dir-search-form button[type="submit"],
4139
  .buddypress .buddypress-wrap input[type="button"].disabled,
4140
  .buddypress .buddypress-wrap input[type="reset"].disabled,
4141
  .buddypress .buddypress-wrap input[type="submit"][disabled="disabled"],
4142
+ .buddypress .buddypress-wrap input[type="submit"]:disabled,
4143
  .buddypress .buddypress-wrap button.pending,
4144
  .buddypress .buddypress-wrap button.disabled,
4145
  .buddypress .buddypress-wrap div.pending a,
4606
  top: 30px;
4607
  }
4608
 
4609
+ body.create-blog #buddypress .error,
4610
+ body.create-blog #buddypress .success {
4611
+ background: #fff;
4612
+ color: #807f7f;
4613
+ box-shadow: 0 1px 1px 1px rgba(0, 0, 0, 0.1);
4614
+ color: #737373;
4615
+ padding: 10px 15px;
4616
+ background-color: #fff;
4617
+ }
4618
+
4619
+ body.create-blog #buddypress .error {
4620
+ border-right: 4px solid #d33;
4621
+ }
4622
+
4623
+ body.create-blog #buddypress .success {
4624
+ border-right: 4px solid #8a2;
4625
+ }
4626
+
4627
  .buddypress.widget .item-options {
4628
  font-size: 12px;
4629
  margin: 0 0 1em;
bp-templates/bp-nouveau/css/buddypress-rtl.min.css CHANGED
@@ -1 +1 @@
1
- body #buddypress * a{box-shadow:none;text-decoration:none}body #buddypress div,body #buddypress dl,body #buddypress input[type=reset],body #buddypress input[type=search],body #buddypress input[type=submit],body #buddypress li,body #buddypress select,body #buddypress textarea{border-radius:2px;background-clip:padding-box}body #buddypress #item-body blockquote,body #buddypress .bp-lists blockquote{margin-right:0}body #buddypress .bp-list .action{box-sizing:border-box}@media screen and (min-width:46.8em){body.buddypress .entry-content,body.buddypress .entry-header,body.buddypress .site-content .entry-header{max-width:none}body.buddypress .entry-header{float:none}body.buddypress .entry-content{float:none}body.buddypress .site-content{padding-top:2.5em}body.buddypress #page #primary{max-width:none}body.buddypress #page #primary .entry-content,body.buddypress #page #primary .entry-header{float:none;width:auto}}body.buddypress .buddypress-wrap h1,body.buddypress .buddypress-wrap h2,body.buddypress .buddypress-wrap h3,body.buddypress .buddypress-wrap h4,body.buddypress .buddypress-wrap h5,body.buddypress .buddypress-wrap h6{clear:none;margin:1em 0;padding:0}body.buddypress .buddypress-wrap h2:before{display:none}.bp-wrap:after,.bp-wrap:before{content:" ";display:table}.bp-wrap:after{clear:both}.buddypress-wrap.round-avatars .avatar{border-radius:50%}body.buddypress article.page>.entry-header{margin-bottom:2em;padding:0}body.buddypress article.page>.entry-header .entry-title{font-size:28px;font-weight:inherit;color:#767676}@media screen and (min-width:46.8em){body.buddypress article.page>.entry-header .entry-title{font-size:34px}}.buddypress-wrap dt.section-title{font-size:18px}@media screen and (min-width:46.8em){.buddypress-wrap dt.section-title{font-size:22px}}.buddypress-wrap .bp-label-text,.buddypress-wrap .message-threads{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-label-text,.buddypress-wrap .message-threads{font-size:16px}}.buddypress-wrap .activity-header{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .activity-header{font-size:16px}}.buddypress-wrap .activity-inner{font-size:15px}@media screen and (min-width:46.8em){.buddypress-wrap .activity-inner{font-size:18px}}.buddypress-wrap #whats-new-post-in{font-size:16px}.buddypress-wrap .acomment-meta,.buddypress-wrap .mini .activity-header{font-size:16px}.buddypress-wrap .dir-component-filters #activity-filter-by{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .dir-component-filters #activity-filter-by{font-size:16px}}.buddypress-wrap .bp-tables-user th{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-tables-user th{font-size:16px}}.buddypress-wrap .bp-tables-user td{font-size:12px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-tables-user td{font-size:14px}}.buddypress-wrap .profile-fields th{font-size:15px}@media screen and (min-width:46.8em){.buddypress-wrap .profile-fields th{font-size:18px}}.buddypress-wrap .profile-fields td{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .profile-fields td{font-size:16px}}.buddypress-wrap #notification-select{font-size:12px}@media screen and (min-width:46.8em){.buddypress-wrap #notification-select{font-size:14px}}.bp-navs{background:0 0;clear:both;overflow:hidden}.bp-navs ul{margin:0;padding:0}.bp-navs ul li{list-style:none;margin:0}.bp-navs ul li.last select{max-width:185px}.bp-navs ul li a,.bp-navs ul li span{border:0;display:block;padding:5px 10px;text-decoration:none}.bp-navs ul li .count{background:#eaeaea;border:1px solid #ccc;border-radius:50%;color:#555;display:inline;font-size:12px;margin-right:2px;padding:3px 6px;text-align:center;vertical-align:middle}.bp-navs ul li.current a,.bp-navs ul li.selected a{color:#333;opacity:1}.bp-navs.bp-invites-filters ul li a,.bp-navs.bp-messages-filters ul li a{border:1px solid #ccc;display:inline-block}.main-navs.dir-navs{margin-bottom:20px}.buddypress-wrap .bp-navs li a:hover a .count,.buddypress-wrap .bp-navs li.current a .count,.buddypress-wrap .bp-navs li.selected a .count{background-color:#ccc}.buddypress-wrap .bp-navs li:not(.current) a:focus,.buddypress-wrap .bp-navs li:not(.current) a:hover,.buddypress-wrap .bp-navs li:not(.selected) a:focus,.buddypress-wrap .bp-navs li:not(.selected) a:hover{background:#ccc;color:#333}.buddypress-wrap .bp-navs li.current a,.buddypress-wrap .bp-navs li.current a:focus,.buddypress-wrap .bp-navs li.current a:hover,.buddypress-wrap .bp-navs li.selected a,.buddypress-wrap .bp-navs li.selected a:focus,.buddypress-wrap .bp-navs li.selected a:hover{background:#555;color:#fafafa}@media screen and (min-width:46.8em){.buddypress-wrap .main-navs:not(.dir-navs) li.current a,.buddypress-wrap .main-navs:not(.dir-navs) li.selected a{background:#fff;color:#333;font-weight:600}.buddypress-wrap .main-navs.vertical li.current a,.buddypress-wrap .main-navs.vertical li.selected a{background:#555;color:#fafafa;text-decoration:none}.buddypress-wrap.bp-dir-hori-nav:not(.bp-vertical-navs) nav:not(.tabbed-links){border-bottom:1px solid #eee;border-top:1px solid #eee;box-shadow:0 2px 12px 0 #fafafa}}.buddypress-wrap .bp-subnavs li.current a,.buddypress-wrap .bp-subnavs li.selected a{background:#fff;color:#333;font-weight:600}@media screen and (max-width:46.8em){.buddypress-wrap:not(.bp-single-vert-nav) .bp-navs li{background:#eaeaea}}.buddypress-wrap:not(.bp-single-vert-nav) .main-navs>ul>li>a{padding:.5em calc(.5em + 2px)}.buddypress-wrap:not(.bp-single-vert-nav) .group-subnav#subsubnav,.buddypress-wrap:not(.bp-single-vert-nav) .user-subnav#subsubnav{background:0 0}.buddypress-wrap .bp-subnavs,.buddypress-wrap ul.subnav{width:100%}.buddypress-wrap .bp-subnavs{margin:10px 0;overflow:hidden}.buddypress-wrap .bp-subnavs ul li{margin-top:0}.buddypress-wrap .bp-subnavs ul li.current :focus,.buddypress-wrap .bp-subnavs ul li.current :hover,.buddypress-wrap .bp-subnavs ul li.selected :focus,.buddypress-wrap .bp-subnavs ul li.selected :hover{background:0 0;color:#333}.buddypress-wrap ul.subnav{width:auto}.buddypress-wrap .bp-navs.bp-invites-filters#subsubnav ul li.last,.buddypress-wrap .bp-navs.bp-invites-nav#subnav ul li.last,.buddypress-wrap .bp-navs.bp-messages-filters#subsubnav ul li.last{margin-top:0}@media screen and (max-width:46.8em){.buddypress-wrap .single-screen-navs{border:1px solid #eee}.buddypress-wrap .single-screen-navs li{border-bottom:1px solid #eee}.buddypress-wrap .single-screen-navs li:last-child{border-bottom:none}.buddypress-wrap .bp-subnavs li a{font-size:14px}.buddypress-wrap .bp-subnavs li.current a,.buddypress-wrap .bp-subnavs li.current a:focus,.buddypress-wrap .bp-subnavs li.current a:hover,.buddypress-wrap .bp-subnavs li.selected a,.buddypress-wrap .bp-subnavs li.selected a:focus,.buddypress-wrap .bp-subnavs li.selected a:hover{background:#555;color:#fff}}.buddypress-wrap .bp-navs li.current a .count,.buddypress-wrap .bp-navs li.selected a .count,.buddypress_object_nav .bp-navs li.current a .count,.buddypress_object_nav .bp-navs li.selected a .count{background-color:#fff}.buddypress-wrap .bp-navs li.dynamic a .count,.buddypress-wrap .bp-navs li.dynamic.current a .count,.buddypress-wrap .bp-navs li.dynamic.selected a .count,.buddypress_object_nav .bp-navs li.dynamic a .count,.buddypress_object_nav .bp-navs li.dynamic.current a .count,.buddypress_object_nav .bp-navs li.dynamic.selected a .count{background-color:#5087e5;border:0;color:#fafafa}.buddypress-wrap .bp-navs li.dynamic a:hover .count,.buddypress_object_nav .bp-navs li.dynamic a:hover .count{background-color:#5087e5;border:0;color:#fff}.buddypress-wrap .bp-navs li a .count:empty,.buddypress_object_nav .bp-navs li a .count:empty{display:none}.buddypress-wrap .bp-navs.group-create-links ul li:not(.current),.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current){color:#767676}.buddypress-wrap .bp-navs.group-create-links ul li:not(.current) a,.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current) a{color:#767676}.buddypress-wrap .bp-navs.group-create-links ul li:not(.current) a:focus,.buddypress-wrap .bp-navs.group-create-links ul li:not(.current) a:hover,.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current) a:focus,.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current) a:hover{background:0 0;color:#333}.buddypress-wrap .bp-navs.group-create-links ul li:not(.current) a[disabled]:focus,.buddypress-wrap .bp-navs.group-create-links ul li:not(.current) a[disabled]:hover,.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current) a[disabled]:focus,.buddypress_object_nav .bp-navs.group-create-links ul li:not(.current) a[disabled]:hover{color:#767676}.buddypress-wrap .bp-navs.group-create-links ul li.current a,.buddypress_object_nav .bp-navs.group-create-links ul li.current a{text-align:center}@media screen and (min-width:46.8em){.buddypress-wrap .bp-navs li{float:right}.buddypress-wrap .subnav{float:right}.buddypress-wrap ul.subnav{width:auto}.buddypress-wrap #subsubnav .activity-search{float:right}.buddypress-wrap #subsubnav .filter{float:left}}.buddypress_object_nav .bp-navs li a .count{display:inline-block;float:left}@media screen and (min-width:46.8em){.bp-dir-vert-nav .bp-navs.dir-navs{background:0 0}.bp-dir-vert-nav .bp-navs.dir-navs a .count{float:left}}@media screen and (min-width:46.8em){.buddypress-wrap .tabbed-links ol,.buddypress-wrap .tabbed-links ul{border-bottom:1px solid #ccc;float:none;margin:20px 0 10px}.buddypress-wrap .tabbed-links ol:after,.buddypress-wrap .tabbed-links ol:before,.buddypress-wrap .tabbed-links ul:after,.buddypress-wrap .tabbed-links ul:before{content:" ";display:block}.buddypress-wrap .tabbed-links ol:after,.buddypress-wrap .tabbed-links ul:after{clear:both}.buddypress-wrap .tabbed-links ol li,.buddypress-wrap .tabbed-links ul li{float:right;list-style:none;margin:0 0 0 10px}.buddypress-wrap .tabbed-links ol li a,.buddypress-wrap .tabbed-links ol li span:not(.count),.buddypress-wrap .tabbed-links ul li a,.buddypress-wrap .tabbed-links ul li span:not(.count){background:0 0;border:none;display:block;padding:4px 10px}.buddypress-wrap .tabbed-links ol li a:focus,.buddypress-wrap .tabbed-links ol li a:hover,.buddypress-wrap .tabbed-links ul li a:focus,.buddypress-wrap .tabbed-links ul li a:hover{background:0 0}.buddypress-wrap .tabbed-links ol li:not(.current),.buddypress-wrap .tabbed-links ul li:not(.current){margin-bottom:2px}.buddypress-wrap .tabbed-links ol li.current,.buddypress-wrap .tabbed-links ul li.current{border-color:#ccc #ccc #fff;border-style:solid;border-top-right-radius:4px;border-top-left-radius:4px;border-width:1px;margin-bottom:-1px;padding:0 .5em 1px}.buddypress-wrap .tabbed-links ol li.current a,.buddypress-wrap .tabbed-links ul li.current a{background:0 0;color:#333}.buddypress-wrap .bp-subnavs.tabbed-links>ul{margin-top:0}.buddypress-wrap .bp-navs.tabbed-links{background:0 0;margin-top:2px}.buddypress-wrap .bp-navs.tabbed-links ul li a{border-left:0;font-size:inherit}.buddypress-wrap .bp-navs.tabbed-links ul li.last{float:left;margin:0}.buddypress-wrap .bp-navs.tabbed-links ul li.last a{margin-top:-.5em}.buddypress-wrap .bp-navs.tabbed-links ul li a,.buddypress-wrap .bp-navs.tabbed-links ul li a:focus,.buddypress-wrap .bp-navs.tabbed-links ul li a:hover,.buddypress-wrap .bp-navs.tabbed-links ul li.current a,.buddypress-wrap .bp-navs.tabbed-links ul li.current a:focus,.buddypress-wrap .bp-navs.tabbed-links ul li.current a:hover{background:0 0;border:0}.buddypress-wrap .bp-navs.tabbed-links ul li a:active,.buddypress-wrap .bp-navs.tabbed-links ul li.current a:active{outline:0}}.buddypress-wrap .dir-component-filters .filter label{display:inline}.buddypress-wrap .subnav-filters:after,.buddypress-wrap .subnav-filters:before{content:" ";display:table}.buddypress-wrap .subnav-filters:after{clear:both}.buddypress-wrap .subnav-filters{background:0 0;list-style:none;margin:15px 0 0;padding:0}.buddypress-wrap .subnav-filters div{margin:0}.buddypress-wrap .subnav-filters>ul{float:right;list-style:none}.buddypress-wrap .subnav-filters.bp-messages-filters ul{width:100%}.buddypress-wrap .subnav-filters.bp-messages-filters .messages-search{margin-bottom:1em}@media screen and (min-width:46.8em){.buddypress-wrap .subnav-filters.bp-messages-filters .messages-search{margin-bottom:0}}.buddypress-wrap .subnav-filters div{float:none}.buddypress-wrap .subnav-filters div input[type=search],.buddypress-wrap .subnav-filters div select{font-size:16px}.buddypress-wrap .subnav-filters div button.nouveau-search-submit{padding:5px .8em 6px}.buddypress-wrap .subnav-filters div button#user_messages_search_submit{padding:7px .8em}.buddypress-wrap .subnav-filters .component-filters{margin-top:10px}.buddypress-wrap .subnav-filters .feed{margin-left:15px}.buddypress-wrap .subnav-filters .last.filter label{display:inline}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions-wrap:after,.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions-wrap:before{content:" ";display:table}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions-wrap:after{clear:both}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions-wrap.bp-show{display:inline-block}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions-wrap.bp-hide{display:none}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .select-wrap{border:0}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .select-wrap:focus,.buddypress-wrap .subnav-filters .user-messages-bulk-actions .select-wrap:hover{outline:1px solid #d6d6d6}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-actions{float:right}.buddypress-wrap .subnav-filters .user-messages-bulk-actions label{display:inline-block;font-weight:300;margin-left:25px;padding:5px 0}.buddypress-wrap .subnav-filters .user-messages-bulk-actions div select{-webkit-appearance:textfield}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-apply{border:0;border-radius:0;font-weight:400;line-height:1.8;margin:0 10px 0 0;padding:3px 5px;text-align:center;text-transform:none;width:auto}.buddypress-wrap .subnav-filters .user-messages-bulk-actions .bulk-apply span{vertical-align:middle}@media screen and (min-width:32em){.buddypress-wrap .subnav-filters li{margin-bottom:0}.buddypress-wrap .subnav-filters .bp-search,.buddypress-wrap .subnav-filters .dir-search,.buddypress-wrap .subnav-filters .feed,.buddypress-wrap .subnav-filters .group-act-search,.buddypress-wrap .subnav-filters .group-invites-search,.buddypress-wrap .subnav-filters .subnav-search,.buddypress-wrap .subnav-filters .subnav-search form,.buddypress-wrap .subnav-filters .user-messages-bulk-actions,.buddypress-wrap .subnav-filters .user-messages-search{float:right}.buddypress-wrap .subnav-filters .component-filters,.buddypress-wrap .subnav-filters .last{float:left;margin-top:0;width:auto}.buddypress-wrap .subnav-filters .component-filters select,.buddypress-wrap .subnav-filters .last select{max-width:250px}.buddypress-wrap .subnav-filters .user-messages-search{float:left}}.buddypress-wrap .notifications-options-nav input#notification-bulk-manage{border:0;border-radius:0;line-height:1.6}.buddypress-wrap .group-subnav-filters .group-invites-search{margin-bottom:1em}.buddypress-wrap .group-subnav-filters .last{text-align:center}.buddypress-wrap .bp-pagination{background:0 0;border:0;color:#767676;float:right;font-size:small;margin:0;padding:.5em 0;position:relative;width:100%}.buddypress-wrap .bp-pagination .pag-count{float:right}.buddypress-wrap .bp-pagination .bp-pagination-links{float:left;margin-left:10px}.buddypress-wrap .bp-pagination .bp-pagination-links a,.buddypress-wrap .bp-pagination .bp-pagination-links span{font-size:small;padding:0 5px}.buddypress-wrap .bp-pagination .bp-pagination-links a:focus,.buddypress-wrap .bp-pagination .bp-pagination-links a:hover{opacity:1}.buddypress-wrap .bp-pagination p{margin:0}.bp-list:after,.bp-list:before{content:" ";display:table}.bp-list:after{clear:both}.bp-list{box-sizing:border-box;border-top:1px solid #eaeaea;clear:both;list-style:none;margin:20px 0;padding:.5em 0;width:100%}.bp-list li:after,.bp-list li:before{content:" ";display:table}.bp-list li:after{clear:both}.bp-list>li{border-bottom:1px solid #eaeaea}.bp-list li{list-style:none;margin:10px 0;padding:.5em 0;position:relative}.bp-list li .item-avatar{text-align:center}.bp-list li .item-avatar img.avatar{display:inline-block;width:auto;height:auto}.bp-list li .item .group-details,.bp-list li .item .item-avatar,.bp-list li .item .item-meta,.bp-list li .item .list-title{text-align:center}.bp-list li .item .list-title{clear:none;font-size:22px;font-weight:400;line-height:1.1;margin:0 auto}@media screen and (min-width:46.8em){.bp-list li .item .list-title{font-size:26px}}.bp-list li .item-meta,.bp-list li .meta{color:#737373;font-size:12px;margin-bottom:10px;margin-top:10px}.bp-list li .last-post{text-align:center}.bp-list li .action{margin:0;text-align:center}.bp-list li .action .generic-button{display:inline-block;font-size:12px;margin:0 0 0 10px}.bp-list li .action div.generic-button{margin:10px 0}@media screen and (min-width:46.8em){.bp-list li .item-avatar{float:right;margin-left:5%}.bp-list li .item{margin:0;overflow:hidden}.bp-list li .item .item-block{float:right;margin-left:2%;width:50%}.bp-list li .item .item-meta,.bp-list li .item .list-title{float:right;text-align:right}.bp-list li .item .group-details,.bp-list li .item .last-post{text-align:right}.bp-list li .group-desc,.bp-list li .last-post,.bp-list li .user-update{clear:none;overflow:hidden;width:auto}.bp-list li .action{clear:right;padding:0;text-align:right}.bp-list li .action li.generic-button{margin-left:0}.bp-list li .action div.generic-button{margin:0 0 10px}.bp-list li .generic-button{display:block;margin:0 0 5px 0}}@media screen and (min-width:32em){#activity-stream{clear:both;padding-top:1em}}.activity-list.bp-list{background:#fafafa;border:1px solid #eee}.activity-list.bp-list .activity-item{background:#fff;border:1px solid #b7b7b7;box-shadow:0 0 6px #d2d2d2;margin:20px 0}.activity-list.bp-list li:first-child{margin-top:0}.friends-list{list-style-type:none}.friends-request-list .item-title,.membership-requests-list .item-title{text-align:center}@media screen and (min-width:46.8em){.friends-request-list li,.membership-requests-list li{display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:row nowrap;flex-flow:row nowrap}.friends-request-list li .item,.membership-requests-list li .item{-moz-flex:1 1 auto;-o-flex:1 1 auto;flex:1 1 auto}.friends-request-list li .action,.membership-requests-list li .action{text-align:left}.friends-request-list li .item-title,.membership-requests-list li .item-title{font-size:22px;text-align:right}.friends-request-list li .item-title h3,.membership-requests-list li .item-title h3{margin:0}}#notifications-user-list{clear:both;padding-top:1em}@media screen and (min-width:46.8em){body:not(.logged-in) .bp-list .item{margin-left:0}}.activity-permalink .item-list,.activity-permalink .item-list li.activity-item{border:0}.activity-update-form{padding:10px 10px 0}.item-body .activity-update-form .activity-form{margin:0;padding:0}.activity-update-form{border:1px solid #ccc;box-shadow:inset 0 0 6px #eee;margin:15px 0}.activity-update-form #whats-new-avatar{margin:10px 0;text-align:center}.activity-update-form #whats-new-avatar img{box-shadow:none;display:inline-block;height:auto;width:auto}.activity-update-form #whats-new-content{padding:0 0 20px 0}.activity-update-form #whats-new-textarea textarea{background:#fff;box-sizing:border-box;color:#333;font-family:inherit;font-size:medium;height:2.2em;line-height:1.4;padding:6px;width:100%}.activity-update-form #whats-new-textarea textarea:focus{box-shadow:0 0 6px 0 #d6d6d6}.activity-update-form #whats-new-post-in-box{margin:10px 0}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items{list-style:none;margin:10px 0;padding-right:0}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items li{margin-bottom:10px}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items button.bp-remove-item{margin-right:10px;height:auto}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items #activity-autocomplete{padding:.3em;width:100%}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object{display:flex;align-items:center;padding:.2em}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object .avatar{width:30px;height:30px}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object span{padding-right:10px;vertical-align:middle}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object:focus,.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object:hover{background:#eaeaea;cursor:pointer}.activity-update-form #whats-new-post-in-box #whats-new-post-in-box-items .bp-activity-object.selected{border:1px solid #d6d6d6}.activity-update-form #whats-new-submit{margin:15px 0 10px}.activity-update-form #whats-new-submit input{font-size:14px;line-height:inherit;margin-bottom:10px;margin-left:10px;padding:.2em 0;text-align:center;width:100%}@media screen and (min-width:46.8em){.activity-update-form #whats-new-avatar{display:block;float:right;margin:0}.activity-update-form #whats-new-content,.activity-update-form #whats-new-post-in-box,.activity-update-form #whats-new-submit{margin-right:55px}.activity-update-form #whats-new-submit input{margin-bottom:0;margin-left:10px;width:8em}}.activity-list{padding:.5em}.activity-list .activity-item:after,.activity-list .activity-item:before{content:" ";display:table}.activity-list .activity-item:after{clear:both}.activity-list .activity-item{list-style:none;padding:1em}.activity-list .activity-item.has-comments{padding-bottom:1em}.activity-list .activity-item div.item-avatar{margin:0 auto;text-align:center;width:auto}.activity-list .activity-item div.item-avatar img{height:auto;max-width:40%}@media screen and (min-width:46.8em){.activity-list .activity-item div.item-avatar{margin:0 0 0 2%;text-align:right;width:15%}.activity-list .activity-item div.item-avatar img{max-width:80%}}.activity-list .activity-item.mini{font-size:13px;position:relative}.activity-list .activity-item.mini .activity-avatar{margin-right:0;text-align:center;width:auto}.activity-list .activity-item.mini .activity-avatar img.FB_profile_pic,.activity-list .activity-item.mini .activity-avatar img.avatar{max-width:15%}@media screen and (min-width:46.8em){.activity-list .activity-item.mini .activity-avatar{margin-right:15px;text-align:right;width:15%}.activity-list .activity-item.mini .activity-avatar img.FB_profile_pic,.activity-list .activity-item.mini .activity-avatar img.avatar{max-width:60%}}.activity-list .activity-item.new_forum_post .activity-inner,.activity-list .activity-item.new_forum_topic .activity-inner{border-right:2px solid #eaeaea;margin-right:10px;padding-right:1em}.activity-list .activity-item.newest_blogs_activity,.activity-list .activity-item.newest_friends_activity,.activity-list .activity-item.newest_groups_activity,.activity-list .activity-item.newest_mentions_activity{background:rgba(31,179,221,.1)}.activity-list .activity-item .activity-inreplyto{color:#767676;font-size:13px}.activity-list .activity-item .activity-inreplyto>p{display:inline;margin:0}.activity-list .activity-item .activity-inreplyto .activity-inner,.activity-list .activity-item .activity-inreplyto blockquote{background:0 0;border:0;display:inline;margin:0;overflow:hidden;padding:0}.activity-list .activity-item .activity-header{margin:0 auto;width:80%}.activity-list .activity-item .activity-header a,.activity-list .activity-item .activity-header img{display:inline}.activity-list .activity-item .activity-header .avatar{display:inline-block;margin:0 5px;vertical-align:text-top;width:20px;height:20px}.activity-list .activity-item .activity-header .time-since{font-size:14px;color:#767676;text-decoration:none}.activity-list .activity-item .activity-header .time-since:hover{color:#767676;cursor:pointer;text-decoration:underline}.activity-list .activity-item .activity-content .activity-header,.activity-list .activity-item .activity-content .comment-header{color:#767676;margin-bottom:10px}.activity-list .activity-item .activity-content .activity-inner,.activity-list .activity-item .activity-content blockquote{background:#fafafa;margin:15px 0 10px;overflow:hidden;padding:1em}.activity-list .activity-item .activity-content p{margin:0}.activity-list .activity-item .activity-inner p{word-wrap:break-word}.activity-list .activity-item .activity-read-more{margin-right:1em;white-space:nowrap}.activity-list .activity-item ul.activity-meta{margin:0;padding-right:0}.activity-list .activity-item ul.activity-meta li{border:0;display:inline-block}.activity-list .activity-item .activity-meta.action{border:1px solid transparent;background:#fafafa;padding:2px;position:relative;text-align:right}.activity-list .activity-item .activity-meta.action div.generic-button{margin:0}.activity-list .activity-item .activity-meta.action .button{background:0 0;color:#555}.activity-list .activity-item .activity-meta.action a{padding:4px 8px}.activity-list .activity-item .activity-meta.action .button:focus,.activity-list .activity-item .activity-meta.action .button:hover{background:0 0}.activity-list .activity-item .activity-meta.action .button:before,.activity-list .activity-item .activity-meta.action .icons:before{font-family:dashicons;font-size:18px;vertical-align:middle}.activity-list .activity-item .activity-meta.action .acomment-reply.button:before{content:"\f101"}.activity-list .activity-item .activity-meta.action .view:before{content:"\f125"}.activity-list .activity-item .activity-meta.action .fav:before{content:"\f154"}.activity-list .activity-item .activity-meta.action .unfav:before{content:"\f155"}.activity-list .activity-item .activity-meta.action .delete-activity:before{content:"\f153"}.activity-list .activity-item .activity-meta.action .delete-activity:hover{color:#800}.activity-list .activity-item .activity-meta.action .button{border:0;box-shadow:none}.activity-list .activity-item .activity-meta.action .button span{background:0 0;color:#555;font-weight:700}@media screen and (min-width:46.8em){.activity-list.bp-list{padding:30px}.activity-list .activity-item .activity-content{margin:0;position:relative}.activity-list .activity-item .activity-content:after{clear:both;content:"";display:table}.activity-list .activity-item .activity-header{margin:0 0 0 15px;width:auto}}.buddypress-wrap .activity-list .load-more,.buddypress-wrap .activity-list .load-newest{background:#fafafa;border:1px solid #eee;font-size:110%;margin:15px 0;padding:0;text-align:center}.buddypress-wrap .activity-list .load-more a,.buddypress-wrap .activity-list .load-newest a{color:#555;display:block;padding:.5em 0}.buddypress-wrap .activity-list .load-more a:focus,.buddypress-wrap .activity-list .load-more a:hover,.buddypress-wrap .activity-list .load-newest a:focus,.buddypress-wrap .activity-list .load-newest a:hover{background:#fff;color:#333}.buddypress-wrap .activity-list .load-more:focus,.buddypress-wrap .activity-list .load-more:hover,.buddypress-wrap .activity-list .load-newest:focus,.buddypress-wrap .activity-list .load-newest:hover{border-color:#e1e1e1;box-shadow:0 0 6px 0 #eaeaea}body.activity-permalink .activity-list li{border-width:1px;padding:1em 0 0 0}body.activity-permalink .activity-list li:first-child{padding-top:0}body.activity-permalink .activity-list li.has-comments{padding-bottom:0}body.activity-permalink .activity-list .activity-avatar{width:auto}body.activity-permalink .activity-list .activity-avatar a{display:block}body.activity-permalink .activity-list .activity-avatar img{max-width:100%;background-color:#eaeaea}body.activity-permalink .activity-list .activity-content{border:0;font-size:100%;line-height:1.5;padding:0}body.activity-permalink .activity-list .activity-content .activity-header{margin:0;padding:.5em 0 0 0;text-align:center;width:100%}body.activity-permalink .activity-list .activity-content .activity-inner,body.activity-permalink .activity-list .activity-content blockquote{margin-right:0;margin-top:10px}body.activity-permalink .activity-list .activity-meta{margin:10px 0 10px}body.activity-permalink .activity-list .activity-comments{margin-bottom:10px}@media screen and (min-width:46.8em){body.activity-permalink .activity-list .activity-avatar{right:-20px;margin-left:0;position:relative;top:-20px}body.activity-permalink .activity-list .activity-avatar img{box-shadow:0 0 0 8px #fff}body.activity-permalink .activity-list .activity-content{margin-left:10px}body.activity-permalink .activity-list .activity-content .activity-header p{text-align:right}}.buddypress-wrap .activity-comments{clear:both;margin:0 5%;overflow:hidden;position:relative;width:auto}.buddypress-wrap .activity-comments ul{clear:both;list-style:none;margin:15px 0 0;padding:0}.buddypress-wrap .activity-comments ul li{border-top:1px solid #eee;border-bottom:0;padding:1em 0 0}.buddypress-wrap .activity-comments ul li ul{margin-right:5%}.buddypress-wrap .activity-comments ul li:first-child{border-top:0}.buddypress-wrap .activity-comments ul li:last-child{margin-bottom:0}.buddypress-wrap .activity-comments div.acomment-avatar{width:auto}.buddypress-wrap .activity-comments div.acomment-avatar img{border-width:1px;float:right;height:25px;max-width:none;width:25px}.buddypress-wrap .activity-comments .acomment-content p,.buddypress-wrap .activity-comments .acomment-meta{font-size:14px}.buddypress-wrap .activity-comments .acomment-meta{color:#555;overflow:hidden;padding-right:2%}.buddypress-wrap .activity-comments .acomment-content{border-right:1px solid #ccc;margin:15px 10% 0 0;padding:.5em 1em}.buddypress-wrap .activity-comments .acomment-content p{margin-bottom:.5em}.buddypress-wrap .activity-comments .acomment-options{float:right;margin:10px 20px 10px 0}.buddypress-wrap .activity-comments .acomment-options a{color:#767676;font-size:14px}.buddypress-wrap .activity-comments .acomment-options a:focus,.buddypress-wrap .activity-comments .acomment-options a:hover{color:inherit}.buddypress-wrap .activity-comments .activity-meta.action{background:0 0;margin-top:10px}.buddypress-wrap .activity-comments .activity-meta.action button{font-size:14px;font-weight:400;text-transform:none}.buddypress-wrap .activity-comments .show-all button{font-size:14px;text-decoration:underline;padding-right:.5em}.buddypress-wrap .activity-comments .show-all button span{text-decoration:none}.buddypress-wrap .activity-comments .show-all button:focus span,.buddypress-wrap .activity-comments .show-all button:hover span{color:#5087e5}.buddypress-wrap .mini .activity-comments{clear:both;margin-top:0}body.activity-permalink .activity-comments{background:0 0;width:auto}body.activity-permalink .activity-comments>ul{padding:0 1em 0 .5em}body.activity-permalink .activity-comments ul li>ul{margin-top:10px}form.ac-form{display:none;padding:1em}form.ac-form .ac-reply-avatar{float:right}form.ac-form .ac-reply-avatar img{border:1px solid #eee}form.ac-form .ac-reply-content{color:#767676;padding-right:1em}form.ac-form .ac-reply-content a{text-decoration:none}form.ac-form .ac-reply-content .ac-textarea{margin-bottom:15px;padding:0 .5em;overflow:hidden}form.ac-form .ac-reply-content .ac-textarea textarea{background:0 0;box-shadow:none;color:#555;font-family:inherit;font-size:100%;height:60px;margin:0;outline:0;padding:.5em;width:100%}form.ac-form .ac-reply-content .ac-textarea textarea:focus{box-shadow:0 0 6px #d6d6d6}form.ac-form .ac-reply-content input{margin-top:10px}.activity-comments li form.ac-form{clear:both;margin-left:15px}.activity-comments form.root{margin-right:0}@media screen and (min-width:46.8em){.buddypress-wrap .blogs-list li .item-block{float:none;width:auto}.buddypress-wrap .blogs-list li .item-meta{clear:right;float:none}}@media screen and (min-width:46.8em){.buddypress-wrap .bp-dir-vert-nav .blogs-list .list-title{width:auto}}.buddypress-wrap .groups-list li .list-title{text-align:center}.buddypress-wrap .groups-list li .group-details{clear:right}.buddypress-wrap .groups-list li .group-desc{border:1px solid #eaeaea;border-radius:10px;background-clip:padding-box;font-size:13px;color:#737373;font-style:italic;margin:10px auto 0;padding:1em}@media screen and (min-width:46.8em){.buddypress-wrap .groups-list li .group-desc{font-size:16px}}.buddypress-wrap .groups-list li p{margin:0 0 .5em}@media screen and (min-width:46.8em){.buddypress-wrap .groups-list li .item{margin-left:0}.buddypress-wrap .groups-list li .item-meta,.buddypress-wrap .groups-list li .list-title{text-align:right;width:auto}.buddypress-wrap .groups-list li .item-meta{margin-bottom:20px}.buddypress-wrap .groups-list li .last-activity{clear:right;margin-top:-20px}}.buddypress-wrap .groups-list li.group-no-avatar div.group-desc{margin-right:0}.buddypress-wrap .mygroups .groups-list.grid .wrap{min-height:450px;padding-bottom:0}@media screen and (min-width:46.8em){.buddypress-wrap .groups-list.grid.four .group-desc,.buddypress-wrap .groups-list.grid.three .group-desc{font-size:14px}}@media screen and (min-width:46.8em){.buddypress .bp-vertical-navs .groups-list .item-avatar{margin-left:3%;width:15%}}.buddypress-wrap .members-list li .member-name{margin-bottom:10px}.buddypress-wrap .members-list li .item-extra-content{clear:both;font-size:14px}.buddypress-wrap .members-list li .user-update{border:1px solid #eaeaea;border-radius:10px;background-clip:padding-box;color:#737373;font-style:italic;font-size:13px;margin:15px auto;padding:1em}@media screen and (min-width:46.8em){.buddypress-wrap .members-list li .user-update{font-size:16px}}.buddypress-wrap .members-list li .user-update .activity-read-more{display:block;font-size:12px;font-style:normal;margin-top:10px;padding-right:2px}@media screen and (min-width:46.8em){.buddypress-wrap .members-list li .last-activity{clear:right;margin-top:-10px}}@media screen and (min-width:46.8em){.buddypress-wrap .members-group-list li .joined{clear:right;float:none}}@media screen and (min-width:32em){body:not(.logged-in) .members-list .user-update{width:96%}}.register-page .register-section{box-sizing:border-box}.register-page .signup-form{margin-top:20px}.register-page .signup-form .default-profile input{margin-bottom:20px}.register-page .signup-form label,.register-page .signup-form legend{margin:10px 0 0}.register-page .signup-form .editfield{margin:15px 0}.register-page .signup-form .editfield fieldset{border:0;padding:0}.register-page .signup-form .editfield fieldset legend{margin:0 0 5px;text-indent:0}.register-page .signup-form .editfield .field-visibility-settings{padding:.5em}.register-page .signup-form .editfield .field-visibility-settings fieldset{margin:0 0 10px}.register-page .signup-form #signup-avatar img{margin:0 0 10px 15px}.register-page .signup-form .wp-pwd button{vertical-align:middle}.register-page .signup-form #pass-strength-result,.register-page .signup-form #pass1,.register-page .signup-form #pass1-text{width:10em}.register-page .signup-form #pass1{display:inline-block;margin-bottom:inherit}.register-page .signup-form #pass1-text,.register-page .signup-form .pw-weak{display:none}.register-page .signup-form .show-password #pass1-text{display:inline-block;margin-bottom:inherit}.register-page .signup-form .show-password #pass1{display:none}.register-page .signup-form .description.indicator-hint{font-size:14px}.register-page .signup-form #submit:disabled{color:#767676;opacity:.4}.register-page .signup-form .password-entry,.register-page .signup-form .password-entry-confirm{border:1px solid #eee}body.buddypress.register.js .user-pass2-wrap{display:none}body.buddypress.register.no-js .wp-hide-pw{display:none}@media screen and (min-width:46.8em){.buddypress-wrap .register-page .layout-wrap{display:flex;flex-flow:row wrap;justify-content:space-around}.buddypress-wrap .register-page .layout-wrap .default-profile{flex:1;padding-left:2em}.buddypress-wrap .register-page .layout-wrap .blog-details{flex:1;padding-right:2em}.buddypress-wrap .register-page .submit{clear:both}}@media screen and (min-width:46.8em){.buddypress-wrap.extended-default-reg .register-page .default-profile{min-width:14em;flex:1;padding-left:1em}.buddypress-wrap.extended-default-reg .register-page .extended-profile{flex:2;padding-right:1em}.buddypress-wrap.extended-default-reg .register-page .blog-details{flex:1 100%}}#group-create-body{padding:.5em}#group-create-body .creation-step-name{text-align:center}#group-create-body img.avatar{width:auto;height:auto}#group-create-body .avatar-nav-items{margin-top:15px}.single-headers:after,.single-headers:before{content:" ";display:table}.single-headers:after{clear:both}.single-headers{margin-bottom:15px}.single-headers #item-header-avatar a{display:block;text-align:center}.single-headers #item-header-avatar a img{float:none;width:auto;height:auto}.single-headers div#item-header-content{float:none}@media screen and (min-width:46.8em){.single-headers #item-header-avatar a{text-align:right}.single-headers #item-header-avatar a img{float:right}.single-headers #item-header-content{padding-right:2em}}.single-headers .activity,.single-headers .group-status{display:inline}.single-headers .group-status{font-size:18px;color:#333;padding-left:1em}.single-headers .activity{display:inline-block;font-size:12px;padding:0}.single-headers #sitewide-notice p,.single-headers div#message p{background-color:#ffd;border:1px solid #cb2;color:#440;font-weight:400;margin-top:3px;text-decoration:none}.single-headers h2{line-height:1.2;margin:0 0 5px}.single-headers h2 a{color:#767676;text-decoration:none}.single-headers h2 span.highlight{display:inline-block;font-size:60%;font-weight:400;line-height:1.7;vertical-align:middle}.single-headers h2 span.highlight span{background:#a1dcfa;color:#fff;cursor:pointer;font-size:80%;font-weight:700;margin-bottom:2px;padding:1px 4px;position:relative;left:-2px;top:-2px;vertical-align:middle}.single-headers img.avatar{float:right;margin:0 0 19px 15px}.single-headers .item-meta{color:#767676;font-size:14px;margin:15px 0 5px;padding-bottom:.5em}.single-headers ul{margin-bottom:15px}.single-headers ul li{float:left;list-style:none}.single-headers div.generic-button{text-align:center}.single-headers li.generic-button{display:inline-block;text-align:center}@media screen and (min-width:46.8em){.single-headers a.button,.single-headers div.generic-button,.single-headers li.generic-button{float:right}}.single-headers a.button,.single-headers div.generic-button{margin:10px 0 0 10px}.single-headers li.generic-button{margin:2px 10px}.single-headers li.generic-button:first-child{margin-right:0}.single-headers div#message.info{line-height:.8}body.no-js .single-item-header .js-self-profile-button{display:none}#cover-image-container{position:relative}#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}#item-header-cover-image{position:relative;z-index:2}#item-header-cover-image #item-header-avatar{padding:0 1em}.groups-header .bp-group-type-list{margin:0}.groups-header .bp-feedback{clear:both}.groups-header .group-item-actions{float:right;margin:0 15px 15px 0;padding-top:0;width:100%}.groups-header .moderators-lists{margin-top:0}.groups-header .moderators-lists .moderators-title{font-size:14px}.groups-header .moderators-lists .user-list{margin:0 0 5px}.groups-header .moderators-lists .user-list ul:after{clear:both;content:"";display:table}.groups-header .moderators-lists .user-list li{display:inline-block;float:none;margin-right:4px;padding:4px}.groups-header .moderators-lists img.avatar{box-shadow:none;float:none;height:30px;margin:0;max-width:100%;width:30px}@media screen and (min-width:46.8em){.groups-header div#item-header-content{float:right;margin-right:10%;text-align:right;padding-top:15px;width:42%}.groups-header .group-item-actions{float:left;margin:0 15px 15px 0;text-align:left;width:20%}.groups-header .groups-meta{clear:both}}.groups-header .desc-wrap{background:#eaeaea;border:1px solid #d6d6d6;margin:0 0 15px;padding:1em;text-align:center}.groups-header .desc-wrap .group-description{background:#fafafa;box-shadow:inset 0 0 9px #ccc;padding:1em;text-align:right}.groups-header .desc-wrap .group-description p{margin:0;padding:0}.bp-user .users-header .user-nicename{margin-bottom:5px}.bp-user .member-header-actions{overflow:hidden}.bp-user .member-header-actions *>*{display:block}.buddypress-wrap .item-body{margin:20px 0}.buddypress-wrap .item-body .screen-heading{font-size:20px;font-weight:400}.buddypress-wrap .item-body .button-tabs{margin:30px 0 15px;list-style:none}.buddypress-wrap.bp-single-vert-nav .bp-list:not(.grid) .item-entry{padding-right:.5em}.single-item.group-members .item-body .filters:not(.no-subnav){border-top:5px solid #eaeaea;padding-top:1em}.single-item.group-members .item-body .filters{margin-top:0}.buddypress-wrap .group-status-type ul{margin:0 20px 20px 0}.groups-manage-members-list{padding:.5em 0}.groups-manage-members-list dd{margin:0;padding:1em 0}.groups-manage-members-list .section-title{background:#eaeaea;padding-right:.3em}.groups-manage-members-list ul{list-style:none;margin-bottom:0}.groups-manage-members-list ul li{border-bottom:1px solid #eee;margin-bottom:10px;padding:.5em .3em .3em}.groups-manage-members-list ul li:last-child,.groups-manage-members-list ul li:only-child{border-bottom:0}.groups-manage-members-list ul li:nth-child(even){background:#fafafa}.groups-manage-members-list ul li.banned-user{background:#fad3d3}.groups-manage-members-list ul .member-name{margin-bottom:0;text-align:center}.groups-manage-members-list ul img{display:block;margin:0 auto;width:20%}@media screen and (min-width:32em){.groups-manage-members-list ul .member-name{text-align:right}.groups-manage-members-list ul img{display:inline;width:50px}}.groups-manage-members-list ul .members-manage-buttons:after,.groups-manage-members-list ul .members-manage-buttons:before{content:" ";display:table}.groups-manage-members-list ul .members-manage-buttons:after{clear:both}.groups-manage-members-list ul .members-manage-buttons{margin:15px 0 5px}.groups-manage-members-list ul .members-manage-buttons a.button{color:#767676;display:block;font-size:13px}@media screen and (min-width:32em){.groups-manage-members-list ul .members-manage-buttons a.button{display:inline-block}}.groups-manage-members-list ul .members-manage-buttons.text-links-list{margin-bottom:0}@media screen and (max-width:32em){.groups-manage-members-list ul .members-manage-buttons.text-links-list a.button{background:#fafafa;border:1px solid #eee;display:block;margin-bottom:10px}}.groups-manage-members-list ul .action:not(.text-links-list) a.button{font-size:12px}@media screen and (min-width:46.8em){.groups-manage-members-list ul li .avatar,.groups-manage-members-list ul li .member-name{float:right}.groups-manage-members-list ul li .avatar{margin-left:15px}.groups-manage-members-list ul li .action{clear:both;float:right}}#group-manage-members-ui #group-members-search-form button[type=submit]{float:left;font-size:inherit;font-weight:400;line-height:1.5;text-align:center;text-transform:none}#group-manage-members-ui #group-members-search-form button[type=submit] span{font-family:dashicons;font-size:18px;line-height:1.6}#group-manage-members-ui #group-members-pagination button:last-child{margin-left:2em}#group-manage-members-ui #bp-no-group-members td{border:none}.buddypress .bp-invites-content ul.item-list{border-top:0}.buddypress .bp-invites-content ul.item-list li{border:1px solid #eaeaea;margin:0 0 1%;padding-right:5px;padding-left:5px;position:relative;width:auto}.buddypress .bp-invites-content ul.item-list li .list-title{margin:0 auto;width:80%}.buddypress .bp-invites-content ul.item-list li .action{position:absolute;top:10px;left:10px}.buddypress .bp-invites-content ul.item-list li .action a.button.invite-button{border:0}.buddypress .bp-invites-content ul.item-list li .action a.button.invite-button:focus,.buddypress .bp-invites-content ul.item-list li .action a.button.invite-button:hover{color:#1fb3dd}.buddypress .bp-invites-content ul.item-list li.selected{box-shadow:inset 0 0 12px 0 rgba(237,187,52,.2)}.buddypress .bp-invites-content .group-inviters li,.buddypress .bp-invites-content .item-list .item-meta span{color:#767676}.buddypress .bp-invites-content li ul.group-inviters{clear:both;margin:0}.buddypress .bp-invites-content li ul.group-inviters li{border:0;float:right;font-size:20px;width:inherit}.buddypress .bp-invites-content li .status{font-size:20px;font-style:italic;clear:both;color:#555;margin:10px 0}.buddypress .bp-invites-content #send-invites-editor ul:after,.buddypress .bp-invites-content #send-invites-editor ul:before{content:" ";display:table}.buddypress .bp-invites-content #send-invites-editor ul:after{clear:both}.buddypress .bp-invites-content #send-invites-editor textarea{width:100%}.buddypress .bp-invites-content #send-invites-editor ul{clear:both;list-style:none;margin:10px 0}.buddypress .bp-invites-content #send-invites-editor ul li{float:right;margin:.5%;max-height:50px;max-width:50px}.buddypress .bp-invites-content #send-invites-editor #bp-send-invites-form{clear:both;margin-top:10px}.buddypress .bp-invites-content #send-invites-editor .action{margin-top:10px;padding-top:10px}.buddypress .bp-invites-content #send-invites-editor.bp-hide{display:none}@media screen and (min-width:46.8em){.buddypress .bp-invites-content ul.item-list>li{box-sizing:border-box;border:1px solid #eaeaea;float:right;padding-right:.5em;padding-left:.5em;width:49.5%}.buddypress .bp-invites-content ul.item-list>li:nth-child(odd){margin-left:.5%}.buddypress .bp-invites-content ul.item-list>li:nth-child(even){margin-right:.5%}.buddypress .bp-invites-content ul.item-list ul.group-inviters{float:right;width:auto}}@media screen and (min-width:46.8em){:not(.vertical)+.item-body #group-invites-container{display:-ms-grid;display:grid;-ms-grid-columns:25% auto;grid-template-columns:25% auto;grid-template-areas:"group-invites-nav group-invites-column"}:not(.vertical)+.item-body #group-invites-container .bp-invites-nav{-ms-grid-row:1;-ms-grid-column:1;grid-area:group-invites-nav}:not(.vertical)+.item-body #group-invites-container .bp-invites-nav li{display:block;float:none}:not(.vertical)+.item-body #group-invites-container .group-invites-column{-ms-grid-row:1;-ms-grid-column:2;grid-area:group-invites-column}}.buddypress.groups .activity-update-form{margin-top:0}.buddypress-wrap .profile{margin-top:30px}.buddypress-wrap .public .profile-fields td.label{width:30%}.buddypress-wrap .profile.edit ul.button-nav{list-style:none;margin:30px 0 10px;padding-right:0}.buddypress-wrap .profile.edit ul.button-nav li{display:inline-block;margin-left:10px}.buddypress-wrap .profile.edit ul.button-nav li a{padding:.5em}.buddypress-wrap .profile.edit .editfield{background:#fafafa;border:1px solid #eee;margin:15px 0;padding:1em}.buddypress-wrap .profile.edit .editfield fieldset{border:0}.buddypress-wrap .profile.edit .editfield fieldset label{font-weight:400}.buddypress-wrap .profile.edit .editfield fieldset label.xprofile-field-label{display:inline}.buddypress-wrap .profile.edit .editfield{display:flex;flex-direction:column}.buddypress-wrap .profile.edit .editfield .description{margin-top:10px;order:2}.buddypress-wrap .profile.edit .editfield>fieldset{order:1}.buddypress-wrap .profile.edit .editfield .field-visibility-settings,.buddypress-wrap .profile.edit .editfield .field-visibility-settings-toggle{order:3}body.no-js .buddypress-wrap .field-visibility-settings-close,body.no-js .buddypress-wrap .field-visibility-settings-toggle{display:none}body.no-js .buddypress-wrap .field-visibility-settings{display:block}.buddypress-wrap .field-visibility-settings{margin:10px 0}.buddypress-wrap .current-visibility-level{font-style:normal;font-weight:700}.buddypress-wrap .field-visibility-settings,.buddypress-wrap .field-visibility-settings-header{color:#737373}.buddypress-wrap .field-visibility-settings fieldset{margin:5px 0}.buddypress-wrap .standard-form .editfield fieldset{margin:0}.buddypress-wrap .standard-form .field-visibility-settings label{font-weight:400;margin:0}.buddypress-wrap .standard-form .field-visibility-settings .radio{list-style:none;margin-bottom:0}.buddypress-wrap .standard-form .field-visibility-settings .field-visibility-settings-close{font-size:12px}.buddypress-wrap .standard-form .wp-editor-container{border:1px solid #dedede}.buddypress-wrap .standard-form .wp-editor-container textarea{background:#fff;width:100%}.buddypress-wrap .standard-form .description{background:#fafafa;font-size:inherit}.buddypress-wrap .standard-form .field-visibility-settings legend,.buddypress-wrap .standard-form .field-visibility-settings-header{font-style:italic}.buddypress-wrap .standard-form .field-visibility-settings-header{font-size:14px}.buddypress-wrap .standard-form .field-visibility-settings label,.buddypress-wrap .standard-form .field-visibility-settings legend{font-size:14px}.buddypress-wrap .standard-form .field-visibility select{margin:0}.buddypress-wrap .html-active button.switch-html{background:#f5f5f5;border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0}.buddypress-wrap .tmce-active button.switch-tmce{background:#f5f5f5;border-bottom-color:transparent;border-bottom-right-radius:0;border-bottom-left-radius:0}.buddypress-wrap .profile.public .profile-group-title{border-bottom:1px solid #ccc}body.register .buddypress-wrap .page ul{list-style:none}.buddypress-wrap .profile .bp-avatar-nav{margin-top:20px}.message-action-delete:before,.message-action-star:before,.message-action-unstar:before,.message-action-view:before{font-family:dashicons;font-size:18px}.message-action-star:before{color:#aaa;content:"\f154"}.message-action-unstar:before{color:#fcdd77;content:"\f155"}.message-action-view:before{content:"\f473"}.message-action-delete:before{content:"\f153"}.message-action-delete:hover:before{color:#a00}.preview-content .actions a{text-decoration:none}.bp-messages-content{margin:15px 0}.bp-messages-content .avatar{box-shadow:none}.bp-messages-content .thread-participants{list-style:none}.bp-messages-content .thread-participants dd{margin-right:0}.bp-messages-content time{color:#737373;font-size:12px}#message-threads{border-top:1px solid #eaeaea;clear:both;list-style:none;margin:0;max-height:220px;overflow-x:hidden;overflow-y:auto;padding:0;width:100%}#message-threads li{border-bottom:1px solid #eaeaea;display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:row nowrap;flex-flow:row nowrap;margin:0;overflow:hidden;padding:.5em 0}#message-threads li .thread-cb{display:flex;align-items:center;-moz-flex:1 2 5%;-o-flex:1 2 5%;flex:1 2 5%}#message-threads li .thread-from,#message-threads li .thread-to{-moz-flex:1 2 20%;-o-flex:1 2 20%;flex:1 2 20%}#message-threads li .thread-from img.avatar,#message-threads li .thread-to img.avatar{float:right;margin:0 0 0 10px}#message-threads li .thread-from .user-name,#message-threads li .thread-to .user-name{display:inline-block;line-height:1.1}#message-threads li .thread-from .num-recipients,#message-threads li .thread-to .num-recipients{color:#737373;font-weight:400;font-size:12px;margin:0}#message-threads li .thread-content{-moz-flex:1 2 60%;-o-flex:1 2 60%;flex:1 2 60%}#message-threads li .thread-date{-moz-flex:1 2 15%;-o-flex:1 2 15%;flex:1 2 15%}#message-threads li.selected{background-color:#fafafa}#message-threads li.selected .thread-subject .subject{color:#5087e5}#message-threads li.unread{font-weight:700}#message-threads li .thread-content .excerpt{color:#737373;font-size:12px;margin:0}#message-threads li .thread-content .thread-from,#message-threads li .thread-content .thread-subject,#message-threads li .thread-content .thread-to{font-size:13px}@media screen and (min-width:46.8em){#message-threads li .thread-content .thread-from,#message-threads li .thread-content .thread-subject,#message-threads li .thread-content .thread-to{font-size:16px}}#message-threads li .thread-content .thread-subject{vertical-align:top}#message-threads li .thread-content .thread-subject .excerpt{font-weight:400}#message-threads li .thread-date{padding-left:5px;text-align:left}.bp-messages-content .actions{float:left;max-width:30%;line-height:1}.bp-messages-content .actions .bp-icons:not(.bp-hide){display:inline-block;margin:0;padding:.3em .5em}.bp-messages-content .actions .bp-icons:not(.bp-hide):before{font-size:26px}.bp-messages-content #thread-preview{border:1px solid #eaeaea;margin-top:20px}.bp-messages-content #thread-preview .preview-message{overflow:hidden}.bp-messages-content #thread-preview .preview-content{margin:.5em}.bp-messages-content #thread-preview .preview-content .preview-message{background:#fafafa;margin:10px 0;padding:1em .3em .3em}.bp-messages-content #bp-message-thread-list{border-top:1px solid #eaeaea;clear:both;list-style:none;padding:1em 0 .3em}.bp-messages-content #bp-message-thread-list li{padding:.5em}.bp-messages-content #bp-message-thread-list li:nth-child(2n) .message-content{background:#fafafa}.bp-messages-content #bp-message-thread-list .message-metadata{border-bottom:1px solid #ccc;box-shadow:2px 1px 9px 0 #eee;display:table;padding:.2em;width:100%}.bp-messages-content #bp-message-thread-list .message-metadata .avatar{width:30px}.bp-messages-content #bp-message-thread-list .message-metadata .user-link{display:block;font-size:13px;float:right}@media screen and (min-width:46.8em){.bp-messages-content #bp-message-thread-list .message-metadata .user-link{font-size:16px}}.bp-messages-content #bp-message-thread-list .message-metadata time{color:#737373;font-size:12px;padding:0 .5em}.bp-messages-content #bp-message-thread-list .message-metadata button{padding:0 .3em}.bp-messages-content #bp-message-thread-list .message-metadata button:before{font-size:20px}.bp-messages-content #bp-message-thread-list .message-content{overflow:hidden;margin:1em auto 0;width:90%}.bp-messages-content #bp-message-thread-list img.avatar{float:right;margin:0 0 0 10px}.bp-messages-content #bp-message-thread-list .actions a:before{font-size:18px}.bp-messages-content form.send-reply .avatar-box{padding:.5em 0}.bp-messages-content .preview-pane-header,.bp-messages-content .single-message-thread-header{border-bottom:1px solid #eaeaea}.bp-messages-content .preview-pane-header:after,.bp-messages-content .single-message-thread-header:after{clear:both;content:"";display:table}.bp-messages-content .preview-thread-title,.bp-messages-content .single-thread-title{font-size:16px}.bp-messages-content .preview-thread-title .messages-title,.bp-messages-content .single-thread-title .messages-title{padding-right:2em}.bp-messages-content .thread-participants{float:right;margin:5px 0;width:70%}.bp-messages-content .thread-participants dd,.bp-messages-content .thread-participants ul{margin-bottom:10px}.bp-messages-content .thread-participants ul{list-style:none}.bp-messages-content .thread-participants ul:after{clear:both;content:"";display:table}.bp-messages-content .thread-participants li{float:right;margin-right:5px}.bp-messages-content .thread-participants img{width:30px;height:30px}.bp-messages-content #bp-message-thread-list li .message-content blockquote,.bp-messages-content #bp-message-thread-list li .message-content ol,.bp-messages-content #bp-message-thread-list li .message-content ul,.bp-messages-content #thread-preview .preview-message blockquote,.bp-messages-content #thread-preview .preview-message ol,.bp-messages-content #thread-preview .preview-message ul{list-style-position:inside;margin-right:0}.bp-messages-content #thread-preview:empty,.bp-messages-content ul#message-threads:empty{display:none}.bp-messages-content #bp-message-thread-header h2:first-child,.bp-messages-content #thread-preview h2:first-child{background-color:#eaeaea;color:#555;font-weight:700;margin:0;padding:.5em}.bp-messages-content #bp-message-thread-list li a.user-link,.bp-messages-content #message-threads .thread-content a{border:0;text-decoration:none}.bp-messages-content .standard-form #subject{margin-bottom:20px}div.bp-navs#subsubnav.bp-messages-filters .user-messages-bulk-actions{margin-left:15px;max-width:42.5%}.buddypress.settings .profile-settings.bp-tables-user select{width:100%}body.buddypress.settings .wp-pwd button{vertical-align:middle}body.buddypress.settings #pass-strength-result,body.buddypress.settings #pass1,body.buddypress.settings #pass1-text{width:16em}body.buddypress.settings #pass1{display:inline-block;margin-bottom:inherit}body.buddypress.settings #pass-strength-result,body.buddypress.settings #pass1-text,body.buddypress.settings .pw-weak{display:none}body.buddypress.settings .show-password #pass1-text{display:inline-block;margin-bottom:inherit}body.buddypress.settings .show-password #pass1{display:none}body.buddypress.settings #your-profile #submit:disabled{color:#767676;opacity:.4}body.buddypress.settings.js .user-pass2-wrap,body.buddypress.settings.js .wp-pwd{display:none}body.buddypress.settings.no-js .wp-cancel-pw,body.buddypress.settings.no-js .wp-generate-pw,body.buddypress.settings.no-js .wp-hide-pw{display:none}body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a{text-decoration:underline}.buddypress-wrap #whats-new-post-in-box select,.buddypress-wrap .filter select{border:1px solid #d6d6d6}.buddypress-wrap input.action[disabled]{cursor:pointer;opacity:.4}.buddypress-wrap #notification-bulk-manage[disabled]{display:none}.buddypress-wrap fieldset legend{font-size:inherit;font-weight:600}.buddypress-wrap input[type=email]:focus,.buddypress-wrap input[type=password]:focus,.buddypress-wrap input[type=tel]:focus,.buddypress-wrap input[type=text]:focus,.buddypress-wrap input[type=url]:focus,.buddypress-wrap textarea:focus{box-shadow:0 0 8px #eaeaea}.buddypress-wrap select{height:auto}.buddypress-wrap textarea{resize:vertical}.buddypress-wrap .standard-form .bp-controls-wrap{margin:1em 0}.buddypress-wrap .standard-form .groups-members-search input[type=search],.buddypress-wrap .standard-form .groups-members-search input[type=text],.buddypress-wrap .standard-form [data-bp-search] input[type=search],.buddypress-wrap .standard-form [data-bp-search] input[type=text],.buddypress-wrap .standard-form input[type=color],.buddypress-wrap .standard-form input[type=date],.buddypress-wrap .standard-form input[type=datetime-local],.buddypress-wrap .standard-form input[type=datetime],.buddypress-wrap .standard-form input[type=email],.buddypress-wrap .standard-form input[type=month],.buddypress-wrap .standard-form input[type=number],.buddypress-wrap .standard-form input[type=password],.buddypress-wrap .standard-form input[type=range],.buddypress-wrap .standard-form input[type=search],.buddypress-wrap .standard-form input[type=tel],.buddypress-wrap .standard-form input[type=text],.buddypress-wrap .standard-form input[type=time],.buddypress-wrap .standard-form input[type=url],.buddypress-wrap .standard-form input[type=week],.buddypress-wrap .standard-form select,.buddypress-wrap .standard-form textarea{background:#fafafa;border:1px solid #d6d6d6;border-radius:0;font:inherit;font-size:100%;padding:.5em}.buddypress-wrap .standard-form input[required],.buddypress-wrap .standard-form select[required],.buddypress-wrap .standard-form textarea[required]{box-shadow:none;border-width:2px;outline:0}.buddypress-wrap .standard-form input[required]:invalid,.buddypress-wrap .standard-form select[required]:invalid,.buddypress-wrap .standard-form textarea[required]:invalid{border-color:#b71717}.buddypress-wrap .standard-form input[required]:valid,.buddypress-wrap .standard-form select[required]:valid,.buddypress-wrap .standard-form textarea[required]:valid{border-color:#91cc2c}.buddypress-wrap .standard-form input[required]:focus,.buddypress-wrap .standard-form select[required]:focus,.buddypress-wrap .standard-form textarea[required]:focus{border-color:#d6d6d6;border-width:1px}.buddypress-wrap .standard-form input.invalid[required],.buddypress-wrap .standard-form select.invalid[required],.buddypress-wrap .standard-form textarea.invalid[required]{border-color:#b71717}.buddypress-wrap .standard-form input:not(.small),.buddypress-wrap .standard-form textarea{width:100%}.buddypress-wrap .standard-form input[type=checkbox],.buddypress-wrap .standard-form input[type=radio]{margin-left:5px;width:auto}.buddypress-wrap .standard-form select{padding:3px}.buddypress-wrap .standard-form textarea{height:120px}.buddypress-wrap .standard-form textarea#message_content{height:200px}.buddypress-wrap .standard-form input[type=password]{margin-bottom:5px}.buddypress-wrap .standard-form input:focus,.buddypress-wrap .standard-form select:focus,.buddypress-wrap .standard-form textarea:focus{background:#fafafa;color:#555;outline:0}.buddypress-wrap .standard-form label,.buddypress-wrap .standard-form span.label{display:block;font-weight:600;margin:15px 0 5px;width:auto}.buddypress-wrap .standard-form a.clear-value{display:block;margin-top:5px;outline:0}.buddypress-wrap .standard-form .submit{clear:both;padding:15px 0 0}.buddypress-wrap .standard-form p.submit{margin-bottom:0}.buddypress-wrap .standard-form div.submit input{margin-left:15px}.buddypress-wrap .standard-form #invite-list label,.buddypress-wrap .standard-form p label{font-weight:400;margin:auto}.buddypress-wrap .standard-form p.description{color:#737373;margin:5px 0}.buddypress-wrap .standard-form div.checkbox label:nth-child(n+2),.buddypress-wrap .standard-form div.radio div label{color:#737373;font-size:100%;font-weight:400;margin:5px 0 0}.buddypress-wrap .standard-form#send-reply textarea{width:97.5%}.buddypress-wrap .standard-form#sidebar-login-form label{margin-top:5px}.buddypress-wrap .standard-form#sidebar-login-form input[type=password],.buddypress-wrap .standard-form#sidebar-login-form input[type=text]{padding:4px;width:95%}.buddypress-wrap .standard-form.profile-edit input:focus{background:#fff}@media screen and (min-width:46.8em){.buddypress-wrap .standard-form .left-menu{float:right}.buddypress-wrap .standard-form #invite-list ul{list-style:none;margin:1%}.buddypress-wrap .standard-form #invite-list ul li{margin:0 1% 0 0}.buddypress-wrap .standard-form .main-column{margin-right:190px}.buddypress-wrap .standard-form .main-column ul#friend-list{clear:none;float:right}.buddypress-wrap .standard-form .main-column ul#friend-list h4{clear:none}}.buddypress-wrap .standard-form .bp-tables-user label{margin:0}.buddypress-wrap .signup-form label,.buddypress-wrap .signup-form legend{font-weight:400}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-wrap .wp-editor-wrap .wp-editor-wrap button,.buddypress-wrap .wp-editor-wrap .wp-editor-wrap input[type=button],.buddypress-wrap .wp-editor-wrap .wp-editor-wrap input[type=submit],.buddypress-wrap .wp-editor-wrap a.button,.buddypress-wrap .wp-editor-wrap input[type=reset]{padding:0 8px 1px}.buddypress-wrap .select-wrap{border:1px solid #eee}.buddypress-wrap .select-wrap label{display:inline}.buddypress-wrap .select-wrap select::-ms-expand{display:none}.buddypress-wrap .select-wrap select{-moz-appearance:none;-webkit-appearance:none;-o-appearance:none;appearance:none;border:0;cursor:pointer;margin-left:-25px;padding:6px 10px 6px 25px;position:relative;text-indent:-2px;z-index:1;width:auto}.buddypress-wrap .select-wrap select,.buddypress-wrap .select-wrap select:active,.buddypress-wrap .select-wrap select:focus{background:0 0}.buddypress-wrap .select-wrap span.select-arrow{display:inline-block;position:relative;z-index:0}.buddypress-wrap .select-wrap span.select-arrow:before{color:#ccc;content:"\25BC"}.buddypress-wrap .select-wrap:focus .select-arrow:before,.buddypress-wrap .select-wrap:hover .select-arrow:before{color:#a6a6a6}.buddypress-wrap .bp-search form:focus,.buddypress-wrap .bp-search form:hover,.buddypress-wrap .select-wrap:focus,.buddypress-wrap .select-wrap:hover{border:1px solid #d5d4d4;box-shadow:inset 0 0 3px #eee}@media screen and (min-width:32em){.buddypress-wrap .notifications-options-nav .select-wrap{float:right}}.buddypress-wrap .bp-dir-search-form,.buddypress-wrap .bp-messages-search-form:after,.buddypress-wrap .bp-messages-search-form:before{content:" ";display:table}.buddypress-wrap .bp-dir-search-form,.buddypress-wrap .bp-messages-search-form:after{clear:both}.buddypress-wrap form#group-members-search,.buddypress-wrap form.bp-dir-search-form,.buddypress-wrap form.bp-messages-search-form,.buddypress-wrap form[data-bp-search].bp-invites-search-form{border:1px solid #eee;width:100%}.buddypress-wrap form#group-members-search label,.buddypress-wrap form.bp-dir-search-form label,.buddypress-wrap form.bp-messages-search-form label,.buddypress-wrap form[data-bp-search].bp-invites-search-form label{margin:0}.buddypress-wrap form#group-members-search button[type=submit],.buddypress-wrap form#group-members-search input[type=search],.buddypress-wrap form#group-members-search input[type=text],.buddypress-wrap form.bp-dir-search-form button[type=submit],.buddypress-wrap form.bp-dir-search-form input[type=search],.buddypress-wrap form.bp-dir-search-form input[type=text],.buddypress-wrap form.bp-messages-search-form button[type=submit],.buddypress-wrap form.bp-messages-search-form input[type=search],.buddypress-wrap form.bp-messages-search-form input[type=text],.buddypress-wrap form[data-bp-search].bp-invites-search-form button[type=submit],.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=search],.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=text]{background:0 0;border:0;border-radius:0;background-clip:padding-box}.buddypress-wrap form#group-members-search input[type=search],.buddypress-wrap form#group-members-search input[type=text],.buddypress-wrap form.bp-dir-search-form input[type=search],.buddypress-wrap form.bp-dir-search-form input[type=text],.buddypress-wrap form.bp-messages-search-form input[type=search],.buddypress-wrap form.bp-messages-search-form input[type=text],.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=search],.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=text]{float:right;line-height:1.5;padding:3px 10px;width:80%}.buddypress-wrap form#group-members-search button[type=submit],.buddypress-wrap form.bp-dir-search-form button[type=submit],.buddypress-wrap form.bp-messages-search-form button[type=submit],.buddypress-wrap form[data-bp-search].bp-invites-search-form button[type=submit]{float:left;font-size:inherit;font-weight:400;line-height:1.5;padding:3px .7em;text-align:center;text-transform:none;width:20%}.buddypress-wrap form#group-members-search button[type=submit] span,.buddypress-wrap form.bp-dir-search-form button[type=submit] span,.buddypress-wrap form.bp-messages-search-form button[type=submit] span,.buddypress-wrap form[data-bp-search].bp-invites-search-form button[type=submit] span{font-family:dashicons;font-size:18px;line-height:1.6}.buddypress-wrap form#group-members-search button[type=submit].bp-show,.buddypress-wrap form.bp-dir-search-form button[type=submit].bp-show,.buddypress-wrap form.bp-messages-search-form button[type=submit].bp-show,.buddypress-wrap form[data-bp-search].bp-invites-search-form button[type=submit].bp-show{height:auto;right:0;overflow:visible;position:static;top:0}.buddypress-wrap form#group-members-search input[type=search]::-webkit-search-cancel-button,.buddypress-wrap form.bp-dir-search-form input[type=search]::-webkit-search-cancel-button,.buddypress-wrap form.bp-messages-search-form input[type=search]::-webkit-search-cancel-button,.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=search]::-webkit-search-cancel-button{-webkit-appearance:searchfield-cancel-button}.buddypress-wrap form#group-members-search input[type=search]::-webkit-search-results-button,.buddypress-wrap form#group-members-search input[type=search]::-webkit-search-results-decoration,.buddypress-wrap form.bp-dir-search-form input[type=search]::-webkit-search-results-button,.buddypress-wrap form.bp-dir-search-form input[type=search]::-webkit-search-results-decoration,.buddypress-wrap form.bp-messages-search-form input[type=search]::-webkit-search-results-button,.buddypress-wrap form.bp-messages-search-form input[type=search]::-webkit-search-results-decoration,.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=search]::-webkit-search-results-button,.buddypress-wrap form[data-bp-search].bp-invites-search-form input[type=search]::-webkit-search-results-decoration{display:none}.buddypress-wrap form#group-members-search:hover{border:1px solid #d5d4d4;box-shadow:inset 0 0 3px #eee}.buddypress-wrap ul.filters li form label input{line-height:1.4;padding:.1em .7em}.buddypress-wrap .current-member-type{font-style:italic}.buddypress-wrap .dir-form{clear:both}.budypress.no-js form.bp-dir-search-form button[type=submit]{height:auto;right:0;overflow:visible;position:static;top:0}.bp-user [data-bp-search] form input[type=search],.bp-user [data-bp-search] form input[type=text]{padding:6px 10px 7px}.buddypress-wrap .bp-tables-user,.buddypress-wrap table.forum,.buddypress-wrap table.wp-profile-fields{width:100%}.buddypress-wrap .bp-tables-user thead tr,.buddypress-wrap table.forum thead tr,.buddypress-wrap table.wp-profile-fields thead tr{background:0 0;border-bottom:2px solid #ccc}.buddypress-wrap .bp-tables-user tbody tr,.buddypress-wrap table.forum tbody tr,.buddypress-wrap table.wp-profile-fields tbody tr{background:#fafafa}.buddypress-wrap .bp-tables-user tr td,.buddypress-wrap .bp-tables-user tr th,.buddypress-wrap table.forum tr td,.buddypress-wrap table.forum tr th,.buddypress-wrap table.wp-profile-fields tr td,.buddypress-wrap table.wp-profile-fields tr th{padding:.5em;vertical-align:middle}.buddypress-wrap .bp-tables-user tr td.label,.buddypress-wrap table.forum tr td.label,.buddypress-wrap table.wp-profile-fields tr td.label{border-left:1px solid #eaeaea;font-weight:600;width:25%}.buddypress-wrap .bp-tables-user tr.alt td,.buddypress-wrap table.wp-profile-fields tr.alt td{background:#fafafa}.buddypress-wrap table.profile-fields .data{padding:.5em 1em}.buddypress-wrap table.profile-fields tr:last-child{border-bottom:none}.buddypress-wrap table.notifications td{padding:1em .5em}.buddypress-wrap table.notifications .bulk-select-all,.buddypress-wrap table.notifications .bulk-select-check{width:7%}.buddypress-wrap table.notifications .bulk-select-check{vertical-align:middle}.buddypress-wrap table.notifications .date,.buddypress-wrap table.notifications .notification-description,.buddypress-wrap table.notifications .notification-since,.buddypress-wrap table.notifications .title{width:39%}.buddypress-wrap table.notifications .actions,.buddypress-wrap table.notifications .notification-actions{width:15%}.buddypress-wrap table.notification-settings th.title,.buddypress-wrap table.profile-settings th.title{width:80%}.buddypress-wrap table.notifications .notification-actions a.delete,.buddypress-wrap table.notifications .notification-actions a.mark-read{display:inline-block}.buddypress-wrap table.notification-settings{margin-bottom:15px;text-align:right}.buddypress-wrap #groups-notification-settings{margin-bottom:0}.buddypress-wrap table.notification-settings td:first-child,.buddypress-wrap table.notification-settings th.icon,.buddypress-wrap table.notifications td:first-child,.buddypress-wrap table.notifications th.icon{display:none}.buddypress-wrap table.notification-settings .no,.buddypress-wrap table.notification-settings .yes{text-align:center;width:40px;vertical-align:middle}.buddypress-wrap table#message-threads{clear:both}.buddypress-wrap table#message-threads .thread-info{min-width:40%}.buddypress-wrap table#message-threads .thread-info p{margin:0}.buddypress-wrap table#message-threads .thread-info p.thread-excerpt{color:#737373;font-size:12px;margin-top:3px}.buddypress-wrap table.profile-fields{margin-bottom:20px}.buddypress-wrap table.profile-fields:last-child{margin-bottom:0}.buddypress-wrap table.profile-fields p{margin:0}.buddypress-wrap table.profile-fields p:last-child{margin-top:0}.bp-screen-reader-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.center-vert{display:flex;align-items:center}.bp-hide{display:none}.bp-show{height:auto;right:0;overflow:visible;position:static;top:0}.buddypress .buddypress-wrap .activity-read-more a,.buddypress .buddypress-wrap .comment-reply-link,.buddypress .buddypress-wrap .generic-button a,.buddypress .buddypress-wrap a.bp-title-button,.buddypress .buddypress-wrap a.button,.buddypress .buddypress-wrap button,.buddypress .buddypress-wrap input[type=button],.buddypress .buddypress-wrap input[type=reset],.buddypress .buddypress-wrap input[type=submit],.buddypress .buddypress-wrap ul.button-nav:not(.button-tabs) li a{background:#fff;border-color:#ccc;border-style:solid;border-width:1px;border-radius:0;color:#555;cursor:pointer;font-family:inherit;font-size:inherit;font-weight:400;outline:0;padding:.3em .5em;text-align:center;text-decoration:none;width:auto;line-height:1}.buddypress .buddypress-wrap a.button.dashicons,.buddypress .buddypress-wrap button.dashicons{font-family:dashicons}.buddypress .buddypress-wrap .button-small[type=button]{padding:0 8px 1px}.buddypress .buddypress-wrap .activity-read-more a:focus,.buddypress .buddypress-wrap .activity-read-more a:hover,.buddypress .buddypress-wrap .button-nav li a:focus,.buddypress .buddypress-wrap .button-nav li a:hover,.buddypress .buddypress-wrap .button-nav li.current a,.buddypress .buddypress-wrap .comment-reply-link:focus,.buddypress .buddypress-wrap .comment-reply-link:hover,.buddypress .buddypress-wrap .generic-button a:focus,.buddypress .buddypress-wrap .generic-button a:hover,.buddypress .buddypress-wrap a.button:focus,.buddypress .buddypress-wrap a.button:hover,.buddypress .buddypress-wrap button:focus,.buddypress .buddypress-wrap button:hover,.buddypress .buddypress-wrap input[type=button]:focus,.buddypress .buddypress-wrap input[type=button]:hover,.buddypress .buddypress-wrap input[type=reset]:focus,.buddypress .buddypress-wrap input[type=reset]:hover,.buddypress .buddypress-wrap input[type=submit]:focus,.buddypress .buddypress-wrap input[type=submit]:hover{background:#ededed;border-color:#999;color:#333;outline:0;text-decoration:none}.buddypress .buddypress-wrap a.disabled,.buddypress .buddypress-wrap button.disabled,.buddypress .buddypress-wrap button.pending,.buddypress .buddypress-wrap div.pending a,.buddypress .buddypress-wrap input[type=button].disabled,.buddypress .buddypress-wrap input[type=button].pending,.buddypress .buddypress-wrap input[type=reset].disabled,.buddypress .buddypress-wrap input[type=reset].pending,.buddypress .buddypress-wrap input[type=submit].pending,.buddypress .buddypress-wrap input[type=submit][disabled=disabled]{border-color:#eee;color:#767676;cursor:default}.buddypress .buddypress-wrap a.disabled:hover,.buddypress .buddypress-wrap button.disabled:hover,.buddypress .buddypress-wrap button.pending:hover,.buddypress .buddypress-wrap div.pending a:hover,.buddypress .buddypress-wrap input[type=button]:hover.disabled,.buddypress .buddypress-wrap input[type=button]:hover.pending,.buddypress .buddypress-wrap input[type=reset]:hover.disabled,.buddypress .buddypress-wrap input[type=reset]:hover.pending,.buddypress .buddypress-wrap input[type=submit]:hover.disabled,.buddypress .buddypress-wrap input[type=submit]:hover.pending{border-color:#eee;color:#767676}.buddypress .buddypress-wrap button.text-button,.buddypress .buddypress-wrap input.text-button{background:0 0;border:0;box-shadow:none;color:#767676}.buddypress .buddypress-wrap button.text-button.small,.buddypress .buddypress-wrap input.text-button.small{font-size:13px}.buddypress .buddypress-wrap button.text-button:focus,.buddypress .buddypress-wrap button.text-button:hover,.buddypress .buddypress-wrap input.text-button:focus,.buddypress .buddypress-wrap input.text-button:hover{background:0 0;text-decoration:underline}.buddypress .buddypress-wrap .activity-list a.button{border:none}.buddypress .buddypress-wrap .bp-invites-content ul.bp-list li a.invite-button:hover{color:#1fb3dd}.buddypress .buddypress-wrap .bp-invites-content ul.bp-list li a.group-remove-invite-button:hover,.buddypress .buddypress-wrap .bp-invites-content ul.bp-list li a.invite-button:hover,.buddypress .buddypress-wrap .bp-invites-content ul.bp-list li.selected a.group-remove-invite-button:hover,.buddypress .buddypress-wrap .bp-invites-content ul.bp-list li.selected a.invite-button:hover{color:#a00}.buddypress .buddypress-wrap #item-buttons:empty{display:none}.buddypress .buddypress-wrap input:disabled:focus,.buddypress .buddypress-wrap input:disabled:hover{background:0 0}.buddypress .buddypress-wrap .text-links-list a.button{background:0 0;border:none;border-left:1px solid #eee;color:#737373;display:inline-block;padding:.3em 1em}.buddypress .buddypress-wrap .text-links-list a.button:visited{color:#d6d6d6}.buddypress .buddypress-wrap .text-links-list a.button:focus,.buddypress .buddypress-wrap .text-links-list a.button:hover{color:#5087e5}.buddypress .buddypress-wrap .text-links-list a:first-child{padding-right:0}.buddypress .buddypress-wrap .text-links-list a:last-child{border-left:none}.buddypress .buddypress-wrap .bp-list.grid .action a,.buddypress .buddypress-wrap .bp-list.grid .action button{border:1px solid #ccc;display:block;margin:0}.buddypress .buddypress-wrap .bp-list.grid .action a:focus,.buddypress .buddypress-wrap .bp-list.grid .action a:hover,.buddypress .buddypress-wrap .bp-list.grid .action button:focus,.buddypress .buddypress-wrap .bp-list.grid .action button:hover{background:#ededed}.buddypress #buddypress .create-button{background:0 0;text-align:center}.buddypress #buddypress .create-button a:focus,.buddypress #buddypress .create-button a:hover{text-decoration:underline}@media screen and (min-width:46.8em){.buddypress #buddypress .create-button{float:left}}.buddypress #buddypress .create-button a{border:1px solid #ccc;border-radius:5px;background-clip:padding-box;box-shadow:inset 0 0 6px 0 #eaeaea;margin:.2em 0;width:auto}.buddypress #buddypress .create-button a:focus,.buddypress #buddypress .create-button a:hover{background:0 0;border-color:#ccc;box-shadow:inset 0 0 12px 0 #eaeaea}@media screen and (min-width:46.8em){.buddypress #buddypress.bp-dir-vert-nav .create-button{float:none;padding-top:2em}.buddypress #buddypress.bp-dir-vert-nav .create-button a{margin-left:.5em}}.buddypress #buddypress.bp-dir-hori-nav .create-button{float:right}.buddypress #buddypress.bp-dir-hori-nav .create-button a,.buddypress #buddypress.bp-dir-hori-nav .create-button a:hover{background:0 0;border:0;box-shadow:none;margin:0}.buddypress-wrap button.ac-reply-cancel,.buddypress-wrap button.bp-icons{background:0 0;border:0}.buddypress-wrap button.bp-icons:focus,.buddypress-wrap button.bp-icons:hover{background:0 0}.buddypress-wrap button.ac-reply-cancel:focus,.buddypress-wrap button.ac-reply-cancel:hover{background:0 0;text-decoration:underline}.buddypress-wrap .bp-invites-content li .invite-button span.icons:before,.buddypress-wrap .bp-invites-filters .invite-button span.icons:before,.buddypress-wrap .bp-messages-filters li a.messages-button:before,.buddypress-wrap .feed a:before,.buddypress-wrap .filter label:before{font-family:dashicons;font-size:18px}.buddypress-wrap .bp-invites-content .item-list li .invite-button span.icons:before{font-size:27px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-invites-content .item-list li .invite-button span.icons:before{font-size:32px}}.buddypress-wrap .bp-list a.button.invite-button:focus,.buddypress-wrap .bp-list a.button.invite-button:hover{background:0 0}.buddypress-wrap .filter label:before{content:"\f536"}.buddypress-wrap div.feed a:before,.buddypress-wrap li.feed a:before{content:"\f303"}.buddypress-wrap ul.item-list li .invite-button:not(.group-remove-invite-button) span.icons:before{content:"\f502"}.buddypress-wrap ul.item-list li .group-remove-invite-button span.icons:before,.buddypress-wrap ul.item-list li.selected .invite-button span.icons:before{content:"\f153"}.buddypress-wrap .bp-invites-filters ul li #bp-invites-next-page:before,.buddypress-wrap .bp-messages-filters ul li #bp-messages-next-page:before{content:"\f345"}.buddypress-wrap .bp-invites-filters ul li #bp-invites-prev-page:before,.buddypress-wrap .bp-messages-filters ul li #bp-messages-prev-page:before{content:"\f341"}.buddypress-wrap .warn{color:#b71717}.buddypress-wrap .bp-messages{border:1px solid #ccc;margin:0 0 15px}.buddypress-wrap .bp-messages .sitewide-notices{display:block;margin:5px;padding:.5em}.buddypress-wrap .bp-messages.info{margin-bottom:0}.buddypress-wrap .bp-messages.updated{clear:both;display:block}.buddypress-wrap .bp-messages.bp-user-messages-feedback{border:0}.buddypress-wrap #group-create-body .bp-cover-image-status p.warning{background:#0b80a4;border:0;box-shadow:0 0 3px 0 rgba(0,0,0,.2);color:#fff}.buddypress-wrap .bp-feedback:not(.custom-homepage-info){display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:row nowrap;flex-flow:row nowrap;align-items:stretch}.buddypress-wrap .bp-feedback{background:#fff;color:#807f7f;box-shadow:0 1px 1px 1px rgba(0,0,0,.1);color:#737373;margin:10px 0;position:relative}.buddypress-wrap .bp-feedback p{margin:0}.buddypress-wrap .bp-feedback span.bp-icon{color:#fff;display:block;font-family:dashicons;right:0;margin-left:10px;position:relative;padding:0 .5em}.buddypress-wrap .bp-feedback .bp-help-text{font-style:italic}.buddypress-wrap .bp-feedback .text{font-size:14px;margin:0;padding:.5em 0}.buddypress-wrap .bp-feedback.no-icon{padding:.5em}.buddypress-wrap .bp-feedback.small:before{line-height:inherit}.buddypress-wrap a[data-bp-close] span:before,.buddypress-wrap button[data-bp-close] span:before{font-size:32px}.buddypress-wrap a[data-bp-close],.buddypress-wrap button[data-bp-close]{border:0;position:absolute;top:10px;left:10px;width:32px}.buddypress-wrap .bp-feedback.no-icon a[data-bp-close],.buddypress-wrap .bp-feedback.no-icon button[data-bp-close]{top:-6px;left:6px}.buddypress-wrap button[data-bp-close]:hover{background-color:transparent}.buddypress-wrap .bp-feedback p{margin:0}.buddypress-wrap .bp-feedback .bp-icon{font-size:20px;padding:0 2px}.buddypress-wrap .bp-feedback.error .bp-icon,.buddypress-wrap .bp-feedback.help .bp-icon,.buddypress-wrap .bp-feedback.info .bp-icon,.buddypress-wrap .bp-feedback.loading .bp-icon,.buddypress-wrap .bp-feedback.success .bp-icon,.buddypress-wrap .bp-feedback.updated .bp-icon,.buddypress-wrap .bp-feedback.warning .bp-icon{display:flex;align-items:center}.buddypress-wrap .bp-feedback.help .bp-icon,.buddypress-wrap .bp-feedback.info .bp-icon{background-color:#0b80a4}.buddypress-wrap .bp-feedback.help .bp-icon:before,.buddypress-wrap .bp-feedback.info .bp-icon:before{content:"\f348"}.buddypress-wrap .bp-feedback.error .bp-icon,.buddypress-wrap .bp-feedback.warning .bp-icon{background-color:#d33}.buddypress-wrap .bp-feedback.error .bp-icon:before,.buddypress-wrap .bp-feedback.warning .bp-icon:before{content:"\f534"}.buddypress-wrap .bp-feedback.loading .bp-icon{background-color:#ffd087}.buddypress-wrap .bp-feedback.loading .bp-icon:before{content:"\f469"}.buddypress-wrap .bp-feedback.success .bp-icon,.buddypress-wrap .bp-feedback.updated .bp-icon{background-color:#8a2}.buddypress-wrap .bp-feedback.success .bp-icon:before,.buddypress-wrap .bp-feedback.updated .bp-icon:before{content:"\f147"}.buddypress-wrap .bp-feedback.help .bp-icon:before{content:"\f468"}.buddypress-wrap #pass-strength-result{background-color:#eee;border-color:#ddd;border-style:solid;border-width:1px;display:none;font-weight:700;margin:10px 0 10px 0;padding:.5em;text-align:center;width:auto}.buddypress-wrap #pass-strength-result.show{display:block}.buddypress-wrap #pass-strength-result.mismatch{background-color:#333;border-color:transparent;color:#fff}.buddypress-wrap #pass-strength-result.bad,.buddypress-wrap #pass-strength-result.error{background-color:#ffb78c;border-color:#ff853c;color:#333}.buddypress-wrap #pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040;color:#333}.buddypress-wrap #pass-strength-result.good{background-color:#ffec8b;border-color:#fc0;color:#333}.buddypress-wrap #pass-strength-result.strong{background-color:#66d66e;border-color:#438c48;color:#333}.buddypress-wrap .standard-form#signup_form div div.error{background:#faa;color:#a00;margin:0 0 10px 0;padding:.5em;width:90%}.buddypress-wrap .accept,.buddypress-wrap .reject{float:right;margin-right:10px}.buddypress-wrap .members-list.grid .bp-ajax-message{background:rgba(255,255,255,.9);border:1px solid #eee;font-size:14px;right:2%;position:absolute;padding:.5em 1em;left:2%;top:30px}.buddypress.widget .item-options{font-size:12px;margin:0 0 1em;padding:1em 0}.buddypress.widget .bp-login-widget-user-avatar{float:right}.buddypress.widget .bp-login-widget-user-links{margin-right:70px}.buddypress.widget ul.item-list{list-style:none;margin:10px 0}.buddypress.widget ul.activity-list{padding:0}.buddypress.widget ul.activity-list blockquote{margin:0 0 1.5em;overflow:visible;padding:0 .75em .75em 0}.buddypress.widget ul.activity-list img{margin-bottom:.5em}.buddypress.widget ul.activity-list li{border-bottom:1px solid #ccc;margin-bottom:1em}.buddypress.widget ul.activity-list li .activity-header p{margin-bottom:.5em}.buddypress.widget ul.activity-list li:last-child{border-bottom:0}.buddypress.widget .avatar-block{display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:row wrap;flex-flow:row wrap}.buddypress.widget .avatar-block img{margin:.5em}.buddypress.widget ul#friends-list li:after,.buddypress.widget ul#friends-list li:before,.buddypress.widget ul#groups-list li:after,.buddypress.widget ul#groups-list li:before,.buddypress.widget ul#members-list li:after,.buddypress.widget ul#members-list li:before{content:" ";display:table}.buddypress.widget ul#friends-list li:after,.buddypress.widget ul#groups-list li:after,.buddypress.widget ul#members-list li:after{clear:both}.buddypress.widget ul#friends-list li,.buddypress.widget ul#groups-list li,.buddypress.widget ul#members-list li{margin-bottom:1em}.buddypress.widget ul#friends-list li .item-avatar,.buddypress.widget ul#groups-list li .item-avatar,.buddypress.widget ul#members-list li .item-avatar{float:right;width:60px}.buddypress.widget ul#friends-list li .item,.buddypress.widget ul#groups-list li .item,.buddypress.widget ul#members-list li .item{margin-right:70px}.buddypress-wrap .buddypress.widget ul#friends-list,.buddypress-wrap .buddypress.widget ul#groups-list,.buddypress-wrap .buddypress.widget ul#members-list{display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:column nowrap;flex-flow:column nowrap}@media screen and (min-width:32em){.buddypress-wrap .buddypress.widget ul#friends-list,.buddypress-wrap .buddypress.widget ul#groups-list,.buddypress-wrap .buddypress.widget ul#members-list{display:-moz-flex;display:-ms-flex;display:-o-flex;display:flex;-o-flex-flow:row wrap;flex-flow:row wrap}}.buddypress-wrap .buddypress.widget ul#friends-list li,.buddypress-wrap .buddypress.widget ul#groups-list li,.buddypress-wrap .buddypress.widget ul#members-list li{border:1px solid #eee;align-items:stretch;-moz-flex:1 1 46%;-o-flex:1 1 46%;flex:1 1 46%;margin:2%}@media screen and (min-width:75em){.buddypress-wrap .buddypress.widget ul#friends-list li,.buddypress-wrap .buddypress.widget ul#groups-list li,.buddypress-wrap .buddypress.widget ul#members-list li{-moz-flex:0 1 20%;-o-flex:0 1 20%;flex:0 1 20%}}.buddypress-wrap .buddypress.widget ul#friends-list li .item-avatar,.buddypress-wrap .buddypress.widget ul#groups-list li .item-avatar,.buddypress-wrap .buddypress.widget ul#members-list li .item-avatar{padding:.5em;text-align:center}.buddypress-wrap .buddypress.widget ul#friends-list li .item,.buddypress-wrap .buddypress.widget ul#groups-list li .item,.buddypress-wrap .buddypress.widget ul#members-list li .item{padding:.5em}.buddypress-wrap .buddypress.widget ul#friends-list li .item .item-meta,.buddypress-wrap .buddypress.widget ul#groups-list li .item .item-meta,.buddypress-wrap .buddypress.widget ul#members-list li .item .item-meta{font-size:12px;overflow-wrap:break-word}@media screen and (min-width:75em){.buddypress-wrap .buddypress.widget ul#friends-list,.buddypress-wrap .buddypress.widget ul#groups-list,.buddypress-wrap .buddypress.widget ul#members-list{margin:10px -2%;width:100%}.buddypress-wrap .buddypress.widget ul#friends-list li,.buddypress-wrap .buddypress.widget ul#groups-list li,.buddypress-wrap .buddypress.widget ul#members-list li{-moz-flex:0 1 auto;-o-flex:0 1 auto;flex:0 1 auto;margin:10px 2% 1%;width:46%}}.buddypress-wrap .buddypress.widget blockquote{margin:0 0 1.5em;overflow:visible;padding:0 .75em .75em 0}#buddypress-wrap *{transition:opacity .1s ease-in-out .1s}#buddypress-wrap a.button,#buddypress-wrap a.generic-button,#buddypress-wrap button,#buddypress-wrap input[type=reset],#buddypress-wrap input[type=submit]{transition:background .1s ease-in-out .1s,color .1s ease-in-out .1s,border-color .1s ease-in-out .1s}.buddypress-wrap a.loading,.buddypress-wrap input.loading{animation:loader-pulsate .5s infinite ease-in-out alternate;border-color:#aaa}@keyframes loader-pulsate{from{border-color:#aaa;box-shadow:0 0 6px #ccc}to{border-color:#ccc;box-shadow:0 0 6px #f8f8f8}}.buddypress-wrap a.loading:hover,.buddypress-wrap input.loading:hover{color:#777}[data-bp-tooltip]{position:relative}[data-bp-tooltip]:after{background-color:#fff;display:none;opacity:0;position:absolute;transform:translate3d(0,0,0);visibility:hidden}[data-bp-tooltip]:after{border:1px solid #737373;border-radius:1px;box-shadow:-4px 4px 8px rgba(0,0,0,.2);color:#333;content:attr(data-bp-tooltip);font-family:"Helvetica Neue",helvetica,arial,san-serif;font-size:12px;font-weight:400;letter-spacing:normal;line-height:1.25;max-width:200px;padding:5px 8px;pointer-events:none;text-shadow:none;text-transform:none;transition:all 1.5s ease;white-space:nowrap;word-wrap:break-word;z-index:100000}[data-bp-tooltip]:active:after,[data-bp-tooltip]:focus:after,[data-bp-tooltip]:hover:after{display:block;opacity:1;overflow:visible;visibility:visible}[data-bp-tooltip=""]{display:none;opacity:0;visibility:hidden}.bp-tooltip:after{right:50%;margin-top:7px;top:110%;transform:translate(50%,0)}.user-list .bp-tooltip:after{right:0;transform:translate(0,0)}@media screen and (min-width:46.8em){.user-list .bp-tooltip:after{right:auto;left:0;transform:translate(0,0)}}.activity-list .bp-tooltip:after,.activity-meta-action .bp-tooltip:after,.avatar-block .item-avatar .bp-tooltip:after,.notification-actions .bp-tooltip:after,.participants-list .bp-tooltip:after{right:0;transform:translate(0,0)}.bp-invites-content .bp-tooltip:after,.message-metadata .actions .bp-tooltip:after,.single-message-thread-header .actions .bp-tooltip:after{right:auto;left:0;transform:translate(0,0)}.bp-invites-content #send-invites-editor .bp-tooltip:after{right:0;left:auto}#item-body,.single-screen-navs{box-sizing:border-box}.grid>li,.grid>li .generic-button a{box-sizing:border-box}.grid>li{border-bottom:0;padding-bottom:10px;padding-top:0}.grid>li .list-wrap{background:#fafafa;border:1px solid #eee;padding-bottom:15px;position:relative;overflow:hidden;padding-top:14px}.grid>li .list-wrap .list-title{padding:.5em}.grid>li .list-wrap .update{color:#737373;padding:.5em 2em}.grid>li .item-avatar{text-align:center}.grid>li .item-avatar .avatar{border-radius:50%;display:inline-block;width:50%}@media screen and (min-width:24em){.grid.members-list .list-wrap{min-height:340px}.grid.members-list .list-wrap .item-block{margin:0 auto;min-height:7rem}.grid.members-group-list .list-wrap .item-block{margin:0 auto;min-height:7rem}.grid.groups-list .list-wrap{min-height:470px}.grid.groups-list .list-wrap .item-block{min-height:6rem}.grid.groups-list .list-wrap .group-desc{margin:15px auto 0;min-height:5em;overflow:hidden}.grid.groups-list .list-wrap .group-details,.grid.groups-list .list-wrap .item-desc,.grid.groups-list .list-wrap .last-activity{margin-bottom:0}.grid.groups-list .list-wrap .group-details p,.grid.groups-list .list-wrap .item-desc p,.grid.groups-list .list-wrap .last-activity p{margin-bottom:0}.grid.blogs-list .list-wrap{min-height:350px}.grid.blogs-list .list-wrap .item-block{margin:0 auto;min-height:7rem}}@media screen and (min-width:24em){.grid>li.item-entry{float:right;margin:0}.grid.two>li{padding-bottom:20px}}@media screen and (min-width:24em) and (min-width:75em){.grid.two>li .list-wrap{max-width:500px;margin:0 auto}}@media screen and (min-width:24em){.grid.three>li,.grid.two>li{width:50%}.grid.three>li:nth-child(odd),.grid.two>li:nth-child(odd){padding-left:10px}.grid.three>li:nth-child(even),.grid.two>li:nth-child(even){padding-right:10px}.grid.three>li .item,.grid.two>li .item{margin:1rem auto 0;width:80%}.grid.three>li .item .item-title,.grid.two>li .item .item-title{width:auto}}@media screen and (min-width:46.8em){.grid.three>li{padding-top:0;width:33.333333%;width:calc(100% / 3)}.grid.three>li:nth-child(1n+1){padding-right:5px;padding-left:5px}.grid.three>li:nth-child(3n+3){padding-right:5px;padding-left:0}.grid.three>li:nth-child(3n+1){padding-right:0;padding-left:5px}}@media screen and (min-width:46.8em){.grid.four>li{width:25%}.grid.four>li:nth-child(1n+1){padding-right:5px;padding-left:5px}.grid.four>li:nth-child(4n+4){padding-right:5px;padding-left:0}.grid.four>li:nth-child(4n+1){padding-right:0;padding-left:5px}}.buddypress-wrap .grid.bp-list{padding-top:1em}.buddypress-wrap .grid.bp-list>li{border-bottom:none}.buddypress-wrap .grid.bp-list>li .list-wrap{padding-bottom:3em}.buddypress-wrap .grid.bp-list>li .item-avatar{margin:0;text-align:center;width:auto}.buddypress-wrap .grid.bp-list>li .item-avatar img.avatar{display:inline-block;height:auto;width:50%}.buddypress-wrap .grid.bp-list>li .item-meta,.buddypress-wrap .grid.bp-list>li .list-title{float:none;text-align:center}.buddypress-wrap .grid.bp-list>li .list-title{font-size:inherit;line-height:1.1}.buddypress-wrap .grid.bp-list>li .item{font-size:18px;right:0;margin:0 auto;text-align:center;width:96%}@media screen and (min-width:46.8em){.buddypress-wrap .grid.bp-list>li .item{font-size:22px}}.buddypress-wrap .grid.bp-list>li .item .group-desc,.buddypress-wrap .grid.bp-list>li .item .item-block{float:none;width:96%}.buddypress-wrap .grid.bp-list>li .item .item-block{margin-bottom:10px}.buddypress-wrap .grid.bp-list>li .item .last-activity{margin-top:5px}.buddypress-wrap .grid.bp-list>li .item .group-desc{clear:none}.buddypress-wrap .grid.bp-list>li .item .user-update{clear:both;text-align:right}.buddypress-wrap .grid.bp-list>li .item .activity-read-more a{display:inline}.buddypress-wrap .grid.bp-list>li .action{bottom:5px;float:none;height:auto;right:0;margin:0;padding:0 5px;position:absolute;text-align:center;top:auto;width:100%}.buddypress-wrap .grid.bp-list>li .action .generic-button{float:none;margin:5px 0 0;text-align:center;width:100%}.buddypress-wrap .grid.bp-list>li .action .generic-button a,.buddypress-wrap .grid.bp-list>li .action .generic-button button{width:100%}.buddypress-wrap .grid.bp-list>li .avatar,.buddypress-wrap .grid.bp-list>li .item,.buddypress-wrap .grid.bp-list>li .item-avatar{float:none}.buddypress-wrap .blogs-list.grid.two>li .blogs-title{min-height:5em}.buddypress-wrap .grid.four>li .group-desc,.buddypress-wrap .grid.three>li .group-desc{min-height:8em}.buddypress-wrap .blogs-list.grid.four>li,.buddypress-wrap .blogs-list.grid.three>li{min-height:350px}.buddypress-wrap .blogs-list.grid.four>li .last-activity,.buddypress-wrap .blogs-list.grid.three>li .last-activity{margin-bottom:0}.buddypress-wrap .blogs-list.grid.four>li .last-post,.buddypress-wrap .blogs-list.grid.three>li .last-post{margin-top:0}.buddypress:not(.logged-in) .grid.bp-list .list-wrap{padding-bottom:5px}.buddypress:not(.logged-in) .grid.groups-list .list-wrap{min-height:430px}.buddypress:not(.logged-in) .grid.members-list .list-wrap{min-height:300px}.buddypress:not(.logged-in) .grid.blogs-list .list-wrap{min-height:320px}@media screen and (min-width:46.8em){.bp-single-vert-nav .bp-navs.vertical{overflow:visible}.bp-single-vert-nav .bp-navs.vertical ul{border-left:1px solid #d6d6d6;border-bottom:0;float:right;margin-left:-1px;width:25%}.bp-single-vert-nav .bp-navs.vertical li{float:none;margin-left:0}.bp-single-vert-nav .bp-navs.vertical li.selected a{background:#ccc;color:#333}.bp-single-vert-nav .bp-navs.vertical li:focus,.bp-single-vert-nav .bp-navs.vertical li:hover{background:#ccc}.bp-single-vert-nav .bp-navs.vertical li span{background:#d6d6d6;border-radius:10%;float:left;margin-left:2px}.bp-single-vert-nav .bp-navs.vertical li:hover span{border-color:#eaeaea}.bp-single-vert-nav .bp-navs.vertical.tabbed-links li.selected a{padding-right:0}.bp-single-vert-nav .bp-wrap{margin-bottom:15px}.bp-single-vert-nav .bp-wrap .group-nav-tabs.groups-nav ul li,.bp-single-vert-nav .bp-wrap .user-nav-tabs.users-nav ul li{right:1px;position:relative}.bp-single-vert-nav .item-body:not(#group-create-body){background:#fff;border-right:1px solid #d6d6d6;float:left;margin:0;min-height:400px;padding:0 1em 0 0;width:calc(75% + 1px)}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links){background:#eaeaea;margin:0 -5px 0 0;width:auto}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li{font-size:16px;margin:10px 0}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li a{border-left:1px solid #ccc;padding:0 .5em}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li a:focus,.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li a:hover{background:0 0}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li.current a{background:0 0;color:#333;text-decoration:underline}.bp-single-vert-nav .item-body:not(#group-create-body) #subnav:not(.tabbed-links) li:last-child a{border:none}.bp-dir-vert-nav .dir-navs{float:right;right:1px;position:relative;width:20%}.bp-dir-vert-nav .dir-navs ul li{float:none;overflow:hidden;width:auto}.bp-dir-vert-nav .dir-navs ul li.selected{border:1px solid #eee}.bp-dir-vert-nav .dir-navs ul li.selected a{background:#555;color:#fff}.bp-dir-vert-nav .dir-navs ul li.selected a span{background:#eaeaea;border-color:#ccc;color:#5087e5}.bp-dir-vert-nav .dir-navs ul li a:focus,.bp-dir-vert-nav .dir-navs ul li a:hover{background:#ccc;color:#333}.bp-dir-vert-nav .dir-navs ul li a:focus span,.bp-dir-vert-nav .dir-navs ul li a:hover span{border:1px solid #555}.bp-dir-vert-nav .screen-content{border-right:1px solid #d6d6d6;margin-right:20%;overflow:hidden;padding:0 1em 2em 0}.bp-dir-vert-nav .screen-content .subnav-filters{margin-top:0}.buddypress-wrap.bp-vertical-navs .dir-navs.activity-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .dir-navs.activity-nav-tabs ul li:not(.selected) a:hover,.buddypress-wrap.bp-vertical-navs .dir-navs.groups-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .dir-navs.groups-nav-tabs ul li:not(.selected) a:hover,.buddypress-wrap.bp-vertical-navs .dir-navs.members-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .dir-navs.members-nav-tabs ul li:not(.selected) a:hover,.buddypress-wrap.bp-vertical-navs .dir-navs.sites-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .dir-navs.sites-nav-tabs ul li:not(.selected) a:hover,.buddypress-wrap.bp-vertical-navs .main-navs.group-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .main-navs.group-nav-tabs ul li:not(.selected) a:hover,.buddypress-wrap.bp-vertical-navs .main-navs.user-nav-tabs ul li:not(.selected) a:focus,.buddypress-wrap.bp-vertical-navs .main-navs.user-nav-tabs ul li:not(.selected) a:hover{background:0 0}.buddypress-wrap.bp-vertical-navs .dir-navs.activity-nav-tabs ul li.selected,.buddypress-wrap.bp-vertical-navs .dir-navs.groups-nav-tabs ul li.selected,.buddypress-wrap.bp-vertical-navs .dir-navs.members-nav-tabs ul li.selected,.buddypress-wrap.bp-vertical-navs .dir-navs.sites-nav-tabs ul li.selected,.buddypress-wrap.bp-vertical-navs .main-navs.group-nav-tabs ul li.selected,.buddypress-wrap.bp-vertical-navs .main-navs.user-nav-tabs ul li.selected{background:0 0;border:1px solid #d6d6d6;border-left-color:#fff}.buddypress-wrap.bp-vertical-navs .dir-navs.activity-nav-tabs ul li.selected a,.buddypress-wrap.bp-vertical-navs .dir-navs.groups-nav-tabs ul li.selected a,.buddypress-wrap.bp-vertical-navs .dir-navs.members-nav-tabs ul li.selected a,.buddypress-wrap.bp-vertical-navs .dir-navs.sites-nav-tabs ul li.selected a,.buddypress-wrap.bp-vertical-navs .main-navs.group-nav-tabs ul li.selected a,.buddypress-wrap.bp-vertical-navs .main-navs.user-nav-tabs ul li.selected a{background:0 0;color:#333;font-weight:600}.buddypress-wrap.bp-vertical-navs .dir-navs.activity-nav-tabs ul li.selected a span,.buddypress-wrap.bp-vertical-navs .dir-navs.groups-nav-tabs ul li.selected a span,.buddypress-wrap.bp-vertical-navs .dir-navs.members-nav-tabs ul li.selected a span,.buddypress-wrap.bp-vertical-navs .dir-navs.sites-nav-tabs ul li.selected a span,.buddypress-wrap.bp-vertical-navs .main-navs.group-nav-tabs ul li.selected a span,.buddypress-wrap.bp-vertical-navs .main-navs.user-nav-tabs ul li.selected a span{background:#555;border:1px solid #d6d6d6;color:#fff}}
1
+ body #buddypress * a{box-shadow:none;text-decoration:none}body #buddypress div,body #buddypress dl,body #buddypress input[type=reset],body #buddypress input[type=search],body #buddypress input[type=submit],body #buddypress li,body #buddypress select,body #buddypress textarea{border-radius:2px;background-clip:padding-box}body #buddypress #item-body blockquote,body #buddypress .bp-lists blockquote{margin-right:0}body #buddypress .bp-list .action{box-sizing:border-box}@media screen and (min-width:46.8em){body.buddypress .entry-content:not(.alignwide):not(.alignfull),body.buddypress .entry-header:not(.alignwide):not(.alignfull),body.buddypress .site-content .entry-header:not(.alignwide):not(.alignfull){max-width:none}body.buddypress .entry-header{float:none}body.buddypress .entry-content{float:none}body.buddypress .site-content{padding-top:2.5em}body.buddypress #page #primary{max-width:none}body.buddypress #page #primary .entry-content,body.buddypress #page #primary .entry-header{float:none;width:auto}}body.buddypress .buddypress-wrap h1,body.buddypress .buddypress-wrap h2,body.buddypress .buddypress-wrap h3,body.buddypress .buddypress-wrap h4,body.buddypress .buddypress-wrap h5,body.buddypress .buddypress-wrap h6{clear:none;margin:1em 0;padding:0}body.buddypress .buddypress-wrap h2:before{display:none}.bp-wrap:after,.bp-wrap:before{content:" ";display:table}.bp-wrap:after{clear:both}.buddypress-wrap.round-avatars .avatar{border-radius:50%}body.buddypress article.page>.entry-header{margin-bottom:2em;padding:0}body.buddypress article.page>.entry-header:not(.alignwide):not(.alignfull) .entry-title{font-size:28px;font-weight:inherit;color:#767676}@media screen and (min-width:46.8em){body.buddypress article.page>.entry-header:not(.alignwide):not(.alignfull) .entry-title{font-size:34px}}.buddypress-wrap dt.section-title{font-size:18px}@media screen and (min-width:46.8em){.buddypress-wrap dt.section-title{font-size:22px}}.buddypress-wrap .bp-label-text,.buddypress-wrap .message-threads{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-label-text,.buddypress-wrap .message-threads{font-size:16px}}.buddypress-wrap .activity-header{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .activity-header{font-size:16px}}.buddypress-wrap .activity-inner{font-size:15px}@media screen and (min-width:46.8em){.buddypress-wrap .activity-inner{font-size:18px}}.buddypress-wrap #whats-new-post-in{font-size:16px}.buddypress-wrap .acomment-meta,.buddypress-wrap .mini .activity-header{font-size:16px}.buddypress-wrap .dir-component-filters #activity-filter-by{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .dir-component-filters #activity-filter-by{font-size:16px}}.buddypress-wrap .bp-tables-user th{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-tables-user th{font-size:16px}}.buddypress-wrap .bp-tables-user td{font-size:12px}@media screen and (min-width:46.8em){.buddypress-wrap .bp-tables-user td{font-size:14px}}.buddypress-wrap .profile-fields th{font-size:15px}@media screen and (min-width:46.8em){.buddypress-wrap .profile-fields th{font-size:18px}}.buddypress-wrap .profile-fields td{font-size:13px}@media screen and (min-width:46.8em){.buddypress-wrap .profile-fields td{font-size:16px}}.buddypress-wrap #notification-select{font-size:1