Make WordPress Core


Ignore:
Timestamp:
08/20/2008 09:42:31 PM (16 years ago)
Author:
ryan
Message:

Collapse crazyhorse to trunk. Incoming! see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r8656 r8691  
    3636    } elseif ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    3737        $location = 'sidebar.php?a=b';
    38     } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
     38    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    3939        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    4040            $location = add_query_arg( array(
     
    4343            ), get_edit_post_link( $post_ID, 'url' ) );
    4444        else
    45             $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
     45            $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
    4646    } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    4747        $location = add_query_arg( 'message', 2, wp_get_referer() );
     
    6363    } elseif ($action == 'editattachment') {
    6464        $location = 'attachments.php';
     65    } elseif ( 'post-quickpress-save-cont' == $_POST['action'] ) {
     66        $location = "post.php?action=edit&post=$post_ID&message=7";
    6567    } else {
    6668        $location = add_query_arg( 'message', 4, get_edit_post_link( $post_ID, 'url' ) );
     
    7678case 'postajaxpost':
    7779case 'post':
     80case 'post-quickpress-publish':
     81case 'post-quickpress-save':
     82case 'post-quickpress-save-cont':
    7883    check_admin_referer('add-post');
    7984
    80     $post_ID = 'post' == $action ? write_post() : edit_post();
     85    if ( 'post-quickpress-publish' == $action )
     86        $_POST['publish'] = 'publish'; // tell write_post() to publish
     87
     88    if ( !empty( $_POST['quickpress_post_ID'] ) ) {
     89        $_POST['post_ID'] = (int) $_POST['quickpress_post_ID'];
     90        $post_ID = edit_post();
     91    } else {
     92        $post_ID = 'postajaxpost' == $action ? edit_post() : write_post();
     93    }
     94
     95    if ( 'post-quickpress-save-cont' != $action && 0 === strpos( $action, 'post-quickpress' ) ) {
     96        $_POST['post_ID'] = $post_ID;
     97        // output the quickpress dashboard widget
     98        require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
     99        add_filter( 'wp_dashboard_widgets', create_function( '$a', 'return array( "dashboard_quick_press" );' ) );
     100        wp_dashboard_setup();
     101        wp_dashboard();
     102        exit;
     103    }
    81104
    82105    redirect_post($post_ID);
Note: See TracChangeset for help on using the changeset viewer.