Make WordPress Core


Ignore:
Timestamp:
11/28/2012 10:28:20 PM (12 years ago)
Author:
nacin
Message:

Use the create_posts post type cap in more places. Remove the janky create_posts meta cap. see #16714.

File:
1 edited

Legend:

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

    r22622 r22908  
    10171017                return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
    10181018        } else {
    1019             if ( ! current_user_can( $post_type->cap->edit_posts ) )
     1019            if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( $post_type->cap->edit_posts ) )
    10201020                return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
    10211021        }
     
    39293929
    39303930        $cap = ($publish) ? 'publish_posts' : 'edit_posts';
    3931         if ( !current_user_can($cap) )
     3931        if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) || !current_user_can($cap) )
    39323932            return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.'));
    39333933
     
    41444144        }
    41454145
     4146        if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) )
     4147            return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) );
    41464148        if ( !current_user_can( $cap ) )
    41474149            return new IXR_Error( 401, $error_message );
Note: See TracChangeset for help on using the changeset viewer.