wphooks.info - allowed_block_types

allowed_block_types

(trunk - 5.1-alpha-44286)

*** New in trunk ***

The hook occurs in the following file:

wp-admin/edit-form-blocks.php:
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/**
 * Filters the allowed block types for the editor, defaulting to true (all
 * block types supported).
 *
 * @since 5.0.0
 *
 * @param bool|array $allowed_block_types Array of block type slugs, or
 *                                        boolean to enable/disable all.
 * @param object $post                    The post resource data.
 */
$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );

// Get all available templates for the post/page attributes meta-box.
// The "Default template" array element should only be added if the array is
// not empty so we do not trigger the template select element without any options
// besides the default value.
$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) );
$available_templates = ! empty( $available_templates ) ? array_merge(
	array(
		/** This filter is documented in wp-admin/includes/meta-boxes.php */