Ticket #19055: 19055.2.diff
File 19055.2.diff, 827 bytes (added by , 12 years ago) |
---|
-
wp-admin/edit.php
9 9 /** WordPress Administration Bootstrap */ 10 10 require_once( './admin.php' ); 11 11 12 if ( !isset($_GET['post_type']) ) 13 $post_type = 'post'; 14 elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) 12 if ( isset( $_GET['post_type'] ) ) { 15 13 $post_type = $_GET['post_type']; 16 else 14 } else { 15 $post_type = $_GET['post_type'] = 'post'; 16 } 17 18 if ( ! in_array( $post_type, get_post_types( array('show_ui' => true ) ) ) ) 17 19 wp_die( __('Invalid post type') ); 18 20 19 $_GET['post_type'] = $post_type;20 21 21 $post_type_object = get_post_type_object( $post_type ); 22 22 23 23 if ( !current_user_can($post_type_object->cap->edit_posts) )