diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index d12eea0e5f326..b29d6a8bfc3c4 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -100,7 +100,7 @@ final class WP_Customize_Manager { * @since 4.5.0 * @var array */ - protected $components = array( 'widgets', 'nav_menus' ); + protected $components = array( 'nav_menus' ); /** * Registered instances of WP_Customize_Section. @@ -286,6 +286,11 @@ public function __construct( $args = array() ) { $args['messenger_channel'] = sanitize_key( wp_unslash( $_REQUEST['customize_messenger_channel'] ) ); } + // Don't load 'widgets' component if a block theme is activated. + if ( ! wp_is_block_theme() ) { + $this->components[] = 'widgets'; + } + $this->original_stylesheet = get_stylesheet(); $this->theme = wp_get_theme( 0 === validate_file( $args['theme'] ) ? $args['theme'] : null ); $this->messenger_channel = $args['messenger_channel'];