[buddypress-trac] [BuddyPress Trac] #7325: Removal of create_function usage for BP 2.8

buddypress-trac noreply at wordpress.org
Fri Nov 4 21:59:30 UTC 2016


#7325: Removal of create_function usage for BP 2.8
-------------------------+------------------
 Reporter:  tw2113       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.8
Component:  Core         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------
Changes (by slaFFik):

 * milestone:  Awaiting Review => 2.8


Comment:

 Replying to [comment:1 tw2113]:
 > These ones will need to remain due to PHP 5.4+ only support for $this in
 closures.
 >
 > {{{#!php
 > src/bp-groups/classes/class-bp-group-extension.php:756: add_action(
 'bp_template_content_header', create_function( '', 'echo "' . esc_attr(
 $this->name ) . '";' ) );
 >
 > src/bp-groups/classes/class-bp-group-extension.php:757: add_action(
 'bp_template_title',          create_function( '', 'echo "' . esc_attr(
 $this->name ) . '";' ) );
 >
 > src/bp-groups/classes/class-bp-group-extension.php:1191:
 create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' .
 $this->slug . '", ' . $group_id . ' );' ),
 >
 > }}}

 We can pass only the required value to anonymous functions in these cases,
 as only 1 property from `$this` is used there.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7325#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list