diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 17c7bb3326..c0d969402d 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -555,6 +555,16 @@ function get_column_headers($page) {
);
return apply_filters('manage_link_categories_columns', $columns);
+ case 'user':
+ $columns = array(
+ 'cb' => '',
+ 'username' => __('Username'),
+ 'name' => __('Name'),
+ 'email' => __('E-mail'),
+ 'role' => __('Role'),
+ 'posts' => __('Posts')
+ );
+ return apply_filters('manage_users_columns', $columns);
}
return $columns;
@@ -1390,21 +1400,49 @@ function user_row( $user_object, $style = '', $role = '' ) {
$edit = '' . $user_object->user_login . '';
}
$role_name = isset($wp_roles->role_names[$role]) ? translate_with_context($wp_roles->role_names[$role]) : __('None');
- $r = "
- |
- $edit |
- $user_object->first_name $user_object->last_name |
- $email |
- $role_name | ";
- $r .= "\n\t\t";
- if ( $numposts > 0 ) {
- $r .= "";
- $r .= $numposts;
- $r .= '';
- } else {
- $r .= 0;
+ $r = " |
";
+ $columns = get_column_headers('user');
+ $hidden = (array) get_user_option( 'manage-user-columns-hidden' );
+ foreach ( $columns as $column_name => $column_display_name ) {
+ $class = "class=\"$column_name column-$column_name\"";
+
+ $style = '';
+ if ( in_array($column_name, $hidden) )
+ $style = ' style="display:none;"';
+
+ $attributes = "$class$style";
+
+ switch ($column_name) {
+ case 'cb':
+ $r .= " | ";
+ break;
+ case 'username':
+ $r .= "$edit | ";
+ break;
+ case 'name':
+ $r .= "$user_object->first_name $user_object->last_name | ";
+ break;
+ case 'email':
+ $r .= "$email | ";
+ break;
+ case 'role':
+ $r .= "$role_name | ";
+ break;
+ case 'posts':
+ $attributes = 'class="posts column-posts num"' . $style;
+ $r .= "";
+ if ( $numposts > 0 ) {
+ $r .= "";
+ $r .= $numposts;
+ $r .= '';
+ } else {
+ $r .= 0;
+ }
+ $r .= " | ";
+ }
}
- $r .= "\n\t
";
+ $r .= '';
+
return $r;
}
@@ -2181,7 +2219,7 @@ function manage_columns_prefs($page) {
foreach ( $columns as $column => $title ) {
// Can't hide these
- if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'media' == $column )
+ if ( 'cb' == $column || 'title' == $column || 'name' == $column || 'username' == $column || 'media' == $column )
continue;
if ( empty($title) )
continue;
diff --git a/wp-admin/js/users.js b/wp-admin/js/users.js
index 522cbadf6d..071fb8cbe4 100644
--- a/wp-admin/js/users.js
+++ b/wp-admin/js/users.js
@@ -1 +1,26 @@
-jQuery( function($) { $('#users').wpList(); } );
+jQuery( function($) {
+ $('#users').wpList();
+
+ columns.init('user');
+
+ // Edit Settings
+ $('#show-settings-link').click(function () {
+ $('#edit-settings').slideDown('normal', function(){
+ $('#show-settings-link').hide();
+ $('#hide-settings-link').show();
+
+ });
+ $('#show-settings').addClass('show-settings-opened');
+ return false;
+ });
+
+ $('#hide-settings-link').click(function () {
+ $('#edit-settings').slideUp('normal', function(){
+ $('#hide-settings-link').hide();
+ $('#show-settings-link').show();
+ $('#show-settings').removeClass('show-settings-opened');
+ });
+
+ return false;
+ });
+});
diff --git a/wp-admin/users.php b/wp-admin/users.php
index 110e8de6f2..fa91729a91 100644
--- a/wp-admin/users.php
+++ b/wp-admin/users.php
@@ -261,6 +261,19 @@ if ( ! empty($messages) ) {
} ?>