Add 'edit_posts' capability check to metaWeblog.newPost. Props Joseph Scott and Wei-Yeh Lee. fixes #4404 for 2.3
git-svn-id: https://develop.svn.wordpress.org/trunk@5651 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6aa3a65c02
commit
5fcd7483ea
@ -925,8 +925,9 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
return $this->error;
|
return $this->error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$cap = ($publish) ? 'publish_posts' : 'edit_posts';
|
||||||
$user = set_current_user(0, $user_login);
|
$user = set_current_user(0, $user_login);
|
||||||
if ( !current_user_can('publish_posts') )
|
if ( !current_user_can($cap) )
|
||||||
return new IXR_Error(401, __('Sorry, you can not post on this weblog or category.'));
|
return new IXR_Error(401, __('Sorry, you can not post on this weblog or category.'));
|
||||||
|
|
||||||
// The post_type defaults to post, but could also be page.
|
// The post_type defaults to post, but could also be page.
|
||||||
|
Loading…
Reference in New Issue
Block a user