WordPress at Your Fingertips
function is not described

Custom_Image_Header::process_default_headers() public WP 3.0.0

Process the default headers

{} It's a method of the class: Custom_Image_Header{}

No Hooks.

Return

null. Nothing.

Usage

$Custom_Image_Header = new Custom_Image_Header();
$Custom_Image_Header->process_default_headers();

Notes

  • Global. Array. $_wp_default_headers

Changelog

Since 3.0.0 Introduced.

Code of Custom_Image_Header::process_default_headers() WP 5.8.2

public function process_default_headers() {
	global $_wp_default_headers;

	if ( ! isset( $_wp_default_headers ) ) {
		return;
	}

	if ( ! empty( $this->default_headers ) ) {
		return;
	}

	$this->default_headers    = $_wp_default_headers;
	$template_directory_uri   = get_template_directory_uri();
	$stylesheet_directory_uri = get_stylesheet_directory_uri();

	foreach ( array_keys( $this->default_headers ) as $header ) {
		$this->default_headers[ $header ]['url'] = sprintf(
			$this->default_headers[ $header ]['url'],
			$template_directory_uri,
			$stylesheet_directory_uri
		);

		$this->default_headers[ $header ]['thumbnail_url'] = sprintf(
			$this->default_headers[ $header ]['thumbnail_url'],
			$template_directory_uri,
			$stylesheet_directory_uri
		);
	}
}