Opened 14 years ago
Closed 14 years ago
#15318 closed defect (bug) (fixed)
Can't add custom columns to the plugins admin page
Reported by: | scribu | Owned by: | |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | needs-patch |
Focuses: | Cc: |
Description
The Plugins list table is different from all the rest, in the sense that it uses more than one row per item (simplified):
<tr> <td>Plugin Name</td> <td>Description</td> </tr> <tr class="second"> <td>Activate | Delete</td> <td>Version 1.0 | By: someone</td> </tr> <tr class="plugin-update-tr"> <td class="plugin-update" colspan="3">There's an update available</td> </tr>
I assume this approach was chosen to make the action links stay at the bottom, when the description is larger.
Problems:
- plugins can't add custom columns
- columns can't be hidden
Supposing these two problems were fixed, we'd still have to have a weird workaround for the colspan attribute in the update notification row.
I suggest we switch to a single row per item and use CSS to position the elements.
Attachments (7)
Change History (29)
#1
@
14 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 3.1
- Version set to 3.1
#3
@
14 years ago
If someone's going to refactor class-wp-plugins-list-table.php maybe they could also add column sorting.
#14987 might be possible to implement at the same time.
#5
@
14 years ago
- Cc edward@… added
Two things have been fixed:
- Accessability rules say that (1) each checkbox needs a label and (2) every label should be unique. I've whipped something up that fulfills both criteria.
- Lower down I've moved the description stuff around. It's all now just one tr per plugin and the description gets hidden when using that there "show on screen" checkbox. The more observant of y'all will notice that the select checkbox column becomes enormous when the description is hidden, so a line or two in the css should solve that problem if my solution is satisfactory.
#6
@
14 years ago
edward mindreantre, thx for the patch. 2 things:
Notice: Undefined variable: plugin_name in /wordpress/wp-admin/includes/class-wp-plugins-list-table.php on line 386
Also after a reload or using the navigation, only the title will be hidden again.
#7
@
14 years ago
Fixed: Description column is hidden when reloading
Fixed: Namn column width is set to auto in order for the checkbox column to not take up half the table.
That should do it. I have no idea why the checkbox and name columns want 50% each...
Anything else broken?
#9
@
14 years ago
I believe the new list-table.js will solve your problem.
Unfortunately it has to run the .hide column() routine thing when switching pages which makes it look sorta weird for a few milliseconds. I haven't found where it sets each column width to 50% per default.
I tried setting the cb-column width to max-width 40px or whatever but it doesn't listen. Not after running .hide() on that column. It seems as if .hide() makes the table recalculate column widths.
Can we has-patch this yet? :)
#10
@
14 years ago
- Keywords has-patch added; needs-patch removed
I so hate it when I don't receive email notifications on tickets I've openened.
#18
@
14 years ago
- Keywords needs-patch added; has-patch removed
Only thing left is to figure out what to do with plugin-update-tr.
#19
follow-up:
↓ 20
@
14 years ago
ocean90 pointed out that WP_MS_Themes_List_Table needs the same treatment.
#20
in reply to:
↑ 19
@
14 years ago
Replying to scribu:
ocean90 pointed out that WP_MS_Themes_List_Table needs the same treatment.
Done with 15318.ms.themes.patch.
At the moment we have the problem with the "Show on screen" and "Description" option, see screenshot: http://grab.by/7dY4