Changeset 10373 for trunk/src/bp-groups/bp-groups-adminbar.php
- Timestamp:
- 11/22/2015 04:58:34 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-adminbar.php
r10148 r10373 26 26 $bp = buddypress(); 27 27 28 // Only show if viewing a group 28 // Only show if viewing a group. 29 29 if ( ! bp_is_group() || bp_is_group_create() ) { 30 30 return false; 31 31 } 32 32 33 // Only show this menu to group admins and super admins 33 // Only show this menu to group admins and super admins. 34 34 if ( ! bp_current_user_can( 'bp_moderate' ) && ! bp_group_is_admin() ) { 35 35 return false; 36 36 } 37 37 38 // Unique ID for the 'Edit Group' menu 38 // Unique ID for the 'Edit Group' menu. 39 39 $bp->group_admin_menu_id = 'group-admin'; 40 40 41 // Add the top-level Group Admin button 41 // Add the top-level Group Admin button. 42 42 $wp_admin_bar->add_menu( array( 43 43 'id' => $bp->group_admin_menu_id, … … 46 46 ) ); 47 47 48 // Index of the Manage tabs parent slug 48 // Index of the Manage tabs parent slug. 49 49 $nav_index = $bp->groups->current_group->slug . '_manage'; 50 50 51 // Check if current group has Manage tabs 51 // Check if current group has Manage tabs. 52 52 if ( empty( $bp->bp_options_nav[ $nav_index ] ) ) { 53 53 return; 54 54 } 55 55 56 // Build the Group Admin menus 56 // Build the Group Admin menus. 57 57 foreach ( $bp->bp_options_nav[ $nav_index ] as $menu ) { 58 58 /** … … 66 66 $title = sprintf( _x( 'Edit Group %s', 'Group WP Admin Bar manage links', 'buddypress' ), $menu['name'] ); 67 67 68 // Title is specific for delete 68 // Title is specific for delete. 69 69 if ( 'delete-group' == $menu['slug'] ) { 70 70 $title = sprintf( _x( '%s Group', 'Group WP Admin Bar delete link', 'buddypress' ), $menu['name'] );
Note: See TracChangeset
for help on using the changeset viewer.