Changeset 12547 for trunk/src/bp-core/classes/class-bp-core-nav.php
- Timestamp:
- 01/29/2020 09:43:16 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/classes/class-bp-core-nav.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-core-nav.php
r11797 r12547 217 217 public function delete_nav( $slug = '', $parent_slug = '' ) { 218 218 219 // Bail if slug is empty 219 // Bail if slug is empty. 220 220 if ( empty( $slug ) ) { 221 221 return false; 222 222 } 223 223 224 // We're deleting a child 224 // We're deleting a child. 225 225 if ( ! empty( $parent_slug ) ) { 226 226 227 // Validate the subnav 227 // Validate the subnav. 228 228 $sub_items = $this->get_secondary( array( 'parent_slug' => $parent_slug, 'slug' => $slug ), false ); 229 229 … … 238 238 } 239 239 240 // Delete the child 240 // Delete the child. 241 241 unset( $this->nav[ $this->object_id ][ $parent_slug . '/' . $slug ] ); 242 242 243 // Return the deleted item's screen function 243 // Return the deleted item's screen function. 244 244 return array( $sub_item->screen_function ); 245 245 246 // We're deleting a parent 246 // We're deleting a parent. 247 247 } else { 248 // Validate the nav 248 // Validate the nav. 249 249 $nav_items = $this->get_primary( array( 'slug' => $slug ), false ); 250 250 … … 268 268 $screen_functions[] = $sub_item->screen_function; 269 269 270 // Delete the child 270 // Delete the child. 271 271 unset( $this->nav[ $this->object_id ][ $nav_item->slug . '/' . $sub_item->slug ] ); 272 272 } … … 293 293 294 294 foreach ( $items as $item ) { 295 // Default position 295 // Default position. 296 296 $position = 99; 297 297 … … 300 300 } 301 301 302 // If position is already taken, move to the first next available 302 // If position is already taken, move to the first next available. 303 303 if ( isset( $sorted[ $position ] ) ) { 304 304 $sorted_keys = array_keys( $sorted );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)