[wp-trac] [WordPress Trac] #27399: Filter the HTML output of wp_get_attachment_image

WordPress Trac noreply at wordpress.org
Thu Nov 10 18:08:40 UTC 2016


#27399: Filter the HTML output of wp_get_attachment_image
-----------------------------+-----------------------
 Reporter:  fgirardey        |       Owner:
     Type:  enhancement      |      Status:  reopened
 Priority:  normal           |   Milestone:
Component:  Media            |     Version:  3.8.1
 Severity:  normal           |  Resolution:
 Keywords:  has-patch close  |     Focuses:
-----------------------------+-----------------------
Changes (by markoheijnen):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 Reopening based on the feedback of @spacedmonkey as I do agree with
 him.`wp_get_attachment_image()` is the only location where you could
 modify the output to add the picture element. Maybe filters as
 `post_thumbnail_html` would help but it would miss some instances.

 If the purpose really is to output an `img` element then it would mean
 that we need an additional function that is between
 `wp_get_attachment_image()` and functions like `the_post_thumbnail()`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27399#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list