Fix edit links for attachments. Props mdawaffe. fixes #6168

git-svn-id: https://develop.svn.wordpress.org/trunk@7250 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-03-11 21:08:09 +00:00
parent c9a9b9373a
commit 3a1f2b5dcc
1 changed files with 3 additions and 10 deletions

View File

@ -441,9 +441,7 @@ function get_search_comments_feed_link($search_query = '', $feed = '') {
function get_edit_post_link( $id = 0 ) { function get_edit_post_link( $id = 0 ) {
$post = &get_post( $id ); $post = &get_post( $id );
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'page' ) {
return;
} elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;
@ -461,9 +459,7 @@ function get_edit_post_link( $id = 0 ) {
function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) {
global $post; global $post;
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'page' ) {
return;
} elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;
@ -483,9 +479,7 @@ function get_edit_comment_link( $comment_id = 0 ) {
$comment = &get_comment( $comment_id ); $comment = &get_comment( $comment_id );
$post = &get_post( $comment->comment_post_ID ); $post = &get_post( $comment->comment_post_ID );
if ( $post->post_type == 'attachment' ) { if ( $post->post_type == 'page' ) {
return;
} elseif ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;
} else { } else {
@ -501,7 +495,6 @@ function edit_comment_link( $link = 'Edit This', $before = '', $after = '' ) {
global $comment, $post; 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 ) ) if ( !current_user_can( 'edit_page', $post->ID ) )
return; return;