Opened 22 months ago
Last modified 12 months ago
#18623 new feature request
Allow themes to pre-register multiple custom backgrounds
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Themes | Version: | 3.3 |
| Severity: | minor | Keywords: | needs-patch dev-feedback |
| Cc: | travis@…, Marco_Teethgrinder, edward.caissie@…, obenland@…, sabreuse@… |
Description
We currently have the ability to register multiple header images and to randomly cycle through them or allow users to select one and stick with it. Is there anything that would prevent a similar implementation for custom backgrounds?
Attachments (2)
Change History (14)
comment:1
zamoose
— 22 months ago
- Summary changed from Allow for themes to pre-register multiple custom backgrounds to Allow themes to pre-register multiple custom backgrounds
comment:3
Marco_Teethgrinder
— 22 months ago
- Cc Marco_Teethgrinder added
comment:6
zamoose
— 17 months ago
Any interest in trying to get this into 3.4? I'd love to see it there.
comment:8
in reply to:
↑ 5
kobenland
— 15 months ago
- Cc obenland@… added
Replying to nacin:
+1. Feature parity here would be great. Random backgrounds probably aren't a big headline feature though.
When you say feature parity, would that also include Themes registering their own background-images?
Would refactoring of /wp-admin/custom-background.php make sense as a first step?
I created a patch, where I took most of the stuff out of admin_page() and made it nice and clean with the Settings API. This way it would be easier to add more settings later.
comment:9
kobenland
— 15 months ago
- Keywords dev-feedback added
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:
- Preview
- Upload
- Image selection
- Remove button
- Reset button
- 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! :)
comment:10
zamoose
— 15 months ago
Please issue your .diffs path-relative -- in other words, diff while in the root of your WP install, instead of from the root of your Mac.
kobenland
— 15 months ago
Refactoring of custom-background.php. I'm just throwing it out there, Feedback more than welcome!
kobenland
— 15 months ago
Makes uploaded background images reusable - like custom headers sans the randomness. Based on step-1.diff
comment:11
kobenland
— 15 months ago
Updated. Thanks for your feedback!
comment:12
sabreuse
— 12 months ago
- Cc sabreuse@… added
+1. Feature parity here would be great. Random backgrounds probably aren't a big headline feature though.
The way we allow for remove_theme_support('custom-header-uploads') would be a nice enhancement as well.
This will miss the boat for 3.3 without a patch soon.