<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][11366] trunk: Removes usage of create_function across various BuddyPress components.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/11366">11366</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/11366","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>tw2113</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2017-01-02 20:13:14 +0000 (Mon, 02 Jan 2017)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Removes usage of create_function across various BuddyPress components.
See <a href="http://buddypress.trac.wordpress.org/ticket/7325">#7325</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivitybpactivityactionsphp">trunk/src/bp-activity/bp-activity-actions.php</a></li>
<li><a href="#trunksrcbpactivitybpactivityfunctionsphp">trunk/src/bp-activity/bp-activity-functions.php</a></li>
<li><a href="#trunksrcbpactivityclassesclassbpactivitylisttablephp">trunk/src/bp-activity/classes/class-bp-activity-list-table.php</a></li>
<li><a href="#trunksrcbpblogsbpblogswidgetsphp">trunk/src/bp-blogs/bp-blogs-widgets.php</a></li>
<li><a href="#trunksrcbpcoreadminbpcoreadmintoolsphp">trunk/src/bp-core/admin/bp-core-admin-tools.php</a></li>
<li><a href="#trunksrcbpcorebpcorewidgetsphp">trunk/src/bp-core/bp-core-widgets.php</a></li>
<li><a href="#trunksrcbpforumsbpforumsbbpresssaphp">trunk/src/bp-forums/bp-forums-bbpress-sa.php</a></li>
<li><a href="#trunksrcbpfriendsbpfriendswidgetsphp">trunk/src/bp-friends/bp-friends-widgets.php</a></li>
<li><a href="#trunksrcbpfriendsclassesclassbpfriendsfriendshipphp">trunk/src/bp-friends/classes/class-bp-friends-friendship.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupswidgetsphp">trunk/src/bp-groups/bp-groups-widgets.php</a></li>
<li><a href="#trunksrcbpgroupsclassesclassbpgroupextensionphp">trunk/src/bp-groups/classes/class-bp-group-extension.php</a></li>
<li><a href="#trunksrcbpmembersbpmemberswidgetsphp">trunk/src/bp-members/bp-members-widgets.php</a></li>
<li><a href="#trunksrcbpmessagesbpmessageswidgetsphp">trunk/src/bp-messages/bp-messages-widgets.php</a></li>
<li><a href="#trunksrcbpxprofilebpxprofileadminphp">trunk/src/bp-xprofile/bp-xprofile-admin.php</a></li>
<li><a href="#trunktestsphpunittestcasescoreclassbpuserqueryphp">trunk/tests/phpunit/testcases/core/class-bp-user-query.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivityactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-actions.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-activity/bp-activity-actions.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -832,7 +832,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add "new_post_type_comment" to the whitelisted activity types, so that the activity's Akismet history is generated
</span><span class="cx" style="display: block; padding: 0 10px"> $post_type_comment_action = $activity_comment_object->action_id;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $comment_akismet_history = create_function( '$t', '$t[] = $post_type_comment_action; return $t;' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $comment_akismet_history = function ( $activity_types ) use ( $post_type_comment_action ) {
+ $activity_types[] = $post_type_comment_action;
+
+ return $activity_types;
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_akismet_get_activity_types', $comment_akismet_history );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the activity change won't edit the comment if sync is on
</span></span></pre></div>
<a id="trunksrcbpactivitybpactivityfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-functions.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-activity/bp-activity-functions.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3750,7 +3750,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_dtheme_embed_read_more( $activity ) {
</span><span class="cx" style="display: block; padding: 0 10px"> buddypress()->activity->read_more_id = $activity->id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'embed_post_id', create_function( '', 'return buddypress()->activity->read_more_id;' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'embed_post_id', function() { return buddypress()->activity->read_more_id; } );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'bp_embed_get_cache', 'bp_embed_activity_cache', 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_embed_update_cache', 'bp_embed_activity_save_cache', 10, 3 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcbpactivityclassesclassbpactivitylisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/classes/class-bp-activity-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/classes/class-bp-activity-list-table.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-activity/classes/class-bp-activity-list-table.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -171,7 +171,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $activities['total'] = count( $activities['activities'] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sort the array by the activity object's date_recorded value.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- usort( $activities['activities'], create_function( '$a, $b', 'return $a->date_recorded > $b->date_recorded;' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ usort( $activities['activities'], function( $a, $b ) { return $a->date_recorded > $b->date_recorded; } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The bp_activity_get function returns an array of objects; cast these to arrays for WP_List_Table.
</span></span></pre></div>
<a id="trunksrcbpblogsbpblogswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-blogs/bp-blogs-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-blogs/bp-blogs-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-blogs/bp-blogs-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_active( 'activity' ) && bp_is_root_blog( $wpdb->blogid ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { register_widget( 'BP_Blogs_Recent_Posts_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' );
</span></span></pre></div>
<a id="trunksrcbpcoreadminbpcoreadmintoolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/admin/bp-core-admin-tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/admin/bp-core-admin-tools.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-core/admin/bp-core-admin-tools.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -357,7 +357,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $message = '<div id="message" class="' . esc_attr( $class ) . '">' . $message . '</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> $message = str_replace( "'", "\'", $message );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $lambda = create_function( '', "echo '$message';" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $lambda = function() use ( $message ) { echo $message; };
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( bp_core_do_network_admin() ? 'network_admin_notices' : 'admin_notices', $lambda );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcorebpcorewidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-core/bp-core-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,6 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_core_register_widgets() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Login_Widget");') );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { register_widget( 'BP_Core_Login_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'bp_core_register_widgets' );
</span></span></pre></div>
<a id="trunksrcbpforumsbpforumsbbpresssaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-forums/bp-forums-bbpress-sa.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-forums/bp-forums-bbpress-sa.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-forums/bp-forums-bbpress-sa.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +149,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- register_shutdown_function( create_function( '', 'do_action("bb_shutdown");' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ register_shutdown_function( function() { do_action( 'bb_shutdown' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bbpress_init', 'bp_forums_load_bbpress' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpfriendsbpfriendswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-friends/bp-friends-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-friends/bp-friends-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-friends/bp-friends-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Friends_Widget");' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { register_widget( 'BP_Core_Friends_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'bp_friends_register_widgets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpfriendsclassesclassbpfriendsfriendshipphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-friends/classes/class-bp-friends-friendship.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-friends/classes/class-bp-friends-friendship.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-friends/classes/class-bp-friends-friendship.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -644,13 +644,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $last_activities = BP_Core_User::get_last_activity( $user_ids );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sort and structure as expected in legacy function.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- usort( $last_activities, create_function( '$a, $b', '
- if ( $a["date_recorded"] == $b["date_recorded"] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ usort( $last_activities, function( $a, $b ) {
+ if ( $a['date_recorded'] == $b['date_recorded'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ( strtotime( $a["date_recorded"] ) < strtotime( $b["date_recorded"] ) ) ? 1 : -1;
- ' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ( strtotime( $a['date_recorded'] ) < strtotime( $b['date_recorded'] ) ) ? 1 : -1;
+ } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $retval = array();
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $last_activities as $last_activity ) {
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-groups/bp-groups-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function groups_register_widgets() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action('widgets_init', create_function('', 'return register_widget("BP_Groups_Widget");') );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { register_widget( 'BP_Groups_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'groups_register_widgets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpgroupsclassesclassbpgroupextensionphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/classes/class-bp-group-extension.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/classes/class-bp-group-extension.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-groups/classes/class-bp-group-extension.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -974,7 +974,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '' !== bp_locate_template( array( 'groups/single/home.php' ), false ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->edit_screen_template = '/groups/single/home';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'bp_template_content_header', function() {
+ echo '<ul class="content-header-nav">';
+ bp_group_admin_tabs();
+ echo '</ul>';
+ } );
</ins><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_template_content', array( &$this, 'call_edit_screen' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->edit_screen_template = '/groups/single/plugins';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1690,9 +1694,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Register the group extension on the bp_init action so we have access
</span><span class="cx" style="display: block; padding: 0 10px"> // to all plugins.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'bp_init', create_function( '', '
- $extension = new ' . $group_extension_class . ';
- add_action( "bp_actions", array( &$extension, "_register" ), 8 );
- add_action( "admin_init", array( &$extension, "_register" ) );
- ' ), 11 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'bp_init', function() use ( $group_extension_class ) {
+ $extension = new $group_extension_class;
+ add_action( 'bp_actions', array( &$extension, '_register' ), 8 );
+ add_action( 'admin_init', array( &$extension, '_register' ) );
+ }, 11 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcbpmembersbpmemberswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-members/bp-members-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-members/bp-members-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-members/bp-members-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,9 +18,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_members_register_widgets() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Members_Widget");' ) );
- add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Whos_Online_Widget");' ) );
- add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Core_Recently_Active_Widget");' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Members_Widget' ); } );
+ add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Whos_Online_Widget' ); } );
+ add_action( 'widgets_init', function() { return register_widget( 'BP_Core_Recently_Active_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'bp_members_register_widgets' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpmessagesbpmessageswidgetsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-messages/bp-messages-widgets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-messages/bp-messages-widgets.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-messages/bp-messages-widgets.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,6 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_messages_register_widgets() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_action( 'widgets_init', create_function('', 'return register_widget( "BP_Messages_Sitewide_Notices_Widget" );') );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_action( 'widgets_init', function() { register_widget( 'BP_Messages_Sitewide_Notices_Widget' ); } );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'bp_register_widgets', 'bp_messages_register_widgets' );
</span></span></pre></div>
<a id="trunksrcbpxprofilebpxprofileadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-xprofile/bp-xprofile-admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-xprofile/bp-xprofile-admin.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/src/bp-xprofile/bp-xprofile-admin.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -700,7 +700,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> printf( '<optgroup label="%1$s">', esc_attr( $category ) ); // Already i18n'd in each profile type class.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Sort these fields types alphabetically.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- uasort( $fields, create_function( '$a, $b', 'return strnatcmp( $a[1]->name, $b[1]->name );' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ uasort( $fields, function( $a, $b ) { return strnatcmp( $a[1]->name, $b[1]->name ); } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $fields as $field_type_obj ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $field_name = $field_type_obj[0];
</span></span></pre></div>
<a id="trunktestsphpunittestcasescoreclassbpuserqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/testcases/core/class-bp-user-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/testcases/core/class-bp-user-query.php 2017-01-02 19:51:45 UTC (rev 11365)
+++ trunk/tests/phpunit/testcases/core/class-bp-user-query.php 2017-01-02 20:13:14 UTC (rev 11366)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,7 +175,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'last_activity' => date( 'Y-m-d H:i:s', $now - 60*6 ),
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'bp_user_query_online_interval', create_function( '', 'return 5;' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'bp_user_query_online_interval', function() { return 5; } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $q = new BP_User_Query( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'online',
</span></span></pre>
</div>
</div>
</body>
</html>