- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/classes/class-bp-messages-component.php
r13435 r13441 197 197 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 198 198 199 // Determine user to use. 200 if ( bp_displayed_user_domain() ) { 201 $user_domain = bp_displayed_user_domain(); 202 } elseif ( bp_loggedin_user_domain() ) { 203 $user_domain = bp_loggedin_user_domain(); 204 } else { 199 // Stop if there is no user displayed or logged in. 200 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 205 201 return; 206 202 } 207 203 208 $access = bp_core_can_edit_settings(); 209 $slug = bp_get_messages_slug(); 210 $messages_link = trailingslashit( $user_domain . $slug ); 204 $access = bp_core_can_edit_settings(); 205 $slug = bp_get_messages_slug(); 211 206 212 207 // Only grab count if we're on a user page and current user has access. … … 242 237 'name' => __( 'Inbox', 'buddypress' ), 243 238 'slug' => 'inbox', 244 'parent_url' => $messages_link,245 239 'parent_slug' => $slug, 246 240 'screen_function' => 'messages_screen_inbox', … … 253 247 'name' => __( 'Starred', 'buddypress' ), 254 248 'slug' => bp_get_messages_starred_slug(), 255 'parent_url' => $messages_link,256 249 'parent_slug' => $slug, 257 250 'screen_function' => 'bp_messages_star_screen', … … 264 257 'name' => __( 'Sent', 'buddypress' ), 265 258 'slug' => 'sentbox', 266 'parent_url' => $messages_link,267 259 'parent_slug' => $slug, 268 260 'screen_function' => 'messages_screen_sentbox', … … 275 267 'name' => __( 'Compose', 'buddypress' ), 276 268 'slug' => 'compose', 277 'parent_url' => $messages_link,278 269 'parent_slug' => $slug, 279 270 'screen_function' => 'messages_screen_compose', … … 286 277 'name' => __( 'Notices', 'buddypress' ), 287 278 'slug' => 'notices', 288 'parent_url' => $messages_link,289 279 'parent_slug' => $slug, 290 280 'screen_function' => 'messages_screen_notices',
Note: See TracChangeset
for help on using the changeset viewer.