mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@24593 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2440,14 +2440,13 @@ class WP_Query {
|
||||
$post_type_object = get_post_type_object ( 'post' );
|
||||
}
|
||||
|
||||
$edit_cap = 'edit_post';
|
||||
$read_cap = 'read_post';
|
||||
|
||||
if ( ! empty( $post_type_object ) ) {
|
||||
$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;
|
||||
$read_private_cap = $post_type_object->cap->read_private_posts;
|
||||
} else {
|
||||
$edit_cap = 'edit_' . $post_type_cap;
|
||||
$read_cap = 'read_' . $post_type_cap;
|
||||
$edit_others_cap = 'edit_others_' . $post_type_cap . 's';
|
||||
$read_private_cap = 'read_private_' . $post_type_cap . 's';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user