mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Fix edit links for attachments. Props mdawaffe. fixes #6168
git-svn-id: http://svn.automattic.com/wordpress/trunk@7250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f0479dbc17
commit
674e725d06
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user