X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a5227bf01edbe6660486c9f5c0f0ed7b7fea3130..f9001779751f83dc8a10e478bfecb4d8dd5f964c:/wp-admin/post.php diff --git a/wp-admin/post.php b/wp-admin/post.php index 548007f7..0dae46dd 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -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