Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support BP Group Hierarchy when suggesting associated group on Edit p…

…age.

Fixes #264. Hat tip @mcolin
  • Loading branch information...
commit e7316d4105f0685a05459e77dfd4cce8baae434a 1 parent 786797d
Boone Gorges authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 includes/templatetags.php
6 includes/templatetags.php
View
@@ -641,6 +641,12 @@ function bp_docs_inline_toggle_js() {
function bp_docs_doc_associated_group_markup() {
// First, try to set the preselected group by looking at the URL params
$selected_group_slug = isset( $_GET['group'] ) ? $_GET['group'] : '';
+
+ // Support for BP Group Hierarchy
+ if ( false !== $slash = strrpos( $selected_group_slug, '/' ) ) {
+ $selected_group_slug = substr( $selected_group_slug, $slash + 1 );
+ }
+
$selected_group = BP_Groups_Group::get_id_from_slug( $selected_group_slug );
if ( $selected_group && ! BP_Docs_Groups_Integration::user_can_associate_doc_with_group( bp_loggedin_user_id(), $selected_group ) ) {
$selected_group = 0;
Please sign in to comment.
Something went wrong with that request. Please try again.