Make WordPress Core


Ignore:
Timestamp:
10/23/2010 06:16:41 PM (14 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r15929 r15935  
    20342034        }
    20352035
    2036         if ( is_array($post_type) ) {
     2036        if ( is_array( $post_type ) ) {
    20372037            $post_type_cap = 'multiple_post_type';
    20382038        } else {
    2039             $post_type_object = get_post_type_object ( $post_type );
    2040             if ( !empty($post_type_object) )
    2041                 $post_type_cap = $post_type_object->capability_type;
    2042             else
     2039            $post_type_object = get_post_type_object( $post_type );
     2040            if ( empty( $post_type_object ) )
    20432041                $post_type_cap = $post_type;
    20442042        }
     
    20672065        }
    20682066
    2069         if ( !empty($post_type_object) ) {
    2070             $post_type_cap = $post_type_object->capability_type;
     2067        if ( ! empty( $post_type_object ) ) {
    20712068            $edit_cap = $post_type_object->cap->edit_post;
    20722069            $read_cap = $post_type_object->cap->read_post;
Note: See TracChangeset for help on using the changeset viewer.