Skip to:
Content

bbPress.org

Changeset 6817


Ignore:
Timestamp:
04/24/2018 03:29:21 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Users: make sure "Forum Role" is next to "Site Role" in User's List Table.

This change comes with a CSS tweak to keep the role column at 15% width, and bumps the asset version accordingly.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bbpress.php

    r6790 r6817  
    204204        /** Versions **********************************************************/
    205205
    206         $this->version    = '2.6-rc-6789';
     206        $this->version    = '2.6-rc-6810';
    207207        $this->db_version = '262';
    208208
  • trunk/src/includes/admin/assets/css/admin.css

    r6798 r6817  
    341341}
    342342
     343.column-bbp_user_role,
    343344.column-bbp_forum_created,
    344345.column-bbp_topic_created,
  • trunk/src/includes/admin/users.php

    r6777 r6817  
    274274     */
    275275    public static function user_role_column( $columns = array() ) {
    276         $columns['role']          = esc_html__( 'Site Role',  'bbpress' );
    277         $columns['bbp_user_role'] = esc_html__( 'Forum Role', 'bbpress' );
    278 
    279         return $columns;
     276
     277        // New title for old Role column
     278        $columns['role'] = esc_html__( 'Site Role',  'bbpress' );
     279
     280        // New column
     281        $bbp_user_role = array(
     282            'bbp_user_role' => esc_html__( 'Forum Role', 'bbpress' )
     283        );
     284
     285        // Make sure role columns are next to each other
     286        $role_pos = array_search( 'role', array_keys( $columns ), true );
     287        $result   = array_slice( $columns, 0, $role_pos + 1 );
     288        $result   = array_merge( $result, $bbp_user_role );
     289
     290        // Merge and return
     291        return array_merge( $result, array_slice( $columns, $role_pos ) );
    280292    }
    281293
Note: See TracChangeset for help on using the changeset viewer.