WP_Translation_Controller::normalize_header()protectedWP 6.5.0

Normalizes header names to be capitalized.

Method of the class: WP_Translation_Controller{}

No Hooks.

Return

String. Normalized header name.

Usage

// protected - for code of main (parent) or child class
$result = $this->normalize_header( $header ): string;
$header(string) (required)
Header name.

Changelog

Since 6.5.0 Introduced.

WP_Translation_Controller::normalize_header() code WP 6.7.1

protected function normalize_header( string $header ): string {
	$parts = explode( '-', $header );
	$parts = array_map( 'ucfirst', $parts );
	return implode( '-', $parts );
}