diff --git a/src/wp-admin/async-upload.php b/src/wp-admin/async-upload.php
index 4d37f7f644..626e9a2adf 100644
|
a
|
b
|
if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) |
| 45 | 45 | if ( 'attachment' != $post->post_type ) { |
| 46 | 46 | wp_die( __( 'Invalid post type.' ) ); |
| 47 | 47 | } |
| 48 | | if ( ! current_user_can( 'edit_post', $id ) ) { |
| 49 | | wp_die( __( 'Sorry, you are not allowed to edit this item.' ) ); |
| 50 | | } |
| 51 | 48 | |
| 52 | 49 | switch ( $_REQUEST['fetch'] ) { |
| 53 | 50 | case 3: |
| … |
… |
if ( isset( $_REQUEST['attachment_id'] ) && intval( $_REQUEST['attachment_id'] ) |
| 55 | 52 | if ( $thumb_url ) { |
| 56 | 53 | echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; |
| 57 | 54 | } |
| 58 | | echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; |
| | 55 | if ( current_user_can( 'edit_post', $id ) ) { |
| | 56 | echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; |
| | 57 | } |
| | 58 | else { |
| | 59 | echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>'; |
| | 60 | } |
| 59 | 61 | |
| 60 | 62 | // Title shouldn't ever be empty, but use filename just in case. |
| 61 | 63 | $file = get_attached_file( $post->ID ); |