Opened 7 years ago
Closed 6 years ago
#42745 closed enhancement (fixed)
Pass $attachment_id to intermediate_image_sizes_advanced filter
Reported by: | robbie505 | Owned by: | johnbillion |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Media | Keywords: | |
Focuses: | Cc: |
Description
I'm requesting that the following patch be added, which simply passes the $attachment_id of the image to be used for the new post thumbnail sizes to the intermediate_image_sizes_advanced filter in the wp_generate_attachment_metadata function.
The purpose of this is for unsetting intermediate sizes based on conditions for specific images. For example, I have a need for creating large private galleries with thumbnails-only. So to save hosting storage, I could unset several image-sizes in the $sizes array, depending on a post_meta of the $attachment_id.
Attachments (4)
Change History (24)
#4
@
7 years ago
Oops, that first patch was generated by git without the --no-prefix
flag so it won't play nicely with SVN. Uploaded a new patch that should work better. Sorry!
#5
@
7 years ago
Yes @drywallbmb that’s exactly what I was looking for!
I’m new to this.. Where do we go from here?
#6
@
7 years ago
@robbie505 Not sure, TBH. I've developed a bunch of plugins but never contributed to core and thought this ticket would be a reasonable entry point. I think now someone like @johnbillion gets to weigh in...?
#7
@
7 years ago
- Milestone changed from Awaiting Review to 5.0
- Owner set to johnbillion
- Status changed from new to reviewing
@drywallbmb Patch looks good! The only thing that needs adding is a @since
entry for the parameter. Example: https://core.trac.wordpress.org/browser/tags/4.9.1/src/wp-admin/includes/media.php?marks=2915#L2907
#8
@
7 years ago
@johnbillion Oh bother! Thanks for catching that.
New patch provided, though I'm not 100% sure I did it right. Specifically, I'm not sure if I should have done 5.0
, 5.0.0
, or some magic string that will get auto-populated with the release version when it's finally committed to core.
#9
@
7 years ago
Closer look at existing codebase leads me to the conclusion it should read 5.0.0
, updating the patch to reflect that.
#13
@
6 years ago
- Keywords good-first-bug removed
- Milestone changed from 5.0 to 5.0.1
- Resolution fixed deleted
- Status changed from closed to reopened
#16
@
6 years ago
Hello,
@johnbillion you closed the ticket as fixed in [42407] (which seems to be right) and you reopened it later. I can't figure why but there is probably a good reason :) What is needed to see this ticket land in 5.0.3?
#17
@
6 years ago
This was fixed in trunk but didn't make it into 5.0. It should be able to go into a minor release soon.
Thanks for the ticket, @robbie505, and welcome to WordPress Trac.
If you're interested in [submitting a patch https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/], that would be a big help!