Changeset 10745 for trunk/src/bp-groups/bp-groups-adminbar.php
- Timestamp:
- 05/12/2016 05:19:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-adminbar.php
r10417 r10745 48 48 49 49 // Index of the Manage tabs parent slug. 50 $ nav_index = $bp->groups->current_group->slug . '_manage';50 $secondary_nav_items = $bp->groups->nav->get_secondary( array( 'parent_slug' => $bp->groups->current_group->slug . '_manage' ) ); 51 51 52 52 // Check if current group has Manage tabs. 53 if ( empty( $bp->bp_options_nav[ $nav_index ] )) {53 if ( ! $secondary_nav_items ) { 54 54 return; 55 55 } 56 56 57 57 // Build the Group Admin menus. 58 foreach ( $ bp->bp_options_nav[ $nav_index ]as $menu ) {58 foreach ( $secondary_nav_items as $menu ) { 59 59 /** 60 60 * Should we add the current manage link in the Group's "Edit" Admin Bar menu ? … … 64 64 * the 'show_in_admin_bar' argument of your edit screen to true 65 65 */ 66 if ( $menu ['show_in_admin_bar']) {67 $title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu ['name']);66 if ( $menu->show_in_admin_bar ) { 67 $title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu->name ); 68 68 69 69 // Title is specific for delete. 70 if ( 'delete-group' == $menu ['slug']) {71 $title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu ['name']);70 if ( 'delete-group' == $menu->slug ) { 71 $title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu->name ); 72 72 } 73 73 74 74 $wp_admin_bar->add_menu( array( 75 75 'parent' => $bp->group_admin_menu_id, 76 'id' => $menu ['slug'],76 'id' => $menu->slug, 77 77 'title' => $title, 78 'href' => bp_get_groups_action_link( 'admin/' . $menu ['slug'])78 'href' => bp_get_groups_action_link( 'admin/' . $menu->slug ) 79 79 ) ); 80 80 }
Note: See TracChangeset
for help on using the changeset viewer.