Ticket #16714: 16714.10.diff
File 16714.10.diff, 2.0 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1016 1016 if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) ) 1017 1017 return new IXR_Error( 401, __( 'The post type may not be changed.' ) ); 1018 1018 } else { 1019 if ( ! current_user_can( $post_type->cap-> edit_posts ) )1019 if ( ! current_user_can( $post_type->cap->create_posts ) ) 1020 1020 return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) ); 1021 1021 } 1022 1022 … … 3927 3927 3928 3928 do_action('xmlrpc_call', 'blogger.newPost'); 3929 3929 3930 $cap = ($publish) ? 'publish_posts' : ' edit_posts';3930 $cap = ($publish) ? 'publish_posts' : 'create_posts'; 3931 3931 if ( !current_user_can($cap) ) 3932 3932 return new IXR_Error(401, __('Sorry, you are not allowed to post on this site.')); 3933 3933 … … 4114 4114 elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] ) 4115 4115 $cap = 'publish_pages'; 4116 4116 else 4117 $cap = ' edit_pages';4117 $cap = 'create_pages'; 4118 4118 $error_message = __( 'Sorry, you are not allowed to publish pages on this site.' ); 4119 4119 $post_type = 'page'; 4120 4120 if ( !empty( $content_struct['wp_page_template'] ) ) … … 4125 4125 elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] ) 4126 4126 $cap = 'publish_posts'; 4127 4127 else 4128 $cap = ' edit_posts';4128 $cap = 'create_posts'; 4129 4129 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 4130 4130 $post_type = 'post'; 4131 4131 } else { … … 4138 4138 elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status']) 4139 4139 $cap = 'publish_posts'; 4140 4140 else 4141 $cap = ' edit_posts';4141 $cap = 'create_posts'; 4142 4142 $error_message = __( 'Sorry, you are not allowed to publish posts on this site.' ); 4143 4143 $post_type = 'post'; 4144 4144 }