#60236 closed defect (bug) (fixed)
Customizer’s Widget's component should only be loaded when not using a Block Theme
| Reported by: | imath | Owned by: | audrasjb |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.6 |
| Component: | Customize | Version: | 5.9 |
| Severity: | normal | Keywords: | has-patch has-screenshots commit |
| Cc: | Focuses: |
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 (8)
This ticket was mentioned in PR #5861 on WordPress/wordpress-develop by @imath.
3 years ago
#1
- Keywords has-patch added
#5
@
2 years ago
Tested this patch with a colleague, and no PHP notices received in either test.
OS: Mac OS
Localhost Server: Nginx 1.25
PHP: 8.2
WordPress: 6.5.3
Browser: Chrome
Theme: Twenty-twenty three
#6
@
2 years ago
- Keywords has-screenshots commit added; needs-testing removed
- Owner set to
- Status new → accepted
Self assigning for commit.
@audrasjb commented on PR #5861:
2 years ago
#8
committed in https://core.trac.wordpress.org/changeset/58376
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)




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