Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge develop into master

  • Loading branch information...
commit 5abb15c3a88f47f4d91f8c02f1770fa8d90d9652 1 parent 2834eb1
Josh Betz joshbetz authored
2  bulk-user-management.php
View
@@ -5,7 +5,7 @@
Plugin Name: Multisite Bulk User Management
Plugin URI: http://wordpress.org/extend/plugins/bulk-user-management/
Description: A plugin that lets you manage users across all your sites from one place on a multisite install
-Version: 1.0.0
+Version: 1.0.1
Author: Automattic
Author URI: http://automattic.com/wordpress-plugins/
License: GPLv2 or later
51 includes/class-bulk-user-table.php
View
@@ -131,29 +131,8 @@ function prepare_items( $queryitems = true ) {
}
// orderby and order
- usort( $query, function( $a, $b ){
-
- // Set $order to 1 or -1
- $order = isset( $_REQUEST['order'] ) && 'desc' == $_REQUEST['order'] ? -1 : 1;
-
- // Only accept 3 options for $orderby
- $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_key( $_REQUEST['orderby'] ) : 'user_login';
- switch ( $orderby ) {
- case 'display_name':
- $cmp = strnatcmp( strtolower( $a->display_name ), strtolower( $b->display_name ) );
- break;
- case 'user_email':
- $cmp = strnatcmp( strtolower( $a->user_email ), strtolower( $b->user_email ) );
- break;
- case 'user_login':
- default:
- $cmp = strnatcmp( strtolower( $a->user_login ), strtolower( $b->user_login ) );
- break;
- }
- // Multiply the comparison by -1 if we want to sort DESC
- return $cmp * $order;
- });
+ usort( $query, array( $this, 'compare_users' ) );
// search
$users = array();
@@ -178,6 +157,34 @@ function prepare_items( $queryitems = true ) {
}
+ /**
+ * Compare users by login, email, or name depending on the
+ * orderby and order request variables
+ */
+ private function compare_users( $a, $b ){
+
+ // Set $order to 1 or -1
+ $order = isset( $_REQUEST['order'] ) && 'desc' == $_REQUEST['order'] ? -1 : 1;
+
+ // Only accept 3 options for $orderby
+ $orderby = isset( $_REQUEST['orderby'] ) ? sanitize_key( $_REQUEST['orderby'] ) : 'user_login';
+ switch ( $orderby ) {
+ case 'display_name':
+ $cmp = strnatcmp( strtolower( $a->display_name ), strtolower( $b->display_name ) );
+ break;
+ case 'user_email':
+ $cmp = strnatcmp( strtolower( $a->user_email ), strtolower( $b->user_email ) );
+ break;
+ case 'user_login':
+ default:
+ $cmp = strnatcmp( strtolower( $a->user_login ), strtolower( $b->user_login ) );
+ break;
+ }
+
+ // Multiply the comparison by -1 if we want to sort DESC
+ return $cmp * $order;
+ }
+
function has_items() {
return count( $this->items ) > 0;
}
7 readme.txt
View
@@ -3,7 +3,7 @@ Contributors: automattic, betzster, danielbachhuber
Tags: admin, users, bulk
Requires at least: 3.4
Tested up to: 3.4.1
-Stable tag: 1.0
+Stable tag: 1.0.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -35,4 +35,7 @@ Because you haven't asked one yet.
== Changelog ==
= 1.0 =
-* Initial Release
+* Initial Release
+
+= 1.0.1 =
+* Fix fatal error in PHP 5.2
Please sign in to comment.
Something went wrong with that request. Please try again.