Opened 2 years ago
Last modified 2 years ago
#57200 new enhancement
WP_List_Table::pagination use singular and plural
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | dev-feedback |
Focuses: | ui, administration | Cc: |
Description
WP_List_Table::pagination() currently hardcodes the number of records display as "1 item"/"XX items". It would be nice if it used the singular and plural set in the constructor, defaulting to item/items if none are set.
Change History (3)
This ticket was mentioned in Slack in #accessibility by ryokuhi. View the logs.
2 years ago
#3
@
2 years ago
- Keywords dev-feedback added
- Version 6.1.1 deleted
Hi @RoscoHead, welcome to Trac and thanks for opening this ticket!
Making this change would be nice, and can be made relatively easily to see some positive results.
However, there are at least a few things to consider:
- The
singular
andplural
arguments are passed throughsanitize_key()
. This means that, for example,media items
becomesmediaitems
. Therefore, we would need to consider storing another version of these sanitized in such a way that certain characters are allowed, such as spaces. - With this change, the
Categories
andPages
screens showtag|tags
andpost|posts
respectively. Therefore, the constructor ofWP_Terms_List_Table
andWP_Posts_List_Table
would need to be changed to correct this. - A list table may exist, for example, in a submenu page under a post type, and may display items of a different post type.
e.g. Menu: Books > Books per author
Books per author shows a list table of authors, the number of books each one has written, and a View Books link to filter the Books screen by author.
The post type is books
and the page's slug is books-per-author
, meaning the list table of authors would show 2 books_page_books-per-author
, instead of 2 authors
.
So, unless the constructor of the author list table is changed to set the values for singular
and plural
, this will show the incorrect value. This is easy to do, however, not all plugins/themes are maintained, which means implementing this change requires consideration so as not to introduce a backward compatibility break.
Adding the dev-feedback
keyword to encourage discussion about this enhancement request.
Hello @RoscoHead,
welcome on Trac and thanks for deciding to contribute to WordPress!
We reviewed this ticket today during the Accessibility Team's weekly bug scrub. As far as we were able to understand, this doesn't seem to be an accessibility issue, that is, a problem faced primarily by people with disabilities.
As such, I'm removing the corresponding focus: if we are missing something, please leave a comment and add the focus back.