WP_Customize_Widgets::should_load_block_editor_scripts_and_styles()publicWP 5.8.0

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

{} It's a method of the class: WP_Customize_Widgets{}

No Hooks.


true|false. Filtered decision about loading block assets.


$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->should_load_block_editor_scripts_and_styles( $is_block_editor_screen );
$is_block_editor_screen(true|false) (required)
Current decision about loading block assets.


Since 5.8.0 Introduced.

Code of WP_Customize_Widgets::should_load_block_editor_scripts_and_styles() WP 6.0

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;