Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/10/2014 07:13:04 PM (10 years ago)
Author:
imath
Message:

Improve Group's Edit WP Admin Bar menu

Use the group's manage options nav to populate the different edit links of the group's Edit WP Admin Bar.
Introduce a new parameter show_in_admin_bar for the edit screen property of the Group Extension API to allow plugins add their edit link into this Admin Bar (if this parameter is set to true).

props boonebgorges

Fixes #6002

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/bp-groups-classes.php

    r9130 r9131  
    36683668        $admin_link = trailingslashit( bp_get_group_permalink( $current_group ) . 'admin' );
    36693669
    3670         // Add the tab to the manage navigation
    3671         bp_core_new_subnav_item( array(
     3670        $subnav_args = array(
    36723671            'name'            => $screen['name'],
    36733672            'slug'            => $screen['slug'],
     
    36773676            'position'        => $position,
    36783677            'screen_function' => 'groups_screen_group_admin',
    3679         ) );
     3678        );
     3679
     3680        // Should we add a menu to the Group's WP Admin Bar
     3681        if ( ! empty( $screen['show_in_admin_bar'] ) ) {
     3682            $subnav_args['show_in_admin_bar'] = true;
     3683        }
     3684
     3685        // Add the tab to the manage navigation
     3686        bp_core_new_subnav_item( $subnav_args );
    36803687
    36813688        // Catch the edit screen and forward it to the plugin template
Note: See TracChangeset for help on using the changeset viewer.