title: Wordpress meta box not saving?
body: <p>Here is my meta box code for that I am trying to save. I have everything else working how I want but I cant figure out how to save the data from that gets inserted into the function clone_to()</p>
  
  <p>I added a couple lines of comments in that section to show what I am trying to save. From there I hope my save meta data function makes sense. </p>
  
  <p>Hopefully someone will notice what I am doing wrong. Thanks in advance. </p>
  
  <pre><code>&lt;?php
  // enqueue scripts and styles, but only if is_admin
  if(is_admin()) {
      wp_enqueue_script('custom-js', get_template_directory_uri().'/js/custom-js.js');
      wp_enqueue_script('jquery.confirm.min', get_template_directory_uri().'/js/jquery.confirm.min.js');  
      wp_enqueue_script('bootstrap.min', get_template_directory_uri().'/js/bootstrap/js/bootstrap.min.js');  
      wp_enqueue_script('edit-box', get_template_directory_uri().'/js/edit-box.js');    
      wp_enqueue_style('jquery-ui-custom', get_template_directory_uri().'/css/jquery-ui-custom.css');
      wp_enqueue_style('page-builder', get_template_directory_uri().'/css/page-builder.css');
      wp_enqueue_style('bootstrap', get_template_directory_uri().'/js/bootstrap/css/bootstrap.css');
  }
  // Add the Meta Box
  function add_custom_meta_box() {
      add_meta_box(
          'custom_meta_box', // $id
          'Custom Meta Box', // $title 
          'show_custom_meta_box', // $callback
          'page', // $page
          'normal', // $context
          'high'); // $priority
  }
  add_action('add_meta_boxes', 'add_custom_meta_box');
  
  $custom_meta_fields = array(
  
          'Divider' =&gt;array(
              'text'=&gt;array(
                  'title'=&gt; 'BACK TO TOP TEXT',
                  'name'=&gt; 'page-option-item-divider-text',
                  'type'=&gt; 'inputtext'
                  )              
          ),
          'Column'=&gt;array(
              'column-text'=&gt;array(
                  'title'   =&gt; 'Column Text',
                  'name'    =&gt; 'page-option-item-column-text',
                  'type'    =&gt; 'textarea'
                  )
          ),
          'Quote'=&gt;array(
              'quote-text'=&gt;array(
                  'title'   =&gt; 'Quote Text',
                  'name'    =&gt; 'page-option-item-quote-text',
                  'type'    =&gt; 'textarea'
                  )
          )
  );
  ?&gt;
  
  &lt;?php
  // The Callback
  function show_custom_meta_box() {
  global $custom_meta_fields, $post;
  
  echo '&lt;div id="overlay-wrapper"&gt;';
  default_items();
  echo '&lt;div class="page-element-lists" id="page-element-lists"&gt;';
  page_items();
  echo '&lt;/div&gt;';
  clone_to();
  echo '&lt;/div&gt;';
  // Use nonce for verification
  wp_nonce_field( 'myplugin_inner_custom_box', 'myplugin_inner_custom_box_nonce' );
  }
  
  // Select Add options
  function default_items(){
  global $custom_meta_fields, $post;
  ?&gt;
  &lt;div class="page-select-element-list-wrapper combobox"&gt;
  &lt;select id="page-select-element-list"&gt;
  &lt;option&gt;Select an item&lt;/option&gt;
  &lt;?php
  foreach ($custom_meta_fields as $page_meta_box =&gt; $value) {
      echo '&lt;option&gt;' .$page_meta_box. '&lt;/option&gt;';
  }
  ?&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  &lt;input type="button" value="Add item" class="page-add-item-button" id="page-add-item-button"&gt;
  &lt;?php
  }
  
  // Elements to clone
  function page_items(){
  global $custom_meta_fields, $post;
  
  foreach( $custom_meta_fields as $page_meta_box =&gt; $value ){  
  
  if($page_meta_box == 'Column'){
      $size = 'element1-4';
      $defaultsize = '1/4';
  }
  elseif($page_meta_box == 'Divider'){
      $size = 'element1-1';
      $defaultsize = '1/1';
  }
  
  ?&gt;
      &lt;div id="page-element" class="page-element &lt;?php echo $size; ?&gt;" rel="&lt;?php echo $page_meta_box; ?&gt;"&gt;
          &lt;div class="page-element-item"&gt;
              &lt;div class="left-side"&gt;
                  &lt;input type="button" class="increase-size" value="+"/&gt;
                  &lt;input type="button" class="decrease-size" value="-"/&gt;
                  &lt;span class="element-description"&gt; &lt;?php echo $page_meta_box; ?&gt; &lt;/span&gt;
              &lt;/div&gt;
              &lt;input type="hidden" name="" value="Tab" class="page-option-item-type" id="page-option-item-type"&gt;
              &lt;input type="hidden" name="" value="element1-4" class="page-option-item-size" id="page-option-item-size"&gt;
              &lt;div class="right-side"&gt;
                  &lt;span class="element-size-text" id="element-size-text"&gt;&lt;?php echo $defaultsize; ?&gt;&lt;/span&gt;
                  &lt;div class="change-element-property"&gt;
                              &lt;a title="Edit"&gt;&lt;div class="edit-element" id="page-element-edit-box" rel="edit-box"&gt;&lt;/div&gt;&lt;/a&gt;
                              &lt;a title="Delete"&gt;&lt;div id="delete-element" class="remove-element"&gt;&lt;/div&gt;&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt; 
          &lt;/div&gt;
          &lt;div class="page-element-edit" id="my_modal"&gt;
          &lt;?php
         if($page_meta_box == 'Column'){
          echo 'Title: &lt;input type="text"/&gt;';
          echo 'Content: &lt;textarea&gt;&lt;/textarea&gt;';
          }
          elseif($page_meta_box == 'Divider'){
              echo '&lt;hr&gt;';
          }
          elseif($page_meta_box == 'Quote'){
              echo 'Content: &lt;textarea&gt;&lt;/textarea&gt;';
          }
          ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;?php
  }
  }
  
  // Area for added elements
  function clone_to(){
      ?&gt;
      &lt;div class="page-methodology"&gt;
      &lt;div class="page-selected-elements-wrapper"&gt;
      &lt;div id="page-selected-elements" name="page-selected-elements" class="page-selected-elements page-no-sidebar ui-sortable"&gt;
      &lt;!-- Trying to save all data that gets inserted into here from the meta box --&gt;
      &lt;!-- Then once saved display the saved data here --&gt;
      &lt;?php 
      $value = get_post_meta( $post-&gt;ID, '_my_meta_value_key', true );
      echo $value; 
      ?&gt;     
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php
  }
  
  function remove_taxonomy_boxes() {
      remove_meta_box('categorydiv', 'post', 'side');
  }
  add_action( 'admin_menu' , 'remove_taxonomy_boxes' );
  
  // Save the Data THIS IS FROM THE EXAMPLE NEED TO FIGURE OUT HOW TO SAVE NEW DATA
  function myplugin_save_postdata( $post_id ) {
  
    /*
     * We need to verify this came from the our screen and with proper authorization,
     * because save_post can be triggered at other times.
     */
    // Check if our nonce is set.
    if ( ! isset( $_POST['myplugin_inner_custom_box_nonce'] ) )
      return $post_id;
    $nonce = $_POST['myplugin_inner_custom_box_nonce'];
    // Verify that the nonce is valid.
    if ( ! wp_verify_nonce( $nonce, 'myplugin_inner_custom_box' ) )
        return $post_id;
    // If this is an autosave, our form has not been submitted, so we don't want to do anything.
    if ( defined( 'DOING_AUTOSAVE' ) &amp;&amp; DOING_AUTOSAVE ) 
        return $post_id;
    // Check the user's permissions.
    if ( 'page' == $_POST['post_type'] ) {
      if ( ! current_user_can( 'edit_page', $post_id ) )
          return $post_id;
    } else {
      if ( ! current_user_can( 'edit_post', $post_id ) )
          return $post_id;
    }
    /* OK, its safe for us to save the data now. */
    // Sanitize user input.
    $mydata = ( $_POST['page-selected-elements'] );
    // Update the meta field in the database.
    update_post_meta( $post_id, '_my_meta_value_key', $mydata );
    print_r($_POST);
  }
  add_action( 'save_post', 'myplugin_save_postdata' );
  
  ?&gt;
  </code></pre>