-case 'post-quickpress-publish':
-case 'post-quickpress-save':
- check_admin_referer('add-' . $post_type);
-
- if ( 'post-quickpress-publish' == $action )
- $_POST['publish'] = 'publish'; // tell write_post() to publish
-
- if ( 'post-quickpress-publish' == $action || 'post-quickpress-save' == $action ) {
- $_POST['comment_status'] = get_option('default_comment_status');
- $_POST['ping_status'] = get_option('default_ping_status');
- }
-
- if ( !empty( $_POST['quickpress_post_ID'] ) ) {
- $_POST['post_ID'] = (int) $_POST['quickpress_post_ID'];
- $post_id = edit_post();
- } else {
- $post_id = 'postajaxpost' == $action ? edit_post() : write_post();
- }
-
- if ( 0 === strpos( $action, 'post-quickpress' ) ) {
- $_POST['post_ID'] = $post_id;
- // output the quickpress dashboard widget
- require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
- wp_dashboard_quick_press_output();
- exit;
- }
-
- redirect_post($post_id);
+ check_admin_referer( 'add-' . $post_type );
+ $post_id = 'postajaxpost' == $action ? edit_post() : write_post();
+ redirect_post( $post_id );