allowed_block_types filter-hook . WP 5.0.0
Filters the allowed block types for the editor, defaulting to true (all block types supported).
Usage
add_filter( 'allowed_block_types', 'filter_function_name_3220', 10, 2 ); function filter_function_name_3220( $allowed_block_types, $post ){ // filter... return $allowed_block_types; }
- $allowed_block_types(true/false/array)
- Array of block type slugs, or boolean to enable/disable all.
- $post(object)
- The post resource data.
Where the hook is called
In file:
/wp-admin/edit-form-blocks.php
allowed_block_types
wp-admin/edit-form-blocks.php 147
$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );