title: wordpress insert post doesnt work on edge
body: <p>I create a code to save data from Form to custom_post_type.
  Everything ok on Firefox but when I test it on edge, the post still save, but I can't edit the post on admin, or view the post(object not found) (see the image)</p>
  
  <p><a href="https://i.stack.imgur.com/1b11Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1b11Y.png" alt="enter image description here"></a> </p>
  
  <p>I really don't know where is the problem, please help.</p>
  
  <p>this is my code, i copy it from my function.php:</p>
  
  <pre><code>    function wpshout_frontend_post() {
       wpshout_save_post_if_submitted();
      ?&gt;
      &lt;div&gt;
          &lt;div&gt;
              RESERVATION
          &lt;/div&gt;      
              &lt;form id="new_post" class = 'datcho' name="new_post" method="post"&gt;
              &lt;input type = 'text' name = 'ten' required&gt;
              &lt;input type = 'tel' name = 'sdt' required&gt;
              &lt;input type = 'number' name = 'num' min='1' max = '10' required&gt;
              &lt;input type = 'date' name = 'ngay' required&gt;
              &lt;input type = 'time' name = 'time' value = '13:00' min='9:00' max='21:00' required&gt;
              &lt;?php wp_nonce_field( 'wps-frontend-post' ); ?&gt;
  
  
              &lt;input type="submit" value="Reservation" id="submit" name="submit"/&gt;
  
              &lt;/div&gt;
              &lt;/form&gt;
      &lt;/div&gt;
      &lt;?php
  }
  
  function wpshout_save_post_if_submitted() {
      // Stop running function if form wasn't submitted
      if ( !isset($_POST['ten']) ) {
          return; 
      }
      // Check that the nonce was set and valid
      if( !wp_verify_nonce($_POST['_wpnonce'], 'wps-frontend-post') ) {
          echo 'Did not save because your form seemed to be invalid. Sorry';
          return;
      }
  
      // Do some minor form validation to make sure there is content
  
      // Add the content of the form to $post as an array
      $title = wp_strip_all_tags($_POST['ten']);
      $post = array(
          'post_title'    =&gt; $title,
          'post_content'  =&gt; $title,
          'post_status'   =&gt; 'Pending',   
          'post_type'     =&gt; 'datcho' 
      );
  
     $eror = wp_insert_post($post,true);
      if($eror){
          $sdt = wp_strip_all_tags($_POST['sdt']);
          $ngay = wp_strip_all_tags($_POST['ngay']);
          $time = wp_strip_all_tags($_POST['time']);
          $num = wp_strip_all_tags($_POST['num']);
          add_post_meta($eror, 'sdt', $sdt);
          add_post_meta($eror, 'ngay', $ngay);
          add_post_meta($eror, 'time', $time);
          add_post_meta($eror, 'num', $num);
          echo 'Saved your post successfully! :)';
      }else {
          echo "something wrong";
      }
  }
  </code></pre>