[wp-trac] [WordPress Trac] #17230: Make the search widget better.

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 24 10:01:00 UTC 2011


#17230: Make the search widget better.
-------------------------+----------------------
 Reporter:  JonezJeA     |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Widgets      |     Version:  3.1
 Severity:  normal       |  Resolution:  wontfix
 Keywords:               |
-------------------------+----------------------

Comment (by ocean90):

 Example code:
 {{{
 function my_exclude_pages_from_search( $query ) {
         if ( $query->is_search )
                 $query->set(  'post_type', 'post' );

         return $query;
 }

 add_filter( 'pre_get_posts', 'my_exclude_pages_from_search' );
 }}}

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


More information about the wp-trac mailing list