Changeset 10319 for trunk/wp-admin/user-edit.php
- Timestamp:
- 01/06/2009 05:23:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r10150 r10319 246 246 <?php if ( !$is_profile_page ): ?> 247 247 <tr><th><label for="role"><?php _e('Role:') ?></label></th> 248 <?php 249 // print_r($profileuser); 250 echo '<td><select name="role" id="role">'; 251 $role_list = ''; 252 $user_has_role = false; 253 foreach($wp_roles->role_names as $role => $name) { 254 $name = translate_with_context($name); 255 if ( $profileuser->has_cap($role) ) { 256 $selected = ' selected="selected"'; 257 $user_has_role = true; 258 } else { 259 $selected = ''; 260 } 261 $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>"; 262 } 263 if ( $user_has_role ) 248 <td><select name="role" id="role"> 249 <?php 250 // Get the highest/primary role for this user 251 // TODO: create a function that does this: wp_get_user_role() 252 $user_roles = $profileuser->roles; 253 $user_role = array_shift($user_roles); 254 255 // print the full list of roles with the primary one selected. 256 wp_dropdown_roles($user_role); 257 258 // print the 'no role' option. Make it selected if the user has no role yet. 259 if ( $user_role ) 264 260 $role_list .= '<option value="">' . __('— No role for this blog —') . '</option>'; 265 261 else 266 262 $role_list .= '<option value="" selected="selected">' . __('— No role for this blog —') . '</option>'; 267 echo $role_list . '</select></td></tr>'; 268 ?> 269 <?php endif; ?> 263 264 echo $role_list;?> 265 </select></td></tr> 266 <?php endif; //!$is_profile_page ?> 270 267 271 268 <tr>
Note: See TracChangeset
for help on using the changeset viewer.