_get_random_header_data example

return $_wp_random_header;
}

/** * Gets random header image URL from registered images in theme. * * @since 3.2.0 * * @return string Path to header image. */
function get_random_header_image() {
    $random_image = _get_random_header_data();

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

    return $random_image->url;
}

/** * Checks if random header image is in use. * * Always true if user expressly chooses the option in Appearance > Header. * Also true if theme has multiple header images registered, no specific header image * is chosen, and theme turns on random headers with add_theme_support(). * * @since 3.2.0 * * @param string $type The random pool to use. Possible values include 'any', * 'default', 'uploaded'. Default 'any'. * @return bool */
Home | Imprint | This part of the site doesn't use cookies.