[wp-trac] [WordPress Trac] #60236: Customizer’s Widget's component should only be loaded when not using a Block Theme

WordPress Trac noreply at wordpress.org
Thu Jan 11 23:53:34 UTC 2024


#60236: Customizer’s Widget's component should only be loaded when not using a
Block Theme
--------------------------+-----------------------------
 Reporter:  imath         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Customize     |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60236>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list