diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index edc3d5dd1..c6c78c83c 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -497,8 +497,8 @@ function page_rows( $parent = 0, $level = 0, $pages = 0 ) { post_modified); ?> - $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "" . __('Edit') . ""; } ?> - $authordata->user_level) or ($user_login == $authordata->user_login)) { echo "" . __('Delete') . ""; } ?> + " . __('Edit') . ""; } ?> + " . __('Delete') . ""; } ?> - + $column_display_name) { case 'control_edit': ?> - ID) ) { echo "" . __('Edit') . ""; } ?> + ID) ) { echo "" . __('Edit') . ""; } ?> - ID) ) { echo "" . __('Delete') . ""; } ?> + ID) ) { echo "" . __('Delete') . ""; } ?> post_status == 'static') @@ -120,9 +117,8 @@ case 'delete': $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); - if (!user_can_delete_post($user_ID, $post_id)) { + if ( !current_user_can('edit_post', $post_id) ) die( __('You are not allowed to delete this post.') ); - } if (! wp_delete_post($post_id)) die( __('Error in deleting...') ); @@ -145,7 +141,7 @@ case 'editcomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'javascript:history.go(-1)')); - if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to edit comments on this post.') ); $comment = get_comment_to_edit($comment); @@ -164,7 +160,7 @@ case 'confirmdeletecomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); - if ( !user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to delete comments on this post.') ); echo "
\n"; @@ -207,7 +203,7 @@ case 'deletecomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'post.php')); - if (!user_can_delete_post_comments($user_ID, $commentdata['comment_post_ID'])) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to edit comments on this post.') ); wp_set_comment_status($comment->comment_ID, "delete"); @@ -238,7 +234,7 @@ case 'unapprovecomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); - if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') ); wp_set_comment_status($comment->comment_ID, "hold"); @@ -258,7 +254,7 @@ case 'mailapprovecomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); - if ( !user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); if ('1' != $comment->comment_approved) { @@ -284,7 +280,7 @@ case 'approvecomment': if ( ! $comment = get_comment($comment) ) die(sprintf(__('Oops, no comment with this ID. Go back!'), 'edit.php')); - if ( !user_can_edit_post_comments($user_ID, $commentdata['comment_post_ID'])) + if ( !current_user_can('edit_post', $comment->comment_post_ID) ) die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') ); wp_set_comment_status($comment->comment_ID, "approve"); @@ -322,7 +318,7 @@ default:

View site »'), get_bloginfo('home')); ?>