- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-component.php
r13432 r13441 147 147 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 148 148 149 // Determine user to use. 150 if ( bp_displayed_user_domain() ) { 151 $user_domain = bp_displayed_user_domain(); 152 } elseif ( bp_loggedin_user_domain() ) { 153 $user_domain = bp_loggedin_user_domain(); 154 } else { 149 // Stop if there is no user displayed or logged in. 150 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 155 151 return; 156 152 } 157 153 158 $access = bp_core_can_edit_settings(); 159 $slug = bp_get_notifications_slug(); 160 $notifications_link = trailingslashit( $user_domain . $slug ); 154 $access = bp_core_can_edit_settings(); 155 $slug = bp_get_notifications_slug(); 161 156 162 157 // Only grab count if we're on a user page and current user has access. … … 192 187 'name' => _x( 'Unread', 'Notification screen nav', 'buddypress' ), 193 188 'slug' => 'unread', 194 'parent_url' => $notifications_link,195 189 'parent_slug' => $slug, 196 190 'screen_function' => 'bp_notifications_screen_unread', … … 203 197 'name' => _x( 'Read', 'Notification screen nav', 'buddypress' ), 204 198 'slug' => 'read', 205 'parent_url' => $notifications_link,206 199 'parent_slug' => $slug, 207 200 'screen_function' => 'bp_notifications_screen_read',
Note: See TracChangeset
for help on using the changeset viewer.