Don't fallback to default post type or taxonomy if given an invalid post type or taxonomy. Use typenow as the canonical post type. Props nacin. see #19131

git-svn-id: http://svn.automattic.com/wordpress/trunk@19321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2011-11-17 18:01:08 +00:00
parent ee60065e28
commit 66388c185e
4 changed files with 21 additions and 30 deletions

View File

@@ -48,14 +48,7 @@ class WP_Posts_List_Table extends WP_List_Table {
function __construct() {
global $post_type_object, $wpdb;
if ( !isset( $_REQUEST['post_type'] ) )
$post_type = 'post';
elseif ( in_array( $_REQUEST['post_type'], get_post_types( array( 'show_ui' => true ) ) ) )
$post_type = $_REQUEST['post_type'];
else
wp_die( __( 'Invalid post type' ) );
$_REQUEST['post_type'] = $post_type;
$post_type = get_current_screen()->post_type;
$post_type_object = get_post_type_object( $post_type );
if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {