title: Dynamically Remove Select Options If Value Doesn't Equal a Certain Number
body: <p>I need to remove all of the options in a dropdown that don't have a specific value. Here's my code:
  `</p>
  
  <pre><code>      &lt;select name="worker"&gt;        
          &lt;option value="0"&gt;John Doe&lt;/option&gt;
          &lt;option value="5"&gt;Jim Smith&lt;/option&gt;
          &lt;option value="6"&gt;Jane Doe&lt;/option&gt;    
        &lt;/select&gt;
  </code></pre>
  
  <p>`</p>
  
  <p>I'm in wordpress, and basically need to say, "If the current user is 5 (Jim Smith), then only show him in the dropdown. Any help would be greatly appreciated.</p>
  
  <p>Here is the php code that generates the dropdown:</p>
  
  <pre><code>/* Workers */
  
      $workers = $wpdb-&gt;get_results("SELECT * FROM " . $this-&gt;workers_table . " " );
  
      $html .= '&lt;label&gt;';
  
      $html .= '&lt;span class="title"&gt;'.__('Provider', 'appointments'). '&lt;/span&gt;';
  
      $html .= '&lt;select name="worker"&gt;';
  
      // Always add an "Our staff" field
  
      $html .= '&lt;option value="0"&gt;'. __('No specific provider', 'appointments') . '&lt;/option&gt;';
  
      if ( $workers ) {
  
          foreach ( $workers as $worker ) {
  
              if ( $app-&gt;worker == $worker-&gt;ID ) {
  
                  $sel = ' selected="selected"';
  
              }
  
              else
  
                  $sel = '';
  
              $html .= '&lt;option value="'.$worker-&gt;ID.'"'.$sel.'&gt;'. $this-&gt;get_worker_name( $worker-&gt;ID, false ) . '&lt;/option&gt;';
  
          }
  
      }
  
      $html .= '&lt;/select&gt;';
  
      $html .= '&lt;/label&gt;';
  </code></pre>