Cap migration.

git-svn-id: https://develop.svn.wordpress.org/trunk@2712 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-07-15 01:24:08 +00:00
parent 6059fcf644
commit 7e94ba45c5
5 changed files with 38 additions and 25 deletions
+2 -1
View File
@@ -532,6 +532,7 @@ function wp_new_comment( $commentdata, $spam = false ) {
if ( $user_id ) {
$userdata = get_userdata($user_id);
$user = new WP_User($user_id);
$post_author = $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = '$comment_post_ID' LIMIT 1");
}
@@ -552,7 +553,7 @@ function wp_new_comment( $commentdata, $spam = false ) {
}
}
if ( $userdata && ( $user_id == $post_author || $userdata->user_level >= 9 ) ) {
if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9') ) ) {
$approved = 1;
} else {
if ( check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $comment_type) )