Filter hook 'get_block_type_uses_context'

in WP Core File wp-includes/class-wp-block-type.php at line 635

View Source

get_block_type_uses_context

Filter Hook
Description
Filters the registered uses context for a block type.

Hook Information

File Location wp-includes/class-wp-block-type.php View on GitHub
Hook Type Filter
Line Number 635

Hook Parameters

Type Name Description
string[] $uses_context Array of registered uses context for a block type.
WP_Block_Type $block_type The full block type object.

Usage Examples

Basic Usage
<?php
// Hook into get_block_type_uses_context
add_filter('get_block_type_uses_context', 'my_custom_filter', 10, 2);

function my_custom_filter($uses_context, $block_type) {
    // Your custom filtering logic here
    return $uses_context;
}

Source Code Context

wp-includes/class-wp-block-type.php:635 - How this hook is used in WordPress core
<?php
 630  		 * @since 6.5.0
 631  		 *
 632  		 * @param string[]      $uses_context Array of registered uses context for a block type.
 633  		 * @param WP_Block_Type $block_type   The full block type object.
 634  		 */
 635  		return apply_filters( 'get_block_type_uses_context', $this->uses_context, $this );
 636  	}
 637  }

PHP Documentation

<?php
/**
		 * Filters the registered uses context for a block type.
		 *
		 * @since 6.5.0
		 *
		 * @param string[]      $uses_context Array of registered uses context for a block type.
		 * @param WP_Block_Type $block_type   The full block type object.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-block-type.php
Related Hooks

Related hooks will be displayed here in future updates.