On this page
get_custom_header_markup(): string
Retrieves the markup for a custom header.
Description
The container div will always be returned in the Customizer preview.
Return
string The markup for a custom header on success.
Source
File: wp-includes/theme.php. View all references
function get_custom_header_markup() {
if ( ! has_custom_header() && ! is_customize_preview() ) {
return '';
}
return sprintf(
'<div id="wp-custom-header" class="wp-custom-header">%s</div>',
get_header_image_tag()
);
}
Related
Uses
| Uses | Description |
|---|---|
| has_custom_header() wp-includes/theme.php | Checks whether a custom header is set or not. |
| get_header_image_tag() wp-includes/theme.php | Creates image tag markup for a custom header image. |
| is_customize_preview() wp-includes/theme.php | Whether the site is being previewed in the Customizer. |
Used By
| Used By | Description |
|---|---|
| the_custom_header_markup() wp-includes/theme.php | Prints the markup for a custom header. |
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_custom_header_markup