From ac761fefd168f3c5d465962a2742e5fcde4cf164 Mon Sep 17 00:00:00 2001 From: Boone B Gorges Date: Fri, 19 Jul 2024 08:36:00 -0500 Subject: [PATCH] Fix Settings subnav items. See cuny-academic-commons/commons-in-a-box#458, cuny-academic-commons#commons-in-a-box#489. --- lib/menus.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/menus.php b/lib/menus.php index 455918b..9e74e77 100644 --- a/lib/menus.php +++ b/lib/menus.php @@ -483,7 +483,6 @@ function openlab_profile_settings_submenu() { $settings_url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( [ bp_get_settings_slug() ] ) ); $notifications_url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( [ bp_get_settings_slug(), 'notifications' ] ) ); - $settings_slug = $dud . bp_get_settings_slug(); $menu_list = array( $profile_edit_url => __( 'Edit Profile', 'commons-in-a-box' ), $change_avatar_url => __( 'Change Avatar', 'commons-in-a-box' ), @@ -496,13 +495,17 @@ function openlab_profile_settings_submenu() { // Export Data - only available for BuddyPress 4.0.0. if ( true === $show_data_page && function_exists( 'bp_signup_requires_privacy_policy_acceptance' ) ) { - $menu_list[ $dud . 'settings/data' ] = __( 'Export Data', 'commons-in-a-box' ); + $export_data_url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( [ bp_get_settings_slug(), 'data' ] ) ); + + $menu_list[ $export_data_url ] = __( 'Export Data', 'commons-in-a-box' ); } if ( ! is_super_admin( bp_displayed_user_id() ) && ( ( ! bp_disable_account_deletion() && bp_is_my_profile() ) || bp_current_user_can( 'delete_users' ) ) ) { + $delete_account_url = bp_members_get_user_url( $user_id, bp_members_get_path_chunks( [ bp_get_settings_slug(), 'delete-account' ] ) ); - $menu_list[ $dud . 'settings/delete-account' ] = __( 'Delete Account', 'commons-in-a-box' ); + $menu_list[ $delete_account_url ] = __( 'Delete Account', 'commons-in-a-box' ); } + return openlab_submenu_gen( $menu_list, true ); }