From 7ac2ef07d336277ee9bf3f495a92fbae97299e75 Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Fri, 15 Nov 2024 15:28:52 -0600 Subject: [PATCH] More use of bp_get_group_url(). See cuny-academic-commons/commons-in-a-box#458. --- lib/group-funcs.php | 15 ++++++++++----- lib/plugin-hooks.php | 11 ++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/group-funcs.php b/lib/group-funcs.php index 5649913..f4e19e1 100644 --- a/lib/group-funcs.php +++ b/lib/group-funcs.php @@ -187,7 +187,7 @@ function openlab_group_site_markup() {

- + @@ -1408,7 +1408,7 @@ function openlab_add_site_subnav_to_group_admin() { 'name' => _x( 'Site', 'Group admin nav item', 'commons-in-a-box' ), 'slug' => 'site-details', 'position' => 15, - 'parent_url' => bp_get_group_permalink( groups_get_current_group() ) . 'admin/', + 'parent_url' => bp_get_group_manage_url( groups_get_current_group() ), 'parent_slug' => bp_get_current_group_slug() . '_manage', 'screen_function' => 'openlab_group_site_settings', 'user_has_access' => bp_is_item_admin(), @@ -1438,7 +1438,12 @@ function openlab_group_site_settings() { bp_core_add_message( __( 'Site settings successfully saved.', 'commons-in-a-box' ) ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/site-details/' ); + $redirect_url = bp_get_group_manage_url( + groups_get_current_group(), + bp_groups_get_path_chunks( [ 'site-details' ], 'manage' ) + ); + + bp_core_redirect( $redirect_url ); } /** @@ -1919,7 +1924,7 @@ function openlab_show_site_posts_and_comments() { -

+

@@ -1944,7 +1949,7 @@ function openlab_show_site_posts_and_comments() { -

+

diff --git a/lib/plugin-hooks.php b/lib/plugin-hooks.php index 8bc8477..87d77a6 100644 --- a/lib/plugin-hooks.php +++ b/lib/plugin-hooks.php @@ -87,9 +87,9 @@ function openlab_manage_members_email_status( $user_id = '', $group = '' ) { $user_id = (int) $user_id; - $group_url = bp_get_group_permalink( $group ) . 'admin/manage-members/email'; + $group_url = bp_get_group_manage_url( $group, bp_groups_get_path_chunks( [ 'manage-members', 'email' ], 'manage' ) ); $sub_type = ass_get_group_subscription_status( $user_id, $group->id ); - echo '
Email Status
'; + echo '
' . esc_html__( 'Email Status', 'commons-in-a-box' ) . '
'; echo '