Changeset 9127 for trunk/src/bp-groups/bp-groups-classes.php
- Timestamp:
- 11/07/2014 11:31:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-classes.php
r9082 r9127 3638 3638 */ 3639 3639 protected function setup_edit_hooks() { 3640 // Bail if not in a group 3641 if ( ! bp_is_group() ) { 3642 return; 3643 } 3640 3644 3641 3645 // Bail if not an edit screen … … 3647 3651 3648 3652 $position = isset( $screen['position'] ) ? (int) $screen['position'] : 10; 3649 3650 // Add the tab 3651 // @todo BP should be using bp_core_new_subnav_item() 3652 add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', 3653 '$selected = ""; 3654 if ( "' . esc_attr( $screen['slug'] ) . '" == $current ) 3655 $selected = " class=\"current\""; 3656 echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $screen['slug'] ) ) . '\">' . esc_attr( $screen['name'] ) . '</a></li>";' 3657 ), $position, 2 ); 3653 $position += 40; 3654 3655 $current_group = groups_get_current_group(); 3656 $admin_link = trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' ); 3657 3658 // Add the tab to the manage navigation 3659 bp_core_new_subnav_item( array( 3660 'name' => $screen['name'], 3661 'slug' => $screen['slug'], 3662 'parent_slug' => $current_group->slug . '_manage', 3663 'parent_url' => trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' ), 3664 'user_has_access' => bp_is_item_admin(), 3665 'position' => $position, 3666 'screen_function' => 'groups_screen_group_admin', 3667 ) ); 3658 3668 3659 3669 // Catch the edit screen and forward it to the plugin template
Note: See TracChangeset
for help on using the changeset viewer.