W3cubDocs

/WordPress

WP_Font_Face_Resolver::to_kebab_case( array $data ): array

Converts all first dimension keys into kebab-case.

Parameters

$dataarrayrequired
The array to process.

Return

array Data with first dimension keys converted into kebab-case.

Source

private static function to_kebab_case( array $data ) {
	foreach ( $data as $key => $value ) {
		$kebab_case          = _wp_to_kebab_case( $key );
		$data[ $kebab_case ] = $value;
		if ( $kebab_case !== $key ) {
			unset( $data[ $key ] );
		}
	}

	return $data;
}

Changelog

Version Description
6.4.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_font_face_resolver/to_kebab_case