Wordpress 4.5.3-scripts
[autoinstalls/wordpress.git] / wp-admin / media-new.php
index f68a4eef2da0fcd9f200effc29678e1d4851adba..9d26651e85546b9c6ae70e0aea7b26ee4e8846ca 100644 (file)
@@ -25,15 +25,15 @@ if ( isset( $_REQUEST['post_id'] ) ) {
 }
 
 if ( $_POST ) {
-       $location = 'upload.php';
        if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
                check_admin_referer('media-form');
                // Upload File button was clicked
-               $id = media_handle_upload( 'async-upload', $post_id );
-               if ( is_wp_error( $id ) )
-                       $location .= '?message=3';
+               $upload_id = media_handle_upload( 'async-upload', $post_id );
+               if ( is_wp_error( $upload_id ) ) {
+                       wp_die( $upload_id );
+               }
        }
-       wp_redirect( admin_url( $location ) );
+       wp_redirect( admin_url( 'upload.php' ) );
        exit;
 }
 
@@ -65,7 +65,7 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
        $form_class .= ' html-uploader';
 ?>
 <div class="wrap">
-       <h2><?php echo esc_html( $title ); ?></h2>
+       <h1><?php echo esc_html( $title ); ?></h1>
 
        <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo esc_attr( $form_class ); ?>" id="file-form">