Make WordPress Core

Ticket #20064: 20064.patch

File 20064.patch, 958 bytes (added by markoheijnen, 13 years ago)
  • wp-admin/post.php

     
    134134        if ( empty($post->ID) )
    135135                wp_die( __('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?') );
    136136
     137        if ( null == $post_type_object || ( $post->post_type == 'revision' && post_type_exists( get_post_type( $post->post_parent ) ) == false ) )
     138                wp_die( __('Unknown post type.') );
     139
    137140        if ( !current_user_can($post_type_object->cap->edit_post, $post_id) )
    138141                wp_die( __('You are not allowed to edit this item.') );
    139142
    140143        if ( 'trash' == $post->post_status )
    141144                wp_die( __('You can’t edit this item because it is in the Trash. Please restore it and try again.') );
    142145
    143         if ( null == $post_type_object )
    144                 wp_die( __('Unknown post type.') );
    145 
    146146        $post_type = $post->post_type;
    147147        if ( 'post' == $post_type ) {
    148148                $parent_file = "edit.php";