WordPress.org

Make WordPress Core

Ticket #20205: media.php.patch

File media.php.patch, 642 bytes (added by jfarthing84, 23 months ago)

Add a filter to wp_get_attachment_image_src() within wp_get_attachment_image().

  • wp-includes/media.php

     
    649649function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') { 
    650650 
    651651        $html = ''; 
    652         $image = wp_get_attachment_image_src($attachment_id, $size, $icon); 
     652        $image = apply_filters( 'wp_get_attachment_image_src', wp_get_attachment_image_src($attachment_id, $size, $icon), $attachment_id, $size, $icon ); 
    653653        if ( $image ) { 
    654654                list($src, $width, $height) = $image; 
    655655                $hwstring = image_hwstring($width, $height);