should_load_block_editor_scripts_and_styles
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 | Введена. |
Где вызывается хук
should_load_block_editor_scripts_and_styles
wp-includes/script-loader.php 2683
return apply_filters( 'should_load_block_editor_scripts_and_styles', $is_block_editor_screen );
Где используется хук в WordPress
wp-includes/block-editor.php 340
add_filter( 'should_load_block_editor_scripts_and_styles', '__return_false' );
wp-includes/block-editor.php 343
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' ) );