See TwentyEleven to get the idea: it uses register_default_headers()
to add new header images. In your plugin or theme just add:
add_action( 'after_setup_theme', 'wpse_42529_add_header_images' );
function wpse_42529_add_header_images()
{
register_default_headers(
array(
'a_short_name' => array(
'url' => '%s/images/headers/a_short_name.jpg',
'thumbnail_url' => '%s/images/headers/a_short_name-thumbnail.jpg',
'description' => __( 'Wheel', 'twentyeleven' )
),
'another_image' => array(
'url' => '%s/images/headers/another_image.jpg',
'thumbnail_url' => '%s/images/headers/another_image-thumbnail.jpg',
'description' => __( 'Shore', 'twentyeleven' )
)
)
);
}
The %s
will be replaced by the stylesheet directory URI. You don’t have to use that. You can use plugin_dir_url( __FILE__ )
instead of %s
.
You can call register_default_headers()
multiple times, it works just like a add_default_headers()
.
Update
To add a new page for custom images similar to the custom header you should extend the class Custom_Image_Header
in a theme options page. But this very class is under reconstruction right now – it is almost impossible to write future proof code based on this. I would wait for WordPress 3.4 and build the code on a more stable base.
Well … I will do that, because I need it probably too.
Another way: copy and modify the current class instead of extending it.