diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-18 09:16:34 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-18 09:16:34 +0000 |
commit | 3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc (patch) | |
tree | 1bc483947163c7351f73b2c62a69ef774e021775 /wp-inst/wp-admin/edit-comments.php | |
parent | 9d3f6c7b7452785bd585424238dd29f9d7369480 (diff) | |
download | wordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.tar.gz wordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.tar.xz wordpress-mu-3d22aa49e07b92dab07b1f9d6a8a66fb6ab20bdc.zip |
Merge from WP Core.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@31 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/edit-comments.php')
-rw-r--r-- | wp-inst/wp-admin/edit-comments.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wp-inst/wp-admin/edit-comments.php b/wp-inst/wp-admin/edit-comments.php index bcfd4c2..d8632d3 100644 --- a/wp-inst/wp-admin/edit-comments.php +++ b/wp-inst/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) { <?php comment_text() ?> <p><?php _e('Posted'); echo ' '; comment_date('M j, g:i A'); - if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) { + if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo " | <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit Comment') . "</a>"; } - if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { + if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo " | <a href=\"post.php?action=deletecomment&p=".$comment->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') . "</a> — "; } // 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; ?> <a href="post.php?action=edit&post=<?php echo $comment->comment_post_ID; ?>"><?php printf(__('Edit Post “%s”'), stripslashes($post_title)); ?></a> @@ -138,15 +138,15 @@ if ('view' == $mode) { $class = ('alternate' == $class) ? '' : 'alternate'; ?> <tr class='<?php echo $class; ?>'> - <td><?php if (user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> + <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> <td><?php comment_author_link() ?></td> <td><?php comment_author_email_link() ?></td> <td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></td> <td><?php comment_excerpt(); ?></td> <td><a href="<?php echo get_permalink($comment->comment_post_ID); ?>#comment-<?php comment_ID() ?>" class="edit"><?php _e('View') ?></a></td> - <td><?php if ( user_can_edit_post_comments($user_ID, $comment->comment_post_ID) ) { + <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo "<a href='post.php?action=editcomment&comment=$comment->comment_ID' class='edit'>" . __('Edit') . "</a>"; } ?></td> - <td><?php if ( user_can_delete_post_comments($user_ID, $comment->comment_post_ID) ) { + <td><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { echo "<a href=\"post.php?action=deletecomment&p=".$comment->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') . "</a>"; } ?></td> </tr> <?php @@ -168,4 +168,4 @@ if ('view' == $mode) { </div> -<?php include('admin-footer.php'); ?>
\ No newline at end of file +<?php include('admin-footer.php'); ?> |