W3cubDocs

/WordPress

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

Changelog

Version Description
4.7.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/has_custom_header