# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: I:\Work\Projects\wordpress src\3.3.2\wp-admin\includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
|
|
|
73 | 73 | 'total_items' => $wp_user_search->get_total(), |
74 | 74 | 'per_page' => $users_per_page, |
75 | 75 | ) ); |
| 76 | |
| 77 | add_filter( 'user_role_name', array( &$this, 'wp_user_role_name' ), 1, 2 ); |
76 | 78 | } |
77 | 79 | |
78 | 80 | function no_items() { |
… |
… |
|
141 | 143 | ?> |
142 | 144 | <div class="alignleft actions"> |
143 | 145 | <label class="screen-reader-text" for="new_role"><?php _e( 'Change role to…' ) ?></label> |
144 | | <select name="new_role" id="new_role"> |
145 | | <option value=''><?php _e( 'Change role to…' ) ?></option> |
146 | | <?php wp_dropdown_roles(); ?> |
147 | | </select> |
| 146 | <?php |
| 147 | // print the full list of roles with the primary one selected. |
| 148 | wp_user_role_selector(array( |
| 149 | 'no_role' => false, |
| 150 | 'id' => 'new_role', |
| 151 | 'name' => 'new_role', |
| 152 | 'before_list' => "<option value=''>" . _e( 'Change role to…' ) . "</option>", |
| 153 | )); |
| 154 | ?> |
148 | 155 | <?php submit_button( __( 'Change' ), 'secondary', 'changeit', false ); ?> |
149 | 156 | </div> |
150 | 157 | <?php |
… |
… |
|
193 | 200 | |
194 | 201 | $style = ''; |
195 | 202 | foreach ( $this->items as $userid => $user_object ) { |
196 | | $role = reset( $user_object->roles ); |
197 | | |
198 | 203 | if ( is_multisite() && empty( $role ) ) |
199 | 204 | continue; |
200 | 205 | |
… |
… |
|
209 | 214 | * @since 2.1.0 |
210 | 215 | * |
211 | 216 | * @param object $user_object |
212 | | * @param string $style Optional. Attributes added to the TR element. Must be sanitized. |
| 217 | * @param string $style Optional. Attributes added to the TR element. Must be sanitized. |
213 | 218 | * @param string $role Key for the $wp_roles array. |
214 | | * @param int $numposts Optional. Post count to display for this user. Defaults to zero, as in, a new user has made zero posts. |
| 219 | * @param int $numposts Optional. Post count to display for this user. Defaults to zero, as in, a new user has made zero posts. |
215 | 220 | * @return string |
216 | 221 | */ |
217 | 222 | function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) { |
… |
… |
|
261 | 266 | } else { |
262 | 267 | $edit = '<strong>' . $user_object->user_login . '</strong>'; |
263 | 268 | } |
264 | | $role_name = isset( $wp_roles->role_names[$role] ) ? translate_user_role( $wp_roles->role_names[$role] ) : __( 'None' ); |
| 269 | |
| 270 | if ( !isset( $role ) || $role == '' ) |
| 271 | $role = $user_object->roles; |
| 272 | if ( !is_array($role) ) |
| 273 | $role = array( $role ); |
| 274 | $role_name = apply_filters( 'user_role_name' , $role, $role ); |
| 275 | |
265 | 276 | $avatar = get_avatar( $user_object->ID, 32 ); |
266 | 277 | |
267 | 278 | $r = "<tr id='user-$user_object->ID'$style>"; |
… |
… |
|
315 | 326 | |
316 | 327 | return $r; |
317 | 328 | } |
| 329 | |
| 330 | /** |
| 331 | * Formats the role name for the WP_Users_List table role column. |
| 332 | * |
| 333 | * @param type string $role the string that is being filtered. |
| 334 | * @param type array $roles the array of roles |
| 335 | * @return type string |
| 336 | */ |
| 337 | static function wp_user_role_name( $role, $roles ) { |
| 338 | global $wp_roles; |
| 339 | return isset( $wp_roles->role_names[$roles[0]] ) ? translate_user_role( $wp_roles->role_names[$roles[0]] ) : __( 'None' ); |
318 | 340 | } |
| 341 | |
| 342 | } |
| 343 | No newline at end of file |