WordPress.org

Make WordPress Core

Ticket #11809: fix_alt_on_image_element.patch

File fix_alt_on_image_element.patch, 556 bytes (added by doug, 5 years ago)

Change alt attribute to alternate text supplied by user rather than caption

  • wp-includes/media.php

     
    561561                $default_attr = array( 
    562562                        'src'   => $src, 
    563563                        'class' => "attachment-$size", 
    564                         'alt'   => trim(strip_tags( $attachment->post_excerpt )), 
     564                        'alt'   => trim(strip_tags( get_post_meta($attachment_id,'_wp_attachment_image_alt',true) )), 
    565565                        'title' => trim(strip_tags( $attachment->post_title )), 
    566566                ); 
    567567                $attr = wp_parse_args($attr, $default_attr);