WordPress.org

Make WordPress Core

Changeset 49949


Ignore:
Timestamp:
01/08/2021 04:53:50 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Accessibility: Customize: Add an empty alt attribute to the <img> tag used as a hidden placeholder in the Customizer preview when no logo is chosen.

Per accessibility best practices, it is recommended that all HTML <img> elements have an alt attribute. Any decorative images should have an empty alt attribute (alt="").

Props laxman-prajapati, sabernhardt, audrasjb.
Fixes #51846.

File:
1 edited

Legend:

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

    r49597 r49949  
    10821082        // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
    10831083        $html = sprintf(
    1084             '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
     1084            '<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo" alt="" /></a>',
    10851085            esc_url( home_url( '/' ) )
    10861086        );
Note: See TracChangeset for help on using the changeset viewer.