title: Wordpress, add_filter, get_search_form
body: <p>I'm trying to <strong>replace</strong> the search form by my own.</p>
  
  <p>An example plugin:</p>
  
  <pre><code>&lt;?php
  /*
  Author: whatever
  Plugin Name: Some Name
  Plugin URI: 
  Text Domain: some-domain
  Version: 1.0
  */
  
  function custom_search($form)
  {
  $form = "testing&lt;form method = 'get' id = 'searchform' action = ' ".site_url()." ' &gt;";
  $form .= "&lt;div&gt;&lt;label class = 'hidden' for='s'&gt;". __("Search for: ") . "&lt;/label&gt;";
  $form .= "&lt;input type = 'text' value=' ". esc_attr(apply_filters('the_search_query', get_search_query())) ." ' name='s' id='s' /&gt;";
  $form .= "&lt;input type = 'submit' id='searchsubmit' value=' ".esc_attr(__('Look for it'))." ' /&gt;";
  $form .= "&lt;/div&gt;";
  $form .= "&lt;/form&gt;";
  
  return $form;
  }
  
  add_filter('get_search_form', 'custom_search');
  </code></pre>
  
  <p>Result, doesn't work.</p>
  
  <p>I'm using the latest Wordpress with twentyeleven theme.</p>
  
  <p>What am I missing here?!?</p>
  
  <p>EDIT: It appears that if the theme has searchform.php file, this filter will be overridden by that file. So basically filter only works if the theme doesn't have searchform.php. Now that is just stupid..</p>