allowed_block_types_all хук-фильтрWP 5.8.0

Filters the allowed block types for all editor types.

Использование

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.
По умолчанию: true (all registered block types supported)
$block_editor_context(WP_Block_Editor_Context)
The current block editor context.

Список изменений

С версии 5.8.0 Введена.

Где вызывается хук

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

Где используется хук в WordPress

Использование не найдено.