Make WordPress Core


Ignore:
Timestamp:
06/29/2015 09:31:21 PM (9 years ago)
Author:
obenland
Message:

Provide alt text for uploaded header images.

The custom header screen will use it rather then the description,
if an alt text is set.

Props francoeurdavid, voldemortensen, valendesigns.
Fixes #27959.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r32964 r32998  
    12101210        $header_data = wp_get_attachment_metadata( $header->ID );
    12111211        $header_index = basename($url);
     1212
    12121213        $header_images[$header_index] = array();
    1213         $header_images[$header_index]['attachment_id'] =  $header->ID;
     1214        $header_images[$header_index]['attachment_id'] = $header->ID;
    12141215        $header_images[$header_index]['url'] =  $url;
    1215         $header_images[$header_index]['thumbnail_url'] =  $url;
     1216        $header_images[$header_index]['thumbnail_url'] = $url;
     1217        $header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
     1218
    12161219        if ( isset( $header_data['width'] ) )
    12171220            $header_images[$header_index]['width'] = $header_data['width'];
Note: See TracChangeset for help on using the changeset viewer.