title: How to use PHP in_array() function?
body: <p>I need to see if multiple values are in a wordpress category. How do I go about checking for multiple categories using in_array()?</p>
  
  <pre><code>if ( in_array( 13, $cats ) ) {
          return TRUE;
      }
  </code></pre>
  
  <p>I need to check for categories: 13, 210, 311, 312</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Full code:</p>
  
  <pre><code>function lw_gpf_exclude_product($excluded, $product_id, $feed_format) {
      // Return TRUE to exclude a product, FALSE to include it, $excluded to use the default behaviour.
      $cats = wp_get_post_terms( $product_id, 'product_cat', array( 'fields' =&gt; 'ids' ) );
      if ( in_array( 13, $cats ) ) {
          return TRUE;
      }
      return $excluded;
  }
  </code></pre>
  
  <p>Thanks for your help!</p>