Changeset 9127 for trunk/src/bp-core/bp-core-template.php
- Timestamp:
- 11/07/2014 11:31:26 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/bp-core-template.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-template.php
r9091 r9127 27 27 * viewed user. 28 28 */ 29 function bp_get_options_nav( ) {29 function bp_get_options_nav( $parent_slug = '' ) { 30 30 $bp = buddypress(); 31 31 … … 33 33 // component as an index. Otherwise we need to use the component's root_slug 34 34 $component_index = !empty( $bp->displayed_user ) ? bp_current_component() : bp_get_root_slug( bp_current_component() ); 35 $selected_item = bp_current_action(); 35 36 36 37 if ( ! bp_is_single_item() ) { … … 41 42 } 42 43 } else { 43 if ( !isset( $bp->bp_options_nav[bp_current_item()] ) || count( $bp->bp_options_nav[bp_current_item()] ) < 1 ) { 44 $current_item = bp_current_item(); 45 46 if ( ! empty( $parent_slug ) ) { 47 $current_item = $parent_slug; 48 $selected_item = bp_action_variable( 0 ); 49 } 50 51 if ( !isset( $bp->bp_options_nav[$current_item] ) || count( $bp->bp_options_nav[$current_item] ) < 1 ) { 44 52 return false; 45 53 } else { 46 $the_index = bp_current_item();54 $the_index = $current_item; 47 55 } 48 56 } … … 55 63 56 64 // If the current action or an action variable matches the nav item id, then add a highlight CSS class. 57 if ( $subnav_item['slug'] == bp_current_action()) {65 if ( $subnav_item['slug'] == $selected_item ) { 58 66 $selected = ' class="current selected"'; 59 67 } else { … … 65 73 66 74 // echo out the final list item 67 echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item );75 echo apply_filters( 'bp_get_options_nav_' . $subnav_item['css_id'], '<li id="' . $subnav_item['css_id'] . '-' . $list_type . '-li" ' . $selected . '><a id="' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>', $subnav_item, $selected_item ); 68 76 } 69 77 } … … 1918 1926 $retval = bp_is_groups_component() && groups_get_current_group(); 1919 1927 } 1920 1928 1921 1929 return (bool) $retval; 1922 1930 }
Note: See TracChangeset
for help on using the changeset viewer.