[wp-trac] [WordPress Trac] #53817: When switching theme, previous theme's 'site_logo' renders instead of the current theme's 'custom_logo'

WordPress Trac noreply at wordpress.org
Wed Jul 28 19:00:13 UTC 2021


#53817: When switching theme, previous theme's 'site_logo' renders instead of the
current theme's 'custom_logo'
----------------------------+-----------------------------
 Reporter:  hellofromTonya  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Themes          |    Version:  5.8
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 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`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53817>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list