WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 2 months ago

#53817 new defect (bug)

When switching theme, previous theme's 'site_logo' renders instead of the current theme's 'custom_logo'

Reported by: hellofromTonya Owned by:
Milestone: Awaiting Review 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:

  1. Go to Appearance > Themes > Activate the Twenty Twenty-One theme.
  2. Go to Customize > Site Identity > Select logo (under Logo setting) and set the logo.
  3. Click Publish.
  4. Exit Customizer.
  5. Go Themes > Activate the Twenty Twenty theme.
  6. Go to Customize > Site Identify > Select logo but select a different logo this time.
  7. Click Publish.
  8. Exist Customizer.
  9. Go back and active the Twenty Twenty-One theme again.
  10. 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)

53817-5.7.2.gif (8.3 MB) - added by hellofromTonya 2 months ago.
WordPress 5.7.2: TT1 has a white logo and TT has a black logo
53817-5.8.0.gif (8.5 MB) - added by hellofromTonya 2 months ago.
WordPress 5.8.0: TT1 should have a white logo and TT should have a black logo

Change History (4)

@hellofromTonya
2 months ago

WordPress 5.7.2: TT1 has a white logo and TT has a black logo

@hellofromTonya
2 months ago

WordPress 5.8.0: TT1 should have a white logo and TT should have a black logo

#1 @hellofromTonya
2 months 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.


2 months ago

Note: See TracTickets for help on using tickets.