WP_Customize_Widgets::should_load_block_editor_scripts_and_styles()
Tells the script loader to load the scripts and styles of custom blocks if the widgets block editor is enabled.
Method of the class: WP_Customize_Widgets{}
No Hooks.
Return
true|false
. Filtered decision about loading block assets.
Usage
$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.
Changelog
Since 5.8.0 | Introduced. |
WP_Customize_Widgets::should_load_block_editor_scripts_and_styles() WP Customize Widgets::should load block editor scripts and styles code WP 6.5.2
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; }