[wp-trac] [WordPress Trac] #18623: Allow themes to pre-register multiple custom backgrounds

WordPress Trac wp-trac at lists.automattic.com
Tue Mar 13 12:07:44 UTC 2012


#18623: Allow themes to pre-register multiple custom backgrounds
--------------------------------------+------------------------------
 Reporter:  zamoose                   |       Owner:
     Type:  feature request           |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Themes                    |     Version:  3.3
 Severity:  minor                     |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+------------------------------
Changes (by kobenland):

 * keywords:  needs-patch => needs-patch dev-feedback


Comment:

 So I thought I might as well attach the patch and see how you guys like
 it.

 The first diff:
 I really didn't change functionality at all here. I just moved all the
 settings into callback functions for their settings fields functions. So
 it's just something I thought might help along.

 As for the second diff:
 I just added the possibility to choose from previously uploaded background
 images and refrained from supporting random backgrounds as that would add
 a lot of overhead and dublicate code.
 Let me know if this is something that ''really needs'' to be patched, too.
 This is what I did:

 * Changed the order of the settings to make it similar to the custom
 header screen:
  1. Preview
  1. Upload
  1. Image selection
  1. Remove button
  1. Reset button
  1. all the rest
 * Benefit would be less code (form markup, noces and nonce checking) and a
 more stringent user experience (as if I knew anthing about ''that'')
 * Dublicated the CSS code to make the image selection behave like the
 custom header selection. It probably would be a good idea to merge
 selectors, but I didn't want to impose on merging the documented sections
 within the file.
 * `get_uploaded_background_images()` behaves a little bit different than
 `get_uploaded_header_images()`. It ''really'' uses thumnail information
 (URL, height, width).

 I think that's all for now. Looking forward to feedback! :)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18623#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list