get_custom_header_markup() WordPress Function

The get_custom_header_markup() function is used to display the custom header markup. This function is used by the WordPress default themes to display the custom header image.

get_custom_header_markup() #

Retrieves the markup for a custom header.


Description

The container div will always be returned in the Customizer preview.


Top ↑

Return

(string) The markup for a custom header on success.


Top ↑

Source

File: wp-includes/theme.php

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


Top ↑

Changelog

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

Show More