Remove last remaining user level checks in favor of capabilities checks. props filosofo. fixes #6940
git-svn-id: https://develop.svn.wordpress.org/trunk@7912 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
020a8cacad
commit
9ae97a6602
@ -344,7 +344,7 @@ function wp_allow_comment($commentdata) {
|
|||||||
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
|
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') ) ) {
|
if ( $userdata && ( $user_id == $post_author || $user->has_cap('moderate_comments') ) ) {
|
||||||
// The author and the admins get respect.
|
// The author and the admins get respect.
|
||||||
$approved = 1;
|
$approved = 1;
|
||||||
} else {
|
} else {
|
||||||
|
@ -788,7 +788,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||||||
do_action('xmlrpc_call', 'blogger.getUsersBlogs');
|
do_action('xmlrpc_call', 'blogger.getUsersBlogs');
|
||||||
|
|
||||||
set_current_user(0, $user_login);
|
set_current_user(0, $user_login);
|
||||||
$is_admin = current_user_can('level_8');
|
$is_admin = current_user_can('manage_options');
|
||||||
|
|
||||||
$struct = array(
|
$struct = array(
|
||||||
'isAdmin' => $is_admin,
|
'isAdmin' => $is_admin,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user