X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/ebf9bbbbf2dbd59c653bbec4ed90d2947a95b9e7..cd3609994b39a094ff7528b93f55631bb213fd7f:/wp-admin/includes/media.php diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 99deac5a..179bfb8f 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -64,6 +64,7 @@ add_filter('media_upload_tabs', 'update_gallery_tab'); function the_media_upload_tabs() { global $redir_tab; $tabs = media_upload_tabs(); + $default = 'type'; if ( !empty($tabs) ) { echo "
$image_edit_button
" . sprintf( __( 'You are about to delete %s.' ), $filename ) . "
" . __( 'Continue' ) . " " . __( 'Cancel' ) . "' . __('The web browser on your device cannot be used to upload files. You may be able to use the native app for your device instead.') . '
'; + return; + } - $flash = apply_filters('flash_uploader', $flash); + $upload_action_url = admin_url('async-upload.php'); $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; + $_type = isset($type) ? $type : ''; + $_tab = isset($tab) ? $tab : ''; - $upload_size_unit = $max_upload_size = wp_max_upload_size(); + $upload_size_unit = $max_upload_size = wp_max_upload_size(); $sizes = array( 'KB', 'MB', 'GB' ); - for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ ) + + for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ ) { $upload_size_unit /= 1024; + } + if ( $u < 0 ) { $upload_size_unit = 0; $u = 0; @@ -1449,26 +1308,19 @@ function media_upload_form( $errors = null ) { $upload_size_unit = (int) $upload_size_unit; } ?> - -@@ -1650,24 +1480,27 @@ if ( $id ) { * @param unknown_type $errors * @param unknown_type $id */ -function media_upload_type_url_form($type = 'file', $errors = null, $id = null) { +function media_upload_type_url_form($type = null, $errors = null, $id = null) { + if ( null === $type ) + $type = 'image'; + media_upload_header(); $post_id = intval($_REQUEST['post_id']); $form_action_url = admin_url("media-upload.php?type=$type&tab=type&post_id=$post_id"); $form_action_url = apply_filters('media_upload_form_url', $form_action_url, $type); + $form_class = 'media-upload-form type-form validate'; - $callback = "type_url_form_$type"; + if ( get_user_setting('uploader') ) + $form_class .= ' html-uploader'; ?> -