Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r21138 r20996  
    13381338
    13391339                $post_type = get_post_type_object( $post['post_type'] );
    1340                 if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) )
     1340                if ( ! current_user_can( $post_type->cap->edit_posts, $post_id ) )
    13411341                        return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
    13421342
     
    13951395                        if ( ! ( (bool) $post_type ) )
    13961396                                return new IXR_Error( 403, __( 'The post type specified is not valid' ) );
    1397                 } else {
    1398                         $post_type = get_post_type_object( 'post' );
    1399                 }
    1400 
    1401                 if ( ! current_user_can( $post_type->cap->edit_posts ) )
    1402                         return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
    1403 
    1404                 $query['post_type'] = $post_type->name;
     1397
     1398                        if ( ! current_user_can( $post_type->cap->edit_posts ) )
     1399                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' ));
     1400
     1401                        $query['post_type'] = $filter['post_type'];
     1402                }
    14051403
    14061404                if ( isset( $filter['post_status'] ) )
     
    14301428                foreach ( $posts_list as $post ) {
    14311429                        $post_type = get_post_type_object( $post['post_type'] );
    1432                         if ( ! current_user_can( $post_type->cap->edit_post, $post['ID'] ) )
     1430                        if ( ! current_user_can( $post_type->cap->edit_posts, $post['ID'] ) )
    14331431                                continue;
    14341432
Note: See TracChangeset for help on using the changeset viewer.