get_random_header_image()WP 3.2.0

Gets random header image URL from registered images in theme.

No Hooks.

Return

String. Path to header image.

Usage

get_random_header_image();

Changelog

Since 3.2.0 Introduced.

get_random_header_image() code WP 6.5.2

function get_random_header_image() {
	$random_image = _get_random_header_data();

	if ( empty( $random_image->url ) ) {
		return '';
	}

	return $random_image->url;
}