title: custom post meta not saving in custom post type
body: <p>i have written a code for my custom meta post. the meta post is check box showing just below the custom post. but when i try to save it. it don not save and leave check box blank.i dont know why its not saving?
  Checkbox it using from another custom post.</p>
  
  <p><pre></p>
  
  <code>    add_action( 'add_meta_boxes', 'cd_meta_box_add_alert' );
      function cd_meta_box_add_alert()
      {   
      add_meta_box( 'my-meta-box-id-2', 'Select People for blog',
      'cd_meta_box_cb_alert', 'alert' , 'normal', 'high' );
      }
  
      function cd_meta_box_cb_alert()
      {
      // $post is already set, and contains an object: the WordPress post
      global $alert;
      $valuesalert = get_post_custom( $post-&gt;ID );
      // We'll use this nonce field later on when saving.
      wp_nonce_field( 'alert_my_meta_box_nonce', 'alert_meta_box_nonce' );
      $checkalert = isset( $valuesalert['people_to_alert'] ) ? esc_attr($valuesalert['people_to_alert'][0] ) : '';
  
      $people_array_alert = unserialize($valuesalert['people_to_alert'][0]);
      $args = array(
      'post_type' =&gt; 'lowenbaumpeople',
      'posts_per_page' =&gt; -1,
      'orderby' =&gt; 'title',
      'order'   =&gt; 'ASC',
      );
      $queryalert = new WP_Query( $args );
      while ( $queryalert-&gt;have_posts() ) : $queryalert-&gt;the_post();
      if ( !empty($people_array_alert) &amp;&amp; is_array($people_array_alert) ) {
      $checkalert = (in_array($post-&gt;ID, $people_array_alert)) ? 'on' : '';
      }
  
  
      &lt;input type="checkbox" value="&lt;?php echo $post-&gt;ID; ?&gt;" name="people_to_blog[]" &lt;?php checked( $checkalert, 'on' ); ?&gt; /&gt;
      &lt;label for="people_to_blog"&gt;&lt;?php the_title();?&gt;&lt;/label&gt;
  
      add_action( 'save_post', 'cd_meta_box_save_alert' );
      function cd_meta_box_save_alert( $post_id )
      {   global $post;
      if( defined( 'DOING_AUTOSAVE' ) &amp;&amp; DOING_AUTOSAVE ) return; 
      if( !isset( $_POST['alert_meta_box_nonce'] ) || !wp_verify_nonce($_POST['alert_meta_box_nonce'], 'alert_my_meta_box_nonce' ) ) return;  
        if( !current_user_can( 'edit_post' ) ) return;
  
      update_post_meta( $post_id, 'people_to_alert', $_POST['people_to_alert'] );
  
  
  }
  </code></pre>
  
  <p>i have turn on the debug mode and found these error </p>
  
  <p>[13-Sep-2015 11:09:59 UTC] PHP Notice:  Undefined offset: 0 in /home/cdrossen6800/public_html/lowenbaumlaw/wp-includes/capabilities.php on line 1190
  [13-Sep-2015 11:09:59 UTC] PHP Notice:  Undefined index: people_to_alert in /home/cdrossen6800/public_html/lowenbaumlaw/wp-content/themes/lowenbaum/functions.php on line 819
  [13-Sep-2015 11:10:00 UTC] PHP Notice:  Array to string conversion in /home/cdrossen6800/public_html/lowenbaumlaw/wp-includes/formatting.php on line 957</p>