From 5ac98a6fba11ad8a3287c2802ec7dec8d3f97b57 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 17 Jul 2005 21:21:50 +0000 Subject: [PATCH] Cap migration. git-svn-id: http://svn.automattic.com/wordpress/trunk@2724 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-comments.php | 14 +++++++------- wp-admin/edit-form.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index bcfd4c2ba..d26d68d5e 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -43,7 +43,7 @@ if ( !empty( $_POST['delete_comments'] ) ) : $comment = (int) $comment; $post_id = $wpdb->get_var("SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = $comment"); $authordata = get_userdata( $wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $post_id") ); - if ( user_can_delete_post_comments($user_ID, $post_id) ) : + if ( current_user_can('edit_post', $post_id) ) : $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_ID = $comment"); ++$i; endif; @@ -93,14 +93,14 @@ if ('view' == $mode) {

comment_post_ID) ) { + if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo " | comment_ID."\">" . __('Edit Comment') . ""; } - if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { + if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo " | comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\">" . __('Delete Comment') . " — "; } // end if any comments to show // Get post title - if ( user_can_edit_post($user_ID, $comment->comment_post_ID) ) { + if ( current_user_can('edit_post', $comment->comment_post_ID) ) { $post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID = $comment->comment_post_ID"); $post_title = ('' == $post_title) ? "# $comment->comment_post_ID" : $post_title; ?> @@ -138,15 +138,15 @@ if ('view' == $mode) { $class = ('alternate' == $class) ? '' : 'alternate'; ?> - comment_post_ID) ) { ?> + comment_post_ID) ) { ?> - comment_post_ID) ) { + comment_post_ID) ) { echo "" . __('Edit') . ""; } ?> - comment_post_ID) ) { + comment_post_ID) ) { echo "comment_post_ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $comment->comment_author) . "')\" class='delete'>" . __('Delete') . ""; } ?> - +