Make WordPress Core

Ticket #4991: 5740.diff

File 5740.diff, 2.1 KB (added by DD32, 17 years ago)

patch from #5740

  • wp-admin/edit-form-advanced.php

     
    4747$saveasdraft = '<input name="save" type="submit" id="save" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';
    4848
    4949if (empty($post->post_status)) $post->post_status = 'draft';
     50if (empty($post->post_type)) $post->post_type = 'post';
    5051
    5152?>
    5253
     
    5455<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
    5556<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
    5657<input type="hidden" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
    57 <input type="hidden" id="post_type" name="post_type" value="post" />
     58<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
    5859
    5960<?php echo $form_extra ?>
    6061<?php if ((isset($post->post_title) && '' == $post->post_title) || (isset($_GET['message']) && 2 > $_GET['message'])) : ?>
  • wp-admin/edit-page-form.php

     
    2727<?php
    2828wp_nonce_field($nonce_action);
    2929
    30 if (isset($mode) && 'bookmarklet' == $mode) {
     30if (isset($mode) && 'bookmarklet' == $mode)
    3131        echo '<input type="hidden" name="mode" value="bookmarklet" />';
    32 }
     32if (empty($post->post_type)) $post->post_type = 'page';
     33
    3334?>
    3435<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
    3536<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
    3637<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
    3738<?php echo $form_extra ?>
    38 <input type="hidden" id="post_type" name="post_type" value="page" />
     39<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
    3940
    4041<script type="text/javascript">
    4142// <![CDATA[