Opened 6 years ago
Closed 6 years ago
#39231 closed defect (bug) (fixed)
Allow the pdf fallback_intermediate_image_sizes filter to process add_image_size() sizes.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Media | Keywords: | has-patch has-unit-tests fixed-major |
Focuses: | Cc: |
Description
The fallback_intermediate_image_sizes
filter added in #38594 only works for default get_option
sizes and not user-defined add_image_size()
sizes, unlike the intermediate_image_sizes_advanced
filter. It'd be more useful if it could work with user-defined sizes also. My particular use case is adding a plugin-defined list thumbnail size, smaller than the default thumbnail size.
The following patch just copies the (before) logic used for intermediate_image_sizes_advanced
to the (after) logic of fallback_intermediate_image_sizes
. It includes a unittest.
Attachments (2)
Change History (10)
#1
@
6 years ago
- Keywords has-patch has-unit-tests added
- Milestone changed from Awaiting Review to 4.7.1
- Owner set to joemcgill
- Status changed from new to accepted
Good catch @gitlost. You're correct that the filter isn't very useful for custom sizes if we don't take steps to check for them later. For the test, I would prefer a simple check that the filter was run, rather than making the filter conditional on the existence of the large
size, in case that were to change later. What would you think of 39231.diff?
Process add_image_sizes() also.