#18520 closed enhancement (fixed)
Allow addition of image sizes in Thickbox via filter
Reported by: | alexkingorg | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
Plugins and themes can register new image sizes, but these don't appear in the media lightbox (#15668).
The right thing to do might be to add a param to add_image_size() that tells it if the image size should be included in the media lightbox (because you definitely don't want to auto-add them all). However, this would be a rather invasive change which would alter the data in global $_wp_additional_image_sizes and may introduce bugs.
Perhaps an easier approach is just to add a hook (patch attached).
If there is consensus that an additional parameter to add_image_size() and automatically displaying those sizes in the media lightbox, I can put together a patch for that too.
Attachments (3)
Change History (10)
#1
@
13 years ago
Once we allow additional sizes to be filtered in, the UI needs a little revision as well. The alignment options need to be moved flush left (to match the rest of the fields) and the different sizes need to be presented in a vertical list instead of floated. Here are screenshots for demonstration purposes:
- Current, with standard sizes
- Current, with additional sizes filtered in
- Proposed, with standard sizes
- Proposed, with additional sizes filtered in
We trade a touch of vertical hight for the default case to be able to better accomodate customization. A reasonable trade IMO.
I've attached a patch that includes the CSS changes needed for this (along with the filter addition).
#2
@
13 years ago
At some point, that lightbox starts getting too large. I have no problem with allowing additional sizes in there, but maybe a different UI idea is needed there. What happens when a theme puts in like 15 image sizes (and don't think they won't).
#3
@
13 years ago
- Owner set to azaozz
- Status changed from new to reviewing
Agree that adding a filter on the selectable image sizes seems the better option. We are attempting to change the layout of the Media Library popup and do away with Thickbox but will always need plugins control on the image sizes available for insertion into the post by the user.
@Otto42 yes, I'm sure some plugins will do some crazy things in there, but I've seen crazy things done with the media library popup right now too :)
#4
@
13 years ago
My goal is to allow users to easily use the sizes that the themes/plugins create that will best match their display needs. I'm not trying to favor any specific implementation, this just seemed like the lowest hanging fruit.
Otto, you did see the screenshots where I reconfigured the UI a little to allow for more sizes to be listed in a slightly cleaner way?
Getting rid of the pop-up in favor of a better media integration sounds great to me.
Allow image sizes to be filtered into media lightbox.