- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-settings/classes/class-bp-settings-component.php
r13432 r13441 133 133 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 134 134 135 // Determine user to use. 136 if ( bp_displayed_user_domain() ) { 137 $user_domain = bp_displayed_user_domain(); 138 } elseif ( bp_loggedin_user_domain() ) { 139 $user_domain = bp_loggedin_user_domain(); 140 } else { 135 // Stop if there is no user displayed or logged in. 136 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 141 137 return; 142 138 } 143 139 144 $access = bp_core_can_edit_settings(); 145 $slug = bp_get_settings_slug(); 146 $settings_link = trailingslashit( $user_domain . $slug ); 140 $access = bp_core_can_edit_settings(); 141 $slug = bp_get_settings_slug(); 147 142 148 143 // Add the settings navigation item. … … 160 155 'name' => __( 'General', 'buddypress' ), 161 156 'slug' => 'general', 162 'parent_url' => $settings_link,163 157 'parent_slug' => $slug, 164 158 'screen_function' => 'bp_settings_screen_general', … … 172 166 'name' => __( 'Email', 'buddypress' ), 173 167 'slug' => 'notifications', 174 'parent_url' => $settings_link,175 168 'parent_slug' => $slug, 176 169 'screen_function' => 'bp_settings_screen_notification', … … 184 177 'name' => __( 'Capabilities', 'buddypress' ), 185 178 'slug' => 'capabilities', 186 'parent_url' => $settings_link,187 179 'parent_slug' => $slug, 188 180 'screen_function' => 'bp_settings_screen_capabilities', … … 206 198 'name' => __( 'Export Data', 'buddypress' ), 207 199 'slug' => 'data', 208 'parent_url' => $settings_link,209 200 'parent_slug' => $slug, 210 201 'screen_function' => 'bp_settings_screen_data', … … 219 210 'name' => __( 'Delete Account', 'buddypress' ), 220 211 'slug' => 'delete-account', 221 'parent_url' => $settings_link,222 212 'parent_slug' => $slug, 223 213 'screen_function' => 'bp_settings_screen_delete_account',
Note: See TracChangeset
for help on using the changeset viewer.