WordPress.org

Make WordPress Core

Changeset 8446


Ignore:
Timestamp:
07/24/2008 10:40:54 PM (13 years ago)
Author:
mdawaffe
Message:

crazyhorse: add 'save and continue' button to quickpress

Location:
branches/crazyhorse/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/includes/dashboard.php

    r8443 r8446  
    309309    echo $after_title;
    310310
     311    if ( ( 'post' === strtolower( $_SERVER['REQUEST_METHOD'] ) ) && 'post-quickpress-save-cont' === $_POST['action'] ) {
     312        $post = get_post_to_edit( $_POST['post_ID'] );
     313    } else {
     314        $_REQUEST = array(); // hack
     315        $post = get_default_post_to_edit();
     316    }
    311317?>
    312318
     
    314320        <h3 id="quick-post-title"><label for="title"><?php _e('Title') ?></label></h3>
    315321        <div class="input-text-wrap">
    316             <input type="text" name="post_title" id="title" autocomplete="off" />
     322            <input type="text" name="post_title" id="title" autocomplete="off" value="<?php echo attribute_escape( $post->post_title ); ?>" />
    317323        </div>
    318324
    319325        <h3><label for="content"><?php _e('Post') ?></label></h3>
    320326        <div class="textarea-wrap">
    321             <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"></textarea>
     327            <textarea name="content" id="quickpress-content" class="mceEditor" rows="3" cols="15"><?php echo $post->post_content; ?></textarea>
    322328        </div>
    323329
    324330        <h3><label for="tags-input"><?php _e('Tags') ?></label></h3>
    325331        <div class="input-text-wrap">
    326             <input type="text" name="tags_input" id="tags-input" />
     332            <input type="text" name="tags_input" id="tags-input" value="<?php echo get_tags_to_edit( $post->ID ); ?>" />
    327333        </div>
    328334        <p class='field-tip'><?php _e('Separate tags with commas'); ?></p>
     
    330336        <p class="submit">
    331337            <input type="hidden" name="action" id="quickpost-action" value="post-quickpress-save" />
     338            <input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" />
    332339            <?php wp_nonce_field('add-post'); ?>
    333340            <input type="submit" name="save" id="save-post" class="button" value="<?php _e('Save'); ?>" />
     341            <input type="submit" name="save-cont" id="save-cont" class="button" value="<?php _e('Save and Continue'); ?>" />
    334342            <input type="submit" name="publish" id="publish" accesskey="p" class="button button-highlighted" value="<?php _e('Publish'); ?>" />
    335343        </p>
     
    398406
    399407    $('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
     408    $('#save-cont').click( function() { act.val( 'post-quickpress-save-cont' ); } );
    400409};
    401410jQuery( quickPressLoad );
  • branches/crazyhorse/wp-admin/post.php

    r8371 r8446  
    6262case 'post-quickpress-publish':
    6363case 'post-quickpress-save':
     64case 'post-quickpress-save-cont':
    6465    check_admin_referer('add-post');
    6566
     
    6768        $_POST['publish'] = 'publish'; // tell write_post() to publish
    6869
    69     $post_ID = 'postajaxpost' == $action ? edit_post() : write_post();
     70    if ( !empty( $_POST['quickpress_post_ID'] ) ) {
     71        $_POST['post_ID'] = (int) $_POST['quickpress_post_ID'];
     72        $post_ID = edit_post();
     73    } else {
     74        $post_ID = 'postajaxpost' == $action ? edit_post() : write_post();
     75    }
    7076
    7177    if ( 0 === strpos( $action, 'post-quickpress' ) ) {
Note: See TracChangeset for help on using the changeset viewer.