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.

Метод класса: WP_Customize_Widgets{}

Хуков нет.

Возвращает

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) (обязательный)
Current decision about loading block assets.

Список изменений

С версии 5.8.0 Введена.

Код WP_Customize_Widgets::should_load_block_editor_scripts_and_styles() 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;
}