allowed_block_types_all filter-hookWP 5.8.0

Filters the allowed block types for all editor types.

Usage

add_filter( 'allowed_block_types_all', 'wp_kama_allowed_block_types_all_filter', 10, 2 );

/**
 * Function for `allowed_block_types_all` filter-hook.
 * 
 * @param bool|string[]           $allowed_block_types  Array of block type slugs, or boolean to enable/disable all.
 * @param WP_Block_Editor_Context $block_editor_context The current block editor context.
 *
 * @return bool|string[]
 */
function wp_kama_allowed_block_types_all_filter( $allowed_block_types, $block_editor_context ){

	// filter...
	return $allowed_block_types;
}
$allowed_block_types(true|false|string[])
Array of block type slugs, or boolean to enable/disable all.
Default: true (all registered block types supported)
$block_editor_context(WP_Block_Editor_Context)
The current block editor context.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

get_allowed_block_types()
allowed_block_types_all
wp-includes/block-editor.php 127
$allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $block_editor_context );

Where the hook is used in WordPress

Usage not found.