Make WordPress Core


Ignore:
Timestamp:
04/04/2014 03:48:34 PM (11 years ago)
Author:
nacin
Message:

Header images: Accessibility and style improvements. Headers no longer jump around when chosen.

props mcsf, ehg.
see #21785.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/custom-header.php

    r27849 r27947  
    12731273        $header_images = get_uploaded_header_images();
    12741274        $timestamp_key = '_wp_attachment_custom_header_last_used_' . get_stylesheet();
     1275        $alt_text_key = '_wp_attachment_image_alt';
    12751276
    12761277        foreach ( $header_images as &$header_image ) {
    1277             $header_image['timestamp'] = get_post_meta( $header_image['attachment_id'], $timestamp_key, true );
     1278            $header_meta = get_post_meta( $header_image['attachment_id'] );
     1279            $header_image['timestamp'] = isset( $header_meta[ $timestamp_key ] ) ? $header_meta[ $timestamp_key ] : '';
     1280            $header_image['alt_text'] = isset( $header_meta[ $alt_text_key ] ) ? $header_meta[ $alt_text_key ] : '';
    12781281        }
    12791282
Note: See TracChangeset for help on using the changeset viewer.