On this page
WP_Theme::display( string $header, bool $markup = true, bool $translate = true ): string|array|false
Gets a theme header, formatted and translated for display.
Parameters
$headerstring Required-
Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags.
$markupbool Optional-
Whether to mark up the header. Defaults to true.
Default:
true $translatebool Optional-
Whether to translate the header. Defaults to true.
Default:
true
Return
string|array|false Processed header. An array for Tags if $markup is false, string otherwise.
False on failure.
Source
File: wp-includes/class-wp-theme.php. View all references
public function display( $header, $markup = true, $translate = true ) {
$value = $this->get( $header );
if ( false === $value ) {
return false;
}
if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) {
$translate = false;
}
if ( $translate ) {
$value = $this->translate_header( $header, $value );
}
if ( $markup ) {
$value = $this->markup_header( $header, $value, $translate );
}
return $value;
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Theme::load_textdomain() wp-includes/class-wp-theme.php | Loads the theme’s textdomain. |
| WP_Theme::translate_header() wp-includes/class-wp-theme.php | Translates a theme header. |
| WP_Theme::markup_header() wp-includes/class-wp-theme.php | Marks up a theme header. |
| WP_Theme::get() wp-includes/class-wp-theme.php | Gets a raw, unformatted theme header. |
Used By
| Used By | Description |
|---|---|
| WP_Theme::markup_header() wp-includes/class-wp-theme.php | Marks up a theme header. |
| WP_Theme::__toString() wp-includes/class-wp-theme.php | When converting the object to a string, the theme name is returned. |
| WP_Theme::__get() wp-includes/class-wp-theme.php | __get() magic method for properties formerly returned by current_theme_info() |
| WP_Theme::offsetGet() wp-includes/class-wp-theme.php |
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_theme/display