From 9855ee1aa2843724f485700e68c9c4c582912004 Mon Sep 17 00:00:00 2001 From: PeteMall Date: Wed, 24 Nov 2010 19:51:36 +0000 Subject: [PATCH] Hide posts column for site-users. Props ocean90, see #15558 git-svn-id: http://svn.automattic.com/wordpress/trunk@16573 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-users-list-table.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-users-list-table.php b/wp-admin/includes/class-wp-users-list-table.php index fb48659546..61b25cb211 100644 --- a/wp-admin/includes/class-wp-users-list-table.php +++ b/wp-admin/includes/class-wp-users-list-table.php @@ -149,7 +149,7 @@ class WP_Users_List_Table extends WP_List_Table { } function get_columns() { - return array( + $c = array( 'cb' => '', 'username' => __( 'Username' ), 'name' => __( 'Name' ), @@ -157,15 +157,25 @@ class WP_Users_List_Table extends WP_List_Table { 'role' => __( 'Role' ), 'posts' => __( 'Posts' ) ); + + if ( $this->is_site_users ) + unset( $c['posts'] ); + + return $c; } function get_sortable_columns() { - return array( + $c = array( 'username' => 'login', 'name' => 'name', 'email' => 'email', 'posts' => 'post_count', ); + + if ( $this->is_site_users ) + unset( $c['posts'] ); + + return $c; } function display_rows() {