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.
Built from https://develop.svn.wordpress.org/trunk@49949


git-svn-id: http://core.svn.wordpress.org/trunk@49648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-01-08 16:55:07 +00:00
parent a756900974
commit 47c146ac27
2 changed files with 2 additions and 2 deletions

View File

@ -1081,7 +1081,7 @@ function get_custom_logo( $blog_id = 0 ) {
} elseif ( is_customize_preview() ) {
// If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
$html = sprintf(
'<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
'<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo" alt="" /></a>',
esc_url( home_url( '/' ) )
);
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-49948';
$wp_version = '5.7-alpha-49949';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.