get_custom_header_markup()
Retrieve the markup for a custom header.
The container div will always be returned in the Customizer preview.
Uses: get_header_image_tag()
Used By: the_custom_header_markup()
No Hooks.
Return
String
. The markup for a custom header on success.
Usage
get_custom_header_markup();
Changelog
Since 4.7.0 | Introduced. |
Code of get_custom_header_markup() get custom header markup WP 5.9.3
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() ); }