Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
Thank you, this was exactly what I needed. My solution, if anyone is interested, is that I changed the groups_check_slug($slug) function in:
…/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
function groups_check_slug( $slug ) {
global $bp;
if ( 'wp' == substr( $slug, 0, 2 ) )
$slug = substr( $slug, 2, strlen( $slug ) - 2 );
if ( in_array( $slug, (array) $bp->groups->forbidden_names )) {
bp_core_add_message( __( 'Sorry, that group name is reserved. Please try again.', 'buddypress' ), 'error' );
bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
}
if ( BP_Groups_Group::check_slug( $slug ) ) {
do {
bp_core_add_message( __( 'Sorry, that group name is already taken. Please try again.', 'buddypress' ), 'error' );
bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_get_groups_current_create_step() . '/' );
}
while ( BP_Groups_Group::check_slug( $slug ) );
}
return $slug;
}
I have since realized that this is a core WordPress Multisite behavior and that I cannot change the url/directory structure for subsites.
In case anyone is interested, and I know it is not the best workaround, but what I did was to edit
…/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php
and add the following code after retrieving the group object in the groups_delete_group( $group_id ) function.
//remove associated group blog
$groupblog_blog_id = get_groupblog_blog_id($bp->groups->current_group->id);;
if ($groupblog_blog_id){
require (ABSPATH. 'wp-admin/includes/ms.php');
wpmu_delete_blog( $groupblog_blog_id, $drop = true);
}
Thank you for your help; that is great news!