diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/user-edit.php --- a/wp/wp-admin/user-edit.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/user-edit.php Fri Sep 05 18:40:08 2025 +0200 @@ -9,9 +9,13 @@ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; -wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) ); +/** WordPress Translation Installation API */ +require_once ABSPATH . 'wp-admin/includes/translation-install.php'; -$user_id = (int) $user_id; +$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; +$user_id = ! empty( $_REQUEST['user_id'] ) ? absint( $_REQUEST['user_id'] ) : 0; +$wp_http_referer = ! empty( $_REQUEST['wp_http_referer'] ) ? sanitize_text_field( $_REQUEST['wp_http_referer'] ) : ''; + $current_user = wp_get_current_user(); if ( ! defined( 'IS_PROFILE_PAGE' ) ) { @@ -71,8 +75,8 @@ get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . - '

' . __( 'Documentation on User Profiles' ) . '

' . - '

' . __( 'Support' ) . '

' + '

' . __( 'Documentation on User Profiles' ) . '

' . + '

' . __( 'Support forums' ) . '

' ); $wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer ); @@ -104,7 +108,7 @@ if ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) { $new_email = get_user_meta( $current_user->ID, '_new_email', true ); if ( $new_email && hash_equals( $new_email['hash'], $_GET['newuseremail'] ) ) { - $user = new stdClass; + $user = new stdClass(); $user->ID = $current_user->ID; $user->user_email = esc_html( trim( $new_email['newemail'] ) ); if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) { @@ -197,36 +201,58 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; ?> - ID ) && current_user_can( 'manage_network_options' ) ) : ?> -

- + ID ) && current_user_can( 'manage_network_options' ) ) : + $message = '' . __( 'Important:' ) . ' ' . __( 'This user has super admin privileges.' ); + wp_admin_notice( + $message, + array( + 'type' => 'info', + ) + ); + endif; - -
- -

- -

- - -

- -
- + if ( isset( $_GET['updated'] ) ) : + if ( IS_PROFILE_PAGE ) : + $message = '' . __( 'Profile updated.' ) . ''; + else : + $message = '' . __( 'User updated.' ) . ''; + endif; + if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : + $message .= '' . __( '← Go to Users' ) . ''; + endif; + wp_admin_notice( + $message, + array( + 'id' => 'message', + 'dismissible' => true, + 'additional_classes' => array( 'updated' ), + ) + ); + endif; - -
- -

- -
- + if ( isset( $_GET['error'] ) ) : + $message = ''; + if ( 'new-email' === $_GET['error'] ) : + $message = __( 'Error while saving the new email address. Please try again.' ); + endif; + wp_admin_notice( + $message, + array( + 'type' => 'error', + ) + ); + endif; - -
-

\n

", $errors->get_error_messages() ); ?>

-
- + if ( isset( $errors ) && is_wp_error( $errors ) ) { + wp_admin_notice( + implode( "

\n

", $errors->get_error_messages() ), + array( + 'additional_classes' => array( 'error' ), + ) + ); + } + ?>

@@ -235,9 +261,9 @@ - + - + @@ -330,7 +356,7 @@ comment_shortcuts ); ?> /> - More information' ); ?> + Documentation on Keyboard Shortcuts' ); ?> @@ -345,8 +371,11 @@ - - + + @@ -368,7 +397,7 @@ 'id' => 'locale', 'selected' => $user_locale, 'languages' => $languages, - 'show_available_translations' => false, + 'show_available_translations' => $can_install_translations, 'show_option_site_default' => true, ) ); @@ -409,7 +438,7 @@ - + ID ) ) : ?> @@ -518,25 +547,28 @@

- ID, '_new_email', true ); ?> - user_email && $profile_user->ID === $current_user->ID ) : ?> -
-

- ' . esc_html( $new_email['newemail'] ) . '' - ); - printf( - ' %2$s', - esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), - __( 'Cancel' ) - ); - ?> -

-
- + ID, '_new_email', true ); + if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : + + $pending_change_message = sprintf( + /* translators: %s: New email. */ + __( 'There is a pending change of your email to %s.' ), + '' . esc_html( $new_email['newemail'] ) . '' + ); + $pending_change_message .= sprintf( + ' %2$s', + esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), + __( 'Cancel' ) + ); + wp_admin_notice( + $pending_change_message, + array( + 'additional_classes' => array( 'updated', 'inline' ), + ) + ); + endif; + ?> @@ -634,12 +666,13 @@