should_load_block_editor_scripts_and_styles хук-фильтрWP 5.6.0

Filters the flag that decides whether or not block editor scripts and styles are going to be enqueued on the current screen.

Использование

add_filter( 'should_load_block_editor_scripts_and_styles', 'wp_kama_should_load_block_editor_scripts_and_styles_filter' );

/**
 * Function for `should_load_block_editor_scripts_and_styles` filter-hook.
 * 
 * @param bool $is_block_editor_screen Current value of the flag.
 *
 * @return bool
 */
function wp_kama_should_load_block_editor_scripts_and_styles_filter( $is_block_editor_screen ){

	// filter...
	return $is_block_editor_screen;
}
$is_block_editor_screen(true|false)
Current value of the flag.

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

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

Где вызывается хук

wp_should_load_block_editor_scripts_and_styles()
should_load_block_editor_scripts_and_styles
wp-includes/script-loader.php 2441
return apply_filters( 'should_load_block_editor_scripts_and_styles', $is_block_editor_screen );

Где используется хук в WordPress

wp-includes/class-wp-customize-widgets.php 121
add_filter( 'should_load_block_editor_scripts_and_styles', array( $this, 'should_load_block_editor_scripts_and_styles' ) );