Skip to:
Content

BuddyPress.org

Ticket #7325: 7325-groups-anonymous-functions.diff

File 7325-groups-anonymous-functions.diff, 1.6 KB (added by tw2113, 8 years ago)
  • src/bp-groups/classes/class-bp-group-extension.php

    diff --git src/bp-groups/classes/class-bp-group-extension.php src/bp-groups/classes/class-bp-group-extension.php
    index 208e2ff..ac4b860 100644
    class BP_Group_Extension { 
    974974                        if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
    975975                                $this->edit_screen_template = '/groups/single/home';
    976976                        } else {
    977                                 add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
     977                                add_action( 'bp_template_content_header', function() {
     978                                        echo '<ul class="content-header-nav">';
     979                                        bp_group_admin_tabs();
     980                                        echo '</ul>';
     981                                } );
    978982                                add_action( 'bp_template_content', array( &$this, 'call_edit_screen' ) );
    979983                                $this->edit_screen_template = '/groups/single/plugins';
    980984                        }
    function bp_register_group_extension( $group_extension_class = '' ) { 
    16901694
    16911695        // Register the group extension on the bp_init action so we have access
    16921696        // to all plugins.
    1693         add_action( 'bp_init', create_function( '', '
    1694                 $extension = new ' . $group_extension_class . ';
    1695                 add_action( "bp_actions", array( &$extension, "_register" ), 8 );
    1696                 add_action( "admin_init", array( &$extension, "_register" ) );
    1697         ' ), 11 );
     1697        add_action( 'bp_init', function() use ( $group_extension_class ) {
     1698                $extension = new $group_extension_class;
     1699                add_action( 'bp_actions', array( &$extension, '_register' ), 8 );
     1700                add_action( 'admin_init', array( &$extension, '_register' ) );
     1701        }, 11 );
    16981702}