From 386eb41adfceb55115b52fed64b4609323ec4299 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 28 Apr 2007 16:45:47 +0000 Subject: [PATCH] Fix edit comment links git-svn-id: https://develop.svn.wordpress.org/trunk@5340 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 7275825107..aea601b994 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -277,9 +277,9 @@ function get_post_comments_feed_link($post_id = '', $feed = 'rss2') { function get_edit_post_link( $id = 0 ) { $post = &get_post( $id ); - if ( $post->post_type == 'attachment' ) + if ( $post->post_type == 'attachment' ) { return; - elseif ( $post->post_type == 'page' ) { + } elseif ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; @@ -297,9 +297,9 @@ function get_edit_post_link( $id = 0 ) { function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { global $post; - if ( $post->post_type == 'attachment' ) + if ( $post->post_type == 'attachment' ) { return; - elseif ( $post->post_type == 'page' ) { + } elseif ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; @@ -319,15 +319,16 @@ function get_edit_comment_link( $comment_id = 0 ) { $comment = &get_comment( $comment_id ); $post = &get_post( $comment->comment_post_ID ); - if ( $post->post_type == 'attachment' ) + if ( $post->post_type == 'attachment' ) { return; - elseif ( $post->post_type == 'page' ) + } elseif ( $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_bloginfo( 'wpurl' ) . '/wp-admin/comment.php?action=editcomment&c=' . $comment->comment_ID; return apply_filters( 'get_edit_comment_link', $location ); } @@ -335,14 +336,15 @@ function get_edit_comment_link( $comment_id = 0 ) { function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { global $comment, $post; - if ( $post->post_type == 'attachment' ) + if ( $post->post_type == 'attachment' ) { return; - elseif ( $post->post_type == 'page' ) + } elseif ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; - else + } else { if ( !current_user_can( 'edit_post', $post->ID ) ) return; + } $link = '' . $link . ''; echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID ) . $after;