On this page
get_random_header_image(): string
Gets random header image URL from registered images in theme.
Return
string Path to header image.
Source
File: wp-includes/theme.php. View all references
function get_random_header_image() {
$random_image = _get_random_header_data();
if ( empty( $random_image->url ) ) {
return '';
}
return $random_image->url;
}
Related
Uses
| Uses | Description |
|---|---|
| _get_random_header_data() wp-includes/theme.php | Gets random header image data from registered images in theme. |
Used By
| Used By | Description |
|---|---|
| get_header_image() wp-includes/theme.php | Retrieves header image for custom header. |
| is_random_header_image() wp-includes/theme.php | Checks if random header image is in use. |
Changelog
| Version | Description |
|---|---|
| 3.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_random_header_image