Alert: 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.

WP_Theme::markup_header() WordPress Method

The WP_Theme::markup_header() method is used to generate the opening markup for a Wordpress theme. This includes the opening tag, the tag, and the tag. The information in the tag is used by the browser to load the correct CSS and JavaScript files for the theme. The tag contains the content of the page.

WP_Theme::markup_header( string $header, string|array $value, string $translate ) #

Marks up a theme header.


Parameters

$header

(string)(Required)Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.

$value

(string|array)(Required)Value to mark up. An array for Tags header, string otherwise.

$translate

(string)(Required)Whether the header has been translated.


Top ↑

Return

(string) Value, marked up.


Top ↑

Source

File: wp-includes/class-wp-theme.php

	private function markup_header( $header, $value, $translate ) {
		switch ( $header ) {
			case 'Name':
				if ( empty( $value ) ) {
					$value = esc_html( $this->get_stylesheet() );
				}
				break;
			case 'Description':
				$value = wptexturize( $value );
				break;
			case 'Author':
				if ( $this->get( 'AuthorURI' ) ) {
					$value = sprintf( '<a href="%1$s">%2$s</a>', $this->display( 'AuthorURI', true, $translate ), $value );
				} elseif ( ! $value ) {
					$value = __( 'Anonymous' );
				}
				break;
			case 'Tags':
				static $comma = null;
				if ( ! isset( $comma ) ) {
					$comma = wp_get_list_item_separator();
				}
				$value = implode( $comma, $value );
				break;
			case 'ThemeURI':
			case 'AuthorURI':
				$value = esc_url( $value );
				break;
		}

		return $value;
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.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.