Ticket #46124: 46124.2.patch
File 46124.2.patch, 1.1 KB (added by , 5 years ago) |
---|
-
src/wp-includes/theme.php
1108 1108 $width = absint( $header->width ); 1109 1109 $height = absint( $header->height ); 1110 1110 1111 if ( ! empty( $header->alt_text ) ) { 1112 $image_alt = $header->alt_text; 1113 } elseif ( ! empty( $header->attachment_id ) ) { 1114 $image_alt = get_post_meta( $header->attachment_id, '_wp_attachment_image_alt', true ); 1115 } else { 1116 $image_alt = ""; 1117 } 1118 1111 1119 $attr = wp_parse_args( 1112 1120 $attr, 1113 1121 array( … … 1114 1122 'src' => $header->url, 1115 1123 'width' => $width, 1116 1124 'height' => $height, 1117 'alt' => get_bloginfo( 'name' ),1125 'alt' => $image_alt, 1118 1126 ) 1119 1127 ); 1120 1128 … … 1356 1364 'width' => get_theme_support( 'custom-header', 'width' ), 1357 1365 'height' => get_theme_support( 'custom-header', 'height' ), 1358 1366 'video' => get_theme_support( 'custom-header', 'video' ), 1367 'alt_text' => '', 1359 1368 ); 1360 1369 return (object) wp_parse_args( $data, $default ); 1361 1370 }