Opened 3 years ago
Closed 7 weeks ago
#53817 closed defect (bug) (reported-upstream)
When switching theme, previous theme's 'site_logo' renders instead of the current theme's 'custom_logo'
Reported by: | hellofromTonya | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.8 |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
An edge case was identified in #53770 where when a previous theme's logo renders when switching back to a theme.
5.8 introduced new functionality (in _override_custom_logo_theme_mod()
) where, when exists, the 'site_logo'
option is used instead of the theme's 'custom_logo'
mod. See #53247 [51091].
What happens when switching back to a theme that has a custom logo stored in its theme mod option? It no longer renders that theme's custom logo but instead renders what's stored in the 'site_logo'
option. The 'site_logo'
was set by the previous theme.
This is a breaking change from 5.7.2 and earlier. But the question is: is this the expected behavior? Should the site logo be the logo regardless of the theme? Does it provide a better experience for site owners by maintaining consistency when switching between themes?
In other words, is this an edge case that needs to be fixed OR is this new behavior by design?
Steps to Reproduce:
- Go to
Appearance
>Themes
>Activate
the Twenty Twenty-One theme. - Go to
Customize
>Site Identity
>Select logo
(underLogo
setting) and set the logo. - Click
Publish
. - Exit Customizer.
- Go
Themes
>Activate
the Twenty Twenty theme. - Go to
Customize
>Site Identify
>Select logo
but select a different logo this time. - Click
Publish
. - Exist Customizer.
- Go back and active the Twenty Twenty-One theme again.
- Go back to
Customize
>Site Identity
.
Notice:
- The logo is the one set in Step 6 (for the Twenty Twenty theme) and not the one set Step 2 (for TT1).
- The IDs are also different in the options database. For example:
theme_mods_twentytwentyone
"custom_logo";i:52;
theme_mods_twentytwenty
"custom_logo";i:47;
site_logo
=47
Attachments (2)
Change History (7)
#1
@
3 years ago
Added 2 attachments to show the behavior in 5.7.2 vs 5.8.0
- TT1's logo is the white WP logo
- TT's logo is the black WP logo
In WP 5.7.2. as shown in 53817-5.7.2.gif:
- The logo stays bound to its theme
- Switching to a theme without a logo shows no logo
- Switching to back to a theme that had a logo set shows its logo and not the previous theme's logo
In WP 5.8.0 as shown in 53817-5.8.0.gif:
- Switching to a theme without a logo shows the logo set from the previous theme
- Switching back to a theme that had a logo set does not show its logo but rather the logo from the previous theme
This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.
3 years ago
#3
@
2 months ago
I've just commented at https://make.wordpress.org/core/2024/08/07/agenda-dev-chat-wednesday-aug-7-2024/
Is the idea to synchronize, have the same value in site_logo
and custom_logo
shouldn't be the easiest way to solve this issue ?
-- edit ---
The sync is done at https://github.com/WordPress/wordpress-develop/blob/9928cd6bcb35d14a700e3930355b6703f0cb4dc8/src/wp-includes/blocks/site-logo.php#L137-L155 but it seems overidden by https://github.com/WordPress/wordpress-develop/blob/9928cd6bcb35d14a700e3930355b6703f0cb4dc8/src/wp-includes/blocks/site-logo.php#L130
This ticket was mentioned in Slack in #core by joemcgill. View the logs.
2 months ago
#5
@
7 weeks ago
- Milestone Awaiting Review deleted
- Resolution set to reported-upstream
- Status changed from new to closed
The site logo block is maintained upstream in the Gutenberg repository. Investigation and resolution needs to happen there. In hindsight, I should have opened this issue there instead of here.
I opened an issue https://github.com/WordPress/gutenberg/issues/64523. I'm closing this ticket as reported upstream. Let's move the discussion to this GB issue. Thank you.
WordPress 5.7.2: TT1 has a white logo and TT has a black logo