WP_Font_Face_Resolver::to_kebab_caseprivate staticWP 6.4.0

Converts all first dimension keys into kebab-case.

Method of the class: WP_Font_Face_Resolver{}

No Hooks.

Returns

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

Usage

$result = WP_Font_Face_Resolver::to_kebab_case( $data );
$data(array) (required)
The array to process.

Changelog

Since 6.4.0 Introduced.

WP_Font_Face_Resolver::to_kebab_case() code WP 7.0

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;
}