diff --git src/wp-admin/edit.php src/wp-admin/edit.php
index 782b61d..86c65cb 100644
|
|
|
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
11 | 11 | |
12 | | if ( ! $typenow ) |
| 12 | if ( ! $typenow ) { |
13 | 13 | wp_die( __( 'Invalid post type' ) ); |
| 14 | } |
| 15 | |
| 16 | if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { |
| 17 | wp_die( __( 'You are not allowed to edit posts in this post type.' ) ); |
| 18 | } |
14 | 19 | |
15 | 20 | if ( 'attachment' === $typenow ) { |
16 | 21 | if ( wp_redirect( admin_url( 'upload.php' ) ) ) { |
diff --git src/wp-admin/post.php src/wp-admin/post.php
index 2fcef19..ba43eb1 100644
|
|
case 'edit': |
109 | 109 | if ( ! $post_type_object ) |
110 | 110 | wp_die( __( 'Unknown post type.' ) ); |
111 | 111 | |
| 112 | if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) { |
| 113 | wp_die( __( 'You are not allowed to edit posts in this post type.' ) ); |
| 114 | } |
| 115 | |
112 | 116 | if ( ! current_user_can( 'edit_post', $post_id ) ) |
113 | 117 | wp_die( __( 'You are not allowed to edit this item.' ) ); |
114 | 118 | |