Make WordPress Core


Ignore:
Timestamp:
07/08/2013 08:05:42 PM (13 years ago)
Author:
nacin
Message:

Use meta caps edit_post, read_post, and delete_post directly, rather than consulting the post type object. map_meta_cap() handles that for us. props markjaquith, kovshenin. fixes #23226.

File:
1 edited

Legend:

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

    r24456 r24593  
    24412441        }
    24422442
     2443        $edit_cap = 'edit_post';
     2444        $read_cap = 'read_post';
     2445
    24432446        if ( ! empty( $post_type_object ) ) {
    2444             $edit_cap = $post_type_object->cap->edit_post;
    2445             $read_cap = $post_type_object->cap->read_post;
    24462447            $edit_others_cap = $post_type_object->cap->edit_others_posts;
    24472448            $read_private_cap = $post_type_object->cap->read_private_posts;
    24482449        } else {
    2449             $edit_cap = 'edit_' . $post_type_cap;
    2450             $read_cap = 'read_' . $post_type_cap;
    24512450            $edit_others_cap = 'edit_others_' . $post_type_cap . 's';
    24522451            $read_private_cap = 'read_private_' . $post_type_cap . 's';
Note: See TracChangeset for help on using the changeset viewer.