PHP 8.2.30
Preview: aria-label.php Size: 1.57 KB
/home/byroehnu/kingslandgroupofschools.com.ng/wp-includes/block-supports/aria-label.php

<?php
/**
 * Aria label block support flag.
 *
 * @package WordPress
 * @since 6.8.0
 */

/**
 * Registers the aria-label block attribute for block types that support it.
 *
 * @since 6.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type Block Type.
 */
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',
		);
	}
}

/**
 * Add the aria-label to the output.
 *
 * @since 6.8.0
 * @access private
 *
 * @param WP_Block_Type $block_type       Block Type.
 * @param array         $block_attributes Block attributes.
 *
 * @return array Block aria-label.
 */
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'] );
}

// Register the block support.
WP_Block_Supports::get_instance()->register(
	'aria-label',
	array(
		'register_attribute' => 'wp_register_aria_label_support',
		'apply'              => 'wp_apply_aria_label_support',
	)
);

Directory Contents

Dirs: 0 × Files: 20

Name Size Perms Modified Actions
1.67 KB lrw-r--r-- 2023-08-10 20:48:20
Edit Download
1.57 KB lrw-r--r-- 2025-03-04 18:06:28
Edit Download
4.05 KB lrw-r--r-- 2025-09-11 00:27:32
Edit Download
9.20 KB lrw-r--r-- 2024-12-21 22:23:24
Edit Download
854 B lrw-r--r-- 2025-11-24 23:30:30
Edit Download
6.27 KB lrw-r--r-- 2023-09-29 14:20:30
Edit Download
5.81 KB lrw-r--r-- 2023-09-29 14:20:30
Edit Download
1.64 KB lrw-r--r-- 2023-08-10 20:48:20
Edit Download
5.28 KB lrw-r--r-- 2024-01-31 07:54:18
Edit Download
2.67 KB lrw-r--r-- 2024-06-04 05:48:18
Edit Download
8.46 KB lrw-r--r-- 2024-05-03 09:25:12
Edit Download
19.47 KB lrw-r--r-- 2026-02-28 03:13:13
Edit Download
1.70 KB lrw-r--r-- 2023-08-10 20:48:20
Edit Download
39.00 KB lrw-r--r-- 2025-10-18 03:54:28
Edit Download
4.24 KB lrw-r--r-- 2023-09-26 17:47:20
Edit Download
4.52 KB lrw-r--r-- 2023-09-26 17:47:20
Edit Download
2.04 KB lrw-r--r-- 2024-06-04 03:36:14
Edit Download
2.81 KB lrw-r--r-- 2023-09-26 17:47:20
Edit Download
29.08 KB lrw-r--r-- 2025-11-17 15:50:20
Edit Download
1011 B lrw-r--r-- 2023-08-18 21:29:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).