block_categories_all
Filters the default array of categories for block types.
Usage
add_filter( 'block_categories_all', 'wp_kama_block_categories_all_filter', 10, 2 ); /** * Function for `block_categories_all` filter-hook. * * @param array[] $block_categories Array of categories for block types. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return array[] */ function wp_kama_block_categories_all_filter( $block_categories, $block_editor_context ){ // filter... return $block_categories; }
- $block_categories(array[])
- Array of categories for block types.
- $block_editor_context(WP_Block_Editor_Context)
- The current block editor context.
Changelog
Since 5.8.0 | Introduced. |
Where the hook is called
block_categories_all
wp-includes/block-editor.php 86
$block_categories = apply_filters( 'block_categories_all', $block_categories, $block_editor_context );