title: Exclude term of current post in the list of terms of taxonomy
body: <p>Under single-CPT.php, I have a <code>select</code> tag which displays terms of my taxonomy. I first return the term of the current post then return the other terms. The problem is that I have a redundant current post term even I perfrom an <code>if</code> test before displaying the other terms, the if test excludes the term of the current post. What is wrong in my code below? your help is valuable.</p>
  <pre><code>&lt;select class=&quot;select&quot;&gt; 
   &lt;?php 
  
      $my_current_term =  wp_get_object_terms(get_the_ID(), 'product_category');
      foreach($my_current_term as $c_term)
      {
      ?&gt;
  
  
      &lt;option value=&quot;&lt;?php echo $c_term-&gt;name;?&gt;&quot;&gt;
      &lt;?php echo $c_term-&gt;name; ?&gt;
      &lt;/option&gt;
      &lt;?php
  
       }
       
      $all_my_terms =  get_terms('product_category');//add asc and order by  name in asc
      
      
      
      foreach ($all_my_terms as $term1 ) {
          if ( $my_current_term-&gt;name != $term1-&gt;name ) {
  
          $option = '&lt;option value=&quot;'.$term1-&gt;name.'&quot;&gt;';
          $option .= $term1-&gt;name;
          $option .= '&lt;/option&gt;';
          echo $option;
          }
      }
  
       ?&gt;
  
  &lt;/select&gt;
  </code></pre>