Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#48330 closed defect (bug) (duplicate)

Theme support, removing background image keeps menu item

Reported by: kebbet's profile kebbet Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Customize Keywords:
Focuses: ui Cc:


If using add_theme_support( 'custom-background', $args ) in combination with $wp_customize->remove_section( 'background_image' ); there is a menu option in the Customize menu section saying "Background", that leads to a dead end in the customizer. I think that the menu item should be removed if the background_image is disabled.

Change History (4)

#1 @SergeyBiryukov
5 years ago

  • Component changed from Themes to Customize

#2 @desrosj
5 years ago

  • Keywords 2nd-opinion close added

Hi @kebbet,

Can you confirm that the menu item you are referring to is the Appearance > Background link? If so, I am able to reproduce this.

I am not sure that there is a good way to fix this, though. The Customizer is not loaded unless the user is actually in the Customizer, so the admin menu would not be able to know if a plugin or theme is removing the background image section.

To me, this seems like the plugin or theme should also remove this admin submenu item.

Can you talk a bit about your use case and why you're removing the Customizer section for background images instead of removing/not registering theme support?

#3 @kebbet
5 years ago

Hi @desrosj,
I can confirm, see attached image in the issue in the TwentyTwenty theme Github repo. It's the second last item in the image.

I suggest looking at issue 480 for Twenty Twenty to see their reason for removing the background image option.

For more background discussion about this menu-link, check

#4 @desrosj
5 years ago

  • Keywords 2nd-opinion close removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

I'm going to close this out as a duplicate of #48338 as there is more discussion there.

Note: See TracTickets for help on using tickets.