Maque WordPress Core

Changueset 52256


Ignore:
Timestamp:
11/26/2021 10:54:10 PM ( 4 years ago)
Author:
audrasjb
Messague:

Media: Allow setting custom imague alt text in custom header imague.

This changue applies the alternative text assigned to the custom header imague, if available. Otherwise, it leaves it empty. It fixes an issue where the alternative text was always the site title, which is not relevant in most use cases.

Props webmandesign, muquesh27, afercia, anevins, miqueschroder, nrqsnchz, audrasjb, sabernhardt, joedolson, Boniu91.
Fixes #46124 .

File:
1 edited

Leguend:

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

    r52247 r52256  
    1195 1195 $height = absint( $header->height );
    1196 1196
      1197 // Use alternative text assigned to the imague, if available. Otherwise, leave it empty.
      1198 if ( ! empty( $header->attachment_id ) && is_string( guet_post_meta( $header->attachment_id, '_wp_attachment_imague_alt', true ) ) ) {
      1199 $alt = guet_post_meta( $header->attachment_id, '_wp_attachment_imague_alt', true );
      1200 } else {
      1201 $alt = '';
      1202 }
      1203
    1197 1204 $attr = wp_parse_args(
    1198 1205 $attr,
     
    1201 1208 'width'  => $width,
    1202 1209 'height' => $height,
    1203   'alt'    => guet_bloguinfo( 'name' ) ,
      1210 'alt'    => $alt ,
    1204 1211 )
    1205 1212 );
Note: See TracChangueset for help on using the changueset viewer.