Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only activate the Customizer’s widget component when the current theme is not a block one #5861

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/wp-includes/class-wp-customize-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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'];
Expand Down
Loading