Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/23/2012 06:17:14 PM (13 years ago)
Author:
boonebgorges
Message:

Adds template tag bp_get_group_current_admin_tab() and implements throughout BuddyPress for accessing current group admin tab data.
Adds current admin tab slug to the body class in the group admin section.
Fixes #4095

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-template.php

    r5941 r5942  
    12631263        $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group;
    12641264
    1265     $current_tab = bp_action_variable( 0 );
     1265    $current_tab = bp_get_group_current_admin_tab();
    12661266
    12671267    if ( bp_is_item_admin() || bp_is_item_mod() ) : ?>
     
    23582358}
    23592359
     2360/**
     2361 * Echoes the current group admin tab slug
     2362 *
     2363 * @since 1.6
     2364 */
     2365function bp_group_current_admin_tab() {
     2366    echo bp_get_group_current_admin_tab();
     2367}
     2368    /**
     2369     * Returns the current group admin tab slug
     2370     *
     2371     * @since 1.6
     2372     *
     2373     * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value
     2374     * @return str $tab The current tab's slug
     2375     */
     2376    function bp_get_group_current_admin_tab() {
     2377        if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) ) {
     2378            $tab = bp_action_variable( 0 );
     2379        } else {
     2380            $tab = '';
     2381        }
     2382       
     2383        return apply_filters( 'bp_get_current_group_admin_tab', $tab );
     2384    }
     2385
    23602386/************************************************************************************
    23612387 * Group Avatar Template Tags
Note: See TracChangeset for help on using the changeset viewer.