#66173 closed defect (bug) (fixed)
Change admin and user email: admin notices and usability inconsistencies
| Reported by: | afercia | Owned by: | afercia |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | Users | Version: | |
| Severity: | normal | Keywords: | has-screenshots has-patch commit |
| Cc: | Focuses: | administration |
Description (last modified by )
Both the 'administrative' email and the current user email can be changed from the WP admin.
The two email have different nature and purpose.
- The administrative email can be changed from the General Settings page. it's saved to the options. The change request is saved in the options table as well as
option_name: new_admin_email. - The current user email can be changed from the User profiel page. It's saved in the users table user entry. The change request is saved in the usermeta table as
meta_key: _new_email.
Note that the current user email may or may not be the same as the administrative email.
Regarldess of whether it's the administrative email or the current user email, this ticket aims to address some usability inconsistencies.
1
When changing the current user email from the User profile page:
- 3 admin notices are rendered on the page:
- Info (blue) notice:
Your email address has not been updated yet ... etc.. - Success (green) notice:
Profile updated.. - A third notice is rendered in the middle of the page, after the email field:
There is a pending change of your email ... etc.. - The third notice is the only place that contains a link to 'cancel' the change request. It's buried down on the page and little discoverable.
2
When changing the administrative email from the General Settings page:
- Only 2 notices are rendered on the page.
- A success (green) notice:
Settings saved.. This is the default notice text for any save settings action. - A succes (green) notice in the middle of the page, after the 'Administration Email Address' field:
There is a pending change of the admin email ... etc..
I see a few problems with the current user experience:
1
Either both flows should show a blue notice at the top or none. The notice information is important enough because it informs the change is not effective yet. As such, I'd suggest to add the info notice in the General settings page.
2
The notices in the middle of the page are very little discoverable and may be missed. They are the only place where a 'Cancel' action is available. Ideally, the Cancel action should be more prominent, maybe at the top of the page.
3
Both the notices in the middle of the page are green, they are the 'success' type. This is wrong because they don't provide a 'success' feedback. Rather, they inform users that there is a pending change request. As such, they should be either info or warning notices.
Before attempting any patch or PR, I suggest waiting for design feedback.
See also attached screenshots.
Attachments (4)
Change History (25)
This ticket was mentioned in PR #13751 on WordPress/wordpress-develop by @devansh2002.
7 weeks ago
#1
- Keywords has-patch has-unit-tests added
When a $path is passed to wp_get_global_settings() or wp_get_global_styles() and that path does not exist, both functions return the entire settings/styles array. This happens because the full array is passed as the fallback to _wp_array_get(). Callers cannot tell "not set" apart from "all settings"
This PR:
- Returns
nullfrom both functions when the requested path does not exist. An empty$pathstill returns everything, as before. - Updates
block_core_image_get_lightbox_settings()in the Image block. It relied on the old behaviour to fall back to the top-levellightboxsetting, and now also falls back when the block-level lookup returnsnull. It works under both the old and new behaviour. A matching change is needed in Gutenberg (packages/block-library/src/image/index.php), since that file is synced from there. - Adds unit tests for existing, missing (top-level and nested), and empty paths, for a missing block, and for the Image lightbox fallback.
Other core callers that pass a path (button.php, block-supports/states.php, block-supports/block-visibility.php, and the wp_get_global_styles( array( 'color' ) ) call in image.php) already handle null.
Trac ticket: https://core.trac.wordpress.org/ticket/66173
Use of AI Tools
AI assistance: Yes
Tool(s): Claude
Model(s): Opus 5.5
Used for: Initial code skeleton and test suggestions; final implementation and tests were reviewed and edited by me.
#3
@
6 weeks ago
Additionally, when clicking the activation links in the confirmation email:
- User profile page: It does show the 'Profile Updated.' notice at the top of the page.
- General settings page: It does not show any success notice.
This ticket was mentioned in PR #13927 on WordPress/wordpress-develop by @afercia.
6 weeks ago
#5
- Keywords has-patch added
@afercia commented on PR #13927:
6 weeks ago
#7
Reminder for myself: check this two hooks for multisite:
This ticket was mentioned in Slack in #meta by afercia. View the logs.
5 weeks ago
#9
@
5 weeks ago
- Keywords commit added
In the screenshot below: the changes after PR 13927. Left: the User profile notices. Right: the General Settings notices.
#11
@
5 weeks ago
Describe the bug: the email-change notice shows twice on Network Admin → Profile and on the User Dashboard profile.
Ask for the ticket to be reopened. Only committers and trusted contributors can reopen it.
If nobody reopens it, open a new ticket instead. Use the Users component and milestone 7.2, and link it to #66173.
This ticket was mentioned in PR #14086 on WordPress/wordpress-develop by @ravipatel.
5 weeks ago
#12
- Keywords has-unit-tests added
Follow-up to r64228. That change stopped hooking new_user_email_admin_notice() to admin_notices and renders it directly in wp-admin/user-edit.php. But the function stayed hooked to user_admin_notices and network_admin_notices in wp-admin/includes/ms-admin-filters.php. Since r64228 also dropped the ?updated check, the notice now appears twice on the Network Admin and User Dashboard profile screens whenever an email change is pending.
This PR:
- Removes the two leftover multisite hooks.
- Adds a
@since 7.2.0changelog entry tonew_user_email_admin_notice(). - Adds unit tests in
tests/phpunit/tests/user/newUserEmailAdminNotice.php. - Removes trailing commas from two function calls added in r64228 (separate commit).
Testing instructions
- On a multisite install, go to Network Admin → Profile and change your email address.
- Before this PR, the "Your email address has not been updated yet…" notice appears twice. After it, the notice appears once.
- Run
npm run test:php -- --filter Tests_User_NewUserEmailAdminNoticeand the same command with-c tests/phpunit/multisite.xml.
Trac ticket: https://core.trac.wordpress.org/ticket/66173
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding the regression during a review of recent commits, drafting the fix and tests. I reviewed, ran and verified all changes (the tests fail without the fix and pass with it).
#13
@
5 weeks ago
- Keywords has-unit-tests removed
Reopening: since [64228], the email change notice is displayed twice on the Network Admin and User Dashboard profile screens, because new_user_email_admin_notice() is still hooked to user_admin_notices and network_admin_notices in ms-admin-filters.php.
PR: https://github.com/WordPress/wordpress-develop/pull/14086
#15
@
5 weeks ago
@ravipatel good catch, thanks for the PR. Will commit soon.
As per the trailing commas, to my understanding they are recommended by [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#indentation the current PHP standards}:
Note the comma after the last array item: this is recommended because it makes it easier to change the order of the array, and makes for cleaner diffs when new items are added.
@afercia commented on PR #14086:
5 weeks ago
#16
@rvpatel thanks for your PR.
By any chance, did you fork your repository from another fork? Ideally, it should be forked from the official wordpress-develop repo instead.
If no objections, you should grant write access to your fork as it appears I can't push changes there.
@ravipatel commented on PR #14086:
5 weeks ago
#17
Thanks @afercia! You're right: my fork was created from another fork (ravikumarup/wordpress-develop) instead of WordPress/wordpress-develop. I've invited you as a collaborator on rvpatel/wordpress-develop, so you should be able to push once you accept the invitation. I'll re-fork from the official repository once my open PRs are wrapped up.
@afercia commented on PR #14086:
5 weeks ago
#18
Thanks @rvpatel yes it's more about having a better setup for the future, not urgent :)
@afercia commented on PR #14086:
5 weeks ago
#19
Just a note to help quickly reproduce the issue: the duplicate notice can be observed on pages like:
http://localhost:8889/wp-admin/network/profile.php
http://localhost:8889/wp-admin/user/profile.php
http://localhost:8889/wp-admin/user/
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
User profile page: notices at the top of the page.