edit_comment_link fix from westi. fixes #2559

git-svn-id: https://develop.svn.wordpress.org/trunk@3647 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-03-20 19:45:46 +00:00
parent 7a89d5f0bd
commit 940499731d

View File

@ -228,12 +228,13 @@ function edit_post_link($link = 'Edit This', $before = '', $after = '') {
function edit_comment_link($link = 'Edit This', $before = '', $after = '') {
global $post, $comment;
if( $post->post_type == 'page' )
if( $post->post_type == 'page' ){
if ( ! current_user_can('edit_page', $post->ID) )
return;
else
} else {
if ( ! current_user_can('edit_post', $post->ID) )
return;
}
$location = get_settings('siteurl') . "/wp-admin/comment.php?action=editcomment&comment=$comment->comment_ID";
echo $before . "<a href='$location'>$link</a>" . $after;