Skip to:
Content

BuddyPress.org

Changeset 3980


Ignore:
Timestamp:
02/01/2011 02:56:33 AM (14 years ago)
Author:
boonebgorges
Message:

Ensures that group extensions load themselves under the groups root_slug

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-hooks.php

    r3962 r3980  
    2929
    3030// Setup widgets
    31 add_action( 'bp_loaded',    'bp_setup_widgets'         );
     31add_action( 'bp_loaded',  'bp_setup_widgets'           );
    3232   
    3333// Setup admin bar
  • trunk/bp-groups/bp-groups-classes.php

    r3954 r3980  
    11691169        if ( $this->visibility == 'public' || ( $this->visibility != 'public' && $bp->groups->current_group->user_has_access ) ) {
    11701170            if ( $this->enable_nav_item ) {
    1171                 if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item )
    1172                     bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
     1171                if ( bp_is_current_component( 'groups' ) && $bp->is_single_item ) {
     1172                    bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => $bp->groups->root_slug, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
     1173                }
    11731174
    11741175                // When we are viewing the extension display page, set the title and options title
    1175                 if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && $bp->current_action == $this->slug ) {
     1176                if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && $bp->current_action == $this->slug ) {
    11761177                    add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
    11771178                    add_action( 'bp_template_title', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
     
    11801181
    11811182            // Hook the group home widget
    1182             if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item && ( !$bp->current_action || 'home' == $bp->current_action ) )
     1183            if ( bp_is_current_component( 'groups' ) && $bp->is_single_item && ( !$bp->current_action || 'home' == $bp->current_action ) )
    11831184                add_action( $this->display_hook, array( &$this, 'widget_display' ) );
    11841185        }
     
    11981199
    11991200    /* Register the group extension on the bp_init action so we have access to all plugins */
    1200     add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "wp", array( &$extension, "_register" ), 2 );' ), 11 );
     1201    add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_init", array( &$extension, "_register" ), 1 );' ), 11 );
    12011202}
    12021203
Note: See TracChangeset for help on using the changeset viewer.