]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/post.php
Wordpress 3.1.2
[autoinstalls/wordpress.git] / wp-admin / post.php
index 548007f7f039c7e7c4132a9a9a42134eb1f98e82..0dae46dde649b9fe80d7f3abda9abd5e75dfe392 100644 (file)
@@ -51,12 +51,7 @@ if ( $post_id ) {
  * @param int $post_id Optional. Post ID.
  */
 function redirect_post($post_id = '') {
-       if ( !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
-               if ( isset($_POST['saveasdraft']) )
-                       $location = 'sidebar.php?a=c';
-               elseif ( isset($_POST['publish']) )
-                       $location = 'sidebar.php?a=b';
-       } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
+       if ( isset($_POST['save']) || isset($_POST['publish']) ) {
                $status = get_post_status( $post_id );
 
                if ( isset( $_POST['publish'] ) ) {
@@ -90,6 +85,7 @@ function redirect_post($post_id = '') {
        }
 
        wp_redirect( apply_filters( 'redirect_post_location', $location, $post_id ) );
+       exit;
 }
 
 if ( isset( $_POST['deletepost'] ) )
@@ -143,7 +139,7 @@ case 'edit':
        $editing = true;
 
        if ( empty( $post_id ) ) {
-               wp_redirect("post.php");
+               wp_redirect( admin_url('post.php') );
                exit();
        }
 
@@ -166,7 +162,10 @@ case 'edit':
                $parent_file = "edit.php";
                $submenu_file = "edit.php";
        } else {
-               $parent_file = "edit.php?post_type=$post_type";
+               if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true )
+                       $parent_file = $post_type_object->show_in_menu;
+               else
+                       $parent_file = "edit.php?post_type=$post_type";
                $submenu_file = "edit.php?post_type=$post_type";
        }
 
@@ -270,7 +269,7 @@ case 'preview':
        break;
 
 default:
-               wp_redirect('edit.php');
+       wp_redirect( admin_url('edit.php') );
        exit();
        break;
 } // end switch