[wp-trac] [WordPress Trac] #50801: A filter for wp_get_attachment_image() html output

WordPress Trac noreply at wordpress.org
Tue Oct 20 13:19:41 UTC 2020


#50801: A filter for wp_get_attachment_image() html output
-------------------------------------------------+-------------------------
 Reporter:  prionkor                             |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.6
Component:  Media                                |     Version:  5.4.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note commit                                    |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * keywords:  has-patch has-unit-tests needs-dev-note => has-patch has-unit-
     tests needs-dev-note commit


Comment:

 The new approach looks good. My only suggestion is to remove the added
 `$attachment = ''` as it's no longer used outside of the `if` block or by
 the new filter.

 {{{#!php
 <?php
 function wp_get_attachment_image( $attachment_id, $size = 'thumbnail',
 $icon = false, $attr = '' ) {
         $attachment = '';
 }}}

 But this can be done when committing this patch.

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


More information about the wp-trac mailing list