Changeset 13441 for trunk/src/bp-core/bp-core-buddybar.php
- Timestamp:
- 03/23/2023 07:35:38 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-buddybar.php
r13436 r13441 161 161 'name' => $r['name'], 162 162 'slug' => $r['slug'], 163 'link' => trailingslashit( bp_loggedin_user_domain() . $r['slug'] ),164 163 'css_id' => $r['item_css_id'], 165 164 'show_for_displayed_user' => $r['show_for_displayed_user'], … … 561 560 562 561 // If we don't have the required info we need, don't create this subnav item. 563 if ( empty( $r['name'] ) || empty( $r['slug'] ) || empty( $r['parent_slug'] ) || empty( $r['parent_url'] ) || empty( $r['screen_function'] ) ) 564 return false; 565 566 // Link was not forced, so create one. 567 if ( empty( $r['link'] ) ) { 562 if ( empty( $r['name'] ) || empty( $r['slug'] ) || empty( $r['parent_slug'] ) || empty( $r['screen_function'] ) ) { 563 return false; 564 } 565 566 // Preserve backward compatibility for plugins forcing URLs. 567 if ( empty( $r['link'] ) && ! empty( $r['parent_url'] ) ) { 568 568 $r['link'] = trailingslashit( $r['parent_url'] . $r['slug'] ); 569 570 $parent_nav = $bp->{$component}->nav->get_primary( array( 'slug' => $r['parent_slug'] ), false );571 572 // If this sub item is the default for its parent, skip the slug.573 if ( $parent_nav ) {574 $parent_nav_item = reset( $parent_nav );575 if ( ! empty( $parent_nav_item->default_subnav_slug ) && $r['slug'] === $parent_nav_item->default_subnav_slug ) {576 $r['link'] = trailingslashit( $r['parent_url'] );577 }578 }579 569 } 580 570 … … 601 591 ); 602 592 593 // Add the item to the subnav. 603 594 buddypress()->{$component}->nav->add_nav( $subnav_item ); 604 595
Note: See TracChangeset
for help on using the changeset viewer.