Custom_Image_Header::process_default_headers() WordPress Method

The Custom_Image_Header::process_default_headers() method is used to process the default headers for a WordPress site. This method is called by the WordPress core when a new header image is uploaded to the site.

Custom_Image_Header::process_default_headers() #

Process the default headers


Source

File: wp-admin/includes/class-custom-image-header.php

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


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.