block_has_support
函数
block_has_support ( $block_type, $feature, $default = false )
- 参数
-
-
(WP_Block_Type)
$block_type
Block type to check for support.- Required: 是
-
(array)
$feature
Path to a specific feature to check support for.- Required: 是
-
(mixed)
$default
Optional. Fallback value for feature support. Default false.- Required: 否
- Default: false
-
(WP_Block_Type)
- 返回值
-
- (bool) Whether the feature is supported.
- 定义位置
-
-
wp-includes/blocks.php
, line 1175
-
wp-includes/blocks.php
- 引入
- 5.8.0
- 弃用
- –
Checks whether the current block type supports the feature requested.
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 ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。