Revert [20568] until a publish_post cap is introduced. see #20474

git-svn-id: https://develop.svn.wordpress.org/trunk@20576 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-04-24 16:22:12 +00:00
parent a89d307726
commit 643618503c

View File

@ -785,23 +785,13 @@ class wp_xmlrpc_server extends IXR_Server {
case 'pending': case 'pending':
break; break;
case 'private': case 'private':
if ( $update ) { if ( ! current_user_can( $post_type->cap->publish_posts ) )
if ( ! current_user_can( $post_type->cap->publish_post, $post_data[ 'ID' ] ) ) return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ));
return new IXR_Error( 401, __( 'Sorry, you are not allowed to set this post as private.' ) );
} else {
if ( ! current_user_can( $post_type->cap->publish_posts ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to create private posts in this post type' ));
}
break; break;
case 'publish': case 'publish':
case 'future': case 'future':
if ( $update ) { if ( ! current_user_can( $post_type->cap->publish_posts ) )
if ( ! current_user_can( $post_type->cap->publish_post, $post_data[ 'ID' ] ) ) return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ));
return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish this post.' ) );
} else {
if ( ! current_user_can( $post_type->cap->publish_posts ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts in this post type' ));
}
break; break;
default: default:
$post_data['post_status'] = 'draft'; $post_data['post_status'] = 'draft';