Title: WP_Theme::markup_header
Published: April 25, 2014
Last modified: April 28, 2025

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Marks up a theme header.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#parameters)󠁿

 `$header`stringrequired

Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.

`$value`string|arrayrequired

Value to mark up. An array for Tags header, string otherwise.

`$translate`stringrequired

Whether the header has been translated.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#return)󠁿

 string Value, marked up.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#source)󠁿

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

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-theme.php#L1008)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-theme.php#L1008-L1039)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_get_list_item_separator()](https://developer.wordpress.org/reference/functions/wp_get_list_item_separator/)`wp-includes/l10n.php` |

Retrieves the list item separator based on the locale.

  | 
| [wptexturize()](https://developer.wordpress.org/reference/functions/wptexturize/)`wp-includes/formatting.php` |

Replaces common plain text characters with formatted entities.

  | 
| [WP_Theme::get_stylesheet()](https://developer.wordpress.org/reference/classes/wp_theme/get_stylesheet/)`wp-includes/class-wp-theme.php` |

Returns the directory name of the theme’s “stylesheet” files, inside the theme root.

  | 
| [WP_Theme::get()](https://developer.wordpress.org/reference/classes/wp_theme/get/)`wp-includes/class-wp-theme.php` |

Gets a raw, unformatted theme header.

  | 
| [WP_Theme::display()](https://developer.wordpress.org/reference/classes/wp_theme/display/)`wp-includes/class-wp-theme.php` |

Gets a theme header, formatted and translated for display.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [esc_url()](https://developer.wordpress.org/reference/functions/esc_url/)`wp-includes/formatting.php` |

Checks and cleans a URL.

  |

[Show 3 more](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#)

| Used by | Description | 
| [WP_Theme::display()](https://developer.wordpress.org/reference/classes/wp_theme/display/)`wp-includes/class-wp-theme.php` |

Gets a theme header, formatted and translated for display.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_theme/markup_header/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_theme%2Fmarkup_header%2F)
before being able to contribute a note or feedback.