Open hellofromtonya opened 4 weeks ago
Copying @sebastienserre's comment from the Trac ticket to here:
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
Description
This issue was originally reported in WordPress Core Trac https://core.trac.wordpress.org/ticket/53817.
An edge case was identified in Trac 53770 where when a previous theme's logo renders when switching back to a theme.
WordPress 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 Trac 53247 / r51091.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.
In other words, is this an edge case that needs to be fixed OR is this new behavior by design?
Step-by-step reproduction instructions
Appearance
>Themes
>Activate
the Twenty Twenty-One theme.Customize
>Site Identity
>Select logo
(underLogo
setting) and set the logo.Publish
.Themes
>Activate
the Twenty Twenty theme.Customize
>Site Identify
>Select logo
but select a different logo this time.Publish
.Customize
>Site Identity
.Notice:
theme_mods_twentytwentyone
"custom_logo";i:52;
theme_mods_twentytwenty
"custom_logo";i:47;
site_logo
=47
Screenshots, screen recording, code snippet
WordPress 5.7.2: TT1 has a white logo and TT has a black logo![53817-5 7 2](https://github.com/user-attachments/assets/31d18ec6-172c-45a4-b025-8b55da27723d)
In WP 5.7.2. as shown in the gif:
WordPress 5.8.0: TT1 should have a white logo and TT should have a black logo![53817-5 8 0](https://github.com/user-attachments/assets/43cf2690-87ba-4058-be07-23c68a3d17ce)
In WP 5.8.0 as shown in gif:
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.