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-admin/custom-header.php

    r32974 r32998  
    280280            $header_url = $header['url'];
    281281            $header_desc = empty( $header['description'] ) ? '' : $header['description'];
     282            $header_alt_text = empty( $header['alt_text'] ) ? $header_desc : $header['alt_text'];
    282283            echo '<div class="default-header">';
    283284            echo '<label><input name="default-header" type="radio" value="' . esc_attr( $header_key ) . '" ' . checked( $header_url, get_theme_mod( 'header_image' ), false ) . ' />';
     
    285286            if ( !empty( $header['attachment_id'] ) )
    286287                $width = ' width="230"';
    287             echo '<img src="' . set_url_scheme( $header_thumbnail ) . '" alt="' . esc_attr( $header_desc ) .'" title="' . esc_attr( $header_desc ) . '"' . $width . ' /></label>';
     288            echo '<img src="' . set_url_scheme( $header_thumbnail ) . '" alt="' . esc_attr( $header_alt_text ) .'" title="' . esc_attr( $header_desc ) . '"' . $width . ' /></label>';
    288289            echo '</div>';
    289290        }
Note: See TracChangeset for help on using the changeset viewer.