mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 01:00:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@32998 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1209,10 +1209,13 @@ function get_uploaded_header_images() {
|
||||
$url = esc_url_raw( wp_get_attachment_url( $header->ID ) );
|
||||
$header_data = wp_get_attachment_metadata( $header->ID );
|
||||
$header_index = basename($url);
|
||||
|
||||
$header_images[$header_index] = array();
|
||||
$header_images[$header_index]['attachment_id'] = $header->ID;
|
||||
$header_images[$header_index]['attachment_id'] = $header->ID;
|
||||
$header_images[$header_index]['url'] = $url;
|
||||
$header_images[$header_index]['thumbnail_url'] = $url;
|
||||
$header_images[$header_index]['thumbnail_url'] = $url;
|
||||
$header_images[$header_index]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true );
|
||||
|
||||
if ( isset( $header_data['width'] ) )
|
||||
$header_images[$header_index]['width'] = $header_data['width'];
|
||||
if ( isset( $header_data['height'] ) )
|
||||
|
||||
Reference in New Issue
Block a user