Add aria-label to link settings popup and input block settings


For accessbility purpose, aria-label attribute should directly be available when setting links, so that we don’t have to create it manually in block’s attributes tab.

(Use case: non readable links like home logo link, image/icon/social links, etc.)

NOTE: Title attribute is one way to explicit non-readable-text links, but it also shows a tooltip on hover, which is not always wanted.

And guess what, there is a free spot for it :wink:


That didn’t age well :see_no_evil:

Not sure if it makes sense, but how about the option too manage all attributes from the link modal?
Something that syncs with the advanced tabs’ option?

Adding/removing attributes, like we are used to from several sections inside the block inspector?

Some attributes might make more sense to one and are used more frequently than someone else would do.

A downside would be the extra clicks, but maybe there is something to get around.
Just a something I wanted quickly share that I had in mind, as I often find myself inside the attributes tab again when links are involved.

EDIT: Included input block into feature request

What is the current workaround for this, adding something in the attributes tab under the advanced tab? And if so, what to add there if the area label should be e.g. “homepage”?

Yep, you want to add it under Advanced > Attributes.
It’s not a workaround, it’s the intended way to do that.
The feature request is only about a contextual shortcut.

1 Like

Yeah, thought that way, and tried it that way, but still that aria-label input seems not be recognized…the only thing I was unsure, is, is the name to be set as “aria-label” or as “data-cc-aria-label” as one might expect from the placeholder settings.

could it be that attributes setting are not working, if template part is placed via a fragment? For “normal” template parts (e.g. the footer) it is working

Sure, can’t rule out, as I didn’t check myself.

In case everything works fine but you can’t find the attribute in the DOM on frontend, just open a bug report, so this can be investigated.

sorry, confused myself, all fine, is working!