Skip to content

Commit

Permalink
WP 4.4 shows all user roles in the users list table, so we don't need…
Browse files Browse the repository at this point in the history
… that anymore.
  • Loading branch information
Justin Tadlock committed Oct 17, 2015
1 parent 70f3b42 commit b557f0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
12 changes: 6 additions & 6 deletions admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public function __construct() {
}

/**
* Adds admin menu items needed by the plugin. Rather than having multiple top-level menu items
* like some plugins, which shall remain unnamed, we'll consolidate everything into a single
* Adds admin menu items needed by the plugin. Rather than having multiple top-level menu items
* like some plugins, which shall remain unnamed, we'll consolidate everything into a single
* item. Yay for no clutter!
*
* @since 1.0.0
Expand Down Expand Up @@ -125,7 +125,7 @@ function parent_file( $parent_file ) {
* @access public
* @return void
*/
function admin_notices() {
function admin_notices() {

if ( !current_theme_supports( 'message-board' ) && current_user_can( 'switch_themes' ) ) { ?>
<div class="error">
Expand Down Expand Up @@ -173,8 +173,8 @@ public function admin_body_class( $class ) {
}

/**
* Puts the post status links in the a better order. By default, WP will list these in the order
* they're registered. Instead, we're going to put them in order from public, private, protected,
* Puts the post status links in the a better order. By default, WP will list these in the order
* they're registered. Instead, we're going to put them in order from public, private, protected,
* and other.
*
* @since 1.0.0
Expand Down Expand Up @@ -210,7 +210,7 @@ public function views_edit( $views ) {
}

/**
* Makes sure the correct post status is used when loading forums on the nav menus screen. By
* Makes sure the correct post status is used when loading forums on the nav menus screen. By
* default, WordPress will only load them if they have the "publish" post status.
*
* @since 1.0.0
Expand Down
14 changes: 3 additions & 11 deletions admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ public function roles_dropdown() {
*/
public function columns( $columns ) {

/* Add custom columns. */
$columns['forum_role'] = __( 'Forum Role', 'message-board' );
$columns['topics'] = __( 'Topics', 'message-board' );
$columns['replies'] = __( 'Replies', 'message-board' );
$columns['topics'] = __( 'Topics', 'message-board' );
$columns['replies'] = __( 'Replies', 'message-board' );

/* Return the columns. */
return $columns;
Expand Down Expand Up @@ -163,14 +161,8 @@ public function sortable_columns( $columns ) {
*/
public function custom_column( $column, $column_name, $user_id ) {

/* Forum role column. */
if ( 'forum_role' === $column_name ) {

$role = mb_get_user_role_name( $user_id );
$column = $role ? $role : '&mdash;';

/* Post status column. */
} elseif ( 'topics' === $column_name ) {
if ( 'topics' === $column_name ) {

$user_id = mb_get_user_id( $user_id );
$topic_count = mb_get_user_topic_count( $user_id );
Expand Down

0 comments on commit b557f0a

Please sign in to comment.