Edit comment from Ryan Boren.
git-svn-id: https://develop.svn.wordpress.org/trunk@673 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
88d4ebbac4
commit
622e22e5bb
@ -33,7 +33,7 @@
|
||||
<?php foreach ($comments as $comment) { ?>
|
||||
<li id="comment-<?php comment_ID() ?>">
|
||||
<?php comment_text() ?>
|
||||
<p><cite><?php comment_type(); ?> by <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
|
||||
<p><cite><?php comment_type(); ?> by <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link('Edit This', ' |'); ?></p>
|
||||
</li>
|
||||
|
||||
<?php } // end for each comment ?>
|
||||
|
@ -562,6 +562,24 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
|
||||
echo "$before <a href='$location'>$link</a> $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 <a href='$location'>$link</a> $after";
|
||||
}
|
||||
|
||||
/***** Date/Time tags *****/
|
||||
|
||||
function the_date_xml() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user