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
$headers
is 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
.
View all references
function register_default_headers( $headers ) {
global $_wp_default_headers;
$_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers );
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example
Edit the file functions.php inside your theme and add the following code, replacing the images and descriptions where required.
The %s is replaced with your themes path, so place the images in your theme directory.
Note: The code above was lifted from the TwentyEleven theme files.
To reference a image in a child theme (ie in the stylesheet directory), use %2$s instead of %s.