Make WordPress Core


Ignore:
Timestamp:
05/12/2010 08:45:18 PM (15 years ago)
Author:
nacin
Message:

Move post type object capabilities to a 'cap' object. Allow them to be initialized via the 'capabilities' key (an array) when registering support for the post type. Caps are now referred to by the name of the cap as if it was a post, i.e. ->cap->edit_post. see #13358.

File:
1 edited

Legend:

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

    r14565 r14585  
    21932193        if ( !empty($post_type_object) ) {
    21942194            $post_type_cap = $post_type_object->capability_type;
    2195             $edit_cap = $post_type_object->edit_cap;
    2196             $read_cap = $post_type_object->read_cap;
    2197             $edit_others_cap = $post_type_object->edit_others_cap;
    2198             $read_private_cap = $post_type_object->read_private_cap;
     2195            $edit_cap = $post_type_object->cap->edit_post;
     2196            $read_cap = $post_type_object->cap->read_post;
     2197            $edit_others_cap = $post_type_object->cap->edit_other_posts;
     2198            $read_private_cap = $post_type_object->cap->read_private_posts;
    21992199        } else {
    22002200            $edit_cap = 'edit_' . $post_type_cap;
Note: See TracChangeset for help on using the changeset viewer.