Make WordPress Core


Ignore:
Timestamp:
11/14/2008 05:13:08 PM (16 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r9589 r9683  
    221221 * @return unknown
    222222 */
    223 function get_editable_user_ids( $user_id, $exclude_zeros = true ) {
     223function get_editable_user_ids( $user_id, $exclude_zeros = true, $post_type = 'post' ) {
    224224    global $wpdb;
    225225
    226226    $user = new WP_User( $user_id );
    227227
    228     if ( ! $user->has_cap('edit_others_posts') ) {
    229         if ( $user->has_cap('edit_posts') || $exclude_zeros == false )
     228    if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
     229        if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false )
    230230            return array($user->id);
    231231        else
Note: See TracChangeset for help on using the changeset viewer.