Changeset 11366
- Timestamp:
- 01/02/2017 08:13:14 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-actions.php
r11102 r11366 833 833 // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated 834 834 $post_type_comment_action = $activity_comment_object->action_id; 835 $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' ); 835 $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) { 836 $activity_types[] = $post_type_comment_action; 837 838 return $activity_types; 839 }; 836 840 add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history ); 837 841 -
trunk/src/bp-activity/bp-activity-functions.php
r11356 r11366 3751 3751 buddypress()->activity->read_more_id = $activity->id; 3752 3752 3753 add_filter( 'embed_post_id', create_function( '', 'return buddypress()->activity->read_more_id;' ));3753 add_filter( 'embed_post_id', function() { return buddypress()->activity->read_more_id; } ); 3754 3754 add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 ); 3755 3755 add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 ); -
trunk/src/bp-activity/classes/class-bp-activity-list-table.php
r11351 r11366 172 172 173 173 // Sort the array by the activity object's date_recorded value. 174 usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ));174 usort( $activities['activities'], function( $a, $b ) { return $a->date_recorded > $b->date_recorded; } ); 175 175 } 176 176 -
trunk/src/bp-blogs/bp-blogs-widgets.php
r11360 r11366 18 18 19 19 if ( bp_is_active( 'activity' ) && bp_is_root_blog( $wpdb->blogid ) ) { 20 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ));20 add_action( 'widgets_init', function() { register_widget( 'BP_Blogs_Recent_Posts_Widget' ); } ); 21 21 } 22 22 } -
trunk/src/bp-core/admin/bp-core-admin-tools.php
r11014 r11366 358 358 $message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>'; 359 359 $message = str_replace( "'", "\'", $message ); 360 $lambda = create_function( '', "echo '$message';" );360 $lambda = function() use ( $message ) { echo $message; }; 361 361 362 362 add_action( bp_core_do_network_admin() ? 'network_admin_notices' : 'admin_notices', $lambda ); -
trunk/src/bp-core/bp-core-widgets.php
r11360 r11366 17 17 */ 18 18 function bp_core_register_widgets() { 19 add_action( 'widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");'));19 add_action( 'widgets_init', function() { register_widget( 'BP_Core_Login_Widget' ); } ); 20 20 } 21 21 add_action( 'bp_register_widgets', 'bp_core_register_widgets' ); -
trunk/src/bp-forums/bp-forums-bbpress-sa.php
r11363 r11366 150 150 * @since 1.1.0 151 151 */ 152 register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ));152 register_shutdown_function( function() { do_action( 'bb_shutdown' ); } ); 153 153 } 154 154 add_action( 'bbpress_init', 'bp_forums_load_bbpress' ); -
trunk/src/bp-friends/bp-friends-widgets.php
r11360 r11366 28 28 } 29 29 30 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Friends_Widget");' ));30 add_action( 'widgets_init', function() { register_widget( 'BP_Core_Friends_Widget' ); } ); 31 31 } 32 32 add_action( 'bp_register_widgets', 'bp_friends_register_widgets' ); -
trunk/src/bp-friends/classes/class-bp-friends-friendship.php
r11242 r11366 645 645 646 646 // Sort and structure as expected in legacy function. 647 usort( $last_activities, create_function( '$a, $b', '648 if ( $a[ "date_recorded"] == $b["date_recorded"] ) {647 usort( $last_activities, function( $a, $b ) { 648 if ( $a['date_recorded'] == $b['date_recorded'] ) { 649 649 return 0; 650 650 } 651 651 652 return ( strtotime( $a[ "date_recorded"] ) < strtotime( $b["date_recorded"] ) ) ? 1 : -1;653 ' ));652 return ( strtotime( $a['date_recorded'] ) < strtotime( $b['date_recorded'] ) ) ? 1 : -1; 653 } ); 654 654 655 655 $retval = array(); -
trunk/src/bp-groups/bp-groups-widgets.php
r11360 r11366 17 17 */ 18 18 function groups_register_widgets() { 19 add_action( 'widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");'));19 add_action( 'widgets_init', function() { register_widget( 'BP_Groups_Widget' ); } ); 20 20 } 21 21 add_action( 'bp_register_widgets', 'groups_register_widgets' ); -
trunk/src/bp-groups/classes/class-bp-group-extension.php
r11091 r11366 975 975 $this->edit_screen_template = '/groups/single/home'; 976 976 } 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 } ); 978 982 add_action( 'bp_template_content', array( &$this, 'call_edit_screen' ) ); 979 983 $this->edit_screen_template = '/groups/single/plugins'; … … 1691 1695 // Register the group extension on the bp_init action so we have access 1692 1696 // 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 ); 1698 1702 } -
trunk/src/bp-members/bp-members-widgets.php
r11360 r11366 19 19 */ 20 20 function bp_members_register_widgets() { 21 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Members_Widget");' ));22 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Whos_Online_Widget");' ));23 add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Recently_Active_Widget");' ));21 add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Members_Widget' ); } ); 22 add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Whos_Online_Widget' ); } ); 23 add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Recently_Active_Widget' ); } ); 24 24 } 25 25 add_action( 'bp_register_widgets', 'bp_members_register_widgets' ); -
trunk/src/bp-messages/bp-messages-widgets.php
r11360 r11366 17 17 */ 18 18 function bp_messages_register_widgets() { 19 add_action( 'widgets_init', create_function('', 'return register_widget( "BP_Messages_Sitewide_Notices_Widget" );'));19 add_action( 'widgets_init', function() { register_widget( 'BP_Messages_Sitewide_Notices_Widget' ); } ); 20 20 } 21 21 add_action( 'bp_register_widgets', 'bp_messages_register_widgets' ); -
trunk/src/bp-xprofile/bp-xprofile-admin.php
r11360 r11366 701 701 702 702 // Sort these fields types alphabetically. 703 uasort( $fields, create_function( '$a, $b', 'return strnatcmp( $a[1]->name, $b[1]->name );' ));703 uasort( $fields, function( $a, $b ) { return strnatcmp( $a[1]->name, $b[1]->name ); } ); 704 704 705 705 foreach ( $fields as $field_type_obj ) { -
trunk/tests/phpunit/testcases/core/class-bp-user-query.php
r11067 r11366 176 176 ) ); 177 177 178 add_filter( 'bp_user_query_online_interval', create_function( '', 'return 5;' ));178 add_filter( 'bp_user_query_online_interval', function() { return 5; } ); 179 179 180 180 $q = new BP_User_Query( array(
Note: See TracChangeset
for help on using the changeset viewer.