title: validate/change input value with php
body: <p>i want to validate and change the input value from a wordpress search form.</p>
  
  <pre><code>&lt;?php $unique_id = esc_attr( uniqid( 'search-form-' ) ); ?&gt;
  
  &lt;form role="search" method="get" class="search-form" action="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;"&gt;
      &lt;label for="&lt;?php echo $unique_id; ?&gt;"&gt;
          &lt;span class="screen-reader-text"&gt;&lt;?php echo _x( 'Search for:', 'label', 'twentyseventeen' ); ?&gt;&lt;/span&gt;
      &lt;/label&gt;
  
  
      &lt;input type="search" id="&lt;?php echo $unique_id; ?&gt;" class="search-field" placeholder="&lt;?php echo esc_attr_x( 'Search &amp;hellip;', 'placeholder', 'twentyseventeen' ); ?&gt;" value="&lt;?php echo get_search_query(); ?&gt;" name="s" /&gt;
  
  
      &lt;button type="submit" class="search-submit"&gt;
  &lt;?php echo twentyseventeen_get_svg( array( 'icon' =&gt; 'search' ) ); ?&gt;&lt;span class="screen-reader-text"&gt;&lt;?php echo _x( 'Search', 'submit button', 'twentyseventeen' ); ?&gt;&lt;/span&gt;&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I used this code to change value but it aint working ;-(</p>
  
  
  
  <p>this should remove all characters with and after TEST but it aint.</p>
  
  <p>Am i missing something?</p>
  
  <p>At the end i want to validate the input value and when it contains specific words it needs to be changed into clean search strings.</p>