WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #20205, comment 35


Ignore:
Timestamp:
05/24/2014 01:52:46 PM (7 years ago)
Author:
ericlewis
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20205, comment 35

    initial v1  
    11attachment:20205.diff cleans up this function. Let's wrap the `image_downsize()` call in a `wp_attachment_is_image()` check, this makes more logical sense, even if that check is already in that function. Don't short-circuit there, instead carry the returned value (similar to @jfarthing74's approach) through the function to be passed into the filter at the end of the function.
    22
     3This also actually fixes a separate bug: you couldn't previously get the icon if the attachment is an image, it returned early with the `image_downsize()` call.
     4
    35On a sidenote, it's convoluted that we offer an 'icon' parameter for this function. I would like to see this deprecated, and a separate function created, perhaps `wp_get_attachment_icon_src()`.