Ticket #2874: 2874.diff
| File 2874.diff, 1.9 KB (added by , 11 years ago) |
|---|
-
src/includes/admin/users.php
42 42 */ 43 43 function setup_actions() { 44 44 45 global $wp_version; 46 45 47 // Bail if in network admin 46 48 if ( is_network_admin() ) { 47 49 return; … … 52 54 53 55 // WordPress user screen 54 56 add_action( 'restrict_manage_users', array( $this, 'user_role_bulk_dropdown' ) ); 55 add_filter( 'manage_users_columns', array( $this, 'user_role_column' ) );56 add_filter( 'manage_users_custom_column', array( $this, 'user_role_row' ), 10, 3 );57 57 58 // In WordPress >= 4.4, all roles are listed in the table so we don't need the additional columns. 59 if( $wp_version < 4.4 ){ 60 add_filter( 'manage_users_columns', array( $this, 'user_role_column' ) ); 61 add_filter( 'manage_users_custom_column', array( $this, 'user_role_row' ), 10, 3 ); 62 } 63 58 64 // Process bulk role change 59 65 add_action( 'load-users.php', array( $this, 'user_role_bulk_change' ) ); 60 66 } … … 127 133 */ 128 134 public static function user_role_bulk_dropdown() { 129 135 130 // Bail if current user cannot promote users 136 // Bail if current user cannot promote users 131 137 if ( ! current_user_can( 'promote_users' ) ) { 132 138 return; 133 139 } … … 182 188 // Bail if nonce check fails 183 189 check_admin_referer( 'bbp-bulk-users', 'bbp-bulk-users-nonce' ); 184 190 185 // Bail if current user cannot promote users 191 // Bail if current user cannot promote users 186 192 if ( ! current_user_can( 'promote_users' ) ) { 187 193 return; 188 194 } … … 200 206 } 201 207 202 208 // Set up user and role data 203 $user_role = bbp_get_user_role( $user_id ); 209 $user_role = bbp_get_user_role( $user_id ); 204 210 $new_role = sanitize_text_field( $_REQUEST['bbp-new-role'] ); 205 211 206 212 // Only keymasters can set other keymasters
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)