Handle both post and page caps in get_editable_user_id(). Props DD32. fixes #8208

git-svn-id: https://develop.svn.wordpress.org/trunk@9683 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-11-14 17:13:08 +00:00
parent 84f08ca047
commit 455462be39
2 changed files with 5 additions and 5 deletions

View File

@@ -220,13 +220,13 @@ function get_editable_authors( $user_id ) {
* @param bool $exclude_zeros Optional, default is true. Whether to exclude zeros.
* @return unknown
*/
function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
global $wpdb;
$user = new WP_User( $user_id );
if ( ! $user->has_cap('edit_others_posts') ) {
if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false )
return array($user->id);
else
return false;