Make WordPress Core


Ignore:
Timestamp:
05/12/2010 08:45:18 PM (14 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-admin/includes/user.php

    r14428 r14585  
    250250    $post_type_obj = get_post_type_object($post_type);
    251251
    252     if ( ! $user->has_cap($post_type_obj->edit_others_cap) ) {
    253         if ( $user->has_cap($post_type_obj->edit_type_cap) || ! $exclude_zeros )
     252    if ( ! $user->has_cap($post_type_obj->cap->edit_other_posts) ) {
     253        if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
    254254            return array($user->id);
    255255        else
Note: See TracChangeset for help on using the changeset viewer.