X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/ebf9bbbbf2dbd59c653bbec4ed90d2947a95b9e7..85ad385665744d9cc3bcd939906309be7268edb3:/wp-admin/includes/media.php diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 99deac5a..e2f78d63 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -7,11 +7,11 @@ */ /** - * {@internal Missing Short Description}} + * Defines the default media upload tabs * * @since 2.5.0 * - * @return unknown + * @return array default tabs */ function media_upload_tabs() { $_default_tabs = array( @@ -25,12 +25,12 @@ function media_upload_tabs() { } /** - * {@internal Missing Short Description}} + * Adds the gallery tab back to the tabs array if post has image attachments * * @since 2.5.0 * - * @param unknown_type $tabs - * @return unknown + * @param array $tabs + * @return array $tabs with gallery if post has image attachment */ function update_gallery_tab($tabs) { global $wpdb; @@ -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' ) . "" . join( "
\n", array_unique( (array) $field['helps'] ) ) . '
'; + $item .= "' . sprintf( __('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.'), 'http://wordpress.org/mobile/' ) . '
'; + 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,122 +1526,90 @@ function media_upload_form( $errors = null ) { $upload_size_unit = (int) $upload_size_unit; } ?> - -@@ -1646,28 +1698,31 @@ if ( $id ) { * * @since 2.7.0 * - * @param unknown_type $type - * @param unknown_type $errors - * @param unknown_type $id + * @param string $type + * @param object $errors + * @param integer $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']); + $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; $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'; ?> -