[wp-trac] [WordPress Trac] #9230: Option to search for posts, pages or both

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 25 03:52:30 GMT 2009


#9230: Option to search for posts, pages or both
-------------------------+--------------------------------------------------
 Reporter:  jidm         |       Owner:  anonymous                             
     Type:  enhancement  |      Status:  new                                   
 Priority:  normal       |   Milestone:  2.7.2                                 
Component:  General      |     Version:                                        
 Severity:  normal       |    Keywords:  search options pages posts needs-patch
-------------------------+--------------------------------------------------
 Hi.

 I seriously believe that there should be an option to choose between
 search on 'any' or 'post'. This could be set from the admin panel.

 In some projects i don't need/want to searh on pages, so i have to
 manually change 'any' for 'post' on wp-includes/query.php:

         if ( !isset($q['post_type']) ) {
                         if ( $this->is_search )
                                 $q['post_type'] = 'any';
                         else
                                 $q['post_type'] = 'post';

 I think this can't be hard to implement (an option in the backend, a row
 in wp_options [maybe wp_blogs in case of wpmu] and a modification on the
 code above to ask for that option).

 Please consider implementing this.
 Thanks!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/9230>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list