mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-29 15:44:27 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@14585 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -249,8 +249,8 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p
|
||||
$user = new WP_User( $user_id );
|
||||
$post_type_obj = get_post_type_object($post_type);
|
||||
|
||||
if ( ! $user->has_cap($post_type_obj->edit_others_cap) ) {
|
||||
if ( $user->has_cap($post_type_obj->edit_type_cap) || ! $exclude_zeros )
|
||||
if ( ! $user->has_cap($post_type_obj->cap->edit_other_posts) ) {
|
||||
if ( $user->has_cap($post_type_obj->cap->edit_posts) || ! $exclude_zeros )
|
||||
return array($user->id);
|
||||
else
|
||||
return array();
|
||||
|
||||
Reference in New Issue
Block a user