Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/13/2017 01:13:51 AM (4 years ago)
Author:
boonebgorges
Message:

Remove calls to create_function().

create_function() is deprecated in PHP 7.2.

See #7634.

File:
1 edited

Legend:

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

    r11703 r11773  
    754754            if ( bp_is_current_action( $this->slug ) ) {
    755755                add_filter( 'bp_group_user_has_access',   array( $this, 'group_access_protection' ), 10, 2 );
    756                 add_action( 'bp_template_content_header', create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
    757                 add_action( 'bp_template_title',          create_function( '', 'echo "' . esc_attr( $this->name ) . '";' ) );
     756
     757                $extension_name = $this->name;
     758                add_action( 'bp_template_content_header', function() use ( $extension_name ) {
     759                    echo esc_attr( $extension_name );
     760                } );
     761                add_action( 'bp_template_title', function() use ( $extension_name ) {
     762                    echo esc_attr( $extension_name );
     763                } );
    758764            }
    759765        }
     
    11971203        $screen   = $this->screens['admin'];
    11981204
     1205        $extension_slug = $this->slug;
     1206        $callback = function() use ( $extension_slug, $group_id ) {
     1207            do_action( 'bp_groups_admin_meta_box_content_' . $extension_slug, $group_id );
     1208        };
     1209
    11991210        add_meta_box(
    12001211            $screen['slug'],
    12011212            $screen['name'],
    1202             create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ),
     1213            $callback,
    12031214            get_current_screen()->id,
    12041215            $screen['metabox_context'],
Note: See TracChangeset for help on using the changeset viewer.