36 else |
42 else |
37 $parent_file = 'profile.php'; |
43 $parent_file = 'profile.php'; |
38 |
44 |
39 $profile_help = '<p>' . __('Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.') . '</p>' . |
45 $profile_help = '<p>' . __('Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.') . '</p>' . |
40 '<p>' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '</p>' . |
46 '<p>' . __('You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.') . '</p>' . |
|
47 '<p>' . __( 'You can select the language you wish to use while using the WordPress administration screen without affecting the language site visitors see.' ) . '</p>' . |
41 '<p>' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '</p>' . |
48 '<p>' . __('Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.') . '</p>' . |
42 '<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out of All Other Sessions button.' ) . '</p>' . |
49 '<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '</p>' . |
43 '<p>' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '</p>' . |
50 '<p>' . __('Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.') . '</p>' . |
44 '<p>' . __('Remember to click the Update Profile button when you are finished.') . '</p>'; |
51 '<p>' . __('Remember to click the Update Profile button when you are finished.') . '</p>'; |
45 |
52 |
46 get_current_screen()->add_help_tab( array( |
53 get_current_screen()->add_help_tab( array( |
47 'id' => 'overview', |
54 'id' => 'overview', |
49 'content' => $profile_help, |
56 'content' => $profile_help, |
50 ) ); |
57 ) ); |
51 |
58 |
52 get_current_screen()->set_help_sidebar( |
59 get_current_screen()->set_help_sidebar( |
53 '<p><strong>' . __('For more information:') . '</strong></p>' . |
60 '<p><strong>' . __('For more information:') . '</strong></p>' . |
54 '<p>' . __('<a href="https://codex.wordpress.org/Users_Your_Profile_Screen" target="_blank">Documentation on User Profiles</a>') . '</p>' . |
61 '<p>' . __('<a href="https://codex.wordpress.org/Users_Your_Profile_Screen">Documentation on User Profiles</a>') . '</p>' . |
55 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
62 '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>' |
56 ); |
63 ); |
57 |
64 |
58 $wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer ); |
65 $wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer ); |
59 |
66 |
60 $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
67 $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ); |
61 |
68 |
62 /** |
69 /** |
63 * Optional SSL preference that can be turned on by hooking to the 'personal_options' action. |
70 * Filters whether to allow administrators on Multisite to edit every user. |
64 * |
|
65 * @since 2.7.0 |
|
66 * |
|
67 * @param object $user User data object |
|
68 */ |
|
69 function use_ssl_preference($user) { |
|
70 ?> |
|
71 <tr class="user-use-ssl-wrap"> |
|
72 <th scope="row"><?php _e('Use https')?></th> |
|
73 <td><label for="use_ssl"><input name="use_ssl" type="checkbox" id="use_ssl" value="1" <?php checked('1', $user->use_ssl); ?> /> <?php _e('Always use https when visiting the admin'); ?></label></td> |
|
74 </tr> |
|
75 <?php |
|
76 } |
|
77 |
|
78 /** |
|
79 * Filter whether to allow administrators on Multisite to edit every user. |
|
80 * |
71 * |
81 * Enabling the user editing form via this filter also hinges on the user holding |
72 * Enabling the user editing form via this filter also hinges on the user holding |
82 * the 'manage_network_users' cap, and the logged-in user not matching the user |
73 * the 'manage_network_users' cap, and the logged-in user not matching the user |
83 * profile open for editing. |
74 * profile open for editing. |
84 * |
75 * |
91 if ( is_multisite() |
82 if ( is_multisite() |
92 && ! current_user_can( 'manage_network_users' ) |
83 && ! current_user_can( 'manage_network_users' ) |
93 && $user_id != $current_user->ID |
84 && $user_id != $current_user->ID |
94 && ! apply_filters( 'enable_edit_any_user_configuration', true ) |
85 && ! apply_filters( 'enable_edit_any_user_configuration', true ) |
95 ) { |
86 ) { |
96 wp_die( __( 'You do not have permission to edit this user.' ) ); |
87 wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); |
97 } |
88 } |
98 |
89 |
99 // Execute confirmed email change. See send_confirmation_on_profile_email(). |
90 // Execute confirmed email change. See send_confirmation_on_profile_email(). |
100 if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) { |
91 if ( IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) { |
101 $new_email = get_option( $current_user->ID . '_new_email' ); |
92 $new_email = get_user_meta( $current_user->ID, '_new_email', true ); |
102 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) { |
93 if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) { |
103 $user = new stdClass; |
94 $user = new stdClass; |
104 $user->ID = $current_user->ID; |
95 $user->ID = $current_user->ID; |
105 $user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) ); |
96 $user->user_email = esc_html( trim( $new_email[ 'newemail' ] ) ); |
106 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) |
97 if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) { |
107 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); |
98 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) ); |
|
99 } |
108 wp_update_user( $user ); |
100 wp_update_user( $user ); |
109 delete_option( $current_user->ID . '_new_email' ); |
101 delete_user_meta( $current_user->ID, '_new_email' ); |
110 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); |
102 wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) ); |
111 die(); |
103 die(); |
|
104 } else { |
|
105 wp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) ); |
112 } |
106 } |
113 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) { |
107 } elseif ( IS_PROFILE_PAGE && ! empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) { |
114 delete_option( $current_user->ID . '_new_email' ); |
108 check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' ); |
|
109 delete_user_meta( $current_user->ID, '_new_email' ); |
115 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); |
110 wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) ); |
116 die(); |
111 die(); |
117 } |
112 } |
118 |
113 |
119 switch ($action) { |
114 switch ($action) { |
120 case 'update': |
115 case 'update': |
121 |
116 |
122 check_admin_referer('update-user_' . $user_id); |
117 check_admin_referer('update-user_' . $user_id); |
123 |
118 |
124 if ( !current_user_can('edit_user', $user_id) ) |
119 if ( !current_user_can('edit_user', $user_id) ) |
125 wp_die(__('You do not have permission to edit this user.')); |
120 wp_die(__('Sorry, you are not allowed to edit this user.')); |
126 |
121 |
127 if ( IS_PROFILE_PAGE ) { |
122 if ( IS_PROFILE_PAGE ) { |
128 /** |
123 /** |
129 * Fires before the page loads on the 'Your Profile' editing screen. |
124 * Fires before the page loads on the 'Your Profile' editing screen. |
130 * |
125 * |
173 |
168 |
174 default: |
169 default: |
175 $profileuser = get_user_to_edit($user_id); |
170 $profileuser = get_user_to_edit($user_id); |
176 |
171 |
177 if ( !current_user_can('edit_user', $user_id) ) |
172 if ( !current_user_can('edit_user', $user_id) ) |
178 wp_die(__('You do not have permission to edit this user.')); |
173 wp_die(__('Sorry, you are not allowed to edit this user.')); |
179 |
174 |
|
175 $title = sprintf( $title, $profileuser->display_name ); |
180 $sessions = WP_Session_Tokens::get_instance( $profileuser->ID ); |
176 $sessions = WP_Session_Tokens::get_instance( $profileuser->ID ); |
181 |
177 |
182 include(ABSPATH . 'wp-admin/admin-header.php'); |
178 include(ABSPATH . 'wp-admin/admin-header.php'); |
183 ?> |
179 ?> |
184 |
180 |
185 <?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?> |
181 <?php if ( !IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?> |
186 <div class="updated"><p><strong><?php _e('Important:'); ?></strong> <?php _e('This user has super admin privileges.'); ?></p></div> |
182 <div class="notice notice-info"><p><strong><?php _e('Important:'); ?></strong> <?php _e('This user has super admin privileges.'); ?></p></div> |
187 <?php } ?> |
183 <?php } ?> |
188 <?php if ( isset($_GET['updated']) ) : ?> |
184 <?php if ( isset($_GET['updated']) ) : ?> |
189 <div id="message" class="updated notice is-dismissible"> |
185 <div id="message" class="updated notice is-dismissible"> |
190 <?php if ( IS_PROFILE_PAGE ) : ?> |
186 <?php if ( IS_PROFILE_PAGE ) : ?> |
191 <p><strong><?php _e('Profile updated.') ?></strong></p> |
187 <p><strong><?php _e('Profile updated.') ?></strong></p> |
192 <?php else: ?> |
188 <?php else: ?> |
193 <p><strong><?php _e('User updated.') ?></strong></p> |
189 <p><strong><?php _e('User updated.') ?></strong></p> |
194 <?php endif; ?> |
190 <?php endif; ?> |
195 <?php if ( $wp_http_referer && !IS_PROFILE_PAGE ) : ?> |
191 <?php if ( $wp_http_referer && false === strpos( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?> |
196 <p><a href="<?php echo esc_url( $wp_http_referer ); ?>"><?php _e('← Back to Users'); ?></a></p> |
192 <p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e('← Back to Users'); ?></a></p> |
197 <?php endif; ?> |
193 <?php endif; ?> |
198 </div> |
194 </div> |
199 <?php endif; ?> |
195 <?php endif; ?> |
|
196 <?php if ( isset( $_GET['error'] ) ) : ?> |
|
197 <div class="notice notice-error"> |
|
198 <?php if ( 'new-email' == $_GET['error'] ) : ?> |
|
199 <p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p> |
|
200 <?php endif; ?> |
|
201 </div> |
|
202 <?php endif; ?> |
200 <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?> |
203 <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?> |
201 <div class="error"><p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p></div> |
204 <div class="error"><p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p></div> |
202 <?php endif; ?> |
205 <?php endif; ?> |
203 |
206 |
204 <div class="wrap" id="profile-page"> |
207 <div class="wrap" id="profile-page"> |
205 <h2> |
208 <h1 class="wp-heading-inline"><?php |
206 <?php |
|
207 echo esc_html( $title ); |
209 echo esc_html( $title ); |
|
210 ?></h1> |
|
211 |
|
212 <?php |
208 if ( ! IS_PROFILE_PAGE ) { |
213 if ( ! IS_PROFILE_PAGE ) { |
209 if ( current_user_can( 'create_users' ) ) { ?> |
214 if ( current_user_can( 'create_users' ) ) { ?> |
210 <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a> |
215 <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a> |
211 <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?> |
216 <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?> |
212 <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a> |
217 <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a> |
213 <?php } |
218 <?php } |
214 } ?> |
219 } |
215 </h2> |
220 ?> |
|
221 |
|
222 <hr class="wp-header-end"> |
|
223 |
216 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php |
224 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php |
217 /** |
225 /** |
218 * Fires inside the your-profile form tag on the user editing screen. |
226 * Fires inside the your-profile form tag on the user editing screen. |
219 * |
227 * |
220 * @since 3.0.0 |
228 * @since 3.0.0 |
228 <p> |
236 <p> |
229 <input type="hidden" name="from" value="profile" /> |
237 <input type="hidden" name="from" value="profile" /> |
230 <input type="hidden" name="checkuser_id" value="<?php echo get_current_user_id(); ?>" /> |
238 <input type="hidden" name="checkuser_id" value="<?php echo get_current_user_id(); ?>" /> |
231 </p> |
239 </p> |
232 |
240 |
233 <h3><?php _e('Personal Options'); ?></h3> |
241 <h2><?php _e( 'Personal Options' ); ?></h2> |
234 |
242 |
235 <table class="form-table"> |
243 <table class="form-table"> |
236 <?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?> |
244 <?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?> |
237 <tr class="user-rich-editing-wrap"> |
245 <tr class="user-rich-editing-wrap"> |
238 <th scope="row"><?php _e( 'Visual Editor' ); ?></th> |
246 <th scope="row"><?php _e( 'Visual Editor' ); ?></th> |
239 <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php if ( ! empty( $profileuser->rich_editing ) ) checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td> |
247 <td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php if ( ! empty( $profileuser->rich_editing ) ) checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td> |
|
248 </tr> |
|
249 <?php endif; ?> |
|
250 <?php |
|
251 $show_syntax_highlighting_preference = ( |
|
252 // For Custom HTML widget and Additional CSS in Customizer. |
|
253 user_can( $profileuser, 'edit_theme_options' ) |
|
254 || |
|
255 // Edit plugins. |
|
256 user_can( $profileuser, 'edit_plugins' ) |
|
257 || |
|
258 // Edit themes. |
|
259 user_can( $profileuser, 'edit_themes' ) |
|
260 ); |
|
261 ?> |
|
262 <?php if ( $show_syntax_highlighting_preference ) : ?> |
|
263 <tr class="user-syntax-highlighting-wrap"> |
|
264 <th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th> |
|
265 <td> |
|
266 <label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php if ( ! empty( $profileuser->syntax_highlighting ) ) checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label> |
|
267 </td> |
240 </tr> |
268 </tr> |
241 <?php endif; ?> |
269 <?php endif; ?> |
242 <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?> |
270 <?php if ( count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker') ) : ?> |
243 <tr class="user-admin-color-wrap"> |
271 <tr class="user-admin-color-wrap"> |
244 <th scope="row"><?php _e('Admin Color Scheme')?></th> |
272 <th scope="row"><?php _e('Admin Color Scheme')?></th> |
390 </select> |
452 </select> |
391 </td> |
453 </td> |
392 </tr> |
454 </tr> |
393 </table> |
455 </table> |
394 |
456 |
395 <h3><?php _e('Contact Info') ?></h3> |
457 <h2><?php _e( 'Contact Info' ); ?></h2> |
396 |
458 |
397 <table class="form-table"> |
459 <table class="form-table"> |
398 <tr class="user-email-wrap"> |
460 <tr class="user-email-wrap"> |
399 <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> |
461 <th><label for="email"><?php _e('Email'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th> |
400 <td><input type="email" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text ltr" /> |
462 <td><input type="email" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text ltr" /> |
401 <?php |
463 <?php |
402 $new_email = get_option( $current_user->ID . '_new_email' ); |
464 $new_email = get_user_meta( $current_user->ID, '_new_email', true ); |
403 if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?> |
465 if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?> |
404 <div class="updated inline"> |
466 <div class="updated inline"> |
405 <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p> |
467 <p><?php |
|
468 printf( |
|
469 /* translators: %s: new email */ |
|
470 __( 'There is a pending change of your email to %s.' ), |
|
471 '<code>' . esc_html( $new_email['newemail'] ) . '</code>' |
|
472 ); |
|
473 printf( |
|
474 ' <a href="%1$s">%2$s</a>', |
|
475 esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), |
|
476 __( 'Cancel' ) |
|
477 ); |
|
478 ?></p> |
406 </div> |
479 </div> |
407 <?php endif; ?> |
480 <?php endif; ?> |
408 </td> |
481 </td> |
409 </tr> |
482 </tr> |
410 |
483 |
437 <?php |
510 <?php |
438 } |
511 } |
439 ?> |
512 ?> |
440 </table> |
513 </table> |
441 |
514 |
442 <h3><?php IS_PROFILE_PAGE ? _e('About Yourself') : _e('About the user'); ?></h3> |
515 <h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2> |
443 |
516 |
444 <table class="form-table"> |
517 <table class="form-table"> |
445 <tr class="user-description-wrap"> |
518 <tr class="user-description-wrap"> |
446 <th><label for="description"><?php _e('Biographical Info'); ?></label></th> |
519 <th><label for="description"><?php _e('Biographical Info'); ?></label></th> |
447 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea> |
520 <td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profileuser->description; // textarea_escaped ?></textarea> |
448 <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p></td> |
521 <p class="description"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p></td> |
449 </tr> |
522 </tr> |
450 |
523 |
451 <?php |
524 <?php if ( get_option( 'show_avatars' ) ) : ?> |
452 /** This filter is documented in wp-admin/user-new.php */ |
525 <tr class="user-profile-picture"> |
453 $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ); |
526 <th><?php _e( 'Profile Picture' ); ?></th> |
454 if ( $show_password_fields ) : |
527 <td> |
455 ?> |
528 <?php echo get_avatar( $user_id ); ?> |
|
529 <p class="description"><?php |
|
530 if ( IS_PROFILE_PAGE ) { |
|
531 /* translators: %s: Gravatar URL */ |
|
532 $description = sprintf( __( 'You can change your profile picture on <a href="%s">Gravatar</a>.' ), |
|
533 __( 'https://en.gravatar.com/' ) |
|
534 ); |
|
535 } else { |
|
536 $description = ''; |
|
537 } |
|
538 |
|
539 /** |
|
540 * Filters the user profile picture description displayed under the Gravatar. |
|
541 * |
|
542 * @since 4.4.0 |
|
543 * @since 4.7.0 Added the `$profileuser` parameter. |
|
544 * |
|
545 * @param string $description The description that will be printed. |
|
546 * @param WP_User $profileuser The current WP_User object. |
|
547 */ |
|
548 echo apply_filters( 'user_profile_picture_description', $description, $profileuser ); |
|
549 ?></p> |
|
550 </td> |
|
551 </tr> |
|
552 <?php endif; ?> |
|
553 |
|
554 <?php |
|
555 /** |
|
556 * Filters the display of the password fields. |
|
557 * |
|
558 * @since 1.5.1 |
|
559 * @since 2.8.0 Added the `$profileuser` parameter. |
|
560 * @since 4.4.0 Now evaluated only in user-edit.php. |
|
561 * |
|
562 * @param bool $show Whether to show the password fields. Default true. |
|
563 * @param WP_User $profileuser User object for the current user to edit. |
|
564 */ |
|
565 if ( $show_password_fields = apply_filters( 'show_password_fields', true, $profileuser ) ) : |
|
566 ?> |
|
567 </table> |
|
568 |
|
569 <h2><?php _e( 'Account Management' ); ?></h2> |
|
570 <table class="form-table"> |
456 <tr id="password" class="user-pass1-wrap"> |
571 <tr id="password" class="user-pass1-wrap"> |
457 <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> |
572 <th><label for="pass1"><?php _e( 'New Password' ); ?></label></th> |
458 <td> |
573 <td> |
459 <input class="hidden" value=" " /><!-- #24364 workaround --> |
574 <input class="hidden" value=" " /><!-- #24364 workaround --> |
460 <input type="password" name="pass1" id="pass1" class="regular-text" size="16" value="" autocomplete="off" /> |
575 <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button> |
461 <p class="description"><?php _e( 'If you would like to change the password type a new one. Otherwise leave this blank.' ); ?></p> |
576 <div class="wp-pwd hide-if-js"> |
|
577 <span class="password-input-wrapper"> |
|
578 <input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" /> |
|
579 </span> |
|
580 <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> |
|
581 <span class="dashicons dashicons-hidden"></span> |
|
582 <span class="text"><?php _e( 'Hide' ); ?></span> |
|
583 </button> |
|
584 <button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>"> |
|
585 <span class="text"><?php _e( 'Cancel' ); ?></span> |
|
586 </button> |
|
587 <div style="display:none" id="pass-strength-result" aria-live="polite"></div> |
|
588 </div> |
462 </td> |
589 </td> |
463 </tr> |
590 </tr> |
464 <tr class="user-pass2-wrap"> |
591 <tr class="user-pass2-wrap hide-if-js"> |
465 <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th> |
592 <th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th> |
466 <td> |
593 <td> |
467 <input name="pass2" type="password" id="pass2" class="regular-text" size="16" value="" autocomplete="off" /> |
594 <input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" /> |
468 <p class="description"><?php _e( 'Type your new password again.' ); ?></p> |
595 <p class="description"><?php _e( 'Type your new password again.' ); ?></p> |
469 <br /> |
596 </td> |
470 <div id="pass-strength-result"><?php _e( 'Strength indicator' ); ?></div> |
597 </tr> |
471 <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p> |
598 <tr class="pw-weak"> |
|
599 <th><?php _e( 'Confirm Password' ); ?></th> |
|
600 <td> |
|
601 <label> |
|
602 <input type="checkbox" name="pw_weak" class="pw-checkbox" /> |
|
603 <span id="pw-weak-text-label"><?php _e( 'Confirm use of potentially weak password' ); ?></span> |
|
604 </label> |
472 </td> |
605 </td> |
473 </tr> |
606 </tr> |
474 <?php endif; ?> |
607 <?php endif; ?> |
475 |
608 |
476 <?php |
609 <?php |
477 if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?> |
610 if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?> |
478 <tr class="user-sessions-wrap hide-if-no-js"> |
611 <tr class="user-sessions-wrap hide-if-no-js"> |
479 <th> </th> |
612 <th><?php _e( 'Sessions' ); ?></th> |
480 <td aria-live="assertive"> |
613 <td aria-live="assertive"> |
481 <div class="destroy-sessions"><button type="button" disabled class="button button-secondary"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div> |
614 <div class="destroy-sessions"><button type="button" disabled class="button"><?php _e( 'Log Out Everywhere Else' ); ?></button></div> |
482 <p class="description"> |
615 <p class="description"> |
483 <?php _e( 'You are only logged in at this location.' ); ?> |
616 <?php _e( 'You are only logged in at this location.' ); ?> |
484 </p> |
617 </p> |
485 </td> |
618 </td> |
486 </tr> |
619 </tr> |
487 <?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?> |
620 <?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?> |
488 <tr class="user-sessions-wrap hide-if-no-js"> |
621 <tr class="user-sessions-wrap hide-if-no-js"> |
489 <th> </th> |
622 <th><?php _e( 'Sessions' ); ?></th> |
490 <td aria-live="assertive"> |
623 <td aria-live="assertive"> |
491 <div class="destroy-sessions"><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Other Sessions' ); ?></button></div> |
624 <div class="destroy-sessions"><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere Else' ); ?></button></div> |
492 <p class="description"> |
625 <p class="description"> |
493 <?php _e( 'Left your account logged in at a public computer? Lost your phone? This will log you out everywhere except your current browser.' ); ?> |
626 <?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?> |
494 </p> |
627 </p> |
495 </td> |
628 </td> |
496 </tr> |
629 </tr> |
497 <?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?> |
630 <?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?> |
498 <tr class="user-sessions-wrap hide-if-no-js"> |
631 <tr class="user-sessions-wrap hide-if-no-js"> |
499 <th> </th> |
632 <th><?php _e( 'Sessions' ); ?></th> |
500 <td> |
633 <td> |
501 <p><button type="button" class="button button-secondary" id="destroy-sessions"><?php _e( 'Log Out of All Sessions' ); ?></button></p> |
634 <p><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere' ); ?></button></p> |
502 <p class="description"> |
635 <p class="description"> |
503 <?php |
636 <?php |
504 /* translators: 1: User's display name. */ |
637 /* translators: 1: User's display name. */ |
505 printf( __( 'Log %s out of all sessions' ), $profileuser->display_name ); |
638 printf( __( 'Log %s out of all locations.' ), $profileuser->display_name ); |
506 ?> |
639 ?> |
507 </p> |
640 </p> |
508 </td> |
641 </td> |
509 </tr> |
642 </tr> |
510 <?php endif; ?> |
643 <?php endif; ?> |