Changeset 22755 for trunk/wp-admin/async-upload.php
- Timestamp:
- 11/21/2012 01:05:44 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r19712 r22755 38 38 wp_die( __( 'You are not allowed to edit this item.' ) ); 39 39 40 if ( 2 == $_REQUEST['fetch'] ) { 41 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); 42 echo get_media_item($id, array( 'send' => false, 'delete' => true )); 43 } else { 44 add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); 45 echo get_media_item($id); 40 switch ( $_REQUEST['fetch'] ) { 41 case 3 : 42 if ( $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ) ) 43 echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; 44 echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>'; 45 $title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // title shouldn't ever be empty, but use filename just in cas.e 46 echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60 ) ) . '</span></div>'; 47 break; 48 case 2 : 49 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); 50 echo get_media_item($id, array( 'send' => false, 'delete' => true )); 51 break; 52 default: 53 add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2); 54 echo get_media_item($id); 55 break; 46 56 } 47 57 exit;
Note: See TracChangeset
for help on using the changeset viewer.