[wp-trac] [WordPress Trac] #57200: WP_List_Table::pagination use singular and plural

WordPress Trac noreply at wordpress.org
Sat Dec 3 11:23:40 UTC 2022


#57200: WP_List_Table::pagination use singular and plural
----------------------------+---------------------------------
 Reporter:  RoscoHead       |       Owner:  (none)
     Type:  enhancement     |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  dev-feedback    |     Focuses:  ui, administration
----------------------------+---------------------------------
Changes (by costdev):

 * keywords:   => dev-feedback
 * version:  6.1.1 =>


Comment:

 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` and `plural` arguments are passed through
 `sanitize_key()`. This means that, for example, `media items` becomes
 `mediaitems`. 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` and `Pages` screens show `tag|tags`
 and `post|posts` respectively. Therefore, the constructor of
 `WP_Terms_List_Table` and `WP_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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57200#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list