[wp-trac] [WordPress Trac] #11330: Empty search takes you to hompage, even when homepage is not your blog
WordPress Trac
wp-trac at lists.automattic.com
Wed May 5 17:20:40 UTC 2010
#11330: Empty search takes you to hompage, even when homepage is not your blog
----------------------------+-----------------------------------------------
Reporter: jacobfogg | Type: defect (bug)
Status: new | Priority: low
Milestone: Future Release | Component: Template
Version: 2.8.5 | Severity: minor
Keywords: needs-patch |
----------------------------+-----------------------------------------------
Changes (by thomask):
* type: enhancement => defect (bug)
Comment:
please when this trivial needs patch will be solved?
Imho it is bug, search should definitely put you on search page even when
you search nothing. So we would be easily able to create separate search
page (in many countries it is a must-have accesibility rule when creating
webs e.g. for public administration)
P.S.: if i would consider this as an enhancement, it would be to have an
option to give it some sexy url, but this could be solved by something
like
{{{
add_action('template_redirect', 'nice_search');
function nice_search() {
if (is_search()) {
$search_uri = get_bloginfo('url') .'/search/'.
urlencode(get_query_var('s')) . ((get_query_var('paged')) ? '/page/'.
get_query_var('paged') .'/' : '/');
if (!empty($_GET['s']) || !empty($_GET['paged']))
wp_redirect($search_uri);
}
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/11330#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list