wpseek.com
A WordPress-centric search engine for devs and theme authors
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
Deprecatedn/a
› wp_apply_aria_label_support ( $block_type, $block_attributes )
| Access: |
|
| Parameters: (2) |
|
| Returns: |
|
| Defined at: | |
| Codex: |
Add the aria-label to the output.
Source
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 ) {
return array();
}
$has_aria_label = array_key_exists( 'ariaLabel', $block_attributes );
if ( ! $has_aria_label ) {
return array();
}
return array( 'aria-label' => $block_attributes['ariaLabel'] );
}