diff --git a/wp-comments.php b/wp-comments.php
index 399f8588aa..cb8770d8c2 100644
--- a/wp-comments.php
+++ b/wp-comments.php
@@ -33,7 +33,7 @@
diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php
index 5dfe42b31c..bef4725506 100644
--- a/wp-includes/template-functions.php
+++ b/wp-includes/template-functions.php
@@ -562,6 +562,24 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
echo "$before $link $after";
}
+function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
+ global $user_level, $post, $comment, $siteurl;
+
+ get_currentuserinfo();
+
+ if ($user_level > 0) {
+ $authordata = get_userdata($post->post_author);
+ if ($user_level < $authordata->user_level) {
+ return;
+ }
+ } else {
+ return;
+ }
+
+ $location = "$siteurl/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID";
+ echo "$before $link $after";
+}
+
/***** Date/Time tags *****/
function the_date_xml() {