#18516 closed enhancement (fixed)
Add custom class to WP_Posts_List_Table->single_row() output
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | General | Version: | 3.3 |
| Severity: | normal | Keywords: | westi-likes has-patch |
| Cc: | brandondove, jbrown510@…, anointed |
Description
I am working on a custom post type implemention with some common custom meta information that I want to display in the post list. There is a need to indicate each post's status with a quick visual queue. Since there is no way to target a group of table rows that have certain characteristics, I resorted to highlighting the rows using jQuery.
Looking at the WP_Posts_List_Table class, it seems that this would be an easy problem to solve by simply adding a filter to the table row class list. I'm sure this same concept could also be extended to the other subclasses of WP_List_Table.
Attachments (3)
Change History (14)
brandondove — 21 months ago
comment:1
brandondove — 21 months ago
- Keywords has-patch added
comment:2
brandondove — 21 months ago
- Cc brandondove added
- Owner changed from brandondove to westi
- Status changed from new to reviewing
brandondove — 21 months ago
A simple plugin that adds a custom class to the single row on the post edit screen
comment:6
brandondove — 21 months ago
The new patch uses get_post_class for WP_Posts_List_Table as nacin suggested. Duplicated classes on the table row were removed and author-(self|other) was moved into get_post_class for consistency.
Replying to nacin:
It'd probably make sense for us to use post_class() here.
I'm sure I wrote this comment when I accepted the ticket ;)
- Keywords westi-likes added
- Milestone changed from Awaiting Review to 3.3
We should keep the code out of get_post_class(), and instead pass in that value to get_post_class(), which takes an additional classes argument.
comment:10
nacin — 20 months ago
- Resolution set to fixed
- Status changed from reviewing to closed
In [18706]:
comment:11
anointed — 20 months ago
- Cc anointed added

It'd probably make sense for us to use post_class() here.