title: Wordpress meta_key with checkboxes
body: <p>I have a custom post type which contains a checkbox group "areas" which allows the user to select multiple areas covered by their service.</p>
  
  <p>On the frontend, I have a custom search query in place which allows the user to refine by basic criteria.</p>
  
  <p>It's working ok but I've hit a wall with the checkboxes. I've tried feeding in an array to the meta_key value (imploded and exploded tried so far) but I can only get it to register the first checked item.</p>
  
  <p>My HTML form:</p>
  
  <pre><code>            &lt;form id="searchform" method="post" action=""&gt;
                  &lt;fieldset&gt;
  
                      &lt;select name="service"&gt;
                          &lt;option value="" &lt;?php if(isset($_GET['service']) &amp;&amp; $_GET['service'] == "") { echo 'selected'; } ?&gt;&gt;All&lt;/option&gt;
                          &lt;option value="3" &lt;?php if(isset($_GET['service']) &amp;&amp; $_GET['service'] == '3') { echo 'selected'; } ?&gt;&gt;Advocacy and Advice&lt;/option&gt;
                          &lt;option value="0"&gt;Alcohol and Drug Partnership&lt;/option&gt;
                          &lt;option value="0"&gt;Befriending&lt;/option&gt;
                          &lt;option value="0"&gt;Care &amp;amp; Support at Home&lt;/option&gt;
                          &lt;option value="4" &lt;?php if(isset($_GET['service']) &amp;&amp; $_GET['service'] == '4') { echo 'selected'; } ?&gt;&gt;Care Homes&lt;/option&gt;
                      &lt;/select&gt;
  
                      &lt;label class="radio" for="order-0"&gt;
                          &lt;input name="order" id="order-0" value="ASC" type="radio" &lt;?php if(isset($_GET['order']) &amp;&amp; $_GET['order'] == 'DESC' || !$_GET['order']) { echo 'checked'; } ?&gt;&gt;
                          Ascending
                      &lt;/label&gt;
                      &lt;label class="radio" for="order-1"&gt;
                          &lt;input name="order" id="order-1" value="DESC" type="radio" &lt;?php if(isset($_GET['order']) &amp;&amp; $_GET['order'] == 'DESC') { echo 'checked'; } ?&gt;&gt;
                          Descending
                      &lt;/label&gt;
  
                      &lt;h3&gt;Areas covered&lt;/h3&gt;
                      &lt;div class="form-group"&gt;
                          &lt;div class="col-md-4"&gt;
                              &lt;div class="checkbox"&gt;
                                  &lt;label&gt;
                                      &lt;input name="areas[]" value="Ardrossan" type="checkbox" class="check"&gt;
                                      Ardrossan
                                  &lt;/label&gt;
                              &lt;/div&gt;
                              &lt;div class="checkbox"&gt;
                                  &lt;label&gt;
                                      &lt;input name="areas[]" value="Largs" type="checkbox" class="check"&gt;
                                      Largs
                                  &lt;/label&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="clearfix"&gt;&lt;/div&gt;
  
                      &lt;button type="submit" class="button green"&gt;Search&lt;/button&gt;
  
                  &lt;/fieldset&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>My query:</p>
  
  <pre><code>            $custom_taxterms = wp_get_object_terms( $post-&gt;ID, 'category', array('fields' =&gt; 'ids') );
              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  
              if($_POST['areas']) {
                  $areas = $_POST['areas']; 
                  $areas = implode(',',$areas);
              }
              else { $areas            = ''; }
  
              if($_GET['service']) {
                  $service             = $_POST['service'];
              }
              else { $service          = 0; }
  
              if($_GET['order']) {
                  $order               = $_POST['order'];
              }
              else { $order            = 'ASC'; }
  
              $args = array(
                  'post_type'          =&gt; 'provider_listing',
                  'cat'                =&gt; $service,
                  'order'              =&gt; $order,
                  'paged'              =&gt; $paged,
                  'meta_query' =&gt; array(
                      array  (
                          'key'       =&gt; 'areas_covered',
                          'value'     =&gt; $areas,
                          'compare'   =&gt; 'LIKE'
                      )
                  )
              );
              $providers = query_posts($args);
  
              if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt; 
              ......
  </code></pre>