diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 00000000..d738c0ce
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,6 @@
+{
+ "extends": [ "plugin:@wordpress/eslint-plugin/recommended" ],
+ "rules": {
+ "prettier/prettier": "off"
+ }
+}
diff --git a/buddypress/activity/index.php b/buddypress/activity/index.php
index e8707721..10b83295 100755
--- a/buddypress/activity/index.php
+++ b/buddypress/activity/index.php
@@ -20,7 +20,7 @@
-
-
+
diff --git a/buddypress/activity/post-form.php b/buddypress/activity/post-form.php
index 9e8b31e2..08b5a620 100755
--- a/buddypress/activity/post-form.php
+++ b/buddypress/activity/post-form.php
@@ -12,7 +12,7 @@
diff --git a/buddypress/docs/docs-loop.php b/buddypress/docs/docs-loop.php
index aa8ed9eb..355f8919 100644
--- a/buddypress/docs/docs-loop.php
+++ b/buddypress/docs/docs-loop.php
@@ -71,7 +71,7 @@
-
+
diff --git a/buddypress/groups/create.php b/buddypress/groups/create.php
index 8516fb1b..e1e4b7b9 100755
--- a/buddypress/groups/create.php
+++ b/buddypress/groups/create.php
@@ -153,21 +153,10 @@
- get_is_portfolio() ) : ?>
-
get_label( 'name_help_text' ) ); ?>
+
get_label( 'name_help_text' ) ); ?>
-
-
-
-
-
-
get_label( 'name_help_text' ) ); ?>
-
+
-
diff --git a/buddypress/groups/groups-loop.php b/buddypress/groups/groups-loop.php
index 3f2aa4d2..8ffbc521 100644
--- a/buddypress/groups/groups-loop.php
+++ b/buddypress/groups/groups-loop.php
@@ -22,7 +22,7 @@
$current_group_type = openlab_get_current_filter( 'group-types' );
if ( ! $current_group_type ) {
$current_group_type = array_map(
- function( $type ) {
+ function ( $type ) {
return $type->get_slug();
},
cboxol_get_group_types()
@@ -144,6 +144,15 @@ function( $type ) {
);
}
+// Exclude private groups if not current user's profile or don't have moderate access.
+$private_groups = [];
+if ( bp_is_user() ) {
+ $private_groups = openlab_get_user_private_memberships( bp_displayed_user_id() );
+ if ( ! bp_is_my_profile() && ! current_user_can( 'bp_moderate' ) ) {
+ $group_args['exclude'] = $private_groups;
+ }
+}
+
?>
@@ -231,12 +240,7 @@ function( $type ) {
- get_is_portfolio() ) : ?>
-
-
-
-
-
+ get_is_portfolio() ) : ?>
@@ -247,6 +251,10 @@ function( $type ) {
+
+
+
+
diff --git a/buddypress/groups/index-directory.php b/buddypress/groups/index-directory.php
index a05fb383..4884cb5a 100644
--- a/buddypress/groups/index-directory.php
+++ b/buddypress/groups/index-directory.php
@@ -4,7 +4,7 @@
// Redirect to the home page if we're not on a valid group directory page.
if ( is_wp_error( $type_object ) ) {
- bp_core_redirect( bp_get_root_domain() );
+ bp_core_redirect( bp_get_root_url() );
}
get_header();
@@ -19,7 +19,13 @@
}
$create_text = $type_object->get_can_be_cloned() ? __( 'Create / Clone', 'commons-in-a-box' ) : __( 'Create New', 'commons-in-a-box' );
-$create_link = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/group-details/?group_type=' . $type_object->get_slug() . '&new=true';
+$create_link = add_query_arg(
+ [
+ 'group_type' => $type_object->get_slug(),
+ 'new' => 'true',
+ ],
+ bp_groups_get_create_url( [ 'group-details' ] )
+);
?>
diff --git a/buddypress/groups/single/activity-list.php b/buddypress/groups/single/activity-list.php
index f9ea8eeb..f82dcd95 100644
--- a/buddypress/groups/single/activity-list.php
+++ b/buddypress/groups/single/activity-list.php
@@ -13,6 +13,13 @@
$group = groups_get_current_group();
$group_url = bp_get_group_permalink( $group );
+
+ if ( current_user_can( 'view_private_members_of_group', $group->id ) ) {
+ $group_private_members = [];
+ } else {
+ $group_private_members = openlab_get_private_members_of_group( $group->id );
+ }
+
?>
@@ -39,9 +46,16 @@
if ( ! empty( $forum_ids ) ) {
$forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids;
}
+
+ $topic_args = [
+ 'posts_per_page' => 3,
+ 'post_parent' => $forum_id,
+ 'author__not_in' => $group_private_members,
+ ];
+
?>
-
+
@@ -53,16 +67,24 @@
$last_reply_id = bbp_get_topic_last_reply_id( $topic_id );
// Oh, bbPress.
- $last_reply = get_post( $last_reply_id );
- if ( ! empty( $last_reply->post_content ) ) {
- $last_topic_content = bp_create_excerpt(
- wp_strip_all_tags( $last_reply->post_content ),
- 250,
- array(
- 'ending' => '',
- )
- );
+ $topic_replies = get_posts(
+ [
+ 'post_type' => 'reply',
+ 'post_parent' => $topic_id,
+ 'author__not_in' => $group_private_members,
+ 'posts_per_page' => 1,
+ 'orderby' => [ 'post_date' => 'DESC' ],
+ ]
+ );
+
+ if ( $topic_replies ) {
+ $last_reply_content = $topic_replies[0]->post_content;
+ } else {
+ $topic_post = get_post( $topic_id );
+ $last_reply_content = $topic_post->post_content;
}
+
+ $last_reply_content = bp_create_excerpt( wp_strip_all_tags( $last_reply_content ), 250 );
?>
@@ -139,8 +161,18 @@
?>
- false ); ?>
-
+
+ false,
+ ];
+
+ if ( ! current_user_can( 'bp_moderate' ) ) {
+ $group_member_args['exclude'] = openlab_get_private_members_of_group( bp_get_current_group_id() );
+ }
+ ?>
+
+
$member->ID,
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
@@ -165,7 +197,9 @@
-
+
+
+
diff --git a/buddypress/groups/single/admin.php b/buddypress/groups/single/admin.php
index 98bf14b6..d39f16e7 100755
--- a/buddypress/groups/single/admin.php
+++ b/buddypress/groups/single/admin.php
@@ -4,6 +4,10 @@
$group_type = cboxol_get_group_group_type( bp_get_current_group_id() );
openlab_group_admin_js_data( $group_type );
+
+// Get private users of the group.
+$private_users = openlab_get_private_members_of_group( bp_get_group_id() );
+
?>
@@ -21,7 +25,7 @@
@@ -52,6 +56,18 @@
+
+
+
+
+
+
+ type="checkbox" name="portfolio-profile-link-toggle" value="1" />
+
+
+
+
+
@@ -344,7 +360,7 @@
$user_avatar = bp_core_fetch_avatar(
array(
'item_id' => bp_get_member_user_id(),
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
@@ -382,7 +398,7 @@
-
+
bp_get_member_user_id(),
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
@@ -426,27 +442,40 @@
-
-
+ 96,
+ 'exclude_banned' => false,
+ ];
+
+ /**
+ * Filters the arguments used to query members on the Manage Members screen.
+ *
+ * @since 1.6.0
+ *
+ * @param array $manage_members_args Array of arguments used to query members on the Manage Members screen.
+ */
+ $manage_members_args = apply_filters( 'cboxol_group_manage_members_args', $manage_members_args );
+ ?>
-
+
+
-
-
-
-
+
+
+
+
+
@@ -538,7 +585,7 @@
$user_avatar = bp_core_fetch_avatar(
array(
'item_id' => $GLOBALS['requests_template']->request->user_id,
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
diff --git a/buddypress/groups/single/documents.php b/buddypress/groups/single/documents.php
index 489806ac..f4ab7085 100644
--- a/buddypress/groups/single/documents.php
+++ b/buddypress/groups/single/documents.php
@@ -10,7 +10,7 @@
$non_empty_folders = array_filter(
$folders,
- function( $folder ) {
+ function ( $folder ) {
return $folder->count > 0;
}
);
@@ -171,11 +171,13 @@ function( $folder ) {
-
+
+
+
diff --git a/buddypress/groups/single/group-home.php b/buddypress/groups/single/group-home.php
index 0f47010c..0f6215bc 100644
--- a/buddypress/groups/single/group-home.php
+++ b/buddypress/groups/single/group-home.php
@@ -251,7 +251,7 @@
$group_contact_label = $group_type->get_label( 'group_contact' );
?>
-
+
- get_is_portfolio() ) : ?>
-
-
-
-
-
diff --git a/buddypress/groups/single/invite-anyone.php b/buddypress/groups/single/invite-anyone.php
index f0be5784..34c8ed86 100644
--- a/buddypress/groups/single/invite-anyone.php
+++ b/buddypress/groups/single/invite-anyone.php
@@ -95,7 +95,7 @@
-
+
diff --git a/buddypress/groups/single/members.php b/buddypress/groups/single/members.php
index a6f1633e..72128a06 100755
--- a/buddypress/groups/single/members.php
+++ b/buddypress/groups/single/members.php
@@ -1,4 +1,20 @@
-
+
+
+
@@ -24,7 +40,7 @@
$user_avatar = bp_core_fetch_avatar(
array(
'item_id' => bp_get_member_user_id(),
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
@@ -44,7 +60,22 @@
-
+
+
+
+
+
+
+ />
+
+
+
+
+
+
+
+
+
diff --git a/buddypress/groups/single/nav/admin.php b/buddypress/groups/single/nav/admin.php
new file mode 100644
index 00000000..7004eaf6
--- /dev/null
+++ b/buddypress/groups/single/nav/admin.php
@@ -0,0 +1,68 @@
+id );
+
+// Portfolio tabs look different from other groups
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ get_can_be_cloned() ) : ?>
+ $group_type->get_slug(),
+ 'clone' => bp_get_current_group_id(),
+ ),
+ bp_get_groups_directory_permalink() . 'create/step/group-details/'
+ );
+ ?>
+
+
+
+
+
+
+ get_is_portfolio() ) : ?>
+
+
+
+
+
+
+
+
diff --git a/buddypress/groups/single/nav/docs.php b/buddypress/groups/single/nav/docs.php
new file mode 100644
index 00000000..282258a6
--- /dev/null
+++ b/buddypress/groups/single/nav/docs.php
@@ -0,0 +1,22 @@
+
+
+
>
+
+
>
+
+
+
+
+
diff --git a/buddypress/groups/single/nav/forum.php b/buddypress/groups/single/nav/forum.php
new file mode 100644
index 00000000..59bbc16c
--- /dev/null
+++ b/buddypress/groups/single/nav/forum.php
@@ -0,0 +1,48 @@
+current_forum_id = $forum_id;
+
+bbp_set_query_name( 'bbp_single_forum' );
+
+// Get the topic
+bbp_has_topics(
+ array(
+ 'name' => bp_action_variable( $offset + 1 ),
+ 'posts_per_page' => 1,
+ 'show_stickies' => false,
+ )
+);
+
+// Setup the topic
+while ( bbp_topics() ) {
+ bbp_the_topic();
+ $topic_title = bbp_get_topic_title();
+}
+
+$group_forum_permalink = bp_get_group_url( $group->id, bp_groups_get_path_chunks( [ 'forum' ] ) );
+
+?>
+
+
>
+
+
+
+
+
+ status ) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buddypress/members/index-directory.php b/buddypress/members/index-directory.php
index 8c7cd3b5..2ecc8a98 100755
--- a/buddypress/members/index-directory.php
+++ b/buddypress/members/index-directory.php
@@ -3,16 +3,12 @@
get_header();
?>
-get_queried_object();
-?>
role="main">
-
post_title ); ?>
+
diff --git a/buddypress/members/members-loop.php b/buddypress/members/members-loop.php
index 2b86ba60..5cdb5b40 100755
--- a/buddypress/members/members-loop.php
+++ b/buddypress/members/members-loop.php
@@ -18,7 +18,7 @@
$user_avatar = bp_core_fetch_avatar(
array(
'item_id' => bp_get_member_user_id(),
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
diff --git a/buddypress/members/single/friends/requests.php b/buddypress/members/single/friends/requests.php
index 6cdad93b..772734f4 100755
--- a/buddypress/members/single/friends/requests.php
+++ b/buddypress/members/single/friends/requests.php
@@ -13,7 +13,7 @@
$user_avatar = bp_core_fetch_avatar(
array(
'item_id' => bp_get_member_user_id(),
- 'object' => 'member',
+ 'object' => 'user',
'type' => 'full',
'html' => false,
)
diff --git a/buddypress/members/single/header.php b/buddypress/members/single/header.php
index e4564a9a..622ec821 100644
--- a/buddypress/members/single/header.php
+++ b/buddypress/members/single/header.php
@@ -27,16 +27,6 @@
);
?>
-
-