wp/wp-admin/media-new.php
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
--- a/wp/wp-admin/media-new.php	Tue Jun 09 11:14:17 2015 +0000
+++ b/wp/wp-admin/media-new.php	Mon Oct 14 17:39:30 2019 +0200
@@ -13,7 +13,7 @@
 require_once( dirname( __FILE__ ) . '/admin.php' );
 
 if (!current_user_can('upload_files'))
-	wp_die(__('You do not have permission to upload files.'));
+	wp_die(__('Sorry, you are not allowed to upload files.'));
 
 wp_enqueue_script('plupload-handlers');
 
@@ -25,15 +25,15 @@
 }
 
 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;
 }
 
@@ -53,8 +53,8 @@
 ) );
 get_current_screen()->set_help_sidebar(
 	'<p><strong>' . __('For more information:') . '</strong></p>' .
-	'<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
-	'<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+	'<p>' . __('<a href="https://codex.wordpress.org/Media_Add_New_Screen">Documentation on Uploading Media Files</a>') . '</p>' .
+	'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
 );
 
 require_once( ABSPATH . 'wp-admin/admin-header.php' );
@@ -65,7 +65,7 @@
 	$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">