title: Wordpress wp_update_post not updating status correctly
body: <p>I am trying to programatically create and update a custom post type from an interface into Wordpress.
  I have the following code and everything works, except for the published / scheduled status:</p>
  
  <pre><code>wp_update_post(
      array(
          'ID' =&gt; $id,
          'post_title' =&gt; $page_title,
          'post_excerpt' =&gt; $page_excerpt,
          'post_content' =&gt; $page_content,
          'edit_date' =&gt; true,
          'post_date' =&gt; $publish_date,
          'post_status' =&gt; ( strtotime( $publish_date ) &gt; time( ) ? 'future' : 'publish' )
      )
  );
  </code></pre>
  
  <p>When creating the post with wp_insert_post, this seems to set the status correctly (using the same logic as above), but when updating the date (and setting the status accordingly), the status never changes.</p>
  
  <p>e.g. if a post is created 6 months into the future, it is set to scheduled. If that post is updated with a post_date in the past, the date is updated, but the status is still set to scheduled.</p>
  
  <p>I've read that you need to set edit_date to true for it to work, but I've tried that as above and still no luck.</p>
  
  <p>Is there something I'm missing?</p>
  
  <p>Thanks in advance for any help.</p>
  
  <p>Regards,</p>
  
  <p>PhilHalf</p>