title: Checkboxes keep disappearing when adding text in different language
body: <p>I have the below code:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;div class="wrap"&gt;
      &lt;div class="add-item"&gt;&lt;input type="button" id="addCheckboxItem" class="button button-primary" value="&lt;?php _e( 'Add checkbox', 'sha-wreg' ); ?&gt;"&gt;&lt;/div&gt;
      &lt;table id="checkboxes-table"&gt;
          &lt;thead&gt;
              &lt;tr valign="top"&gt;
                  &lt;th class="detail-name" colspan="2"&gt;&lt;?php _e( 'Checkbox label', 'sha-wreg' ); ?&gt;&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;?php foreach ( $checkboxes as $field_id =&gt; $field_value ): ?&gt;
                  &lt;tr id="detail-&lt;?php echo $field_id; ?&gt;"&gt;
                      &lt;td&gt;&lt;input type="text" name="&lt;?php echo $sha_wreg_prefix; ?&gt;checkbox_data[&lt;?php echo $field_id; ?&gt;]" value="&lt;?php echo $field_value; ?&gt;" /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;button type="button" class="remove-item button" onclick="removeRow('&lt;?php echo $field_id; ?&gt;')"&gt;-&lt;/button&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;?php endforeach; ?&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  &lt;script type="text/javascript"&gt;
      var prefix = '&lt;?php echo $sha_wreg_prefix; ?&gt;'; 
  &lt;/script&gt;
  </code></pre>
  
  <p>Which outputs as the screenshot below:</p>
  
  <p><a href="https://i.stack.imgur.com/rjwau.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rjwau.png" alt="enter image description here"></a></p>
  
  <p>The problem I'm getting is I'm trying to translate the text into French and when I go to save the checkbox the entire row disappears like this:</p>
  
  <p><a href="https://i.stack.imgur.com/31snZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/31snZ.png" alt="enter image description here"></a></p>
  
  <p>This plugin was custom developed for our Wordpress site by another developer who isn't available anymore. Can someone help me with this issue and let me know why the text keeps disappearing as soon as I add another language?</p>
  
  <p>Here is the code for the backend:</p>
  
  <pre class="lang-php prettyprint-override"><code>    function sha_wreg_add_checkboxes_metabox( $item_data ) {
      global $sha_wreg_module_slug, $sha_wreg_prefix, $sha_wreg_plugin_dir;
      $checkboxes = unserialize( get_post_meta( $item_data-&gt;ID, $sha_wreg_prefix . 'checkbox_data', true ) );
      require_once $sha_wreg_plugin_dir . 'admin/templates/checkboxes_metabox.php'; }
  
      add_action( 'save_post', 'sha_wreg_save_update', 10, 2 );
  
  function sha_wreg_save_update( $item_id, $item_data ) {
      global $sha_wreg_module_slug, $sha_wreg_prefix, $sha_wreg_uploads_dir;
  
      switch ( $item_data-&gt;post_type ) {
  
          case $sha_wreg_module_slug:
              // Update systems
              if ( isset( $_POST[ $sha_wreg_prefix . 'system' ] ) &amp;&amp; !empty( $_POST[ $sha_wreg_prefix . 'system' ] ) ) {
                  //Change status to allocating
                  $system_data = get_post_meta( $item_id, $sha_wreg_prefix . 'system', true );
                  $system_name = get_post( $_POST[ $sha_wreg_prefix . 'system' ] )-&gt;post_title;
                  $system_object = array(
                      'id'    =&gt; (int)$_POST[ $sha_wreg_prefix . 'system' ],
                      'name'  =&gt; $system_name
                  );
  
                  if ( empty( $system_data ) ) {
                      update_post_meta( $item_id, $sha_wreg_prefix . 'status', 'Allocated' );
                  }
                  update_post_meta( $item_id, $sha_wreg_prefix . 'system', $system_object );
              }
  
              //Remove empty rows
              foreach ( $_POST[ $sha_wreg_prefix . 'detail_data' ] as $k =&gt; $v ) {
                  if ( empty( $v['name'] ) || ( empty( $v['name'] ) &amp;&amp; empty( $v['value'] ) ) ) {
                      unset( $_POST[ $sha_wreg_prefix . 'detail_data' ][ $k ] );
                  }
              }
  
              // Update details
              $detail_data = get_post_meta( $item_id, $sha_wreg_prefix . 'detail_data', true );
              $detail_data = unserialize( $detail_data );
              if ( $detail_data !== $_POST[ $sha_wreg_prefix . 'detail_data' ] ) {
                  update_post_meta( $item_id, $sha_wreg_prefix . 'detail_data', serialize( $_POST[ $sha_wreg_prefix . 'detail_data' ] ) );
              }
  
          break;
  
          case $sha_wreg_module_slug . '_pdfs':
              // Update PDF
              if ( isset( $_FILES[ $sha_wreg_prefix . 'pdf_file' ] ) &amp;&amp; $_FILES[ $sha_wreg_prefix . 'pdf_file' ][ 'error' ] == 0 ) {
                  $oldfile = get_post_meta( $item_id, $sha_wreg_prefix . 'pdf_file', true );
                  $uploadfile = sprintf('%s/%s', $sha_wreg_uploads_dir,  $_FILES[ $sha_wreg_prefix . 'pdf_file' ]['name'] );
  
                  //Copy PDF
                  if ( move_uploaded_file( $_FILES[ $sha_wreg_prefix . 'pdf_file' ]['tmp_name'], $uploadfile ) ) {
                      update_post_meta( $item_id, $sha_wreg_prefix . 'pdf_file', basename( $uploadfile ) );
                  }
  
                  //Remove old PDF
                  if ( isset( $oldfile ) &amp;&amp; !empty( $oldfile ) ) {
                      if ( file_exists( sprintf( '%s/%s', $sha_wreg_uploads_dir, basename( $oldfile ) ) ) ) {
                          unlink( sprintf( '%s/%s', $sha_wreg_uploads_dir, basename( $oldfile ) ) );
                      }
                  }
              }
  
              // Update checkboxes
              $checkbox_data = get_post_meta( $item_id, $sha_wreg_prefix . 'checkbox_data', true );
              $checkbox_data = unserialize( $detail_data );
              if ( $checkbox_data !== $_POST[ $sha_wreg_prefix . 'checkbox_data' ] ) {
                  update_post_meta( $item_id, $sha_wreg_prefix . 'checkbox_data', serialize( $_POST[ $sha_wreg_prefix . 'checkbox_data' ] ) );
              }
  
              // Update extra data
              $extra_data = get_post_meta( $item_id, $sha_wreg_prefix . 'extra_data', true );
              $extra_data = unserialize( $extra_data );
              if ( isset( $_POST[ $sha_wreg_prefix . 'extra_data' ] ) &amp;&amp; ( $extra_data !== $_POST[ $sha_wreg_prefix . 'extra_data' ] ) ) {
                  update_post_meta( $item_id, $sha_wreg_prefix . 'extra_data', serialize( $_POST[ $sha_wreg_prefix . 'extra_data' ] ) );
              }
  
          break;
      }
  }
  </code></pre>