W3cubDocs

/WordPress

get_header_image()

Retrieves header image for custom header.

Return

(string|false)

Source

File: wp-includes/theme.php

function get_header_image() {
	$url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) );

	if ( 'remove-header' === $url ) {
		return false;
	}

	if ( is_random_header_image() ) {
		$url = get_random_header_image();
	}

	return esc_url_raw( set_url_scheme( $url ) );
}

Changelog

Version Description
2.1.0 Introduced.

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