Skip to:
Content

BuddyPress.org

Ticket #2976: 2976-2.patch

File 2976-2.patch, 2.1 KB (added by boonebgorges, 14 years ago)
  • bp-groups/bp-groups-classes.php

     
    11641164                        if ( $bp->current_component == $bp->groups->slug && 'admin' == $bp->current_action && !empty( $bp->action_variables[0] ) && $this->slug == $bp->action_variables[0] ) {
    11651165                                add_action( 'wp', array( &$this, 'edit_screen_save' ) );
    11661166                                add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) );
    1167 
    1168                                 if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) {
    1169                                         bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
    1170                                 } else {
    1171                                         add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
    1172                                         add_action( 'bp_template_content', array( &$this, 'edit_screen' ) );
    1173                                         bp_core_load_template( apply_filters( 'bp_core_template_plugin', '/groups/single/plugins' ) );
    1174                                 }
     1167                               
     1168                                // The template must be loaded very late so that other functions
     1169                                // hooked to 'wp' have a chance to run
     1170                                add_action( 'wp', array( &$this, '_load_edit_template' ), 999 );
    11751171                        }
    11761172                }
    11771173
     
    11931189                                add_action( $this->display_hook, array( &$this, 'widget_display' ) );
    11941190                }
    11951191        }
     1192       
     1193        /**
     1194         * Load the extension's admin template
     1195         *
     1196         * @since 1.3
     1197         */
     1198        function _load_edit_template() {       
     1199                if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) {
     1200                        bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) );
     1201                } else {
     1202                        add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
     1203                        add_action( 'bp_template_content', array( &$this, 'edit_screen' ) );
     1204                        bp_core_load_template( apply_filters( 'bp_core_template_plugin', '/groups/single/plugins' ) );
     1205                }
     1206        }
    11961207
    11971208        function _display_hook() {
    11981209                add_action( 'bp_template_content', array( &$this, 'display' ) );