[wp-trac] [WordPress Trac] #17240: Themes: Add ability to show a random header image

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 26 04:26:51 UTC 2011


#17240: Themes: Add ability to show a random header image
-----------------------------+-----------------------------
 Reporter:  lancewillett     |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Themes           |    Version:
 Severity:  normal           |   Keywords:  needs-patch
-----------------------------+-----------------------------
 '''Goal:'''

 Add the option to load a different header image with each page load.

 (Note: this is ''not'' intended to be a "random image rotator" that
 changes the image without a page load.)

 '''Admin'''

 If a theme has multiple headers defined with
 {{{register_default_headers()}}}, and the theme chooses to enable this
 feature, show a new option in checkbox in Appearance > Header that turns
 on the randomization.

 Make the new option the first (or last) radio option in the form so that
 you choose not to use a single image, but to show any of them on any page
 or post. See attached screenshot "random-option-admin-example.png" for a
 visual example.

 '''Theme Support'''

 1. Themes wishing to use this feature should define multiple header images
 with {{{register_default_headers()}}}.
 2. Then turn it on with {{{define( 'HEADER_IMAGE', 'random' )}}} to set it
 on by default for the theme. If set to "random" and a user visits
 Appearance > Header the "Show Random Image" option should be selected
 instead of one of the images.

 When {{{get_header_image()}}} is called from a template, instead of
 returning the value in "header_image" theme_mod, the function should pick
 a random node from the global {{{$_wp_default_headers}}} variable and
 return its URL instead.

 '''Reference:'''

  * This was originally brought up in #14151.
  * A further idea is to allow end users to rotate multiple header images
 that they've uploaded. See #15100 for the general idea.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17240>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list