Opened 11 years ago
Closed 10 years ago
#28867 closed defect (bug) (fixed)
Correctly label forms in wp_list_table
Reported by: | joedolson | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Administration | Keywords: | has-patch needs-docs |
Focuses: | accessibility | Cc: |
Description
Adds labels to current page selector and bulk actions select field so that screen readers have an explicit label for those fields.
Passes $which
to bulk_actions method in class-wp-list-table.php
and in class-wp-plugins-list-table.php
so that IDs on top and bottom forms are unique.
Attachments (2)
Change History (14)
#3
@
11 years ago
- Keywords needs-docs needs-refresh added
Every subclass of WP_List_Table
needs $which
in the method signature for ->bulk_actions()
#6
@
10 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
In 29294:
#8
@
10 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
bulk_actions( $which )
- the parameter was added without a default value. Old code fails with
Warning: Missing argument 1 for WP_List_Table::bulk_actions()
#9
@
10 years ago
Added a patch which passed empty string as default argument to WP_List_Table::bulk_actions()
Does empty string good for this or is something else more sensible as the default argument?
#10
@
10 years ago
- Status changed from reopened to reviewing
@wonderboymusic: I hesitate to signify $which
as optional, though I don't have a good solution for back-compat + guaranteeing it holds the value expected. Suggestions?
Side note: I'm happy to write inline docs wherever needed.
#11
@
10 years ago
I don't know that there's a ready way to guarantee that it holds the value expected; but I think that having it optional is at least reasonable, since we need to pass something.
If it's optional and not supplied, the inputs will potentially be invalidly labeled due to a repetitive ID value. This would still leave them better labeled than they were prior to this patch, and would not be a regression for old code -- since old code was in an environment that was never correctly labeled in the first place.
Speaking for myself, I think that having the variable be optional is the best option we have right now, and I would accept it.
Labels for wp_list_table inputs