Only link to a post for editing if the user can edit it.

git-svn-id: https://develop.svn.wordpress.org/trunk@7321 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-03-15 21:52:12 +00:00
parent a951a2019b
commit 36889f6313
1 changed files with 9 additions and 6 deletions

View File

@ -606,13 +606,16 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true
$authordata = get_userdata($post->post_author);
$the_comment_status = wp_get_comment_status($comment->comment_ID);
$class = ('unapproved' == $the_comment_status) ? 'unapproved' : '';
if ( 'attachment' == $post->post_type )
$post_link = "<a href='upload.php?attachment_id=$post->ID'>";
elseif ( 'page' == $post->post_type )
$post_link = "<a href='edit-pages.php?page_id=$post->ID'>";
else
$post_link = "<a href='edit.php?p=$post->ID'>";
if ( current_user_can( 'edit_post', $post->ID ) ) {
if ( 'attachment' == $post->post_type )
$post_link = "<a href='upload.php?attachment_id=$post->ID'>";
elseif ( 'page' == $post->post_type )
$post_link = "<a href='edit-pages.php?page_id=$post->ID'>";
else
$post_link = "<a href='edit.php?p=$post->ID'>";
}
$post_link .= get_the_title($comment->comment_post_ID) . '</a>';
$author_url = get_comment_author_url();
if ( 'http://' == $author_url )
$author_url = '';