#17016 closed enhancement (wontfix)
Empty search not allowed - makes it hard to build an enhanced search page
Reported by: | jobjorn | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Template | Keywords: | |
Focuses: | Cc: |
Description
Hello all,
I am building an enhanced search form for a recipe database (using a Star Trek LCARS-like interface!). The enhancement is primarily being able to select tags that the returned results should be tagged with. This is made possible in part through using query_posts(); in the landing page, search.php.
However, what if you want to search for *just* tags, and no text? You want to look at what's tagged both "cheese" and "tomato", and see no need to enter any search term. The result is that $_GET['s']
will be empty, and you will not get to search.php at all - and then you can't see your cheese+tomato recipes.
This is because wp-includes/query.php uses !empty
rather than isset
when trying to figure out whether we want to see a search page attached or not.
Extremely simple diff attached. If this solution is for some reason unacceptable, I would very much appreciate any ideas on how to work around the issue.
Attachments (2)
Change History (7)
#3
@
14 years ago
The just added attachment works as expected, but I suppose there is a good reason to use $qv['s']
rather than $_GET['s']
?
#4
@
14 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
This would introduce a glaring inconsistency: all other empty query vars are ignored, while 's' gets special treatment. That's not a good idea, from an API point of view.
Also, by your definition of search, when you're going to /category/foo/ you're also doing a search, which is plainly wrong, in the WP universe.
For these reasons, I'm closing this ticket as wontfix.
Feel free to leave follow-up comments (without opening the ticket).
Diff of wp-includes/query.php