Make WordPress Core

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


Ignore:
Timestamp:
08/05/2012 10:38:41 PM (12 years ago)
Author:
helgatheviking
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20205, comment 15

    initial v1  
    33i'd agree that a wp_get_attachment_image_src filter should be inside the wp_get_attachment_image_src function, but that function is currently structured such that if you are getting the attachment_image for a non-image, you pretty much fail right away b/c if you don't get an image back from image_downsize(), you get kicked to looking for an icon.  and there's no way to return an image from an attachment's postmeta, b/c image_downsize() immediately returns false if the attachment itself isn't an image. 
    44
    5 i like your solution too though. it should be there, but for my use case, it is a little late and would be redundant.  but a filter for wp_get_attachment_image_src definitely gives the most control.  just a matter of where it should be.
     5i like your solution too though. it should be there, but for my use case, it is a little late and would be redundant.  but a filter for wp_get_attachment_image_src definitely gives the most control.  just a matter of where it should be.  it is definitely trickier in the wp_get_attachment_image_src function b/c there are places where a value could return