Skip to content

Admin bar: correctly preview changes to site title and icon#12474

Closed
fushar wants to merge 1 commit into
WordPress:trunkfrom
fushar:site-title-icon-changes
Closed

Admin bar: correctly preview changes to site title and icon#12474
fushar wants to merge 1 commit into
WordPress:trunkfrom
fushar:site-title-icon-changes

Conversation

@fushar

@fushar fushar commented Jul 10, 2026

Copy link
Copy Markdown

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

  1. Go to Settings -> General
  2. Try to update site title, or add / change / remove site icon. Verify that the change is immediately live-previewed in the admin bar,

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.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@fushar fushar changed the title Admin bar: correctly preview site title changes when there's site icon Admin bar: correctly preview changes to site title and icon Jul 10, 2026
@fushar fushar marked this pull request as ready for review July 10, 2026 12:10
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props fushar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@fushar fushar force-pushed the site-title-icon-changes branch from 4a33182 to 68ccb6d Compare July 10, 2026 12:18

@tyxla tyxla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice enhancement, thanks @fushar! 🙌

It's probably a behavior that could benefit from some e2e tests. That being said, this is not a blocker for this PR.

It tests well and code is looking good!

Comment on lines +203 to +207
class: 'site-icon',
src: attributes.url,
alt: '',
width: 20,
height: 20,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

pento pushed a commit that referenced this pull request Jul 10, 2026
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
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 62686
GitHub commit: e4dc6ee

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants