Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot remove logo in Theme Customizer once it's been added #30152

Closed
bradhogan opened this issue Mar 23, 2021 · 6 comments · Fixed by #30427
Closed

Cannot remove logo in Theme Customizer once it's been added #30152

bradhogan opened this issue Mar 23, 2021 · 6 comments · Fixed by #30427
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@bradhogan
Copy link

Description

My guess is this is a core WP issue, but not sure where to post it if it is. In either case, I've noticed on all sites I have admin access to that are on the latest versions of WP that if you add a custom logo in Theme Customizer, save, then view, the logo is there. However, if you then open up the customizer menu and remove the logo, the real-time update works, but when you Publish and view the site, the old logo is still there.

I've been able to replicate this with no plugins and just the default theme installed across multiple different sites. If I completely delete the logo file from the media, then nothing appears (i.e. not even the text version of the site name).

Expected behaviour

Should be able to remove logo in Site Identity theme customizer menu.

Actual behaviour

Somehow the custom_logo is still there regardless if you remove it or not.

Screenshots or screen recording (optional)

Quick video showing that I add a logo successfully, then try to remove it and save but the logo continues to appear:
https://soapbox.wistia.com/videos/VMOWaROoWo

WordPress information

  • WordPress version: 5.7
  • Gutenberg version: not installed
  • Are all plugins except Gutenberg deactivated? yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? yes

Device information

  • Device: desktop
  • Operating system: iOS
  • Browser: Chrome
@talldan
Copy link
Contributor

talldan commented Mar 24, 2021

Hi @bradley2083. Thanks for reporting. You're right that this looks like a core issue.

Core trac is the bug tracker for core — https://core.trac.wordpress.org/. It requires a WordPress.org account, which you can create here — https://login.wordpress.org/register.

Would you be happy to create a ticket there?

@talldan talldan added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label Mar 24, 2021
@bradhogan
Copy link
Author

Hey, @talldan I've gone ahead and submitted the ticket in the core WP tracker. Thanks for sharing that!

@talldan
Copy link
Contributor

talldan commented Mar 25, 2021

Thanks—I'm just sharing the ticket reference here to connect things together:
https://core.trac.wordpress.org/ticket/52902

@talldan talldan closed this as completed Mar 25, 2021
@bradhogan
Copy link
Author

Hey @talldan I just realized this issue only occurs IF the Gutenberg plugin is active. So I suppose this is an issue with Gutenberg (and not core WP). Are you able to re-open this ticket?

@hellofromtonya
Copy link
Contributor

As @bradley2083 noted, the problem occurs when the Gutenberg plugin is active. I was able to trace it to here:

function sync_site_logo_to_theme_mod( $custom_logo ) {
if ( $custom_logo ) {
update_option( 'sitelogo', $custom_logo );
}
return $custom_logo;
}

If the $custom_logo is 0 or '0', then updating the sitelogo option is skipped. Just above that logic is another callback that defaults to use the 'sitelogo' option when it exists.

A fix here is to delete the option like this:

function gutenberg_sync_site_logo_to_theme_mod( $custom_logo ) {
	if ( ! empty( $custom_logo ) ) {
		update_option( 'sitelogo', $custom_logo );
	} else {
		delete_option( 'sitelogo', $custom_logo );
	}
	return $custom_logo;
}

This issue should be reopened. I'll submit a PR with the above fix.

@ockham
Copy link
Contributor

ockham commented Apr 27, 2021

(For xref purposes: Noting here that this issue was a duplicate of sorts of #25173.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
5 participants