Make WordPress Core

Opened 7 weeks ago

Last modified 6 weeks ago

#64932 accepted defect (bug)

WP admin - Subpages in the list of pages are not indicated as subpages for blind people

Reported by: juliemoynat's profile juliemoynat Owned by: joedolson's profile joedolson
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-patch
Focuses: accessibility, administration Cc:

Description

Description of the problem

In the WordPress administration, in the list of all pages, a sighted person can identify subpages thanks to a long dash before the name of the subpage (example: — A subpage of a page). And so, you know that the above page is its parent.

But, this is absolutely not accessible to blind people.

The code of the link on the page name is that one: <a class="row-title" href="https://example.org/wp-admin/post.php?post=554&amp;action=edit" aria-label="“My beautiful subpage” (Edit)">— My beautiful subpage</a>

The aria-label attribute removes the long dash and doesn't replace it by the information it conveys.

What is expected

  • The link name should, at least, inform that a subpage is a subpage.
  • It would also ideally give the name of the parent page because you can see it quickly but a blind person must navigate until they find a link which is not indicated as a subpage.

We could have: <a class="row-title" href="https://example.org/wp-admin/post.php?post=554&amp;action=edit" aria-label="“My beautiful subpage” (subpage of “Wonderful page”) (Edit)">— My beautiful subpage</a>

Attachments (1)

Screenshot_20260324_142208.png (11.7 KB) - added by ekaterina92 7 weeks ago.
Title with parent name

Download all attachments as: .zip

Change History (14)

#1 @audrasjb
7 weeks ago

  • Keywords needs-patch good-first-bug added
  • Version 6.9.4 deleted

Hi and thanks for the ticket Julie,
I confirm there is currently no indication of a page being a child of another one.
Adding good-first-bug as this seems like a pretty simple patch at a glance.

#2 in reply to: ↑ description @ekaterina92
7 weeks ago

$parent_name was empty for pages with subpages, but if I set the value than this part works (code below) and subpage name is concatinated to title. I guess in that case no aria label needed

if ( isset( $parent_name ) ) {
	$post_type_object = get_post_type_object( $post->post_type );
	echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );
}
Last edited 7 weeks ago by ekaterina92 (previous) (diff)

@ekaterina92
7 weeks ago

Title with parent name

#3 @juliemoynat
7 weeks ago

I think that adding the text "Parent Page: [Name of the page]" next to the link is a good alternative to have the name of the parent page.

But, the aria-label is still required because:

  1. It is already adding the information that the link is an edit link (the "(Edit)" at the end).
  2. We still need to add an alternative to the long dash in the link name.

So, with your proposal, I recommend just adding the text "Subpage" before the page name in the aria-label:

<a class="row-title" href="https://example.org/wp-admin/post.php?post=554&amp;action=edit" aria-label="Subpage “My beautiful subpage” (Edit)">— My beautiful subpage</a>

Last edited 7 weeks ago by juliemoynat (previous) (diff)

This ticket was mentioned in PR #11350 on WordPress/wordpress-develop by @ekaterina92.


6 weeks ago
#4

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/64932

## Use of AI Tools

This ticket was mentioned in PR #11353 on WordPress/wordpress-develop by @ekaterina92.


6 weeks ago
#5

Trac ticket: https://core.trac.wordpress.org/ticket/64932

Added an aria-label for subpages because with screen reader it's not clear if it's a page or subpage.

## Use of AI Tools

#6 @ekaterina92
6 weeks ago

I just saw that aria labels were actually recently removed from those links https://core.trac.wordpress.org/ticket/33002 but they didn't have information about subpages.

#7 follow-up: @juliemoynat
6 weeks ago

I was not aware of that removing. Thank you for the information.

I've tested your PR (thankyou!) on the WordPress Playground and it seems good but I noticed that there is the "(Edit)" in the aria-label so if #33002 removed it, we shouldn't re-add it.

So it should be:

<a class="row-title" href="https://example.org/wp-admin/post.php?post=554&amp;action=edit" aria-label="Subpage “My beautiful subpage”">— My beautiful subpage</a>

#8 in reply to: ↑ 7 @ekaterina92
6 weeks ago

I added a new commit to the same branch, but I guess I should have created a new pull request (or not?)
Sorry, I'm new here.

#9 @juliemoynat
6 weeks ago

It might be OK to add a commit, I guess.

For me, the PR is OK but I'm not a person who can validate. I let the WordPress team do it.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


6 weeks ago

#11 @joedolson
6 weeks ago

  • Milestone changed from Awaiting Review to 7.1
  • Owner set to joedolson
  • Status changed from new to accepted

Thank you! I'm milestoning this for 7.1 and taking ownership to shepherd through.

The reason that the aria-label was removed was also to improve the experience for voice command users, who benefit from having the accessible name of a control match the visual name - so I'd prefer to find a way that doesn't require re-breaking that fix.

#12 @ekaterina92
6 weeks ago

Ok! I think at least |Parent Page: Parent page title must be shown and be pronounced by screenreader . The word Parent would suggest it's a subpage.
https://core.trac.wordpress.org/raw-attachment/ticket/64932/Screenshot_20260324_142208.png
The code for this was already there, but it wasn't working because of an empty $parent_name.

#13 @juliemoynat
6 weeks ago

The text "|Parent Page: Parent page title" is not part of the link name so it's not the same thing.

We have a long dash in the link name that needs an alternative inside the link name so that blind people have the same level of information.

Note: See TracTickets for help on using tickets.