title: Checkboxes don't stay checked in WP admin
body: <p>I have a list of checkboxes in the WP post dashboard.</p>
  
  <p>The issue is that they don't stay selected after I update the post, so I have to select them again each time:</p>
  
  <p>I tried:</p>
  
  <pre><code>&lt;input type="checkbox" name="industry[]" value="habia" &lt;?php if(isset($_POST['habia'])){echo "checked='checked'";}?&gt; /&gt; habia&lt;br&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;input type="checkbox" name="industry[]" value="habia" &lt;?php if(isset($_POST['industry[]'])){echo "checked='checked'";}?&gt; /&gt; habia&lt;br&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;input type="checkbox" name="industry[habia]" value="habia" &lt;?php if(isset($_POST['industry']['habia'])){echo "checked='checked'";}?&gt; /&gt; habia&lt;br&gt;
  </code></pre>
  
  <p><code>echo $_POST['habia']</code> doesn't return anything;</p>
  
  <p>My rest of the code:</p>
  
  <pre><code>function industryApprovals(){//the field in the admin section
          global $post;
          $custom = get_post_custom($post-&gt;ID);
          $industry = $custom["industry"][0];
          ?&gt;
          &lt;input type="checkbox" name="industry[]" value="habia" &lt;?php if(isset($_POST['habia'])){echo "checked='checked'";}?&gt; /&gt; habia&lt;br&gt;
          &lt;input type="checkbox"/&gt;
  
          Current values are: 
          &lt;b&gt;&lt;?php  
              $industry=unserialize($industry); //looks like wp always returns data from checkboxes serialized
              if($industry == false){ 
                  echo "No selected industries.";
              } 
              else{
                  $show_values = implode(", ", $industry);
                  echo $show_values.'.'; 
              }
          ?&gt;&lt;/b&gt; 
  
          &lt;?php
      }
  
      function save_industry_approvals(){//preserve the data in the admin section
          global $post;
          update_post_meta($post-&gt;ID, "industry", $_POST["industry"]);
      }
  </code></pre>
  
  <p>Thanks!</p>