WP_Customize_Widgets::should_load_block_editor_scripts_and_styles() WordPress Method

The WP_Customize_Widgets::should_load_block_editor_scripts_and_styles() method is used to determine whether the block editor scripts and styles should be loaded. This can be useful for plugins that need to use the block editor while also supporting the customizer.

WP_Customize_Widgets::should_load_block_editor_scripts_and_styles( bool $is_block_editor_screen ) #

Tells the script loader to load the scripts and styles of custom blocks if the widgets block editor is enabled.


Parameters

$is_block_editor_screen

(bool)(Required)Current decision about loading block assets.


Top ↑

Return

(bool) Filtered decision about loading block assets.


Top ↑

Source

File: wp-includes/class-wp-customize-widgets.php

	public function should_load_block_editor_scripts_and_styles( $is_block_editor_screen ) {
		if ( wp_use_widgets_block_editor() ) {
			return true;
		}

		return $is_block_editor_screen;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.