Remove some capability_type code in WP_Query. Only build faux caps if we're querying for multiple post types or if the post type object can't be found. see #14122.

git-svn-id: http://svn.automattic.com/wordpress/trunk@15935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-10-23 18:16:41 +00:00
parent f244d99609
commit b0443feba3
1 changed files with 4 additions and 7 deletions

View File

@ -2037,9 +2037,7 @@ class WP_Query extends WP_Object_Query {
$post_type_cap = 'multiple_post_type';
} else {
$post_type_object = get_post_type_object( $post_type );
if ( !empty($post_type_object) )
$post_type_cap = $post_type_object->capability_type;
else
if ( empty( $post_type_object ) )
$post_type_cap = $post_type;
}
@ -2067,7 +2065,6 @@ class WP_Query extends WP_Object_Query {
}
if ( ! empty( $post_type_object ) ) {
$post_type_cap = $post_type_object->capability_type;
$edit_cap = $post_type_object->cap->edit_post;
$read_cap = $post_type_object->cap->read_post;
$edit_others_cap = $post_type_object->cap->edit_others_posts;