get_random_header_image
Get random header image url from registered images in theme.
Description
(string) get_random_header_image();
Returns (string)
Path to header image
Usage
if ( !function_exists( 'get_random_header_image' ) ) { require_once ABSPATH . WPINC . '/theme.php'; } // NOTICE! Understand what this does before running. $result = get_random_header_image();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/theme.php
- function get_random_header_image() {
- $random_image = _get_random_header_data();
- if ( empty( $random_image->url ) )
- return '';
- return $random_image->url;
- }