title: Run functions.php snippet only targeting frontend
body: <p>So i have the following snippet in my functions.php:</p>
  
  <pre><code>function SearchFilter($query) {
  if ($query-&gt;is_search) {
  $query-&gt;set('post_type', 'product');
  }
  return $query;
  }
  
  add_filter('pre_get_posts','SearchFilter');
  </code></pre>
  
  <p>This will only show products when a user searches for something. But it also affects the search in de admin area. how can i ensure that it only targets front-end?</p>
  
  <p>Thanks in advance!</p>