has_custom_header() WordPress Function
The has_custom_header() function in WordPress allows you to check if a custom header image has been set for the current theme. This can be useful if you want to conditionally display different content on your website based on whether or not a custom header image has been set.
has_custom_header() #
Checks whether a custom header is set or not.
Return
(bool) True if a custom header is set. False if not.
Source
File: wp-includes/theme.php
function has_custom_header() {
if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) {
return true;
}
return false;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.7.0 | Introduced. |