apply_filters( 'allowed_block_types_all', bool|string[] $allowed_block_types , WP_Block_Editor_Context $block_editor_context )
Filters the allowed block types for all editor types.
Parameters
-
$allowed_block_types
bool|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.
Source
File: wp-includes/block-editor.php
.
View all references
$allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $block_editor_context );
Changelog
Version | Description |
---|---|
5.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
To find the list of all the core blocks that can be filtered, see: https://developer.wordpress.org/block-editor/reference-guides/core-blocks/
Basic Example
How it can be used to filter for multiple post types in the same function. This filters the custom post types of ‘sponsors’, ‘news’ and ‘faqs’ to only allow the core Gutenberg blocks listed.