Fix Author selection for non-post type posts. Props prettyboymp. Fixes #12408

git-svn-id: https://develop.svn.wordpress.org/trunk@13488 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-02-28 06:38:15 +00:00
parent f937e72ae9
commit 1a258ebff7
1 changed files with 3 additions and 2 deletions

View File

@ -246,9 +246,10 @@ function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'p
global $wpdb;
$user = new WP_User( $user_id );
$post_type_obj = get_post_type_object($post_type);
if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false )
if ( ! $user->has_cap($post_type_obj->edit_others_cap) ) {
if ( $user->has_cap($post_type_obj->edit_cap) || $exclude_zeros == false )
return array($user->id);
else
return array();