wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_register_aria_label_support › WordPress Function

Depuis6.8.0
Dépréciéen/a
› wp_register_aria_label_support ( $block_type )
Accès:
  • private
Paramètres:
  • (WP_Block_Type) $block_type Block Type.
    Requis: Oui
Défini(e) dans:
Codex:

Registers the aria-label block attribute for block types that support it.



Source

function wp_register_aria_label_support( $block_type ) {
	$has_aria_label_support = block_has_support( $block_type, array( 'ariaLabel' ), false );

	if ( ! $has_aria_label_support ) {
		return;
	}

	if ( ! $block_type->attributes ) {
		$block_type->attributes = array();
	}

	if ( ! array_key_exists( 'ariaLabel', $block_type->attributes ) ) {
		$block_type->attributes['ariaLabel'] = array(
			'type' => 'string',
		);
	}
}