#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 |
---|---|---|---|
Milestone: | 6.6 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Customize | Keywords: | has-patch has-screenshots commit |
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 (8)
This ticket was mentioned in PR #5861 on WordPress/wordpress-develop by @imath.
9 months ago
#1
- Keywords has-patch added
#2
@
7 months ago
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 6.6
- Version changed from trunk to 5.9
#5
@
4 months 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
@
4 months ago
- Keywords has-screenshots commit added; needs-testing removed
- Owner set to audrasjb
- Status changed from new to accepted
Self assigning for commit
.
@audrasjb commented on PR #5861:
4 months ago
#8
committed in https://core.trac.wordpress.org/changeset/58376
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