Changeset 10810 for trunk/wp-admin/includes/user.php
- Timestamp:
- 03/18/2009 02:43:45 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/includes/user.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/user.php
r10760 r10810 11 11 * 12 12 * It seems that the first half is for backwards compatibility, but only 13 * has the ability to alter the user's role. Wordpress core seems to 13 * has the ability to alter the user's role. Wordpress core seems to 14 14 * use this function only in the second way, running edit_user() with 15 15 * no id so as to create a new user. … … 32 32 if (!$editable_roles[$_POST['role']]) 33 33 wp_die(__('You can’t give users that role.')); 34 34 35 35 $user = new WP_User( $user_id ); 36 36 $user->set_role( $_POST['role'] ); … … 78 78 // Don't let anyone with 'edit_users' (admins) edit their own role to something without it. 79 79 if( $user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap( 'edit_users' )) 80 $user->role = $_POST['role']; 80 $user->role = $_POST['role']; 81 81 82 82 // If the new role isn't editable by the logged-in user die with error … … 259 259 260 260 /** 261 * Fetch a filtered list of user roles that the current user is 262 * allowed to edit. 263 * 264 * Simple function who's main purpose is to allow filtering of the 261 * Fetch a filtered list of user roles that the current user is 262 * allowed to edit. 263 * 264 * Simple function who's main purpose is to allow filtering of the 265 265 * list of roles in the $wp_roles object so that plugins can remove 266 266 * innappropriate ones depending on the situation or user making edits. … … 268 268 * capability can edit others to be administrators, even if they are 269 269 * only editors or authors. This filter allows admins to delegate 270 * user management. 270 * user management. 271 271 * 272 272 * @since 2.8 … … 278 278 279 279 $all_roles = $wp_roles->roles; 280 $editable_roles = apply_filters('editable_roles', $all_roles); 281 280 $editable_roles = apply_filters('editable_roles', $all_roles); 281 282 282 return $editable_roles; 283 283 }
Note: See TracChangeset
for help on using the changeset viewer.