diff options
Diffstat (limited to 'wp-admin/includes/media.php')
-rw-r--r-- | wp-admin/includes/media.php | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index d8c3858..6b28c96 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -57,7 +57,7 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal if ( $url ) $html = "<a href='".attribute_escape($url)."'$rel>$html</a>"; - $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url ); + $html = apply_filters( 'image_send_to_editor', $html, $id, $alt, $title, $align, $url, $size ); return $html; } @@ -202,18 +202,6 @@ add_action('media_upload_media', 'media_upload_handler'); function media_upload_form_handler() { check_admin_referer('media-form'); - // Insert media button was clicked - if ( isset($_POST['html-upload']) && !empty($_FILES) ) { - // Upload File button was clicked - - $id = media_handle_upload('async-upload', $_REQUEST['post_id']); - - if ( is_wp_error($id) ) { - $errors['upload_error'] = $id; - $id = false; - } - } - if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) { $post = $_post = get_post($attachment_id, ARRAY_A); if ( isset($attachment['post_content']) ) @@ -590,8 +578,9 @@ function get_attachment_fields_to_edit($post, $errors = null) { } function get_media_items( $post_id, $errors ) { - if ( $post_id && $post = get_post($post_id) ) { - if ( $post->post_type == 'attachment' ) + if ( $post_id ) { + $post = get_post($post_id); + if ( $post && $post->post_type == 'attachment' ) $attachments = array($post->ID => $post); else $attachments = get_children("post_parent=$post_id&post_type=attachment&orderby=menu_order ASC, ID&order=DESC"); @@ -606,7 +595,7 @@ function get_media_items( $post_id, $errors ) { foreach ( $attachments as $id => $attachment ) if ( $item = get_media_item( $id, array( 'errors' => isset($errors[$id]) ? $errors[$id] : null) ) ) - $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div id='media-upload-error-$id'></div><div class='filename'></div><div class='progress'><div class='bar'></div></div>$item<div class='progress clickmask'></div>\n</div>"; + $output .= "\n<div id='media-item-$id' class='media-item child-of-$attachment->post_parent preloaded'><div class='progress'><div class='bar'></div></div><div id='media-upload-error-$id'></div><div class='filename'></div>$item\n</div>"; return $output; } @@ -665,15 +654,15 @@ function get_media_item( $attachment_id, $args = null ) { $toggle_links <div class='filename new'>$display_title</div> <table class='slidetoggle describe $class'> - <tbody class='media-item-info'> + <thead class='media-item-info'> <tr> <td class='A1B1' rowspan='4'><img class='thumbnail' src='$thumb_url' alt='' /></td> <td>$filename</td> </tr> - <td>$post->post_mime_type</td></tr> + <tr><td>$post->post_mime_type</td></tr> <tr><td>" . mysql2date($post->post_date, get_option('time_format')) . "</td></tr> - <tr><td>" . apply_filters('media_meta', '', $post) . "</tr></td> - </tbody> + <tr><td>" . apply_filters('media_meta', '', $post) . "</td></tr> + </thead> <tbody>\n"; $defaults = array( @@ -685,7 +674,7 @@ function get_media_item( $attachment_id, $args = null ) { $delete_href = wp_nonce_url("post.php?action=delete-post&post=$attachment_id", 'delete-post_' . $attachment_id); if ( $send ) - $send = "<button type='submit' class='button' value='1' name='send[$attachment_id]'>" . __('Insert into Post') . '</button>'; + $send = "<input type='submit' class='button' name='send[$attachment_id]' value='" . __('Insert into Post') . "' />"; if ( $delete ) $delete = "<a href='$delete_href' id='del[$attachment_id]' disabled='disabled' class='delete'>" . __('Delete') . "</button>"; if ( ( $send || $delete ) && !isset($form_fields['buttons']) ) @@ -744,6 +733,7 @@ function get_media_item( $attachment_id, $args = null ) { if ( !empty($form_fields['_final']) ) $item .= "\t\t<tr class='final'><td colspan='2'>{$form_fields['_final']}</td></tr>\n"; + $item .= "\t</tbody>\n"; $item .= "\t</table>\n"; foreach ( $hidden_fields as $name => $value ) @@ -794,12 +784,13 @@ jQuery(function($){ upload_url : "<?php echo attribute_escape( $flash_action_url ); ?>", flash_url : "<?php echo get_option('siteurl').'/wp-includes/js/swfupload/swfupload_f9.swf'; ?>", file_post_name: "async-upload", - file_types: "*.*", + file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>", post_params : { "post_id" : "<?php echo $post_id; ?>", "auth_cookie" : "<?php echo $_COOKIE[AUTH_COOKIE]; ?>", "type" : "<?php echo $type; ?>", - "tab" : "<?php echo $tab; ?>" + "tab" : "<?php echo $tab; ?>", + "short" : "1" }, file_size_limit : "<?php echo wp_max_upload_size(); ?>b", swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available |