register_default_headers() WordPress Function
The register_default_headers() function is used to register default headers for a theme. This function should be called in the theme's functions.php file. The function takes an array of header images as its only parameter. The array should be keyed by the header image file name, and the value should be an array of header image data. The header image data array can contain the following keys: 'url', 'thumbnail_url', and 'description'.
register_default_headers( array $headers ) #
Registers a selection of default headers to be displayed by the custom header admin UI.
Parameters
- $headers
(array)(Required)Array of headers keyed by a string ID. The IDs point to arrays containing 'url', 'thumbnail_url', and 'description' keys.
More Information
- The parameter
$headersis required to merge with already registered headers. - This function is needed in order to use custom headers. The header image(s) must first be registered before using it.
Source
File: wp-includes/theme.php
function register_default_headers( $headers ) {
global $_wp_default_headers;
$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |