title: Wordpress Search Form with selection In Post, Page or Forum (bbpress)
body: <p>How to create Wordpress search form with select possibility of where we want to search? Search in Posts, Pages or Forum (bbpress). Is there any simple solution to do that without creating additional files in theme folder?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I use this code and it works but I don't know how to add bbPress.</p>
  
  <p>At now the url of the search results looks like that: <em>?s=mysearch&amp;post_type=page</em></p>
  
  <p>Default bbPress results url: <em>forums/search/mysearch/</em></p>
  
  <pre><code>&lt;form role="search" method="get" class="search-form" action="&lt;?php echo home_url( '/' ); ?&gt;"&gt;
      &lt;label&gt;
          &lt;span class="screen-reader-text"&gt;&lt;?php echo _x( 'Search for:', 'label' ) ?&gt;&lt;/span&gt;
          &lt;input type="search" class="search-field" placeholder="&lt;?php echo esc_attr_x( 'Search …', 'placeholder' ) ?&gt;" value="&lt;?php echo get_search_query() ?&gt;" name="s" title="&lt;?php echo esc_attr_x( 'Search for:', 'label' ) ?&gt;" /&gt;
          &lt;input type="radio" name="post_type" value="post" id="posts" checked /&gt;&lt;label for="posts"&gt;Posts&lt;/label&gt;
          &lt;input type="radio" name="post_type" value="page" id="pages" /&gt;&lt;label for="pages"&gt;Pages&lt;/label&gt;
      &lt;/label&gt;
      &lt;input type="submit" class="search-submit" value="&lt;?php echo esc_attr_x( 'Search', 'submit button' ) ?&gt;" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Maybe with the script it is possible to change the search URL after selecting the "Forum" option?</p>