Admin bar: correctly preview changes to site title and icon#12474
Admin bar: correctly preview changes to site title and icon#12474fushar wants to merge 1 commit into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
4a33182 to
68ccb6d
Compare
| class: 'site-icon', | ||
| src: attributes.url, | ||
| alt: '', | ||
| width: 20, | ||
| height: 20, |
There was a problem hiding this comment.
One minor divergence from the original markup is the missing srcset here, although practically it's not an issue because it already uses the original (likely large) image.
On Settings → General, live-previewing an unsaved site title change no longer removes the admin bar site icon: the icon element is preserved and re-prepended when the title text is updated. Additionally, adding, changing, or removing the site icon is now live-previewed in the admin bar, keeping the toolbar in sync with the `img.site-icon` element and the `has-site-icon` class before the form is saved. Developed in: #12474. Props fushar, tyxla. Fixes #65606. git-svn-id: https://develop.svn.wordpress.org/trunk@62686 602fd350-edb4-49c9-b593-d223f7449a82
Trac ticket: https://core.trac.wordpress.org/ticket/65606
A follow-up to #11781. This PR improves the site title/icon update logic in Settings -> General, when the form is not saved yet.
Previously, only site title is live-previewed (but removes site icon accidentally; see the video in the linked Trac ticket). This PR fixes that, and also live-preview the site icon changes, so that addition/change/removal to the site icon is also live-previewed in the admin bar.
See the following video:
Screen.Capture.on.2026-07-10.at.19-08-08.mp4
Testing Instructions
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.8
Used for: code generation and brainstorming
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.