WordPress.org

Make WordPress Core

Ticket #12408: 12408.diff

File 12408.diff, 652 bytes (added by prettyboymp, 8 years ago)
  • wp-admin/includes/user.php

     
    245245        global $wpdb;
    246246
    247247        $user = new WP_User( $user_id );
     248        $post_type_obj = get_post_type_object($post_type);
    248249
    249         if ( ! $user->has_cap("edit_others_{$post_type}s") ) {
    250                 if ( $user->has_cap("edit_{$post_type}s") || $exclude_zeros == false )
     250        if ( ! $user->has_cap($post_type_obj->edit_others_cap) ) {
     251                if ( $user->has_cap($post_type_obj->edit_cap) || $exclude_zeros == false )
    251252                        return array($user->id);
    252253                else
    253254                        return array();