title: How to return checked checkbox after data is stored?
body: <p>I have created a checkbox list of all my customers in wordpress.</p>
  
  <p>The data is stored into my custom table called wp_assigned_products, I get the post_id(product id), meta_key(customer keyword), meta_value(customer ID) and assigned(yes or no) values saved into the table when a user is is checked and the post is updated.</p>
  
  <p>I cant for the life of me figure out how to return a checked box for the checked users, once the page is reloded.</p>
  
  <p>My checkboxes are all empty but the record is saved to the database table. Can anyone give me a push in the right direction? I have been working on this for hours but keep ending up with a conflict between the meta_value and assigned row. Many thanks.</p>
  
  <p>My code as follows:</p>
  
  <pre><code>add_action("admin_init", "users_meta_init");
  function users_meta_init(){
      add_meta_box("users-meta", "Assign customers to this product", "users", "product", "normal", "high");
  }
  
  function users(){
  
      global $post;
      $custom = get_post_custom($post-&gt;ID);
      $user_args  = array(
          'role' =&gt; 'customer',
          'orderby' =&gt; 'display_name'
         );
  
      $wp_user_query = new WP_User_Query($user_args);
      $authors = $wp_user_query-&gt;get_results();
  
      if (!empty($authors)) {
          foreach ($authors as $author) {
              $author_info = get_userdata($author-&gt;ID);
              $author_id = get_post_meta($post-&gt;ID, 'users', $author_info-&gt;ID);
  
              echo " &lt;input type='checkbox' name='users' value='$author_info-&gt;ID'&gt; $author_info-&gt;first_name $author_info-&gt;last_name&lt;br/&gt; ";
          }
      }
  }
  
  add_action('save_post', 'save_userlist');
  
  function save_userlist($author_id){
  
      global $wpdb;
      global $post;
  
      if (defined('DOING_AUTOSAVE') &amp;&amp; DOING_AUTOSAVE) {
          return $post-&gt;ID;
          return $author_info-&gt;ID;
      }
      $table_name = $wpdb-&gt;prefix . "assigned_products";
  
      $wpdb-&gt;insert($table_name, array(
                        'post_id'    =&gt; $post-&gt;ID,
                        'meta_key'  =&gt; "customer",
                        'meta_value'  =&gt; $_POST["users"],
                        'assigned'  =&gt; "yes",
                        )
                    );
  }
  </code></pre>