get_block_type_uses_context
Filters the registered uses context for a block type.
Usage
add_filter( 'get_block_type_uses_context', 'wp_kama_get_block_type_uses_context_filter', 10, 2 );
/**
* Function for `get_block_type_uses_context` filter-hook.
*
* @param string[] $uses_context Array of registered uses context for a block type.
* @param WP_Block_Type $block_type The full block type object.
*
* @return string[]
*/
function wp_kama_get_block_type_uses_context_filter( $uses_context, $block_type ){
// filter...
return $uses_context;
}
- $uses_context(string[])
- Array of registered uses context for a block type.
- $block_type(WP_Block_Type)
- The full block type object.
Changelog
| Since 6.5.0 | Introduced. |
Where the hook is called
get_block_type_uses_context
wp-includes/class-wp-block-type.php 635
return apply_filters( 'get_block_type_uses_context', $this->uses_context, $this );