wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_apply_aria_label_support is private and should not be used in themes or plugins directly.
wp_apply_aria_label_support › WordPress Function
Since6.8.0
已弃用n/a
› wp_apply_aria_label_support ( $block_type, $block_attributes )
| 访问: |
|
| 参数: (2) |
|
| 返回: |
|
| 定义在: | |
| 文档: |
Add the aria-label to the output.
源码
function wp_apply_aria_label_support( $block_type, $block_attributes ) {
if ( ! $block_attributes ) {
return array();
}
$has_aria_label_support = block_has_support( $block_type, array( 'ariaLabel' ), false );
if (
! $has_aria_label_support ||
wp_should_skip_block_supports_serialization( $block_type, 'ariaLabel' )
) {
return array();
}
$has_aria_label = array_key_exists( 'ariaLabel', $block_attributes );
if ( ! $has_aria_label ) {
return array();
}
return array( 'aria-label' => $block_attributes['ariaLabel'] );
}