block_has_support()WP 5.8.0

Checks whether the current block type supports the feature requested.

No Hooks.


true|false. Whether the feature is supported.


block_has_support( $block_type, $feature, $default );
$block_type(WP_Block_Type) (required)
Block type to check for support.
$feature(array) (required)
Path to a specific feature to check support for.
Fallback value for feature support.
Default: false


Since 5.8.0 Introduced.

Код block_has_support() WP 6.1.1

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 );