Make WordPress Core

Opened 3 months ago

Last modified 8 weeks ago

#60236 new defect (bug)

Customizer’s Widget's component should only be loaded when not using a Block Theme

Reported by: imath's profile imath Owned by:
Milestone: 6.6 Priority: normal
Severity: normal Version: 5.9
Component: Customize Keywords: has-patch needs-testing
Focuses: Cc:

Description

Hi,

The BuddyPress plugin has a feature to customize the notification emails it sends when users interact. This feature uses the Customizer from the WP Admin context only.

When the current theme is a Block Theme, previewing/customizing notification emails is generating this Warning notice:
PHP Warning: Attempt to read property "title" on null in /path/to/wordpress.develop/build/wp-includes/class-wp-customize-widgets.php on line 905

After some search into the WP_Customize_Manager class I noticed, although these kind of themes do not use the widgets component all corresponding Customizer controllers were loaded although this was not necessary.

Disabling the Customizer widgets component using the 'customize_loaded_components' filter removed this Warning notice, so I could use this from BuddyPress when these kind of themes are active on sites.

But I believe WordPress should only make the Customizer's widgets component available when the active theme is not a Block theme as BuddyPress might not be the only plugin to use the Customizer even if a Block theme is the active one.

Change History (2)

This ticket was mentioned in PR #5861 on WordPress/wordpress-develop by @imath.


3 months ago
#1

  • Keywords has-patch added

Check the current theme is not a block one before adding the widgets component to the Customizer manager.

See https://github.com/buddypress/buddypress/pull/215

Trac ticket: https://core.trac.wordpress.org/ticket/60236

#2 @swissspidy
8 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 6.6
  • Version changed from trunk to 5.9
Note: See TracTickets for help on using tickets.