should_load_block_editor_scripts_and_styles filter-hookWP 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.

Usage

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.

Changelog

Since 5.6.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

wp-includes/block-editor.php 339
add_filter( 'should_load_block_editor_scripts_and_styles', '__return_false' );
wp-includes/block-editor.php 341
remove_filter( 'should_load_block_editor_scripts_and_styles', '__return_false' );
wp-includes/class-wp-customize-widgets.php 122
add_filter( 'should_load_block_editor_scripts_and_styles', array( $this, 'should_load_block_editor_scripts_and_styles' ) );