WordPress.org

Make WordPress Core

Ticket #52387: 52387.diff

File 52387.diff, 572 bytes (added by joedolson, 12 months ago)

Pass alt attribute with img title.

  • src/wp-includes/media.php

     
    34243424
    34253425                if ( isset( $attachments[ $k ] ) ) {
    34263426                        $attachment_id = $attachments[ $k ]->ID;
    3427                         $output        = wp_get_attachment_link( $attachment_id, $size, true, false, $text );
     3427                        $attr          = array( 'alt' => get_the_title( $attachment_id ) );
     3428                        $output        = wp_get_attachment_link( $attachment_id, $size, true, false, $text, $attr );
    34283429                }
    34293430        }
    34303431