Changeset 3677 for trunk/wp-admin/user-edit.php
- Timestamp:
- 04/02/2006 12:31:26 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/user-edit.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/user-edit.php
r3615 r3677 35 35 check_admin_referer(); 36 36 37 $errors = array();38 39 37 if (!current_user_can('edit_users')) 40 $errors ['head'] = __('You do not have permission to edit this user.');38 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 41 39 else 42 40 $errors = edit_user($user_id); 43 41 44 if( count($errors) == 0) {42 if( !is_wp_error( $errors ) ) { 45 43 header("Location: user-edit.php?user_id=$user_id&updated=true"); 46 44 exit; … … 52 50 $profileuser = new WP_User($user_id); 53 51 54 if (!current_user_can('edit_users')) $errors['head'] = __('You do not have permission to edit this user.'); 52 if (!current_user_can('edit_users')) 53 if ( !is_wp_error( $errors ) ) 54 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 55 55 ?> 56 56 … … 60 60 </div> 61 61 <?php endif; ?> 62 <?php if ( count($errors) != 0) : ?>62 <?php if ( is_wp_error( $errors ) ) : ?> 63 63 <div class="error"> 64 64 <ul> 65 65 <?php 66 foreach($errors as $error) echo "<li>$error</li>"; 66 foreach( $errors->get_error_codes() as $code) 67 foreach( $errors->get_error_messages($code) as $message ) 68 echo "<li>$message</li>"; 67 69 ?> 68 70 </ul>
Note: See TracChangeset
for help on using the changeset viewer.