From 3a1f2b5dcca7cc7220c04826aa11d94043f12966 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 11 Mar 2008 21:08:09 +0000 Subject: [PATCH] Fix edit links for attachments. Props mdawaffe. fixes #6168 git-svn-id: https://develop.svn.wordpress.org/trunk@7250 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/link-template.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index d2bb5a47f7..c191668a40 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -441,9 +441,7 @@ function get_search_comments_feed_link($search_query = '', $feed = '') { function get_edit_post_link( $id = 0 ) { $post = &get_post( $id ); - if ( $post->post_type == 'attachment' ) { - return; - } elseif ( $post->post_type == 'page' ) { + if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; @@ -461,9 +459,7 @@ function get_edit_post_link( $id = 0 ) { function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { global $post; - if ( $post->post_type == 'attachment' ) { - return; - } elseif ( $post->post_type == 'page' ) { + if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; @@ -483,9 +479,7 @@ 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' ) { - return; - } elseif ( $post->post_type == 'page' ) { + if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return; } else { @@ -501,7 +495,6 @@ function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) { global $comment, $post; if ( $post->post_type == 'attachment' ) { - return; } elseif ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) return;