]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/post.php
WordPress 3.4.1
[autoinstalls/wordpress.git] / wp-admin / post.php
index c3bca7020f3c117a271fb32ccadb4789f88cb0e2..035a185540a119ad5afef3e5d40a3c2797a27294 100644 (file)
@@ -134,15 +134,15 @@ case 'edit':
        if ( empty($post->ID) )
                wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') );
 
+       if ( null == $post_type_object )
+               wp_die( __('Unknown post type.') );
+
        if ( !current_user_can($post_type_object->cap->edit_post, $post_id) )
                wp_die( __('You are not allowed to edit this item.') );
 
        if ( 'trash' == $post->post_status )
                wp_die( __('You can’t edit this item because it is in the Trash. Please restore it and try again.') );
 
-       if ( null == $post_type_object )
-               wp_die( __('Unknown post type.') );
-
        $post_type = $post->post_type;
        if ( 'post' == $post_type ) {
                $parent_file = "edit.php";
@@ -262,4 +262,3 @@ default:
        break;
 } // end switch
 include('./admin-footer.php');
-?>