[wp-trac] [WordPress Trac] #11330: Empty search takes you to hompage instead of empty search page (was: Empty search takes you to hompage, even when homepage is not your blog)

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 14 15:02:03 UTC 2011


#11330: Empty search takes you to hompage instead of empty search page
--------------------------+-----------------------------
 Reporter:  jacobfogg     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  low           |   Milestone:  Future Release
Component:  Query         |     Version:  3.3
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |
--------------------------+-----------------------------
Changes (by strop):

 * version:  2.8.5 => 3.3
 * component:  Template => Query


Comment:

 Other solutions that are cropping up that indicate that this "should"
 really be updated.
 What's the logic in not counting an empty search as search?

 {{{
 function fix_empty_search ($query){
     global $wp_query;
     if (isset($_GET['s']) && empty($_GET['s'])){
         $wp_query->is_search=true;
     }
     return $query;
 }
 add_action('pre_get_posts','fix_empty_search');
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11330#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list