WP_Font_Face_Resolver::to_kebab_case( array $data ): array

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

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

VersionDescription
6.4.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.