Opened 14 years ago
Closed 14 years ago
#15353 closed defect (bug) (fixed)
Search box appears when there is nothing to search
Reported by: | nacin | Owned by: | scribu |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch 2nd-opinion |
Focuses: | Cc: |
Description
Title is pretty clear on this one. List table search boxes appear even when in the view, this is nothing to search.
This looks particularly ridiculous on the themes.php page when you have only one theme (and it is active).
Attachments (3)
Change History (15)
#2
@
14 years ago
A user can have 100 items listed per page but still want the search to narrow down the items.
#9
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
In the wake of #15849, I don't think this was fixed properly.
We should hide the search only when there are no items at all and not when a search term yields no results.
#10
@
14 years ago
search_box.15353.diff adds a search_box() method to WP_List_Table, which is then reused in all list screens, except themes.php, due to the fancy new filter. :)
Notes:
In network/users.php
, the submit_button() received 'post-query-submit', which was probably a bug. With the patch, it's 'submit'.
In edit.php
and upload.php
, the_search_query() was used. In the patch, _admin_search_query() is used. I think this is ok, since most filters probably only want to hook into the front-end anyway.
Not sure if this is the best way to go, but I thought I would offer a solution.