Make WordPress Core

Ticket #7299: FixAtomPubDrafts.diff

File FixAtomPubDrafts.diff, 940 bytes (added by redsweater, 17 years ago)
  • wp-app.php

     
    394394                        $this->auth_required(__('Sorry, you do not have the right to edit this post.'));
    395395
    396396                $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
     397                $post_status = ($publish) ? 'publish' : 'draft';
    397398
    398399                extract($entry);
    399400
     
    407408                $post_modified = $pubtimes[0];
    408409                $post_modified_gmt = $pubtimes[1];
    409410
    410                 // let's not go backwards and make something draft again.
    411                 if(!$publish && $post_status == 'draft') {
    412                         $post_status = ($publish) ? 'publish' : 'draft';
    413                 } elseif($publish) {
    414                         $post_status = 'publish';
    415                 }
    416 
    417411                $postdata = compact('ID', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt');
    418412                $this->escape($postdata);
    419413