Move post_type var setup back into edit.php and reinstate the cap check. See #15326

git-svn-id: http://svn.automattic.com/wordpress/trunk@16965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2010-12-15 18:58:05 +00:00
parent 6f607d4046
commit d70286d3a6
2 changed files with 15 additions and 8 deletions

View File

@ -8,6 +8,21 @@
/** WordPress Administration Bootstrap */
require_once( './admin.php' );
if ( !isset($_GET['post_type']) )
$post_type = 'post';
elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
$post_type = $_GET['post_type'];
else
wp_die( __('Invalid post type') );
$_GET['post_type'] = $post_type;
$post_type_object = get_post_type_object( $post_type );
if ( !current_user_can($post_type_object->cap->edit_posts) )
wp_die(__('Cheatin’ uh?'));
$wp_list_table = get_list_table('WP_Posts_List_Table');
$wp_list_table->check_permissions();
$pagenum = $wp_list_table->get_pagenum();

View File

@ -47,14 +47,6 @@ class WP_Posts_List_Table extends WP_List_Table {
function WP_Posts_List_Table() {
global $post_type_object, $post_type, $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_object = get_post_type_object( $post_type );
if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {