Make WordPress Core

Ticket #16714: 16714.10.diff

File 16714.10.diff, 2.0 KB (added by johnbillion, 12 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    10161016                        if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) )
    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 ) )
    10201020                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) );
    10211021                }
    10221022
     
    39273927
    39283928                do_action('xmlrpc_call', 'blogger.newPost');
    39293929
    3930                 $cap = ($publish) ? 'publish_posts' : 'edit_posts';
     3930                $cap = ($publish) ? 'publish_posts' : 'create_posts';
    39313931                if ( !current_user_can($cap) )
    39323932                        return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.'));
    39333933
     
    41144114                                elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] )
    41154115                                        $cap  = 'publish_pages';
    41164116                                else
    4117                                         $cap = 'edit_pages';
     4117                                        $cap = 'create_pages';
    41184118                                $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' );
    41194119                                $post_type = 'page';
    41204120                                if ( !empty( $content_struct['wp_page_template'] ) )
     
    41254125                                elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] )
    41264126                                        $cap  = 'publish_posts';
    41274127                                else
    4128                                         $cap = 'edit_posts';
     4128                                        $cap = 'create_posts';
    41294129                                $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    41304130                                $post_type = 'post';
    41314131                        } else {
     
    41384138                        elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'])
    41394139                                $cap  = 'publish_posts';
    41404140                        else
    4141                                 $cap = 'edit_posts';
     4141                                $cap = 'create_posts';
    41424142                        $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
    41434143                        $post_type = 'post';
    41444144                }