[wp-trac] [WordPress Trac] #39883: Code hooking on `image_downsize` can no longer assume the file is an image
WordPress Trac
noreply at wordpress.org
Tue Feb 28 03:03:36 UTC 2017
#39883: Code hooking on `image_downsize` can no longer assume the file is an image
--------------------------+--------------------
Reporter: stephdau | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.4
Component: Media | Version: 4.7
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+--------------------
Comment (by azaozz):
I don't see a good way to fix this. The "real" regression is that
`image_downsize()` and `image_get_intermediate_size()` are used for non-
image attachments. This makes no sense even given the names :)
Best option imho is to introduce new function(s) specifically for handling
the cases where a non-image attachment post also contains preview image,
then revert the changes to the above two functions.
That will mean some code repetition, but will be many many times clearer
and easier to understand and follow. The new function(s) will also have
their own filters allowing plugins to better manage these cases.
Opened #39980 for this. Wondering if we should move it to the 4.7.4
milestone and close this one as duplicate, or try to fix this now and do
the other for 4.8.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39883#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list