WordPress.org

Make WordPress Core

Opened 7 months ago

Closed 5 months ago

Last modified 5 months ago

#40628 closed enhancement (fixed)

User list table admin: Need to replace blank space with "—" when first_name and last_name is blank

Reported by: Girishpanchal Owned by: afercia
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch
Focuses: accessibility Cc:

Description

When the user doesn't enter their first name and last name, admin panel the user listing page has listed blank space instead of "—" "Name" column like page listing. I have attached the screenshot for more clarification.
http://www.awesomescreenshot.com/image/2451426/6ea3628ba681f70e587594748a9147d8

Attachments (5)

40628.patch (1.6 KB) - added by Girishpanchal 7 months ago.
40628.1.patch (728 bytes) - added by Girishpanchal 7 months ago.
40628.2.patch (737 bytes) - added by Girishpanchal 7 months ago.
Updated patch for class-wp-user-list-table.php
40628.3.patch (625 bytes) - added by Girishpanchal 7 months ago.
Updated patch for multi-site.
40628.4.patch (1.3 KB) - added by yahil 5 months ago.

Download all attachments as: .zip

Change History (18)

#1 @Girishpanchal
7 months ago

  • Keywords has-patch added

#2 @afercia
7 months ago

  • Focuses accessibility added; administration removed
  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 4.8
  • Version 4.7.4 deleted

@Girishpanchal thanks for your patch, makes sense to me! Ideally this should be implemented as in the other list tables, hiding the dash to assistive technologies and adding some hidden screen reader text. See for example:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-posts-list-table.php?rev=40361#L1124
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-list-table.php?rev=40361#L659

In this case, the hidden text could be something like No name?

#3 @Girishpanchal
7 months ago

  • Keywords ui-feedback added

@afercia Can we use "Unknown" instead of "No name"?. Please let me know your thought then i will update patch for same.

Also i have found post category listing page where description is empty/blank.
http://www.awesomescreenshot.com/image/2455447/e13c74d4c1489ff1f6806c4a0b7aac42

I will add another patch for the category description column.

Thank you

#4 @afercia
7 months ago

"Unknown" makes sense to me and maybe it's even better. Screen readers already announce the column header "Name" so I'd say that hearing "Name ... unknown" is better than "Name ... No name" :)

Maybe such a string would need to give some context to translators though, so I'd consider to use _x().

Also i have found ...

Yep nice catch! Would you mind to open a separate ticket for that, please? It's always preferable to to keep things separated.

#5 @Girishpanchal
7 months ago

  • Keywords dev-feedback added; needs-refresh ui-feedback removed

Here, I have attached the patch for user listing table according to your suggestion.

Please check and let me know!

I will open new ticket for the post category description and will update patch for same.

@Girishpanchal
7 months ago

Updated patch for class-wp-user-list-table.php

#7 @afercia
7 months ago

  • Keywords needs-refresh added; dev-feedback removed
  • Milestone changed from 4.8 to 4.8.1

The same should be done for the wp-admin/network/users.php screen on multisite, see:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php?rev=40310#L260

#8 @Girishpanchal
7 months ago

Thank you for suggestion let me update patch for multisite !!

@Girishpanchal
7 months ago

Updated patch for multi-site.

#9 @afercia
6 months ago

  • Owner set to afercia
  • Status changed from new to assigned

See also #40659.

#10 @yahil
5 months ago

@afercia I have made changes on existing .path to improve coding standard.

Solve phpcs notice:

  1. Whitespace found at end of line
  2. expected 1 space before/after closing bracket [ _x( 'Unknown' ); ]

@yahil
5 months ago

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


5 months ago

#12 @SergeyBiryukov
5 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 40956:

Administration: In user list tables, display a dash instead of a blank space and add "Unknown" as a screen reader text when the user's first name and last name are blank.

Props Girishpanchal, yahil.
Fixes #40628.

#13 @SergeyBiryukov
5 months ago

  • Keywords needs-refresh removed
  • Milestone changed from 4.8.1 to 4.9
Note: See TracTickets for help on using tickets.