Make WordPress Core


Ignore:
Timestamp:
11/17/2011 06:01:08 PM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r19213 r19321  
    4949        global $post_type_object, $wpdb;
    5050
    51         if ( !isset( $_REQUEST['post_type'] ) )
    52             $post_type = 'post';
    53         elseif ( in_array( $_REQUEST['post_type'], get_post_types( array( 'show_ui' => true ) ) ) )
    54             $post_type = $_REQUEST['post_type'];
    55         else
    56             wp_die( __( 'Invalid post type' ) );
    57         $_REQUEST['post_type'] = $post_type;
    58 
     51        $post_type = get_current_screen()->post_type;
    5952        $post_type_object = get_post_type_object( $post_type );
    6053
Note: See TracChangeset for help on using the changeset viewer.