From 151e5ef9421e0ef8b017c66311a055251f269867 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 26 May 2023 08:41:42 +0200 Subject: [PATCH 1/9] Cover: Add aria-label to fixed and repeated backgrounds --- packages/block-library/src/cover/block.json | 3 -- .../block-library/src/cover/edit/index.js | 3 +- .../src/cover/edit/inspector-controls.js | 44 ++++++++----------- packages/block-library/src/cover/save.js | 3 +- 4 files changed, 23 insertions(+), 30 deletions(-) diff --git a/packages/block-library/src/cover/block.json b/packages/block-library/src/cover/block.json index f7e117add40658..fe20083239f3d1 100644 --- a/packages/block-library/src/cover/block.json +++ b/packages/block-library/src/cover/block.json @@ -19,9 +19,6 @@ }, "alt": { "type": "string", - "source": "attribute", - "selector": "img", - "attribute": "alt", "default": "" }, "hasParallax": { diff --git a/packages/block-library/src/cover/edit/index.js b/packages/block-library/src/cover/edit/index.js index cbb8ac4e4891b1..c0c324dd6dcaa5 100644 --- a/packages/block-library/src/cover/edit/index.js +++ b/packages/block-library/src/cover/edit/index.js @@ -380,7 +380,8 @@ function CoverEdit( { ) : (
) } - { ! useFeaturedImage && - url && - isImageBackground && - isImgElement && ( - - setAttributes( { alt: newAlt } ) - } - help={ - <> - - { __( - 'Describe the purpose of the image.' - ) } - -
+ { ! useFeaturedImage && url && ( + + setAttributes( { alt: newAlt } ) + } + help={ + <> + { __( - 'Leave empty if decorative.' + 'Describe the purpose of the image.' ) } - - } - /> - ) } + +
+ { __( 'Leave empty if decorative.' ) } + + } + /> + ) }