mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +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 ) {
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user