Accessibility: Themes: Only unlink custom logo on the home page if the theme declares support for that.

To accommodate for the change, the `custom-logo` theme feature now accepts the `unlink-homepage-logo` parameter.

If and when the logo is linked on the home page, the link has the `aria-current` attribute for better accessibility.

Follow-up to [48039], [48283].

Props sabernhardt, audrasjb, johnstonphilip, demetris.
Fixes #37011.

git-svn-id: https://develop.svn.wordpress.org/trunk@48749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-08-07 15:24:10 +00:00
parent def2425406
commit 54cba57fa6
2 changed files with 15 additions and 8 deletions

View File

@@ -2472,6 +2472,7 @@ function get_theme_starter_content() {
* @since 5.3.0 Formalized the existing and already documented `...$args` parameter
* by adding it to the function signature.
* @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default.
* @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'.
*
* @global array $_wp_theme_features
*
@@ -2538,11 +2539,12 @@ function add_theme_support( $feature, ...$args ) {
$args = array( 0 => array() );
}
$defaults = array(
'width' => null,
'height' => null,
'flex-width' => false,
'flex-height' => false,
'header-text' => '',
'width' => null,
'height' => null,
'flex-width' => false,
'flex-height' => false,
'header-text' => '',
'unlink-homepage-logo' => false,
);
$args[0] = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults );