WordPress at Your Fingertips
function is not described

block_has_support() WP 5.8.0

Checks whether the current block type supports the feature requested.

No Hooks.

Return

true|false. Whether or not the feature is supported.

Usage

block_has_support( $block_type, $feature, $default );
$block_type(WP_Block_Type) (required)
Block type to check for support.
$feature(string) (required)
Name of the feature to check support for.
$default(mixed)
Fallback value for feature support.
Default: false

Changelog

Since 5.8.0 Introduced.

Code of block_has_support() WP 5.8.2

function block_has_support( $block_type, $feature, $default = false ) {
	$block_support = $default;
	if ( $block_type && property_exists( $block_type, 'supports' ) ) {
		$block_support = _wp_array_get( $block_type->supports, $feature, $default );
	}

	return true === $block_support || is_array( $block_support );
}