<!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][6674] trunk/bp-groups/bp-groups-admin.php: Escape some output and clean up code in bp-groups-admin.php.</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, #logmsg > ol { margin-left: 0; 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">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/6674">6674</a></dd>
<dt>Author</dt> <dd>johnjamesjacoby</dd>
<dt>Date</dt> <dd>2012-12-26 09:17:49 +0000 (Wed, 26 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Escape some output and clean up code in bp-groups-admin.php.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpgroupsbpgroupsadminphp">trunk/bp-groups/bp-groups-admin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpgroupsbpgroupsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-groups/bp-groups-admin.php (6673 => 6674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-groups/bp-groups-admin.php        2012-12-25 23:22:13 UTC (rev 6673)
+++ trunk/bp-groups/bp-groups-admin.php        2012-12-26 09:17:49 UTC (rev 6674)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @global object $bp BuddyPress global settings
</span><span class="cx">  * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.7)
</ins><span class="cx">  */
</span><span class="cx"> function bp_groups_admin_load() {
</span><span class="cx">         global $bp_groups_list_table;
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx">                 &lt;p&gt;&lt;strong&gt;&lt;?php _e( 'This action cannot be undone.', 'buddypress' ) ?&gt;&lt;/strong&gt;&lt;/p&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;a class=&quot;button-primary&quot; href=&quot;&lt;?php echo wp_nonce_url( add_query_arg( array( 'action' =&gt; 'do_delete', 'gid' =&gt; implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ?&gt;&quot;&gt;&lt;?php _e( 'Delete Permanently', 'buddypress' ) ?&gt;&lt;/a&gt;
</span><del>-                &lt;a class=&quot;button&quot; href=&quot;&lt;?php echo $base_url ?&gt;&quot;&gt;&lt;?php _e( 'Cancel', 'buddypress' ) ?&gt;&lt;/a&gt;
</del><ins>+                &lt;a class=&quot;button&quot; href=&quot;&lt;?php echo esc_attr( $base_url ); ?&gt;&quot;&gt;&lt;?php _e( 'Cancel', 'buddypress' ) ?&gt;&lt;/a&gt;
</ins><span class="cx">         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;?php
</span><span class="lines">@@ -601,15 +601,13 @@
</span><span class="cx">                 if ( $deleted &gt; 0 ) {
</span><span class="cx">                         $messages[] = sprintf( _n( '%s activity has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );
</span><span class="cx">                 }
</span><del>-
</del><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Prepare the activity items for display
</span><span class="cx">         $bp_groups_list_table-&gt;prepare_items();
</span><span class="cx"> 
</span><span class="cx">         // Call an action for plugins to modify the messages before we display the edit form
</span><del>-        do_action( 'bp_groups_admin_index', $messages );
-?&gt;
</del><ins>+        do_action( 'bp_groups_admin_index', $messages ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;wrap&quot;&gt;
</span><span class="cx">                 &lt;?php screen_icon( 'buddypress-groups' ); ?&gt;
</span><span class="lines">@@ -647,9 +645,8 @@
</span><span class="cx">  * @since BuddyPress (1.7)
</span><span class="cx">  */
</span><span class="cx"> function bp_groups_admin_edit_metabox_settings( $item ) {
</span><del>-        $invite_status = groups_get_groupmeta( $item-&gt;id, 'invite_status' );
</del><span class="cx"> 
</span><del>-?&gt;
</del><ins>+        $invite_status = groups_get_groupmeta( $item-&gt;id, 'invite_status' ); ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;bp-groups-settings-section&quot; id=&quot;bp-groups-settings-section-forum&quot;&gt;
</span><span class="cx">                 &lt;label for=&quot;group-show-forum&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;group-show-forum&quot; id=&quot;group-show-forum&quot; &lt;?php checked( $item-&gt;enable_forum ) ?&gt; /&gt; &lt;?php _e( 'Enable discussion forum', 'buddypress' ) ?&gt;&lt;br /&gt;
</span><span class="lines">@@ -702,7 +699,7 @@
</span><span class="cx">         // We'll also keep track of group members here to place them into a
</span><span class="cx">         // javascript variable, which will help with group member autocomplete
</span><span class="cx">         $member_ids = array();
</span><del>-        $members = array(
</del><ins>+        $members    = array(
</ins><span class="cx">                 'admin'  =&gt; array(),
</span><span class="cx">                 'mod'    =&gt; array(),
</span><span class="cx">                 'member' =&gt; array(),
</span><span class="lines">@@ -772,23 +769,24 @@
</span><span class="cx">                                 &lt;/thead&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;tbody&gt;
</span><ins>+
</ins><span class="cx">                                 &lt;?php foreach ( $type_users as $type_user ) : ?&gt;
</span><del>-                                        &lt;?php $user_link = bp_core_get_user_domain( $type_user-&gt;user_id ); ?&gt;
</del><ins>+
</ins><span class="cx">                                         &lt;tr&gt;
</span><del>-                                                &lt;th scope=&quot;row&quot; class=&quot;uid-column&quot;&gt;&lt;?php echo $type_user-&gt;user_id ?&gt;&lt;/th&gt;
</del><ins>+                                                &lt;th scope=&quot;row&quot; class=&quot;uid-column&quot;&gt;&lt;?php echo esc_html( $type_user-&gt;user_id ); ?&gt;&lt;/th&gt;
</ins><span class="cx"> 
</span><span class="cx">                                                 &lt;td class=&quot;uname-column&quot;&gt;
</span><del>-                                                        &lt;a style=&quot;float: left;&quot; href=&quot;&lt;?php echo $user_link ?&gt;&quot;&gt;&lt;?php echo bp_core_fetch_avatar( array(
-                                                                        'item_id' =&gt; $type_user-&gt;user_id,
-                                                                        'width'   =&gt; '32',
-                                                                        'height'  =&gt; '32'
-                                                        ) ) ?&gt;&lt;/a&gt;
</del><ins>+                                                        &lt;a style=&quot;float: left;&quot; href=&quot;&lt;?php echo bp_core_get_user_domain( $type_user-&gt;user_id ); ?&gt;&quot;&gt;&lt;?php echo bp_core_fetch_avatar( array(
+                                                                'item_id' =&gt; $type_user-&gt;user_id,
+                                                                'width'   =&gt; '32',
+                                                                'height'  =&gt; '32'
+                                                        ) ); ?&gt;&lt;/a&gt;
</ins><span class="cx"> 
</span><span class="cx">                                                         &lt;span style=&quot;margin: 8px; float: left;&quot;&gt;&lt;?php echo bp_core_get_userlink( $type_user-&gt;user_id ) ?&gt;&lt;/span&gt;
</span><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;td class=&quot;urole-column&quot;&gt;
</span><del>-                                                        &lt;select class=&quot;bp-groups-role&quot; id=&quot;bp-groups-role-&lt;?php echo $type_user-&gt;user_id ?&gt;&quot; name=&quot;bp-groups-role[&lt;?php echo $type_user-&gt;user_id ?&gt;]&quot;&gt;
</del><ins>+                                                        &lt;select class=&quot;bp-groups-role&quot; id=&quot;bp-groups-role-&lt;?php echo esc_attr( $type_user-&gt;user_id ); ?&gt;&quot; name=&quot;bp-groups-role[&lt;?php echo esc_attr( $type_user-&gt;user_id ); ?&gt;]&quot;&gt;
</ins><span class="cx">                                                                 &lt;option value=&quot;admin&quot; &lt;?php selected( 'admin', $member_type ) ?&gt;&gt;&lt;?php _e( 'Administrator', 'buddypress' ) ?&gt;&lt;/option&gt;
</span><span class="cx">                                                                 &lt;option value=&quot;mod&quot; &lt;?php selected( 'mod', $member_type ) ?&gt;&gt;&lt;?php _e( 'Moderator', 'buddypress' ) ?&gt;&lt;/option&gt;
</span><span class="cx">                                                                 &lt;option value=&quot;member&quot; &lt;?php selected( 'member', $member_type ) ?&gt;&gt;&lt;?php _e( 'Member', 'buddypress' ) ?&gt;&lt;/option&gt;
</span><span class="lines">@@ -796,11 +794,19 @@
</span><span class="cx">                                                                 &lt;option class=&quot;remove&quot; value=&quot;remove&quot;&gt;&lt;?php _e( 'Remove From Group', 'buddypress' ) ?&gt;&lt;/option&gt;
</span><span class="cx">                                                         &lt;/select&gt;
</span><span class="cx"> 
</span><del>-                                                        &lt;?php /* Store the current role for this user, so we can easily detect changes */ ?&gt;
-                                                        &lt;input type=&quot;hidden&quot; name=&quot;bp-groups-existing-role[&lt;?php echo $type_user-&gt;user_id ?&gt;]&quot; value=&quot;&lt;?php echo $member_type ?&gt;&quot; /&gt;
</del><ins>+                                                        &lt;?php
+                                                        /**
+                                                         * Store the current role for this user,
+                                                         * so we can easily detect changes.
+                                                         *
+                                                         * @todo remove this, and do database detection on save
+                                                         */ ?&gt;
+                                                        &lt;input type=&quot;hidden&quot; name=&quot;bp-groups-existing-role[&lt;?php echo esc_attr( $type_user-&gt;user_id ); ?&gt;]&quot; value=&quot;&lt;?php echo esc_attr( $member_type ); ?&gt;&quot; /&gt;
</ins><span class="cx">                                                 &lt;/td&gt;
</span><span class="cx">                                         &lt;/tr&gt;
</span><ins>+
</ins><span class="cx">                                 &lt;?php endforeach; ?&gt;
</span><ins>+
</ins><span class="cx">                                 &lt;/tbody&gt;
</span><span class="cx">                         &lt;/table&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -839,7 +845,6 @@
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- #major-publishing-actions --&gt;
</span><del>-
</del><span class="cx">         &lt;/div&gt;&lt;!-- #submitcomment --&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><span class="lines">@@ -850,11 +855,12 @@
</span><span class="cx">  *
</span><span class="cx">  * @since BuddyPress (1.7)
</span><span class="cx">  */
</span><del>-function bp_groups_admin_get_usernames_from_ids( $user_ids ) {
</del><ins>+function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {
+
</ins><span class="cx">         $usernames = array();
</span><ins>+        $users     = new WP_User_Query( array( 'blog_id' =&gt; 0, 'include' =&gt; $user_ids ) );
</ins><span class="cx"> 
</span><del>-        $users = new WP_User_Query( array( 'blog_id' =&gt; 0, 'include' =&gt; $user_ids ) );
-        foreach ( $users-&gt;results as $user ) {
</del><ins>+        foreach ( (array) $users-&gt;results as $user ) {
</ins><span class="cx">                 $usernames[] = $user-&gt;user_login;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -867,23 +873,25 @@
</span><span class="cx">  * @since BuddyPress (1.7)
</span><span class="cx">  */
</span><span class="cx"> function bp_groups_admin_autocomplete_handler() {
</span><del>-        if ( ! current_user_can( 'bp_moderate' ) || is_multisite() &amp;&amp; wp_is_large_network( 'users' ) )
</del><ins>+
+        // Bail if user user shouldn't be here, or is a large network
+        if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() &amp;&amp; wp_is_large_network( 'users' ) ) )
</ins><span class="cx">                 wp_die( -1 );
</span><span class="cx"> 
</span><span class="cx">         $return = array();
</span><span class="cx"> 
</span><span class="cx">         // Exclude current group members
</span><span class="cx">         $group_members = isset( $_REQUEST['group_members'] ) ? wp_parse_id_list( $_REQUEST['group_members'] ) : array();
</span><del>-
-        $users = get_users( array(
-                'blog_id' =&gt; false,
-                'search'  =&gt; '*' . $_REQUEST['term'] . '*',
-                'exclude' =&gt; $group_members,
</del><ins>+        $terms         = isset( $_REQUEST['term']          ) ? $_REQUEST['term'] : '';
+        $users         = get_users( array(
+                'blog_id'        =&gt; false,
+                'search'         =&gt; '*' . $terms . '*',
+                'exclude'        =&gt; $group_members,
</ins><span class="cx">                 'search_columns' =&gt; array( 'user_login', 'user_nicename', 'user_email', 'display_name' ),
</span><del>-                'number'  =&gt; 10
</del><ins>+                'number'         =&gt; 10
</ins><span class="cx">         ) );
</span><span class="cx"> 
</span><del>-        foreach ( $users as $user ) {
</del><ins>+        foreach ( (array) $users as $user ) {
</ins><span class="cx">                 $return[] = array(
</span><span class="cx">                         /* translators: 1: user_login, 2: user_email */
</span><span class="cx">                         'label' =&gt; sprintf( __( '%1$s (%2$s)' ), $user-&gt;user_login, $user-&gt;user_email ),
</span><span class="lines">@@ -898,28 +906,28 @@
</span><span class="cx"> /**
</span><span class="cx">  * List table class for the Groups component admin page.
</span><span class="cx">  *
</span><del>- * @since BuddyPress (1.6)
</del><ins>+ * @since BuddyPress (1.7)
</ins><span class="cx">  */
</span><span class="cx"> class BP_Groups_List_Table extends WP_List_Table {
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * What type of view is being displayed? e.g. &quot;All&quot;, &quot;Pending&quot;, &quot;Approved&quot;, &quot;Spam&quot;...
</span><span class="cx">          *
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">         */
</span><span class="cx">         public $view = 'all';
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Group counts for each group type
</span><span class="cx">          *
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">          */
</span><span class="cx">         public $group_counts = 0;
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="cx">          * Constructor
</span><span class="cx">          *
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">          */
</span><span class="cx">         public function __construct() {
</span><span class="cx"> 
</span><span class="lines">@@ -934,7 +942,7 @@
</span><span class="cx">         /**
</span><span class="cx">          * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
</span><span class="cx">          *
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">          */
</span><span class="cx">         function prepare_items() {
</span><span class="cx">                 global $groups_template;
</span><span class="lines">@@ -942,9 +950,8 @@
</span><span class="cx">                 $screen = get_current_screen();
</span><span class="cx"> 
</span><span class="cx">                 // Option defaults
</span><del>-                $include_id       = false;
-                $search_terms     = false;
-                $sort             = 'DESC';
</del><ins>+                $include_id   = false;
+                $search_terms = false;
</ins><span class="cx"> 
</span><span class="cx">                 // Set current page
</span><span class="cx">                 $page = $this-&gt;get_pagenum();
</span><span class="lines">@@ -955,7 +962,7 @@
</span><span class="cx">                 // Sort order. Note: not supported in bp_has_groups()
</span><span class="cx">                 $order = 'ASC';
</span><span class="cx">                 if ( !empty( $_REQUEST['order'] ) ) {
</span><del>-                        $order = 'desc' == strtolower( $_REQUEST['order'] ) ? 'DESC' : 'ASC';
</del><ins>+                        $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC';
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 // Order by - default to newest
</span><span class="lines">@@ -1097,13 +1104,13 @@
</span><span class="cx">          * @param object $item The current item
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function single_row( $item ) {
</del><ins>+        function single_row( $item = array() ) {
</ins><span class="cx">                 static $row_class = '';
</span><span class="cx"> 
</span><span class="cx">                 if ( empty( $row_class ) ) {
</span><del>-                        $row_class = ' class=&quot;alternate&quot;';
</del><ins>+                        $row_class = ' class=&quot;alternate odd&quot;';
</ins><span class="cx">                 } else {
</span><del>-                        $row_class = '';
</del><ins>+                        $row_class = ' class=&quot;even&quot;';
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 echo '&lt;tr' . $row_class . ' id=&quot;activity-' . esc_attr( $item['id'] ) . '&quot; data-parent_id=&quot;' . esc_attr( $item['id'] ) . '&quot; data-root_id=&quot;' . esc_attr( $item['id'] ) . '&quot;&gt;';
</span><span class="lines">@@ -1136,10 +1143,9 @@
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><span class="cx">         function get_bulk_actions() {
</span><del>-                $actions = array();
-                $actions['delete'] = __( 'Delete', 'buddypress' );
-
-                return apply_filters( 'bp_groups_list_table_get_bulk_actions', $actions );
</del><ins>+                return apply_filters( 'bp_groups_list_table_get_bulk_actions', array(
+                        'delete' =&gt; __( 'Delete', 'buddypress' )
+                ) );
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><span class="lines">@@ -1152,11 +1158,11 @@
</span><span class="cx">         function get_columns() {
</span><span class="cx">                 return array(
</span><span class="cx">                         'cb'          =&gt; '&lt;input name type=&quot;checkbox&quot; /&gt;',
</span><del>-                        'comment'     =&gt; _x( 'Name', 'Groups admin Group Name column header', 'buddypress' ),
</del><ins>+                        'comment'     =&gt; _x( 'Name', 'Groups admin Group Name column header',               'buddypress' ),
</ins><span class="cx">                         'description' =&gt; _x( 'Description', 'Groups admin Group Description column header', 'buddypress' ),
</span><del>-                        'status'      =&gt; _x( 'Status', 'Groups admin Privacy Status column header', 'buddypress' ),
-                        'members'     =&gt; _x( '# Members', 'Groups admin Members column header', 'buddypress' ),
-                        'last_active' =&gt; _x( 'Last Active', 'Groups admin Last Active column header', 'buddypress' )
</del><ins>+                        'status'      =&gt; _x( 'Status', 'Groups admin Privacy Status column header',         'buddypress' ),
+                        'members'     =&gt; _x( '# Members', 'Groups admin Members column header',             'buddypress' ),
+                        'last_active' =&gt; _x( 'Last Active', 'Groups admin Last Active column header',       'buddypress' )
</ins><span class="cx">                 );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1168,9 +1174,9 @@
</span><span class="cx">          */
</span><span class="cx">         function get_sortable_columns() {
</span><span class="cx">                 return array(
</span><del>-                        'gid'         =&gt; array( 'gid', false ),
-                        'comment'     =&gt; array( 'name', false ),
-                        'members'     =&gt; array( 'members', false ),
</del><ins>+                        'gid'         =&gt; array( 'gid',         false ),
+                        'comment'     =&gt; array( 'name',        false ),
+                        'members'     =&gt; array( 'members',     false ),
</ins><span class="cx">                         'last_active' =&gt; array( 'last_active', false )
</span><span class="cx">                 );
</span><span class="cx">         }
</span><span class="lines">@@ -1180,9 +1186,9 @@
</span><span class="cx">          *
</span><span class="cx">          * @param array $item A singular item (one full row)
</span><span class="cx">          * @see WP_List_Table::single_row_columns()
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">          */
</span><del>-        function column_cb( $item ) {
</del><ins>+        function column_cb( $item = array() ) {
</ins><span class="cx">                 printf( '&lt;input type=&quot;checkbox&quot; name=&quot;gid[]&quot; value=&quot;%d&quot; /&gt;', (int) $item['id'] );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1191,9 +1197,9 @@
</span><span class="cx">          *
</span><span class="cx">          * @param array $item A singular item (one full row)
</span><span class="cx">          * @see WP_List_Table::single_row_columns()
</span><del>-         * @since BuddyPress (1.6)
</del><ins>+         * @since BuddyPress (1.7)
</ins><span class="cx">          */
</span><del>-        function column_gid( $item ) {
</del><ins>+        function column_gid( $item = array() ) {
</ins><span class="cx">                 echo '&lt;strong&gt;' . $item['id'] . '&lt;/strong&gt;';
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1206,7 +1212,7 @@
</span><span class="cx">          * @see WP_List_Table::single_row_columns()
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function column_comment( $item ) {
</del><ins>+        function column_comment( $item = array() ) {
</ins><span class="cx"> 
</span><span class="cx">                 // Preorder items: Visit | Edit | Delete
</span><span class="cx">                 $actions = array(
</span><span class="lines">@@ -1220,7 +1226,6 @@
</span><span class="cx"> 
</span><span class="cx">                 // Build actions URLs
</span><span class="cx">                 $base_url   = bp_get_admin_url( 'admin.php?page=bp-groups&amp;amp;gid=' . $item['id'] );
</span><del>-
</del><span class="cx">                 $delete_url = wp_nonce_url( $base_url . &quot;&amp;amp;action=delete&quot;, 'bp-groups-delete' );
</span><span class="cx">                 $edit_url   = $base_url . '&amp;amp;action=edit';
</span><span class="cx">                 $visit_url  = bp_get_group_permalink( $item_obj );
</span><span class="lines">@@ -1261,7 +1266,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function column_description( $item ) {
</del><ins>+        function column_description( $item = array() ) {
</ins><span class="cx">                 echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1270,9 +1275,8 @@
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function column_status( $item ) {
-                $status = $item['status'];
-
</del><ins>+        function column_status( $item = array() ) {
+                $status      = $item['status'];
</ins><span class="cx">                 $status_desc = '';
</span><span class="cx"> 
</span><span class="cx">                 // @todo This should be abstracted out somewhere for the whole
</span><span class="lines">@@ -1297,7 +1301,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function column_members( $item ) {
</del><ins>+        function column_members( $item = array() ) {
</ins><span class="cx">                 $count = groups_get_groupmeta( $item['id'], 'total_member_count' );
</span><span class="cx">                 echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) );
</span><span class="cx">         }
</span><span class="lines">@@ -1307,7 +1311,7 @@
</span><span class="cx">          *
</span><span class="cx">          * @since BuddyPress (1.7)
</span><span class="cx">          */
</span><del>-        function column_last_active( $item ) {
</del><ins>+        function column_last_active( $item = array() ) {
</ins><span class="cx">                 $last_active = groups_get_groupmeta( $item['id'], 'last_activity' );
</span><span class="cx">                 echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) );
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>