From cf9f85dc8121a359d550ffa3b735fb48859eee88 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 24 Apr 2008 11:45:39 +0000 Subject: Merged with WP 2.5, revision 7806 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1260 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-admin/includes/media.php | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'wp-admin/includes/media.php') 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 = "$html"; - $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
$item
\n
"; + $output .= "\n
$item\n
"; return $output; } @@ -665,15 +654,15 @@ function get_media_item( $attachment_id, $args = null ) { $toggle_links
$display_title
- + - + - - + + \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 = "'; + $send = ""; if ( $delete ) $delete = "" . __('Delete') . ""; 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\n"; + $item .= "\t\n"; $item .= "\t
$filename
$post->post_mime_type
$post->post_mime_type
" . mysql2date($post->post_date, get_option('time_format')) . "
" . apply_filters('media_meta', '', $post) . "
" . apply_filters('media_meta', '', $post) . "
{$form_fields['_final']}
\n"; foreach ( $hidden_fields as $name => $value ) @@ -794,12 +784,13 @@ jQuery(function($){ upload_url : "", flash_url : "", file_post_name: "async-upload", - file_types: "*.*", + file_types: "", post_params : { "post_id" : "", "auth_cookie" : "", "type" : "", - "tab" : "" + "tab" : "", + "short" : "1" }, file_size_limit : "b", swfupload_element_id : "flash-upload-ui", // id of the element displayed when swfupload is available -- cgit